@medplum/app 4.1.11 → 4.2.0

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,581 +0,0 @@
1
- function n3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function ax(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pv={exports:{}},ku={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Nj;function r3(){if(Nj)return ku;Nj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var c=null;if(o!==void 0&&(c=""+o),a.key!==void 0&&(c=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:c,ref:a!==void 0?a:null,props:o}}return ku.Fragment=t,ku.jsx=n,ku.jsxs=n,ku}var Oj;function a3(){return Oj||(Oj=1,pv.exports=r3()),pv.exports}var s=a3(),Ja=function(){return Ja=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ja.apply(this,arguments)};function KT(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function i3(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var mv={exports:{}},yt={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Mj;function o3(){if(Mj)return yt;Mj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=g&&O[g]||O["@@iterator"],typeof O=="function"?O:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function C(O,U,K){this.props=O,this.context=U,this.refs=j,this.updater=K||b}C.prototype.isReactComponent={},C.prototype.setState=function(O,U){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,U,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=C.prototype;function D(O,U,K){this.props=O,this.context=U,this.refs=j,this.updater=K||b}var E=D.prototype=new R;E.constructor=D,S(E,C.prototype),E.isPureReactComponent=!0;var T=Array.isArray,A={H:null,A:null,T:null,S:null,V:null},k=Object.prototype.hasOwnProperty;function M(O,U,K,ee,be,xe){return K=xe.ref,{$$typeof:e,type:O,key:U,ref:K!==void 0?K:null,props:xe}}function L(O,U){return M(O.type,U,void 0,void 0,void 0,O.props)}function $(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function V(O){var U={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(K){return U[K]})}var Y=/\/+/g;function Q(O,U){return typeof O=="object"&&O!==null&&O.key!=null?V(""+O.key):U.toString(36)}function J(){}function G(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(J,J):(O.status="pending",O.then(function(U){O.status==="pending"&&(O.status="fulfilled",O.value=U)},function(U){O.status==="pending"&&(O.status="rejected",O.reason=U)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function Z(O,U,K,ee,be){var xe=typeof O;(xe==="undefined"||xe==="boolean")&&(O=null);var ye=!1;if(O===null)ye=!0;else switch(xe){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(O.$$typeof){case e:case t:ye=!0;break;case m:return ye=O._init,Z(ye(O._payload),U,K,ee,be)}}if(ye)return be=be(O),ye=ee===""?"."+Q(O,0):ee,T(be)?(K="",ye!=null&&(K=ye.replace(Y,"$&/")+"/"),Z(be,U,K,"",function(tt){return tt})):be!=null&&($(be)&&(be=L(be,K+(be.key==null||O&&O.key===be.key?"":(""+be.key).replace(Y,"$&/")+"/")+ye)),U.push(be)),1;ye=0;var qe=ee===""?".":ee+":";if(T(O))for(var Ne=0;Ne<O.length;Ne++)ee=O[Ne],xe=qe+Q(ee,Ne),ye+=Z(ee,U,K,xe,be);else if(Ne=v(O),typeof Ne=="function")for(O=Ne.call(O),Ne=0;!(ee=O.next()).done;)ee=ee.value,xe=qe+Q(ee,Ne++),ye+=Z(ee,U,K,xe,be);else if(xe==="object"){if(typeof O.then=="function")return Z(G(O),U,K,ee,be);throw U=String(O),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ye}function P(O,U,K){if(O==null)return O;var ee=[],be=0;return Z(O,ee,"","",function(xe){return U.call(K,xe,be++)}),ee}function I(O){if(O._status===-1){var U=O._result;U=U(),U.then(function(K){(O._status===0||O._status===-1)&&(O._status=1,O._result=K)},function(K){(O._status===0||O._status===-1)&&(O._status=2,O._result=K)}),O._status===-1&&(O._status=0,O._result=U)}if(O._status===1)return O._result.default;throw O._result}var z=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function H(){}return yt.Children={map:P,forEach:function(O,U,K){P(O,function(){U.apply(this,arguments)},K)},count:function(O){var U=0;return P(O,function(){U++}),U},toArray:function(O){return P(O,function(U){return U})||[]},only:function(O){if(!$(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},yt.Component=C,yt.Fragment=n,yt.Profiler=a,yt.PureComponent=D,yt.StrictMode=r,yt.Suspense=f,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,yt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return A.H.useMemoCache(O)}},yt.cache=function(O){return function(){return O.apply(null,arguments)}},yt.cloneElement=function(O,U,K){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ee=S({},O.props),be=O.key,xe=void 0;if(U!=null)for(ye in U.ref!==void 0&&(xe=void 0),U.key!==void 0&&(be=""+U.key),U)!k.call(U,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&U.ref===void 0||(ee[ye]=U[ye]);var ye=arguments.length-2;if(ye===1)ee.children=K;else if(1<ye){for(var qe=Array(ye),Ne=0;Ne<ye;Ne++)qe[Ne]=arguments[Ne+2];ee.children=qe}return M(O.type,be,void 0,void 0,xe,ee)},yt.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},yt.createElement=function(O,U,K){var ee,be={},xe=null;if(U!=null)for(ee in U.key!==void 0&&(xe=""+U.key),U)k.call(U,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(be[ee]=U[ee]);var ye=arguments.length-2;if(ye===1)be.children=K;else if(1<ye){for(var qe=Array(ye),Ne=0;Ne<ye;Ne++)qe[Ne]=arguments[Ne+2];be.children=qe}if(O&&O.defaultProps)for(ee in ye=O.defaultProps,ye)be[ee]===void 0&&(be[ee]=ye[ee]);return M(O,xe,void 0,void 0,null,be)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(O){return{$$typeof:u,render:O}},yt.isValidElement=$,yt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:I}},yt.memo=function(O,U){return{$$typeof:p,type:O,compare:U===void 0?null:U}},yt.startTransition=function(O){var U=A.T,K={};A.T=K;try{var ee=O(),be=A.S;be!==null&&be(K,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(H,z)}catch(xe){z(xe)}finally{A.T=U}},yt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},yt.use=function(O){return A.H.use(O)},yt.useActionState=function(O,U,K){return A.H.useActionState(O,U,K)},yt.useCallback=function(O,U){return A.H.useCallback(O,U)},yt.useContext=function(O){return A.H.useContext(O)},yt.useDebugValue=function(){},yt.useDeferredValue=function(O,U){return A.H.useDeferredValue(O,U)},yt.useEffect=function(O,U,K){var ee=A.H;if(typeof K=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(O,U)},yt.useId=function(){return A.H.useId()},yt.useImperativeHandle=function(O,U,K){return A.H.useImperativeHandle(O,U,K)},yt.useInsertionEffect=function(O,U){return A.H.useInsertionEffect(O,U)},yt.useLayoutEffect=function(O,U){return A.H.useLayoutEffect(O,U)},yt.useMemo=function(O,U){return A.H.useMemo(O,U)},yt.useOptimistic=function(O,U){return A.H.useOptimistic(O,U)},yt.useReducer=function(O,U,K){return A.H.useReducer(O,U,K)},yt.useRef=function(O){return A.H.useRef(O)},yt.useState=function(O){return A.H.useState(O)},yt.useSyncExternalStore=function(O,U,K){return A.H.useSyncExternalStore(O,U,K)},yt.useTransition=function(){return A.H.useTransition()},yt.version="19.1.0",yt}var Ij;function ix(){return Ij||(Ij=1,mv.exports=o3()),mv.exports}var y=ix();const Cn=ax(y),s3=n3({__proto__:null,default:Cn},[y]);var fh="right-scroll-bar-position",hh="width-before-scroll-bar",l3="with-scroll-bars-hidden",c3="--removed-body-scroll-bar-size";function gv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function u3(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var d3=typeof window<"u"?y.useLayoutEffect:y.useEffect,Lj=new WeakMap;function f3(e,t){var n=u3(null,function(r){return e.forEach(function(a){return gv(a,r)})});return d3(function(){var r=Lj.get(n);if(r){var a=new Set(r),o=new Set(e),c=n.current;a.forEach(function(u){o.has(u)||gv(u,null)}),o.forEach(function(u){a.has(u)||gv(u,c)})}Lj.set(n,e)},[e]),n}function h3(e){return e}function p3(e,t){t===void 0&&(t=h3);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var c=t(o,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(o){for(r=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(o),c=n}var f=function(){var m=c;c=[],m.forEach(o)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(m){c.push(m),p()},filter:function(m){return c=c.filter(m),n}}}};return a}function m3(e){e===void 0&&(e={});var t=p3(null);return t.options=Ja({async:!0,ssr:!1},e),t}var XT=function(e){var t=e.sideCar,n=KT(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 y.createElement(r,Ja({},n))};XT.isSideCarExport=!0;function g3(e,t){return e.useMedium(t),XT}var ZT=m3(),vv=function(){},rp=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:vv,onWheelCapture:vv,onTouchMoveCapture:vv}),a=r[0],o=r[1],c=e.forwardProps,u=e.children,f=e.className,p=e.removeScrollBar,m=e.enabled,g=e.shards,v=e.sideCar,b=e.noRelative,S=e.noIsolation,j=e.inert,C=e.allowPinchZoom,R=e.as,D=R===void 0?"div":R,E=e.gapMode,T=KT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,k=f3([n,t]),M=Ja(Ja({},T),a);return y.createElement(y.Fragment,null,m&&y.createElement(A,{sideCar:ZT,removeScrollBar:p,shards:g,noRelative:b,noIsolation:S,inert:j,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:E}),c?y.cloneElement(y.Children.only(u),Ja(Ja({},M),{ref:k})):y.createElement(D,Ja({},M,{className:f,ref:k}),u))});rp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rp.classNames={fullWidth:hh,zeroRight:fh};var v3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function y3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=v3();return t&&e.setAttribute("nonce",t),e}function x3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function b3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var S3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=y3())&&(x3(t,n),b3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},w3=function(){var e=S3();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},JT=function(){var e=w3(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},j3={left:0,top:0,right:0,gap:0},yv=function(e){return parseInt(e||"",10)||0},C3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[yv(n),yv(r),yv(a)]},E3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return j3;var t=C3(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])}},T3=JT(),nc="data-scroll-locked",R3=function(e,t,n,r){var a=e.left,o=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
18
- .`.concat(l3,` {
19
- overflow: hidden `).concat(r,`;
20
- padding-right: `).concat(u,"px ").concat(r,`;
21
- }
22
- body[`).concat(nc,`] {
23
- overflow: hidden `).concat(r,`;
24
- overscroll-behavior: contain;
25
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
26
- padding-left: `.concat(a,`px;
27
- padding-top: `).concat(o,`px;
28
- padding-right: `).concat(c,`px;
29
- margin-left:0;
30
- margin-top:0;
31
- margin-right: `).concat(u,"px ").concat(r,`;
32
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
33
- }
34
-
35
- .`).concat(fh,` {
36
- right: `).concat(u,"px ").concat(r,`;
37
- }
38
-
39
- .`).concat(hh,` {
40
- margin-right: `).concat(u,"px ").concat(r,`;
41
- }
42
-
43
- .`).concat(fh," .").concat(fh,` {
44
- right: 0 `).concat(r,`;
45
- }
46
-
47
- .`).concat(hh," .").concat(hh,` {
48
- margin-right: 0 `).concat(r,`;
49
- }
50
-
51
- body[`).concat(nc,`] {
52
- `).concat(c3,": ").concat(u,`px;
53
- }
54
- `)},zj=function(){var e=parseInt(document.body.getAttribute(nc)||"0",10);return isFinite(e)?e:0},D3=function(){y.useEffect(function(){return document.body.setAttribute(nc,(zj()+1).toString()),function(){var e=zj()-1;e<=0?document.body.removeAttribute(nc):document.body.setAttribute(nc,e.toString())}},[])},A3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;D3();var o=y.useMemo(function(){return E3(a)},[a]);return y.createElement(T3,{styles:R3(o,!t,a,n?"":"!important")})},fy=!1;if(typeof window<"u")try{var Xf=Object.defineProperty({},"passive",{get:function(){return fy=!0,!0}});window.addEventListener("test",Xf,Xf),window.removeEventListener("test",Xf,Xf)}catch{fy=!1}var Bl=fy?{passive:!1}:!1,_3=function(e){return e.tagName==="TEXTAREA"},eR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_3(e)&&n[t]==="visible")},k3=function(e){return eR(e,"overflowY")},P3=function(e){return eR(e,"overflowX")},$j=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=tR(e,r);if(a){var o=nR(e,r),c=o[1],u=o[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},N3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},O3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},tR=function(e,t){return e==="v"?k3(t):P3(t)},nR=function(e,t){return e==="v"?N3(t):O3(t)},M3=function(e,t){return e==="h"&&t==="rtl"?-1:1},I3=function(e,t,n,r,a){var o=M3(e,window.getComputedStyle(t).direction),c=o*r,u=n.target,f=t.contains(u),p=!1,m=c>0,g=0,v=0;do{if(!u)break;var b=nR(e,u),S=b[0],j=b[1],C=b[2],R=j-C-o*S;(S||R)&&tR(e,u)&&(g+=R,v+=S);var D=u.parentNode;u=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(v)<1)&&(p=!0),p},Zf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Uj=function(e){return[e.deltaX,e.deltaY]},Bj=function(e){return e&&"current"in e?e.current:e},L3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},z3=function(e){return`
55
- .block-interactivity-`.concat(e,` {pointer-events: none;}
56
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
- `)},$3=0,Vl=[];function U3(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState($3++)[0],o=y.useState(JT)[0],c=y.useRef(e);y.useEffect(function(){c.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var j=i3([e.lockRef.current],(e.shards||[]).map(Bj),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var R=Zf(j),D=n.current,E="deltaX"in j?j.deltaX:D[0]-R[0],T="deltaY"in j?j.deltaY:D[1]-R[1],A,k=j.target,M=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in j&&M==="h"&&k.type==="range")return!1;var L=$j(M,k);if(!L)return!0;if(L?A=M:(A=M==="v"?"h":"v",L=$j(M,k)),!L)return!1;if(!r.current&&"changedTouches"in j&&(E||T)&&(r.current=A),!A)return!0;var $=r.current||A;return I3($,C,j,$==="h"?E:T)},[]),f=y.useCallback(function(j){var C=j;if(!(!Vl.length||Vl[Vl.length-1]!==o)){var R="deltaY"in C?Uj(C):Zf(C),D=t.current.filter(function(A){return A.name===C.type&&(A.target===C.target||C.target===A.shadowParent)&&L3(A.delta,R)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var E=(c.current.shards||[]).map(Bj).filter(Boolean).filter(function(A){return A.contains(C.target)}),T=E.length>0?u(C,E[0]):!c.current.noIsolation;T&&C.cancelable&&C.preventDefault()}}},[]),p=y.useCallback(function(j,C,R,D){var E={name:j,delta:C,target:R,should:D,shadowParent:B3(R)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),m=y.useCallback(function(j){n.current=Zf(j),r.current=void 0},[]),g=y.useCallback(function(j){p(j.type,Uj(j),j.target,u(j,e.lockRef.current))},[]),v=y.useCallback(function(j){p(j.type,Zf(j),j.target,u(j,e.lockRef.current))},[]);y.useEffect(function(){return Vl.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Bl),document.addEventListener("touchmove",f,Bl),document.addEventListener("touchstart",m,Bl),function(){Vl=Vl.filter(function(j){return j!==o}),document.removeEventListener("wheel",f,Bl),document.removeEventListener("touchmove",f,Bl),document.removeEventListener("touchstart",m,Bl)}},[]);var b=e.removeScrollBar,S=e.inert;return y.createElement(y.Fragment,null,S?y.createElement(o,{styles:z3(a)}):null,b?y.createElement(A3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function B3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const V3=g3(ZT,U3);var lc=y.forwardRef(function(e,t){return y.createElement(rp,Ja({},e,{ref:t,sideCar:V3}))});lc.classNames=rp.classNames;function sn(e){return Object.keys(e)}function xv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function ox(e,t){const n={...e},r=t;return xv(e)&&xv(t)&&Object.keys(t).forEach(a=>{xv(r[a])&&a in e?n[a]=ox(n[a],r[a]):n[a]=r[a]}),n}function F3(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function H3(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function Wu(e){const t=H3(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 bv(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function rR(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const a=`${r/16}${e}`;return t?bv(a):a}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(o=>n(o)).join(",");if(r.includes(" "))return r.split(" ").map(o=>n(o)).join(" ");if(r.includes(e))return t?bv(r):r;const a=r.replace("px","");if(!Number.isNaN(Number(a))){const o=`${Number(a)/16}${e}`;return t?bv(o):o}}return r}return n}const le=rR("rem",{shouldScale:!0}),jh=rR("em");function Ho(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function aR(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 Fi(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==y.Fragment:!1}function vr(e){const t=y.createContext(null);return[({children:a,value:o})=>s.jsx(t.Provider,{value:o,children:a}),()=>{const a=y.useContext(t);if(a===null)throw new Error(e);return a}]}function Hi(e=null){const t=y.createContext(e);return[({children:a,value:o})=>s.jsx(t.Provider,{value:o,children:a}),()=>y.useContext(t)]}function Vj(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Ch(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function q3(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 G3(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 Q3(e,t,n){return Ch(e,n)===Ch(t,n)}function iR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:a=!1,dir:o="rtl",orientation:c}){return u=>{var S;n==null||n(u);const f=Array.from(((S=Ch(u.currentTarget,e))==null?void 0:S.querySelectorAll(t))||[]).filter(j=>Q3(u.currentTarget,j,e)),p=f.findIndex(j=>u.currentTarget===j),m=G3(p,f,r),g=q3(p,f,r),v=o==="rtl"?g:m,b=o==="rtl"?m:g;switch(u.key){case"ArrowRight":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[v].focus(),a&&f[v].click());break}case"ArrowLeft":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[b].focus(),a&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[g].focus(),a&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[m].focus(),a&&f[m].click());break}case"Home":{u.stopPropagation(),u.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{u.stopPropagation(),u.preventDefault();const j=f.length-1;!f[j].disabled&&f[j].focus();break}}}}const W3={app:100,modal:200,popover:300,overlay:400,max:9999};function Wr(e){return W3[e]}const Eh=()=>{};function Y3(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Eh:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function rt(e,t="size",n=!0){if(e!==void 0)return aR(e)?n?le(e):e:`var(--${t}-${e})`}function Nn(e){return rt(e,"mantine-spacing")}function Vt(e){return e===void 0?"var(--mantine-radius-default)":rt(e,"mantine-radius")}function On(e){return rt(e,"mantine-font-size")}function oR(e){return rt(e,"mantine-line-height",!1)}function sx(e){if(e)return rt(e,"mantine-shadow",!1)}function Rr(e,t){return n=>{e==null||e(n),t==null||t(n)}}function lx(e,t){return e in t?Wu(t[e]):Wu(e)}function Yu(e,t){const n=e.map(r=>({value:r,px:lx(r,t)}));return n.sort((r,a)=>r.px-a.px),n}function _a(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function K3(e,t,n){var r;return n?Array.from(((r=Ch(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(a=>a===n):null}function X3(){const[e,t]=y.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function ph(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 Th(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function Z3(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 a=0;a<r;a+=1){const o=n[a];if(!(o in t)||e[o]!==t[o]&&!(Number.isNaN(e[o])&&Number.isNaN(t[o])))return!1}return!0}function Fj(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function js(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ap(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,a=js(e),o=y.useRef(0),c=y.useRef(()=>{}),u=Object.assign(y.useCallback((...f)=>{window.clearTimeout(o.current);const p=()=>{o.current!==0&&(o.current=0,a(...f))};c.current=p,u.flush=p,o.current=window.setTimeout(p,n)},[a,n]),{flush:c.current});return y.useEffect(()=>()=>{window.clearTimeout(o.current),r&&u.flush()},[u,r]),u}const Hj=["mousedown","touchstart"];function J3(e,t,n){const r=y.useRef(null);return y.useEffect(()=>{const a=o=>{const{target:c}=o??{};if(Array.isArray(n)){const u=(c==null?void 0:c.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(c)&&c.tagName!=="HTML";n.every(p=>!!p&&!o.composedPath().includes(p))&&!u&&e()}else r.current&&!r.current.contains(c)&&e()};return(t||Hj).forEach(o=>document.addEventListener(o,a)),()=>{(t||Hj).forEach(o=>document.removeEventListener(o,a))}},[r,e,n]),r}function sR({timeout:e=2e3}={}){const[t,n]=y.useState(null),[r,a]=y.useState(!1),[o,c]=y.useState(null),u=m=>{window.clearTimeout(o),c(window.setTimeout(()=>a(!1),e)),a(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:()=>{a(!1),n(null),window.clearTimeout(o)},error:t,copied:r}}function eN(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function tN(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function lR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,a]=y.useState(n?t:tN(e)),o=y.useRef(null);return y.useEffect(()=>{if("matchMedia"in window)return o.current=window.matchMedia(e),a(o.current.matches),eN(o.current,c=>a(c.matches))},[e]),r}function nN(e,t){return lR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Sc=typeof document<"u"?y.useLayoutEffect:y.useEffect;function zi(e,t){const n=y.useRef(!1);y.useEffect(()=>()=>{n.current=!1},[]),y.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function cR({opened:e,shouldReturnFocus:t=!0}){const n=y.useRef(null),r=()=>{var a;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((a=n.current)==null||a.focus({preventScroll:!0}))};return zi(()=>{let a=-1;const o=c=>{c.key==="Tab"&&window.clearTimeout(a)};return document.addEventListener("keydown",o),e?n.current=document.activeElement:t&&(a=window.setTimeout(r,10)),()=>{window.clearTimeout(a),document.removeEventListener("keydown",o)}},[e,t]),r}const rN=/input|select|textarea|button|object/,uR="a, input, select, textarea, button, object, [tabindex]";function aN(e){return e.style.display==="none"}function iN(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(aN(n))return!1;n=n.parentNode}return!0}function dR(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function hy(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(dR(e));return(rN.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&iN(e)}function fR(e){const t=dR(e);return(Number.isNaN(t)||t>=0)&&hy(e)}function oN(e){return Array.from(e.querySelectorAll(uR)).filter(fR)}function sN(e,t){const n=oN(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],a=e.getRootNode();let o=r===a.activeElement||e===a.activeElement;const c=a.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(o=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!o)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function lN(e=!0){const t=y.useRef(null),n=a=>{let o=a.querySelector("[data-autofocus]");if(!o){const c=Array.from(a.querySelectorAll(uR));o=c.find(fR)||c.find(hy)||null,!o&&hy(a)&&(o=a)}o&&o.focus({preventScroll:!0})},r=y.useCallback(a=>{e&&a!==null&&t.current!==a&&(a?(setTimeout(()=>{a.getRootNode()&&n(a)}),t.current=a):t.current=null)},[e]);return y.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const a=o=>{o.key==="Tab"&&t.current&&sN(t.current,o)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),r}const cN=e=>(e+1)%1e6;function uN(){const[,e]=y.useReducer(cN,0);return e}const dN=Cn.useId||(()=>{});function fN(){const e=dN();return e?`mantine-${e.replace(/:/g,"")}`:""}function yr(e){const t=fN(),[n,r]=y.useState(t);return Sc(()=>{r(Th())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function hR(e,t,n){y.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Ku(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function hN(...e){const t=new Map;return n=>{if(e.forEach(r=>{const a=Ku(r,n);a&&t.set(r,a)}),t.size>0)return()=>{e.forEach(r=>{const a=t.get(r);a?a():Ku(r,null)}),t.clear()}}}function zn(...e){return y.useCallback(hN(...e),e)}function Yn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[a,o]=y.useState(t!==void 0?t:n),c=(u,...f)=>{o(u),r==null||r(u,...f)};return e!==void 0?[e,r,!0]:[a,c,!1]}function ko(e,t){const n=t-e+1;return Array.from({length:n},(r,a)=>a+e)}const Jf="dots";function pN({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:a=1,onChange:o}){const c=Math.max(Math.trunc(e),0),[u,f]=Yn({value:r,onChange:o,defaultValue:a,finalValue:a}),p=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>p(u+1),g=()=>p(u-1),v=()=>p(1),b=()=>p(c);return{range:y.useMemo(()=>{if(t*2+3+n*2>=c)return ko(1,c);const C=Math.max(u-t,n),R=Math.min(u+t,c-n),D=C>n+2,E=R<c-(n+1);if(!D&&E){const T=t*2+n+2;return[...ko(1,T),Jf,...ko(c-(n-1),c)]}if(D&&!E){const T=n+1+2*t;return[...ko(1,n),Jf,...ko(c-T,c)]}return[...ko(1,n),Jf,...ko(C,R),Jf,...ko(c-n+1,c)]},[c,t,u]),active:u,setPage:p,next:m,previous:g,first:v,last:b}}function cx(e,t){return lR("(prefers-reduced-motion: reduce)",e,t)}function mN(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(!Z3(e[n],t[n]))return!1;return!0}function gN(e){const t=y.useRef([]),n=y.useRef(0);return mN(t.current,e)||(t.current=e,n.current+=1),[n.current]}function vN(e,t){y.useEffect(e,gN(t))}function ip(e=!1,t){const{onOpen:n,onClose:r}={},[a,o]=y.useState(e),c=y.useCallback(()=>{o(p=>p||(n==null||n(),!0))},[n]),u=y.useCallback(()=>{o(p=>p&&(r==null||r(),!1))},[r]),f=y.useCallback(()=>{a?u():c()},[u,c,a]);return[a,{open:c,close:u,toggle:f}]}function yN(e,t,n={autoInvoke:!1}){const r=y.useRef(null),a=y.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),o=y.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return y.useEffect(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function xN(e,t,n){const r=y.useRef(null),a=y.useRef(null);return y.useEffect(()=>{const o=typeof n=="function"?n():n;return(o||a.current)&&(r.current=new MutationObserver(e),r.current.observe(o||a.current,t)),()=>{var c;(c=r.current)==null||c.disconnect()}},[e,t]),a}function bN(){const[e,t]=y.useState(!1);return y.useEffect(()=>t(!0),[]),e}var SN={};function pR(){return typeof process<"u"&&SN?"production":"development"}function op(e){var n;const t=Cn.version;return typeof Cn.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function mR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=mR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ut(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=mR(e))&&(r&&(r+=" "),r+=t);return r}const wN={};function jN(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,a])=>{t[r]?t[r]=Ut(t[r],a):t[r]=a})}),t}function sp({theme:e,classNames:t,props:n,stylesCtx:r}){const o=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||wN);return jN(o)}function Rh({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((o,c)=>typeof c=="function"?{...o,...c(e,n,r)}:{...o,...c},{})}const ux=y.createContext(null);function qi(){const e=y.useContext(ux);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function CN(){return qi().cssVariablesResolver}function EN(){return qi().classNamesPrefix}function lp(){return qi().getStyleNonce}function TN(){return qi().withStaticClasses}function RN(){return qi().headless}function DN(){var e;return(e=qi().stylesTransform)==null?void 0:e.sx}function AN(){var e;return(e=qi().stylesTransform)==null?void 0:e.styles}function gR(){return qi().env||"default"}function _N(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function kN(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,a=n>>8&255,o=n&255;return{r,g:a,b:o,a:1}}function PN(e){const[t,n,r,a]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:a===void 0?1:a}}function NN(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),a=parseInt(n[2],10)/100,o=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*o-1))*a,f=r/60,p=u*(1-Math.abs(f%2-1)),m=o-u/2;let g,v,b;return f>=0&&f<1?(g=u,v=p,b=0):f>=1&&f<2?(g=p,v=u,b=0):f>=2&&f<3?(g=0,v=u,b=p):f>=3&&f<4?(g=0,v=p,b=u):f>=4&&f<5?(g=p,v=0,b=u):(g=u,v=0,b=p),{r:Math.round((g+m)*255),g:Math.round((v+m)*255),b:Math.round((b+m)*255),a:c||1}}function dx(e){return _N(e)?kN(e):e.startsWith("rgb")?PN(e):e.startsWith("hsl")?NN(e):{r:0,g:0,b:0,a:1}}function eh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:a,a:o}=dx(e),c=1-t,u=f=>Math.round(f*c);return`rgba(${u(n)}, ${u(r)}, ${u(a)}, ${o})`}function Xu(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Sv(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function ON(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function MN(e){if(e.startsWith("oklch("))return(ON(e)||0)/100;const{r:t,g:n,b:r}=dx(e),a=t/255,o=n/255,c=r/255,u=Sv(a),f=Sv(o),p=Sv(c);return .2126*u+.7152*f+.0722*p}function Pu(e,t=.179){return e.startsWith("var(")?!1:MN(e)>t}function fa({color:e,theme:t,colorScheme:n}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:n==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Pu(n==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:n==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Pu(n==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Pu(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,a]=e.split("."),o=a?Number(a):void 0,c=r in t.colors;if(c){const u=o!==void 0?t.colors[r][o]:t.colors[r][Xu(t,n||"light")];return{color:r,value:u,shade:o,isThemeColor:c,isLight:Pu(u,t.luminanceThreshold),variable:a?`--mantine-color-${r}-${o}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:Pu(e,t.luminanceThreshold),shade:o,variable:void 0}}function Ht(e,t){const n=fa({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function py(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)??t.defaultGradient.deg??0},r=Ht(n.from,t),a=Ht(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${a} 100%)`}function la(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const o=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${o}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:a}=dx(e);return`rgba(${n}, ${r}, ${a}, ${t})`}const Fl=la,IN=({color:e,theme:t,variant:n,gradient:r,autoContrast:a})=>{const o=fa({color:e,theme:t}),c=typeof a=="boolean"?a:t.autoContrast;if(n==="filled"){const u=c&&o.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return o.isThemeColor?o.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${le(1)} solid transparent`}:{background:`var(--mantine-color-${o.color}-${o.shade})`,hover:`var(--mantine-color-${o.color}-${o.shade===9?8:o.shade+1})`,color:u,border:`${le(1)} solid transparent`}:{background:e,hover:eh(e,.1),color:u,border:`${le(1)} solid transparent`}}if(n==="light"){if(o.isThemeColor){if(o.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:la(u,.1),hover:la(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:la(e,.1),hover:la(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return o.isThemeColor?o.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:la(t.colors[o.color][o.shade],.05),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid var(--mantine-color-${o.color}-${o.shade})`}:{background:"transparent",hover:la(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(o.isThemeColor){if(o.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:"transparent",hover:la(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:la(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?o.isThemeColor?o.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?o.isThemeColor?o.shade===void 0?{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:py(r,t),hover:py(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${le(1)} solid var(--mantine-color-default-border)`}:{}},LN={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},qj="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fx={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:LN,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:IN,autoContrast:!1,luminanceThreshold:.3,fontFamily:qj,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:qj,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:le(34),lineHeight:"1.3"},h2:{fontSize:le(26),lineHeight:"1.35"},h3:{fontSize:le(22),lineHeight:"1.4"},h4:{fontSize:le(18),lineHeight:"1.45"},h5:{fontSize:le(16),lineHeight:"1.5"},h6:{fontSize:le(14),lineHeight:"1.5"}}},fontSizes:{xs:le(12),sm:le(14),md:le(16),lg:le(18),xl:le(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:le(2),sm:le(4),md:le(8),lg:le(16),xl:le(32)},spacing:{xs:le(10),sm:le(12),md:le(16),lg:le(20),xl:le(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), 0 ${le(1)} ${le(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(10)} ${le(15)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(7)} ${le(7)} ${le(-5)}`,md:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(20)} ${le(25)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(10)} ${le(10)} ${le(-5)}`,lg:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(28)} ${le(23)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(12)} ${le(12)} ${le(-7)}`,xl:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(36)} ${le(28)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(17)} ${le(17)} ${le(-7)}`},other:{},components:{}};function Gj(e){return e==="auto"||e==="dark"||e==="light"}function zN({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 Gj(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&&Gj(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const $N="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",Qj="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function wv(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Wj(e){if(!(e.primaryColor in e.colors))throw new Error($N);if(typeof e.primaryShade=="object"&&(!wv(e.primaryShade.dark)||!wv(e.primaryShade.light)))throw new Error(Qj);if(typeof e.primaryShade=="number"&&!wv(e.primaryShade))throw new Error(Qj)}function UN(e,t){var r;if(!t)return Wj(e),e;const n=ox(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),Wj(n),n}const hx=y.createContext(null),BN=()=>y.useContext(hx)||fx;function Sn(){const e=y.useContext(hx);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 vR({theme:e,children:t,inherit:n=!0}){const r=BN(),a=y.useMemo(()=>UN(n?r:fx,e),[e,r,n]);return s.jsx(hx.Provider,{value:a,children:t})}vR.displayName="@mantine/core/MantineThemeProvider";function VN(){const e=Sn(),t=lp(),n=sn(e.breakpoints).reduce((r,a)=>{const o=e.breakpoints[a].includes("px"),c=Wu(e.breakpoints[a]),u=o?`${c-.1}px`:jh(c-.1),f=o?`${c}px`:jh(c);return`${r}@media (max-width: ${u}) {.mantine-visible-from-${a} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${a} {display: none !important;}}`},"");return s.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function jv(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Nu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,a)=>`${a}{${r}}`,t)}function FN(e,t){const n=jv(e.variables),r=n?Nu(t,n):"",a=jv(e.dark),o=jv(e.light),c=a?Nu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,a):"",u=o?Nu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,o):"";return`${r}${c}${u}`}function Gi({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&fa({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function Yj(e,t){return Gi({color:e.colors[e.primaryColor][Xu(e,t)],theme:e,autoContrast:null})}function th({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:a=!0}){if(!e.colors[t])return{};if(n==="light"){const u=Xu(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`]:Fl(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:Fl(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`]:Fl(e.colors[t][u],.05)};return a?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const o=Xu(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${o})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${o===9?8:o+1})`,[`--mantine-color-${r}-light`]:Fl(e.colors[t][Math.max(0,o-2)],.15),[`--mantine-color-${r}-light-hover`]:Fl(e.colors[t][Math.max(0,o-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(o-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(o-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Fl(e.colors[t][Math.max(o-4,0)],.05)};return a?{[`--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 HN(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Hl(e,t,n){sn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const yR=e=>{const t=Xu(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":Yj(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":Yj(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)"}};Hl(r.variables,e.breakpoints,"breakpoint"),Hl(r.variables,e.spacing,"spacing"),Hl(r.variables,e.fontSizes,"font-size"),Hl(r.variables,e.lineHeights,"line-height"),Hl(r.variables,e.shadows,"shadow"),Hl(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((o,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),sn(e.colors).forEach(o=>{const c=e.colors[o];if(HN(c)){Object.assign(r.light,th({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,th({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((u,f)=>{r.variables[`--mantine-color-${o}-${f}`]=u}),Object.assign(r.light,th({theme:e,color:o,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,th({theme:e,color:o,colorScheme:"dark",withColorValues:!1}))});const a=e.headings.sizes;return sn(a).forEach(o=>{r.variables[`--mantine-${o}-font-size`]=a[o].fontSize,r.variables[`--mantine-${o}-line-height`]=a[o].lineHeight,r.variables[`--mantine-${o}-font-weight`]=a[o].fontWeight||e.headings.fontWeight}),r};function qN({theme:e,generator:t}){const n=yR(e),r=t==null?void 0:t(e);return r?ox(n,r):n}const Cv=yR(fx);function GN(e){const t={variables:{},light:{},dark:{}};return sn(e.variables).forEach(n=>{Cv.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),sn(e.light).forEach(n=>{Cv.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),sn(e.dark).forEach(n=>{Cv.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function QN(e){return`
58
- ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
59
- ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
60
- `}function xR({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Sn(),r=lp(),a=CN(),o=qN({theme:n,generator:a}),c=e===":root"&&t,u=c?GN(o):o,f=FN(u,e);return f?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${f}${c?"":QN(e)}`}}):null}xR.displayName="@mantine/CssVariables";function WN(){const e=console.error;console.error=(...t)=>{t.length>1&&typeof t[0]=="string"&&t[0].toLowerCase().includes("extra attributes from the server")&&typeof t[1]=="string"&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}}function ql(e,t){var a,o;const n=typeof window<"u"&&"matchMedia"in window&&((a=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:a.matches),r=e!=="auto"?e:n?"dark":"light";(o=t())==null||o.setAttribute("data-mantine-color-scheme",r)}function YN({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const a=y.useRef(null),[o,c]=y.useState(()=>e.get(t)),u=r||o,f=y.useCallback(m=>{r||(ql(m,n),c(m),e.set(m))},[e.set,u,r]),p=y.useCallback(()=>{c(t),ql(t,n),e.clear()},[e.clear,t]);return y.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),Sc(()=>{ql(e.get(t),n)},[]),y.useEffect(()=>{var g;if(r)return ql(r,n),()=>{};r===void 0&&ql(o,n),typeof window<"u"&&"matchMedia"in window&&(a.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=v=>{o==="auto"&&ql(v.matches?"dark":"light",n)};return(g=a.current)==null||g.addEventListener("change",m),()=>{var v;return(v=a.current)==null?void 0:v.removeEventListener("change",m)}},[o,r]),{colorScheme:u,setColorScheme:f,clearColorScheme:p}}function KN({respectReducedMotion:e,getRootElement:t}){Sc(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}WN();function bR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:a=!0,deduplicateCssVariables:o=!0,withCssVariables:c=!0,cssVariablesSelector:u=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=zN(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:v,forceColorScheme:b,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:R,clearColorScheme:D}=YN({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return KN({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:g}),s.jsx(ux.Provider,{value:{colorScheme:C,setColorScheme:R,clearColorScheme:D,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:v,cssVariablesSelector:u,withStaticClasses:r,stylesTransform:S,env:j},children:s.jsxs(vR,{theme:e,children:[c&&s.jsx(xR,{cssVariablesSelector:u,deduplicateCssVariables:o}),a&&s.jsx(VN,{}),t]})})}bR.displayName="@mantine/core/MantineProvider";function Ws({classNames:e,styles:t,props:n,stylesCtx:r}){const a=Sn();return{resolvedClassNames:sp({theme:a,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Rh({theme:a,styles:t,props:n,stylesCtx:r||void 0})}}const XN={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function ZN({theme:e,options:t,unstyled:n}){return Ut((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||XN[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function JN({selector:e,stylesCtx:t,options:n,props:r,theme:a}){return sp({theme:a,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function Kj({selector:e,stylesCtx:t,theme:n,classNames:r,props:a}){return sp({theme:n,classNames:r,props:a,stylesCtx:t})[e]}function eO({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function tO({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function nO({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(a=>`${t}-${a}-${n}`)}function rO({themeName:e,theme:t,selector:n,props:r,stylesCtx:a}){return e.map(o=>{var c,u;return(u=sp({theme:t,classNames:(c=t.components[o])==null?void 0:c.classNames,props:r,stylesCtx:a}))==null?void 0:u[n]})}function aO({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function iO({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:a,classNames:o,classes:c,unstyled:u,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:v,headless:b,transformedStyles:S}){return Ut(ZN({theme:e,options:t,unstyled:u||b}),rO({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),aO({options:t,classes:c,selector:r,unstyled:u}),Kj({selector:r,stylesCtx:g,theme:e,classNames:o,props:m}),Kj({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),JN({selector:r,stylesCtx:g,options:t,props:m,theme:e}),eO({rootSelector:p,selector:r,className:f}),tO({selector:r,classes:c,unstyled:u||b}),v&&!b&&nO({themeName:n,classNamesPrefix:a,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function oO({theme:e,themeName:t,props:n,stylesCtx:r,selector:a}){return t.map(o=>{var c;return Rh({theme:e,styles:(c=e.components[o])==null?void 0:c.styles,props:n,stylesCtx:r})[a]}).reduce((o,c)=>({...o,...c}),{})}function my({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...my({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function sO(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Ho(n[r])}}),t),{})}function lO({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:a,selector:o,themeName:c,headless:u}){var f;return(f=sO([u?{}:t==null?void 0:t(n,r,a),...c.map(p=>{var m,g,v;return(v=(g=(m=n.components)==null?void 0:m[p])==null?void 0:g.vars)==null?void 0:v.call(g,n,r,a)}),e==null?void 0:e(n,r,a)]))==null?void 0:f[o]}function cO({theme:e,themeName:t,selector:n,options:r,props:a,stylesCtx:o,rootSelector:c,styles:u,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:v}){return{...!v&&oO({theme:e,themeName:t,props:a,stylesCtx:o,selector:n}),...!v&&Rh({theme:e,styles:u,props:a,stylesCtx:o})[n],...!v&&Rh({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||a,stylesCtx:o})[n],...lO({theme:e,props:a,stylesCtx:o,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?my({style:f,theme:e}):null,...my({style:r==null?void 0:r.style,theme:e})}}function uO({props:e,stylesCtx:t,themeName:n}){var c;const r=Sn(),a=(c=AN())==null?void 0:c();return{getTransformedStyles:u=>a?[...u.map(p=>a(p,{props:e,theme:r,ctx:t})),...n.map(p=>{var m;return a((m=r.components[p])==null?void 0:m.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!a}}function Ie({name:e,classes:t,props:n,stylesCtx:r,className:a,style:o,rootSelector:c="root",unstyled:u,classNames:f,styles:p,vars:m,varsResolver:g}){const v=Sn(),b=EN(),S=TN(),j=RN(),C=(Array.isArray(e)?e:[e]).filter(E=>E),{withStylesTransform:R,getTransformedStyles:D}=uO({props:n,stylesCtx:r,themeName:C});return(E,T)=>({className:iO({theme:v,options:T,themeName:C,selector:E,classNamesPrefix:b,classNames:f,classes:t,unstyled:u,className:a,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:S,headless:j,transformedStyles:D([T==null?void 0:T.styles,p])}),style:cO({theme:v,themeName:C,selector:E,options:T,props:n,stylesCtx:r,rootSelector:c,styles:p,style:o,vars:m,varsResolver:g,headless:j,withStylesTransform:R})})}function Ys(e,t){return typeof e=="boolean"?e:t.autoContrast}function Xj(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 dO({keepTransitions:e}={}){const t=y.useRef(Eh),n=y.useRef(-1),r=y.useContext(ux),a=lp(),o=y.useRef(a==null?void 0:a());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:Xj(o.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var v;(v=t.current)==null||v.call(t)},10)},u=()=>{r.clearColorScheme(),t.current=e?()=>{}:Xj(o.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var g;(g=t.current)==null||g.call(t)},10)},f=nN("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?f:r.colorScheme,m=y.useCallback(()=>c(p==="light"?"dark":"light"),[c,p]);return y.useEffect(()=>()=>{var g;(g=t.current)==null||g.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:u,toggleColorScheme:m}}function se(e,t,n){var c;const r=Sn(),a=(c=r.components[e])==null?void 0:c.defaultProps,o=typeof a=="function"?a(r):a;return{...t,...o,...Ho(n)}}function Ev(e){return sn(e).reduce((t,n)=>e[n]!==void 0?`${t}${F3(n)}:${e[n]};`:t,"").trim()}function fO({selector:e,styles:t,media:n,container:r}){const a=t?Ev(t):"",o=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${Ev(u.styles)}}}`):[],c=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${Ev(u.styles)}}}`):[];return`${a?`${e}{${a}}`:""}${o.join("")}${c.join("")}`.trim()}function Ks(e){const t=lp();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:fO(e)}})}function Qi(e){const{m:t,mx:n,my:r,mt:a,mb:o,ml:c,mr:u,me:f,ms:p,p:m,px:g,py:v,pt:b,pb:S,pl:j,pr:C,pe:R,ps:D,bd:E,bg:T,c:A,opacity:k,ff:M,fz:L,fw:$,lts:V,ta:Y,lh:Q,fs:J,tt:G,td:Z,w:P,miw:I,maw:z,h:H,mih:O,mah:U,bgsz:K,bgp:ee,bgr:be,bga:xe,pos:ye,top:qe,left:Ne,bottom:tt,right:Ae,inset:gt,display:Mt,flex:It,hiddenFrom:mt,visibleFrom:Dt,lightHidden:nn,darkHidden:Ce,sx:Re,...Ge}=e;return{styleProps:Ho({m:t,mx:n,my:r,mt:a,mb:o,ml:c,mr:u,me:f,ms:p,p:m,px:g,py:v,pt:b,pb:S,pl:j,pr:C,pe:R,ps:D,bd:E,bg:T,c:A,opacity:k,ff:M,fz:L,fw:$,lts:V,ta:Y,lh:Q,fs:J,tt:G,td:Z,w:P,miw:I,maw:z,h:H,mih:O,mah:U,bgsz:K,bgp:ee,bgr:be,bga:xe,pos:ye,top:qe,left:Ne,bottom:tt,right:Ae,inset:gt,display:Mt,flex:It,hiddenFrom:mt,visibleFrom:Dt,lightHidden:nn,darkHidden:Ce,sx:Re}),rest:Ge}}const hO={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function px(e,t){const n=fa({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 pO(e,t){const n=fa({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:px(e,t)}function mO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...a]=e.split(" ").filter(c=>c.trim()!=="");let o=`${le(n)}`;return r&&(o+=` ${r}`),a.length>0&&(o+=` ${px(a.join(" "),t)}`),o.trim()}return e}const Zj={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 gO(e){return typeof e=="string"&&e in Zj?Zj[e]:e}const vO=["h1","h2","h3","h4","h5","h6"];function yO(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&vO.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function xO(e){return e}const bO=["h1","h2","h3","h4","h5","h6"];function SO(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&bO.includes(e)?`var(--mantine-${e}-line-height)`:e}function wO(e){return typeof e=="number"?le(e):e}function jO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return le(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const Tv={color:px,textColor:pO,fontSize:yO,spacing:jO,identity:xO,size:wO,lineHeight:SO,fontFamily:gO,border:mO};function Jj(e){return e.replace("(min-width: ","").replace("em)","")}function CO({media:e,...t}){const r=Object.keys(e).sort((a,o)=>Number(Jj(a))-Number(Jj(o))).map(a=>({query:a,styles:e[a]}));return{...t,media:r}}function EO(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function TO(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function RO(e){return typeof e=="object"&&e!==null?sn(e).filter(t=>t!=="base"):[]}function DO(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function SR({styleProps:e,data:t,theme:n}){return CO(sn(e).reduce((r,a)=>{if(a==="hiddenFrom"||a==="visibleFrom"||a==="sx")return r;const o=t[a],c=Array.isArray(o.property)?o.property:[o.property],u=TO(e[a]);if(!EO(e[a]))return c.forEach(p=>{r.inlineStyles[p]=Tv[o.type](u,n)}),r;r.hasResponsiveStyles=!0;const f=RO(e[a]);return c.forEach(p=>{u&&(r.styles[p]=Tv[o.type](u,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:Tv[o.type](DO(e[a],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function ud(){return`__m__-${y.useId().replace(/:/g,"")}`}function wR(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...wR(r,t)}),{}):typeof e=="function"?e(t):e??{}}function jR(e){return e.startsWith("data-")?e:`data-${e}`}function AO(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[jR(n)]=e[n]),t},{})}function CR(e){return e?typeof e=="string"?{[jR(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...CR(n)}),{}):AO(e):null}function gy(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...gy(r,t)}),{}):typeof e=="function"?e(t):e??{}}function _O({theme:e,style:t,vars:n,styleProps:r}){const a=gy(t,e),o=gy(n,e);return{...a,...o,...r}}const ER=y.forwardRef(({component:e,style:t,__vars:n,className:r,variant:a,mod:o,size:c,hiddenFrom:u,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:v,...b},S)=>{var L;const j=Sn(),C=e||"div",{styleProps:R,rest:D}=Qi(b),E=DN(),T=(L=E==null?void 0:E())==null?void 0:L(R.sx),A=ud(),k=SR({styleProps:R,theme:j,data:hO}),M={ref:S,style:_O({theme:j,style:t,vars:n,styleProps:k.inlineStyles}),className:Ut(r,T,{[A]:k.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${f}`]:f}),"data-variant":a,"data-size":aR(c)?void 0:c||void 0,size:v,...CR(o),...D};return s.jsxs(s.Fragment,{children:[k.hasResponsiveStyles&&s.jsx(Ks,{selector:`.${A}`,styles:k.styles,media:k.media}),typeof g=="function"?g(M):s.jsx(C,{...M})]})});ER.displayName="@mantine/core/Box";const ce=ER;function TR(e){return e}function kO(e){const t=e;return n=>{const r=y.forwardRef((a,o)=>s.jsx(t,{...n,...a,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ve(e){const t=y.forwardRef(e);return t.extend=TR,t.withProps=n=>{const r=y.forwardRef((a,o)=>s.jsx(t,{...n,...a,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function lr(e){const t=y.forwardRef(e);return t.withProps=n=>{const r=y.forwardRef((a,o)=>s.jsx(t,{...n,...a,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=TR,t}const PO=y.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Xs(){return y.useContext(PO)}var Rv={exports:{}},ar={};/**
61
- * @license React
62
- * react-dom.production.js
63
- *
64
- * Copyright (c) Meta Platforms, Inc. and affiliates.
65
- *
66
- * This source code is licensed under the MIT license found in the
67
- * LICENSE file in the root directory of this source tree.
68
- */var eC;function NO(){if(eC)return ar;eC=1;var e=ix();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:f,containerInfo:p,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return ar.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ar.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return o(f,p,null,m)},ar.flushSync=function(f){var p=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=p,r.p=m,r.d.f()}},ar.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(f,p))},ar.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},ar.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=u(m,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},ar.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=u(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(f)},ar.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=u(m,p.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},ar.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=u(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},ar.requestFormReset=function(f){r.d.r(f)},ar.unstable_batchedUpdates=function(f,p){return f(p)},ar.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},ar.useFormStatus=function(){return c.H.useHostTransitionStatus()},ar.version="19.1.0",ar}var tC;function RR(){if(tC)return Rv.exports;tC=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(),Rv.exports=NO(),Rv.exports}var mx=RR();const Vu=ax(mx);function cp(){return typeof window<"u"}function wc(e){return DR(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ui(e){var t;return(t=(DR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function DR(e){return cp()?e instanceof Node||e instanceof Dr(e).Node:!1}function vn(e){return cp()?e instanceof Element||e instanceof Dr(e).Element:!1}function Gr(e){return cp()?e instanceof HTMLElement||e instanceof Dr(e).HTMLElement:!1}function vy(e){return!cp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}function dd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ha(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function OO(e){return["table","td","th"].includes(wc(e))}function up(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function gx(e){const t=dp(),n=vn(e)?ha(e):e;return["transform","translate","scale","rotate","perspective"].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)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function MO(e){let t=$i(e);for(;Gr(t)&&!Uo(t);){if(gx(t))return t;if(up(t))return null;t=$i(t)}return null}function dp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Uo(e){return["html","body","#document"].includes(wc(e))}function ha(e){return Dr(e).getComputedStyle(e)}function fp(e){return vn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $i(e){if(wc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vy(e)&&e.host||ui(e);return vy(t)?t.host:t}function AR(e){const t=$i(e);return Uo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gr(t)&&dd(t)?t:AR(t)}function Ii(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=AR(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),c=Dr(a);if(o){const u=yy(c);return t.concat(c,c.visualViewport||[],dd(a)?a:[],u&&n?Ii(u):[])}return t.concat(a,Ii(a,[],n))}function yy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nC(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 Zu(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&vy(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function _R(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function kR(){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 IO(e){return $O()?!1:!rC()&&e.width===0&&e.height===0||rC()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function LO(){return/apple/i.test(navigator.vendor)}function rC(){const e=/android/i;return e.test(_R())||e.test(kR())}function zO(){return _R().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function $O(){return kR().includes("jsdom/")}function xy(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function UO(e){return"nativeEvent"in e}function BO(e){return e.matches("html,body")}function Rs(e){return(e==null?void 0:e.ownerDocument)||document}function Dv(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 Zl(e){return"composedPath"in e?e.composedPath()[0]:e.target}const VO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function FO(e){return Gr(e)&&e.matches(VO)}const Oa=Math.min,ir=Math.max,Dh=Math.round,nh=Math.floor,ti=e=>({x:e,y:e}),HO={left:"right",right:"left",bottom:"top",top:"bottom"},qO={start:"end",end:"start"};function by(e,t,n){return ir(e,Oa(t,n))}function Ui(e,t){return typeof e=="function"?e(t):e}function Ma(e){return e.split("-")[0]}function jc(e){return e.split("-")[1]}function vx(e){return e==="x"?"y":"x"}function yx(e){return e==="y"?"height":"width"}function ka(e){return["top","bottom"].includes(Ma(e))?"y":"x"}function xx(e){return vx(ka(e))}function GO(e,t,n){n===void 0&&(n=!1);const r=jc(e),a=xx(e),o=yx(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(c=Ah(c)),[c,Ah(c)]}function QO(e){const t=Ah(e);return[Sy(e),t,Sy(t)]}function Sy(e){return e.replace(/start|end/g,t=>qO[t])}function WO(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:c;default:return[]}}function YO(e,t,n,r){const a=jc(e);let o=WO(Ma(e),n==="start",r);return a&&(o=o.map(c=>c+"-"+a),t&&(o=o.concat(o.map(Sy)))),o}function Ah(e){return e.replace(/left|right|bottom|top/g,t=>HO[t])}function KO(e){return{top:0,right:0,bottom:0,left:0,...e}}function bx(e){return typeof e!="number"?KO(e):{top:e,right:e,bottom:e,left:e}}function cc(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function aC(e,t,n){let{reference:r,floating:a}=e;const o=ka(t),c=xx(t),u=yx(c),f=Ma(t),p=o==="y",m=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,v=r[u]/2-a[u]/2;let b;switch(f){case"top":b={x:m,y:r.y-a.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-a.width,y:g};break;default:b={x:r.x,y:r.y}}switch(jc(t)){case"start":b[c]-=v*(n&&p?-1:1);break;case"end":b[c]+=v*(n&&p?-1:1);break}return b}const XO=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:c}=n,u=o.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:g}=aC(p,r,f),v=r,b={},S=0;for(let j=0;j<u.length;j++){const{name:C,fn:R}=u[j],{x:D,y:E,data:T,reset:A}=await R({x:m,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=D??m,g=E??g,b={...b,[C]:{...b[C],...T}},A&&S<=50&&(S++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(p=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:m,y:g}=aC(p,v,f)),j=-1)}return{x:m,y:g,placement:v,strategy:a,middlewareData:b}};async function Sx(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:c,elements:u,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:v=!1,padding:b=0}=Ui(t,e),S=bx(b),C=u[v?g==="floating"?"reference":"floating":g],R=cc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:p,rootBoundary:m,strategy:f})),D=g==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),T=await(o.isElement==null?void 0:o.isElement(E))?await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1}:{x:1,y:1},A=cc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:D,offsetParent:E,strategy:f}):D);return{top:(R.top-A.top+S.top)/T.y,bottom:(A.bottom-R.bottom+S.bottom)/T.y,left:(R.left-A.left+S.left)/T.x,right:(A.right-R.right+S.right)/T.x}}const ZO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:c,elements:u,middlewareData:f}=t,{element:p,padding:m=0}=Ui(e,t)||{};if(p==null)return{};const g=bx(m),v={x:n,y:r},b=xx(a),S=yx(b),j=await c.getDimensions(p),C=b==="y",R=C?"top":"left",D=C?"bottom":"right",E=C?"clientHeight":"clientWidth",T=o.reference[S]+o.reference[b]-v[b]-o.floating[S],A=v[b]-o.reference[b],k=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let M=k?k[E]:0;(!M||!await(c.isElement==null?void 0:c.isElement(k)))&&(M=u.floating[E]||o.floating[S]);const L=T/2-A/2,$=M/2-j[S]/2-1,V=Oa(g[R],$),Y=Oa(g[D],$),Q=V,J=M-j[S]-Y,G=M/2-j[S]/2+L,Z=by(Q,G,J),P=!f.arrow&&jc(a)!=null&&G!==Z&&o.reference[S]/2-(G<Q?V:Y)-j[S]/2<0,I=P?G<Q?G-Q:G-J:0;return{[b]:v[b]+I,data:{[b]:Z,centerOffset:G-Z-I,...P&&{alignmentOffset:I}},reset:P}}}),JO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:c,initialPlacement:u,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=Ui(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const R=Ma(a),D=ka(u),E=Ma(u)===u,T=await(f.isRTL==null?void 0:f.isRTL(p.floating)),A=v||(E||!j?[Ah(u)]:QO(u)),k=S!=="none";!v&&k&&A.push(...YO(u,j,S,T));const M=[u,...A],L=await Sx(t,C),$=[];let V=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&$.push(L[R]),g){const G=GO(a,c,T);$.push(L[G[0]],L[G[1]])}if(V=[...V,{placement:a,overflows:$}],!$.every(G=>G<=0)){var Y,Q;const G=(((Y=o.flip)==null?void 0:Y.index)||0)+1,Z=M[G];if(Z&&(!(g==="alignment"?D!==ka(Z):!1)||V.every(z=>z.overflows[0]>0&&ka(z.placement)===D)))return{data:{index:G,overflows:V},reset:{placement:Z}};let P=(Q=V.filter(I=>I.overflows[0]<=0).sort((I,z)=>I.overflows[1]-z.overflows[1])[0])==null?void 0:Q.placement;if(!P)switch(b){case"bestFit":{var J;const I=(J=V.filter(z=>{if(k){const H=ka(z.placement);return H===D||H==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(H=>H>0).reduce((H,O)=>H+O,0)]).sort((z,H)=>z[1]-H[1])[0])==null?void 0:J[0];I&&(P=I);break}case"initialPlacement":P=u;break}if(a!==P)return{reset:{placement:P}}}return{}}}};function PR(e){const t=Oa(...e.map(o=>o.left)),n=Oa(...e.map(o=>o.top)),r=ir(...e.map(o=>o.right)),a=ir(...e.map(o=>o.bottom));return{x:t,y:n,width:r-t,height:a-n}}function eM(e){const t=e.slice().sort((a,o)=>a.y-o.y),n=[];let r=null;for(let a=0;a<t.length;a++){const o=t[a];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(a=>cc(PR(a)))}const tM=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:a,platform:o,strategy:c}=t,{padding:u=2,x:f,y:p}=Ui(e,t),m=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(r.reference))||[]),g=eM(m),v=cc(PR(m)),b=bx(u);function S(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&p!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&p>C.top-b.top&&p<C.bottom+b.bottom)||v;if(g.length>=2){if(ka(n)==="y"){const V=g[0],Y=g[g.length-1],Q=Ma(n)==="top",J=V.top,G=Y.bottom,Z=Q?V.left:Y.left,P=Q?V.right:Y.right,I=P-Z,z=G-J;return{top:J,bottom:G,left:Z,right:P,width:I,height:z,x:Z,y:J}}const C=Ma(n)==="left",R=ir(...g.map(V=>V.right)),D=Oa(...g.map(V=>V.left)),E=g.filter(V=>C?V.left===D:V.right===R),T=E[0].top,A=E[E.length-1].bottom,k=D,M=R,L=M-k,$=A-T;return{top:T,bottom:A,left:k,right:M,width:L,height:$,x:k,y:T}}return v}const j=await o.getElementRects({reference:{getBoundingClientRect:S},floating:r.floating,strategy:c});return a.reference.x!==j.reference.x||a.reference.y!==j.reference.y||a.reference.width!==j.reference.width||a.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}};async function nM(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=Ma(n),u=jc(n),f=ka(n)==="y",p=["left","top"].includes(c)?-1:1,m=o&&f?-1:1,g=Ui(t,e);let{mainAxis:v,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),f?{x:b*m,y:v*p}:{x:v*p,y:b*m}}const rM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:c,middlewareData:u}=t,f=await nM(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:o+f.y,data:{...f,placement:c}}}}},aM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:C=>{let{x:R,y:D}=C;return{x:R,y:D}}},...f}=Ui(e,t),p={x:n,y:r},m=await Sx(t,f),g=ka(Ma(a)),v=vx(g);let b=p[v],S=p[g];if(o){const C=v==="y"?"top":"left",R=v==="y"?"bottom":"right",D=b+m[C],E=b-m[R];b=by(D,b,E)}if(c){const C=g==="y"?"top":"left",R=g==="y"?"bottom":"right",D=S+m[C],E=S-m[R];S=by(D,S,E)}const j=u.fn({...t,[v]:b,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[v]:o,[g]:c}}}}}},iM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:p=!0}=Ui(e,t),m={x:n,y:r},g=ka(a),v=vx(g);let b=m[v],S=m[g];const j=Ui(u,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const E=v==="y"?"height":"width",T=o.reference[v]-o.floating[E]+C.mainAxis,A=o.reference[v]+o.reference[E]-C.mainAxis;b<T?b=T:b>A&&(b=A)}if(p){var R,D;const E=v==="y"?"width":"height",T=["top","left"].includes(Ma(a)),A=o.reference[g]-o.floating[E]+(T&&((R=c.offset)==null?void 0:R[g])||0)+(T?0:C.crossAxis),k=o.reference[g]+o.reference[E]+(T?0:((D=c.offset)==null?void 0:D[g])||0)-(T?C.crossAxis:0);S<A?S=A:S>k&&(S=k)}return{[v]:b,[g]:S}}}},oM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:c,elements:u}=t,{apply:f=()=>{},...p}=Ui(e,t),m=await Sx(t,p),g=Ma(a),v=jc(a),b=ka(a)==="y",{width:S,height:j}=o.floating;let C,R;g==="top"||g==="bottom"?(C=g,R=v===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,C=v==="end"?"top":"bottom");const D=j-m.top-m.bottom,E=S-m.left-m.right,T=Oa(j-m[C],D),A=Oa(S-m[R],E),k=!t.middlewareData.shift;let M=T,L=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=D),k&&!v){const V=ir(m.left,0),Y=ir(m.right,0),Q=ir(m.top,0),J=ir(m.bottom,0);b?L=S-2*(V!==0||Y!==0?V+Y:ir(m.left,m.right)):M=j-2*(Q!==0||J!==0?Q+J:ir(m.top,m.bottom))}await f({...t,availableWidth:L,availableHeight:M});const $=await c.getDimensions(u.floating);return S!==$.width||j!==$.height?{reset:{rects:!0}}:{}}}};function NR(e){const t=ha(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Gr(e),o=a?e.offsetWidth:n,c=a?e.offsetHeight:r,u=Dh(n)!==o||Dh(r)!==c;return u&&(n=o,r=c),{width:n,height:r,$:u}}function wx(e){return vn(e)?e:e.contextElement}function rc(e){const t=wx(e);if(!Gr(t))return ti(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=NR(t);let c=(o?Dh(n.width):n.width)/r,u=(o?Dh(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const sM=ti(0);function OR(e){const t=Dr(e);return!dp()||!t.visualViewport?sM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function Is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=wx(e);let c=ti(1);t&&(r?vn(r)&&(c=rc(r)):c=rc(e));const u=lM(o,n,r)?OR(o):ti(0);let f=(a.left+u.x)/c.x,p=(a.top+u.y)/c.y,m=a.width/c.x,g=a.height/c.y;if(o){const v=Dr(o),b=r&&vn(r)?Dr(r):r;let S=v,j=yy(S);for(;j&&r&&b!==S;){const C=rc(j),R=j.getBoundingClientRect(),D=ha(j),E=R.left+(j.clientLeft+parseFloat(D.paddingLeft))*C.x,T=R.top+(j.clientTop+parseFloat(D.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=E,p+=T,S=Dr(j),j=yy(S)}}return cc({width:m,height:g,x:f,y:p})}function jx(e,t){const n=fp(e).scrollLeft;return t?t.left+n:Is(ui(e)).left+n}function MR(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:jx(e,r)),o=r.top+t.scrollTop;return{x:a,y:o}}function cM(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",c=ui(r),u=t?up(t.floating):!1;if(r===c||u&&o)return n;let f={scrollLeft:0,scrollTop:0},p=ti(1);const m=ti(0),g=Gr(r);if((g||!g&&!o)&&((wc(r)!=="body"||dd(c))&&(f=fp(r)),Gr(r))){const b=Is(r);p=rc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const v=c&&!g&&!o?MR(c,f,!0):ti(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-f.scrollLeft*p.x+m.x+v.x,y:n.y*p.y-f.scrollTop*p.y+m.y+v.y}}function uM(e){return Array.from(e.getClientRects())}function dM(e){const t=ui(e),n=fp(e),r=e.ownerDocument.body,a=ir(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ir(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+jx(e);const u=-n.scrollTop;return ha(r).direction==="rtl"&&(c+=ir(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:c,y:u}}function fM(e,t){const n=Dr(e),r=ui(e),a=n.visualViewport;let o=r.clientWidth,c=r.clientHeight,u=0,f=0;if(a){o=a.width,c=a.height;const p=dp();(!p||p&&t==="fixed")&&(u=a.offsetLeft,f=a.offsetTop)}return{width:o,height:c,x:u,y:f}}function hM(e,t){const n=Is(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=Gr(e)?rc(e):ti(1),c=e.clientWidth*o.x,u=e.clientHeight*o.y,f=a*o.x,p=r*o.y;return{width:c,height:u,x:f,y:p}}function iC(e,t,n){let r;if(t==="viewport")r=fM(e,n);else if(t==="document")r=dM(ui(e));else if(vn(t))r=hM(t,n);else{const a=OR(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return cc(r)}function IR(e,t){const n=$i(e);return n===t||!vn(n)||Uo(n)?!1:ha(n).position==="fixed"||IR(n,t)}function pM(e,t){const n=t.get(e);if(n)return n;let r=Ii(e,[],!1).filter(u=>vn(u)&&wc(u)!=="body"),a=null;const o=ha(e).position==="fixed";let c=o?$i(e):e;for(;vn(c)&&!Uo(c);){const u=ha(c),f=gx(c);!f&&u.position==="fixed"&&(a=null),(o?!f&&!a:!f&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||dd(c)&&!f&&IR(e,c))?r=r.filter(m=>m!==c):a=u,c=$i(c)}return t.set(e,r),r}function mM(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const c=[...n==="clippingAncestors"?up(t)?[]:pM(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((p,m)=>{const g=iC(t,m,a);return p.top=ir(g.top,p.top),p.right=Oa(g.right,p.right),p.bottom=Oa(g.bottom,p.bottom),p.left=ir(g.left,p.left),p},iC(t,u,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function gM(e){const{width:t,height:n}=NR(e);return{width:t,height:n}}function vM(e,t,n){const r=Gr(t),a=ui(t),o=n==="fixed",c=Is(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=ti(0);function p(){f.x=jx(a)}if(r||!r&&!o)if((wc(t)!=="body"||dd(a))&&(u=fp(t)),r){const b=Is(t,!0,o,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else a&&p();o&&!r&&a&&p();const m=a&&!r&&!o?MR(a,u):ti(0),g=c.left+u.scrollLeft-f.x-m.x,v=c.top+u.scrollTop-f.y-m.y;return{x:g,y:v,width:c.width,height:c.height}}function Av(e){return ha(e).position==="static"}function oC(e,t){if(!Gr(e)||ha(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ui(e)===n&&(n=n.ownerDocument.body),n}function LR(e,t){const n=Dr(e);if(up(e))return n;if(!Gr(e)){let a=$i(e);for(;a&&!Uo(a);){if(vn(a)&&!Av(a))return a;a=$i(a)}return n}let r=oC(e,t);for(;r&&OO(r)&&Av(r);)r=oC(r,t);return r&&Uo(r)&&Av(r)&&!gx(r)?n:r||MO(e)||n}const yM=async function(e){const t=this.getOffsetParent||LR,n=this.getDimensions,r=await n(e.floating);return{reference:vM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xM(e){return ha(e).direction==="rtl"}const bM={convertOffsetParentRelativeRectToViewportRelativeRect:cM,getDocumentElement:ui,getClippingRect:mM,getOffsetParent:LR,getElementRects:yM,getClientRects:uM,getDimensions:gM,getScale:rc,isElement:vn,isRTL:xM};function zR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SM(e,t){let n=null,r;const a=ui(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const p=e.getBoundingClientRect(),{left:m,top:g,width:v,height:b}=p;if(u||t(),!v||!b)return;const S=nh(g),j=nh(a.clientWidth-(m+v)),C=nh(a.clientHeight-(g+b)),R=nh(m),E={rootMargin:-S+"px "+-j+"px "+-C+"px "+-R+"px",threshold:ir(0,Oa(1,f))||1};let T=!0;function A(k){const M=k[0].intersectionRatio;if(M!==f){if(!T)return c();M?c(!1,M):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!zR(p,e.getBoundingClientRect())&&c(),T=!1}try{n=new IntersectionObserver(A,{...E,root:a.ownerDocument})}catch{n=new IntersectionObserver(A,E)}n.observe(e)}return c(!0),o}function wM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=wx(e),m=a||o?[...p?Ii(p):[],...Ii(t)]:[];m.forEach(R=>{a&&R.addEventListener("scroll",n,{passive:!0}),o&&R.addEventListener("resize",n)});const g=p&&u?SM(p,n):null;let v=-1,b=null;c&&(b=new ResizeObserver(R=>{let[D]=R;D&&D.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var E;(E=b)==null||E.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let S,j=f?Is(e):null;f&&C();function C(){const R=Is(e);j&&!zR(j,R)&&n(),j=R,S=requestAnimationFrame(C)}return n(),()=>{var R;m.forEach(D=>{a&&D.removeEventListener("scroll",n),o&&D.removeEventListener("resize",n)}),g==null||g(),(R=b)==null||R.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const jM=rM,CM=aM,EM=JO,TM=oM,sC=ZO,RM=tM,DM=iM,AM=(e,t,n)=>{const r=new Map,a={platform:bM,...n},o={...a.platform,_c:r};return XO(e,t,{...a,platform:o})};var _M=typeof document<"u",kM=function(){},mh=_M?y.useLayoutEffect:kM;function _h(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,a;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(!_h(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!_h(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function $R(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lC(e,t){const n=$R(e);return Math.round(t*n)/n}function _v(e){const t=y.useRef(e);return mh(()=>{t.current=e}),t}function PM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:c}={},transform:u=!0,whileElementsMounted:f,open:p}=e,[m,g]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=y.useState(r);_h(v,r)||b(r);const[S,j]=y.useState(null),[C,R]=y.useState(null),D=y.useCallback(z=>{z!==k.current&&(k.current=z,j(z))},[]),E=y.useCallback(z=>{z!==M.current&&(M.current=z,R(z))},[]),T=o||S,A=c||C,k=y.useRef(null),M=y.useRef(null),L=y.useRef(m),$=f!=null,V=_v(f),Y=_v(a),Q=_v(p),J=y.useCallback(()=>{if(!k.current||!M.current)return;const z={placement:t,strategy:n,middleware:v};Y.current&&(z.platform=Y.current),AM(k.current,M.current,z).then(H=>{const O={...H,isPositioned:Q.current!==!1};G.current&&!_h(L.current,O)&&(L.current=O,mx.flushSync(()=>{g(O)}))})},[v,t,n,Y,Q]);mh(()=>{p===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,g(z=>({...z,isPositioned:!1})))},[p]);const G=y.useRef(!1);mh(()=>(G.current=!0,()=>{G.current=!1}),[]),mh(()=>{if(T&&(k.current=T),A&&(M.current=A),T&&A){if(V.current)return V.current(T,A,J);J()}},[T,A,J,V,$]);const Z=y.useMemo(()=>({reference:k,floating:M,setReference:D,setFloating:E}),[D,E]),P=y.useMemo(()=>({reference:T,floating:A}),[T,A]),I=y.useMemo(()=>{const z={position:n,left:0,top:0};if(!P.floating)return z;const H=lC(P.floating,m.x),O=lC(P.floating,m.y);return u?{...z,transform:"translate("+H+"px, "+O+"px)",...$R(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:O}},[n,u,P.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:J,refs:Z,elements:P,floatingStyles:I}),[m,J,Z,P,I])}const NM=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?sC({element:r.current,padding:a}).fn(n):{}:r?sC({element:r,padding:a}).fn(n):{}}}},UR=(e,t)=>({...jM(e),options:[e,t]}),Cx=(e,t)=>({...CM(e),options:[e,t]}),cC=(e,t)=>({...DM(e),options:[e,t]}),kh=(e,t)=>({...EM(e),options:[e,t]}),OM=(e,t)=>({...TM(e),options:[e,t]}),Gu=(e,t)=>({...RM(e),options:[e,t]}),BR=(e,t)=>({...NM(e),options:[e,t]});function MM(e){return y.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const VR={...s3},IM=VR.useInsertionEffect,LM=IM||(e=>e());function Mi(e){const t=y.useRef(()=>{});return LM(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}var ni=typeof document<"u"?y.useLayoutEffect:y.useEffect;let uC=!1,zM=0;const dC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+zM++;function $M(){const[e,t]=y.useState(()=>uC?dC():void 0);return ni(()=>{e==null&&t(dC())},[]),y.useEffect(()=>{uC=!0},[]),e}const UM=VR.useId,FR=UM||$M;function BM(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(a=>a!==n))||[])}}}const VM=y.createContext(null),FM=y.createContext(null),Ex=()=>{var e;return((e=y.useContext(VM))==null?void 0:e.id)||null},Tx=()=>y.useContext(FM);function Rx(e){return"data-floating-ui-"+e}function kv(e){const t=y.useRef(e);return ni(()=>{t.current=e}),t}const fC=Rx("safe-polygon");function gh(e,t,n){return n&&!xy(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function HM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,events:o,elements:c}=e,{enabled:u=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:v=!0}=t,b=Tx(),S=Ex(),j=kv(p),C=kv(f),R=kv(n),D=y.useRef(),E=y.useRef(-1),T=y.useRef(),A=y.useRef(-1),k=y.useRef(!0),M=y.useRef(!1),L=y.useRef(()=>{}),$=y.useRef(!1),V=y.useCallback(()=>{var I;const z=(I=a.current.openEvent)==null?void 0:I.type;return(z==null?void 0:z.includes("mouse"))&&z!=="mousedown"},[a]);y.useEffect(()=>{if(!u)return;function I(z){let{open:H}=z;H||(clearTimeout(E.current),clearTimeout(A.current),k.current=!0,$.current=!1)}return o.on("openchange",I),()=>{o.off("openchange",I)}},[u,o]),y.useEffect(()=>{if(!u||!j.current||!n)return;function I(H){V()&&r(!1,H,"hover")}const z=Rs(c.floating).documentElement;return z.addEventListener("mouseleave",I),()=>{z.removeEventListener("mouseleave",I)}},[c.floating,n,r,u,j,V]);const Y=y.useCallback(function(I,z,H){z===void 0&&(z=!0),H===void 0&&(H="hover");const O=gh(C.current,"close",D.current);O&&!T.current?(clearTimeout(E.current),E.current=window.setTimeout(()=>r(!1,I,H),O)):z&&(clearTimeout(E.current),r(!1,I,H))},[C,r]),Q=Mi(()=>{L.current(),T.current=void 0}),J=Mi(()=>{if(M.current){const I=Rs(c.floating).body;I.style.pointerEvents="",I.removeAttribute(fC),M.current=!1}}),G=Mi(()=>a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1);y.useEffect(()=>{if(!u)return;function I(U){if(clearTimeout(E.current),k.current=!1,m&&!xy(D.current)||g>0&&!gh(C.current,"open"))return;const K=gh(C.current,"open",D.current);K?E.current=window.setTimeout(()=>{R.current||r(!0,U,"hover")},K):n||r(!0,U,"hover")}function z(U){if(G())return;L.current();const K=Rs(c.floating);if(clearTimeout(A.current),$.current=!1,j.current&&a.current.floatingContext){n||clearTimeout(E.current),T.current=j.current({...a.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){J(),Q(),G()||Y(U,!0,"safe-polygon")}});const be=T.current;K.addEventListener("mousemove",be),L.current=()=>{K.removeEventListener("mousemove",be)};return}(D.current==="touch"?!Zu(c.floating,U.relatedTarget):!0)&&Y(U)}function H(U){G()||a.current.floatingContext&&(j.current==null||j.current({...a.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){J(),Q(),G()||Y(U)}})(U))}if(vn(c.domReference)){var O;const U=c.domReference;return n&&U.addEventListener("mouseleave",H),(O=c.floating)==null||O.addEventListener("mouseleave",H),v&&U.addEventListener("mousemove",I,{once:!0}),U.addEventListener("mouseenter",I),U.addEventListener("mouseleave",z),()=>{var K;n&&U.removeEventListener("mouseleave",H),(K=c.floating)==null||K.removeEventListener("mouseleave",H),v&&U.removeEventListener("mousemove",I),U.removeEventListener("mouseenter",I),U.removeEventListener("mouseleave",z)}}},[c,u,e,m,g,v,Y,Q,J,r,n,R,b,C,j,a,G]),ni(()=>{var I;if(u&&n&&(I=j.current)!=null&&I.__options.blockPointerEvents&&V()){M.current=!0;const H=c.floating;if(vn(c.domReference)&&H){var z;const O=Rs(c.floating).body;O.setAttribute(fC,"");const U=c.domReference,K=b==null||(z=b.nodesRef.current.find(ee=>ee.id===S))==null||(z=z.context)==null?void 0:z.elements.floating;return K&&(K.style.pointerEvents=""),O.style.pointerEvents="none",U.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{O.style.pointerEvents="",U.style.pointerEvents="",H.style.pointerEvents=""}}}},[u,n,S,c,b,j,V]),ni(()=>{n||(D.current=void 0,$.current=!1,Q(),J())},[n,Q,J]),y.useEffect(()=>()=>{Q(),clearTimeout(E.current),clearTimeout(A.current),J()},[u,c.domReference,Q,J]);const Z=y.useMemo(()=>{function I(z){D.current=z.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(z){const{nativeEvent:H}=z;function O(){!k.current&&!R.current&&r(!0,H,"hover")}m&&!xy(D.current)||n||g===0||$.current&&z.movementX**2+z.movementY**2<2||(clearTimeout(A.current),D.current==="touch"?O():($.current=!0,A.current=window.setTimeout(O,g)))}}},[m,r,n,R,g]),P=y.useMemo(()=>({onMouseEnter(){clearTimeout(E.current)},onMouseLeave(I){G()||Y(I.nativeEvent,!1)}}),[Y,G]);return y.useMemo(()=>u?{reference:Z,floating:P}:{},[u,Z,P])}const wy=()=>{},HR=y.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:wy,setState:wy,isInstantPhase:!1}),qM=()=>y.useContext(HR);function GM(e){const{children:t,delay:n,timeoutMs:r=0}=e,[a,o]=y.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=y.useRef(null),u=y.useCallback(f=>{o({currentId:f})},[]);return ni(()=>{a.currentId?c.current===null?c.current=a.currentId:a.isInstantPhase||o({isInstantPhase:!0}):(a.isInstantPhase&&o({isInstantPhase:!1}),c.current=null)},[a.currentId,a.isInstantPhase]),y.createElement(HR.Provider,{value:y.useMemo(()=>({...a,setState:o,setCurrentId:u}),[a,u])},t)}function QM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:a}=e,{id:o,enabled:c=!0}=t,u=o??a,f=qM(),{currentId:p,setCurrentId:m,initialDelay:g,setState:v,timeoutMs:b}=f;return ni(()=>{c&&p&&(v({delay:{open:1,close:gh(g,"close")}}),p!==u&&r(!1))},[c,u,r,v,p,g]),ni(()=>{function S(){r(!1),v({delay:g,currentId:null})}if(c&&p&&!n&&p===u){if(b){const j=window.setTimeout(S,b);return()=>{clearTimeout(j)}}S()}},[c,n,v,p,u,r,g,b]),ni(()=>{c&&(m===wy||!n||m(u))},[c,n,m,u]),f}function Pv(e,t){let n=e.filter(a=>{var o;return a.parentId===t&&((o=a.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(a=>{var o;return(o=r)==null?void 0:o.some(c=>{var u;return a.parentId===c.id&&((u=a.context)==null?void 0:u.open)})}),n=n.concat(r);return n}const WM="data-floating-ui-focusable",YM={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},KM={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hC=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function XM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:a,dataRef:o}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:b,capture:S}=t,j=Tx(),C=Mi(typeof f=="function"?f:()=>!1),R=typeof f=="function"?C:f,D=y.useRef(!1),E=y.useRef(!1),{escapeKey:T,outsidePress:A}=hC(b),{escapeKey:k,outsidePress:M}=hC(S),L=y.useRef(!1),$=Mi(Z=>{var P;if(!n||!c||!u||Z.key!=="Escape"||L.current)return;const I=(P=o.current.floatingContext)==null?void 0:P.nodeId,z=j?Pv(j.nodesRef.current,I):[];if(!T&&(Z.stopPropagation(),z.length>0)){let H=!0;if(z.forEach(O=>{var U;if((U=O.context)!=null&&U.open&&!O.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,UO(Z)?Z.nativeEvent:Z,"escape-key")}),V=Mi(Z=>{var P;const I=()=>{var z;$(Z),(z=Zl(Z))==null||z.removeEventListener("keydown",I)};(P=Zl(Z))==null||P.addEventListener("keydown",I)}),Y=Mi(Z=>{var P;const I=D.current;D.current=!1;const z=E.current;if(E.current=!1,p==="click"&&z||I||typeof R=="function"&&!R(Z))return;const H=Zl(Z),O="["+Rx("inert")+"]",U=Rs(a.floating).querySelectorAll(O);let K=vn(H)?H:null;for(;K&&!Uo(K);){const ye=$i(K);if(Uo(ye)||!vn(ye))break;K=ye}if(U.length&&vn(H)&&!BO(H)&&!Zu(H,a.floating)&&Array.from(U).every(ye=>!Zu(K,ye)))return;if(Gr(H)&&G){const ye=H.clientWidth>0&&H.scrollWidth>H.clientWidth,qe=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let Ne=qe&&Z.offsetX>H.clientWidth;if(qe&&ha(H).direction==="rtl"&&(Ne=Z.offsetX<=H.offsetWidth-H.clientWidth),Ne||ye&&Z.offsetY>H.clientHeight)return}const ee=(P=o.current.floatingContext)==null?void 0:P.nodeId,be=j&&Pv(j.nodesRef.current,ee).some(ye=>{var qe;return Dv(Z,(qe=ye.context)==null?void 0:qe.elements.floating)});if(Dv(Z,a.floating)||Dv(Z,a.domReference)||be)return;const xe=j?Pv(j.nodesRef.current,ee):[];if(xe.length>0){let ye=!0;if(xe.forEach(qe=>{var Ne;if((Ne=qe.context)!=null&&Ne.open&&!qe.context.dataRef.current.__outsidePressBubbles){ye=!1;return}}),!ye)return}r(!1,Z,"outside-press")}),Q=Mi(Z=>{var P;const I=()=>{var z;Y(Z),(z=Zl(Z))==null||z.removeEventListener(p,I)};(P=Zl(Z))==null||P.addEventListener(p,I)});y.useEffect(()=>{if(!n||!c)return;o.current.__escapeKeyBubbles=T,o.current.__outsidePressBubbles=A;let Z=-1;function P(U){r(!1,U,"ancestor-scroll")}function I(){window.clearTimeout(Z),L.current=!0}function z(){Z=window.setTimeout(()=>{L.current=!1},dp()?5:0)}const H=Rs(a.floating);u&&(H.addEventListener("keydown",k?V:$,k),H.addEventListener("compositionstart",I),H.addEventListener("compositionend",z)),R&&H.addEventListener(p,M?Q:Y,M);let O=[];return v&&(vn(a.domReference)&&(O=Ii(a.domReference)),vn(a.floating)&&(O=O.concat(Ii(a.floating))),!vn(a.reference)&&a.reference&&a.reference.contextElement&&(O=O.concat(Ii(a.reference.contextElement)))),O=O.filter(U=>{var K;return U!==((K=H.defaultView)==null?void 0:K.visualViewport)}),O.forEach(U=>{U.addEventListener("scroll",P,{passive:!0})}),()=>{u&&(H.removeEventListener("keydown",k?V:$,k),H.removeEventListener("compositionstart",I),H.removeEventListener("compositionend",z)),R&&H.removeEventListener(p,M?Q:Y,M),O.forEach(U=>{U.removeEventListener("scroll",P)}),window.clearTimeout(Z)}},[o,a,u,R,p,n,r,v,c,T,A,$,k,V,Y,M,Q]),y.useEffect(()=>{D.current=!1},[R,p]);const J=y.useMemo(()=>({onKeyDown:$,[YM[g]]:Z=>{m&&r(!1,Z.nativeEvent,"reference-press")}}),[$,r,m,g]),G=y.useMemo(()=>({onKeyDown:$,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[KM[p]]:()=>{D.current=!0}}),[$,p]);return y.useMemo(()=>c?{reference:J,floating:G}:{},[c,J,G])}function ZM(e){const{open:t=!1,onOpenChange:n,elements:r}=e,a=FR(),o=y.useRef({}),[c]=y.useState(()=>BM()),u=Ex()!=null,[f,p]=y.useState(r.reference),m=Mi((b,S,j)=>{o.current.openEvent=b?S:void 0,c.emit("openchange",{open:b,event:S,reason:j,nested:u}),n==null||n(b,S,j)}),g=y.useMemo(()=>({setPositionReference:p}),[]),v=y.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return y.useMemo(()=>({dataRef:o,open:t,onOpenChange:m,elements:v,events:c,floatingId:a,refs:g}),[t,m,v,c,a,g])}function Dx(e){e===void 0&&(e={});const{nodeId:t}=e,n=ZM({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,a=r.elements,[o,c]=y.useState(null),[u,f]=y.useState(null),m=(a==null?void 0:a.domReference)||o,g=y.useRef(null),v=Tx();ni(()=>{m&&(g.current=m)},[m]);const b=PM({...e,elements:{...a,...u&&{reference:u}}}),S=y.useCallback(E=>{const T=vn(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),contextElement:E}:E;f(T),b.refs.setReference(T)},[b.refs]),j=y.useCallback(E=>{(vn(E)||E===null)&&(g.current=E,c(E)),(vn(b.refs.reference.current)||b.refs.reference.current===null||E!==null&&!vn(E))&&b.refs.setReference(E)},[b.refs]),C=y.useMemo(()=>({...b.refs,setReference:j,setPositionReference:S,domReference:g}),[b.refs,j,S]),R=y.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),D=y.useMemo(()=>({...b,...r,refs:C,elements:R,nodeId:t}),[b,C,R,t,r]);return ni(()=>{r.dataRef.current.floatingContext=D;const E=v==null?void 0:v.nodesRef.current.find(T=>T.id===t);E&&(E.context=D)}),y.useMemo(()=>({...b,context:D,refs:C,elements:R}),[b,C,R,D])}function JM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:a,dataRef:o,elements:c}=e,{enabled:u=!0,visibleOnly:f=!0}=t,p=y.useRef(!1),m=y.useRef(),g=y.useRef(!0);y.useEffect(()=>{if(!u)return;const b=Dr(c.domReference);function S(){!n&&Gr(c.domReference)&&c.domReference===nC(Rs(c.domReference))&&(p.current=!0)}function j(){g.current=!0}return b.addEventListener("blur",S),b.addEventListener("keydown",j,!0),()=>{b.removeEventListener("blur",S),b.removeEventListener("keydown",j,!0)}},[c.domReference,n,u]),y.useEffect(()=>{if(!u)return;function b(S){let{reason:j}=S;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,u]),y.useEffect(()=>()=>{clearTimeout(m.current)},[]);const v=y.useMemo(()=>({onPointerDown(b){IO(b.nativeEvent)||(g.current=!1)},onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const S=Zl(b.nativeEvent);if(f&&vn(S))try{if(LO()&&zO())throw Error();if(!S.matches(":focus-visible"))return}catch{if(!g.current&&!FO(S))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const S=b.relatedTarget,j=b.nativeEvent,C=vn(S)&&S.hasAttribute(Rx("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var R;const D=nC(c.domReference?c.domReference.ownerDocument:document);!S&&D===c.domReference||Zu((R=o.current.floatingContext)==null?void 0:R.refs.floating.current,D)||Zu(c.domReference,D)||C||r(!1,j,"focus")})}}),[o,c.domReference,r,f]);return y.useMemo(()=>u?{reference:v}:{},[u,v])}const pC="active",mC="selected";function Nv(e,t,n){const r=new Map,a=n==="item";let o=e;if(a&&e){const{[pC]:c,[mC]:u,...f}=e;o=f}return{...n==="floating"&&{tabIndex:-1,[WM]:""},...o,...t.map(c=>{const u=c?c[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((c,u)=>(u&&Object.entries(u).forEach(f=>{let[p,m]=f;if(!(a&&[pC,mC].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof m=="function"){var g;(g=r.get(p))==null||g.push(m),c[p]=function(){for(var v,b=arguments.length,S=new Array(b),j=0;j<b;j++)S[j]=arguments[j];return(v=r.get(p))==null?void 0:v.map(C=>C(...S)).find(C=>C!==void 0)}}}else c[p]=m}),c),{})}}function e9(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),a=y.useCallback(u=>Nv(u,e,"reference"),t),o=y.useCallback(u=>Nv(u,e,"floating"),n),c=y.useCallback(u=>Nv(u,e,"item"),r);return y.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:c}),[a,o,c])}const t9=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function n9(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:a}=e,{enabled:o=!0,role:c="dialog"}=t,u=(n=t9.get(c))!=null?n:c,f=FR(),m=Ex()!=null,g=y.useMemo(()=>u==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?a:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":r?a:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:f},...u==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[u,a,m,r,f,c]),v=y.useMemo(()=>{const S={id:a,...u&&{role:u}};return u==="tooltip"||c==="label"?S:{...S,...u==="menu"&&{"aria-labelledby":f}}},[u,a,f,c]),b=y.useCallback(S=>{let{active:j,selected:C}=S;const R={role:"option",...j&&{id:a+"-option"}};switch(c){case"select":return{...R,"aria-selected":j&&C};case"combobox":return{...R,...j&&{"aria-selected":!0}}}return{}},[a,c]);return y.useMemo(()=>o?{reference:g,floating:v,item:b}:{},[o,g,v,b])}const[r9,va]=vr("ScrollArea.Root component was not found in tree");function uc(e,t){const n=js(t);Sc(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}const a9=y.forwardRef((e,t)=>{const{style:n,...r}=e,a=va(),[o,c]=y.useState(0),[u,f]=y.useState(0),p=!!(o&&u);return uc(a.scrollbarX,()=>{var g;const m=((g=a.scrollbarX)==null?void 0:g.offsetHeight)||0;a.onCornerHeightChange(m),f(m)}),uc(a.scrollbarY,()=>{var g;const m=((g=a.scrollbarY)==null?void 0:g.offsetWidth)||0;a.onCornerWidthChange(m),c(m)}),p?s.jsx("div",{...r,ref:t,style:{...n,width:o,height:u}}):null}),i9=y.forwardRef((e,t)=>{const n=va(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(a9,{...e,ref:t}):null}),o9={scrollHideDelay:1e3,type:"hover"},qR=y.forwardRef((e,t)=>{const n=se("ScrollAreaRoot",o9,e),{type:r,scrollHideDelay:a,scrollbars:o,...c}=n,[u,f]=y.useState(null),[p,m]=y.useState(null),[g,v]=y.useState(null),[b,S]=y.useState(null),[j,C]=y.useState(null),[R,D]=y.useState(0),[E,T]=y.useState(0),[A,k]=y.useState(!1),[M,L]=y.useState(!1),$=zn(t,V=>f(V));return s.jsx(r9,{value:{type:r,scrollHideDelay:a,scrollArea:u,viewport:p,onViewportChange:m,content:g,onContentChange:v,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:M,onScrollbarYEnabledChange:L,onCornerWidthChange:D,onCornerHeightChange:T},children:s.jsx(ce,{...c,ref:$,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${R}px`,"--sa-corner-height":o!=="xy"?"0px":`${E}px`}})})});qR.displayName="@mantine/core/ScrollAreaRoot";function GR(e,t){const n=e/t;return Number.isNaN(n)?0:n}function hp(e){const t=GR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function QR(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 s9(e,[t,n]){return Math.min(n,Math.max(t,e))}function gC(e,t,n="ltr"){const r=hp(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,c=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,c]:[c*-1,0],p=s9(e,f);return QR([0,c],[0,u])(p)}function l9(e,t,n,r="ltr"){const a=hp(n),o=a/2,c=t||o,u=a-c,f=n.scrollbar.paddingStart+c,p=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return QR([f,p],g)(e)}function WR(e,t){return e>0&&e<t}function $o(e){return e?parseInt(e,10):0}function Os(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[c9,YR]=vr("ScrollAreaScrollbar was not found in tree"),KR=y.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,v=va(),[b,S]=y.useState(null),j=zn(t,L=>S(L)),C=y.useRef(null),R=y.useRef(""),{viewport:D}=v,E=n.content-n.viewport,T=js(p),A=js(u),k=ap(m,10),M=L=>{if(C.current){const $=L.clientX-C.current.left,V=L.clientY-C.current.top;f({x:$,y:V})}};return y.useEffect(()=>{const L=$=>{const V=$.target;(b==null?void 0:b.contains(V))&&T($,E)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[D,b,E,T]),y.useEffect(A,[n,A]),uc(b,k),uc(v.content,k),s.jsx(c9,{value:{scrollbar:b,hasThumb:r,onThumbChange:js(a),onThumbPointerUp:js(o),onThumbPositionChange:A,onThumbPointerDown:js(c)},children:s.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:Os(e.onPointerDown,L=>{L.preventDefault(),L.button===0&&(L.target.setPointerCapture(L.pointerId),C.current=b.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(L))}),onPointerMove:Os(e.onPointerMove,M),onPointerUp:Os(e.onPointerUp,L=>{const $=L.target;$.hasPointerCapture(L.pointerId)&&(L.preventDefault(),$.releasePointerCapture(L.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=R.current,C.current=null}})})}),XR=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:a,...o}=e,c=va(),[u,f]=y.useState(),p=y.useRef(null),m=zn(t,p,c.onScrollbarXChange);return y.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),s.jsx(KR,{"data-orientation":"horizontal",...o,ref:m,sizes:n,style:{...a,"--sa-thumb-width":`${hp(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(c.viewport){const b=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),WR(b,v)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&u&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:$o(u.paddingLeft),paddingEnd:$o(u.paddingRight)}})}})});XR.displayName="@mantine/core/ScrollAreaScrollbarX";const ZR=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:a,...o}=e,c=va(),[u,f]=y.useState(),p=y.useRef(null),m=zn(t,p,c.onScrollbarYChange);return y.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),s.jsx(KR,{...o,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${hp(n)}px`,...a},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(c.viewport){const b=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),WR(b,v)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&u&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:$o(u.paddingTop),paddingEnd:$o(u.paddingBottom)}})}})});ZR.displayName="@mantine/core/ScrollAreaScrollbarY";const pp=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:a}=Xs(),o=va(),c=y.useRef(null),u=y.useRef(0),[f,p]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=GR(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:b=>{u.current=b}},v=(b,S)=>l9(b,u.current,f,S);return n==="horizontal"?s.jsx(XR,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollLeft,S=gC(b,f,a);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollLeft=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollLeft=v(b,a))}}):n==="vertical"?s.jsx(ZR,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollTop,S=gC(b,f);f.scrollbar.size===0?c.current.style.setProperty("--thumb-opacity","0"):c.current.style.setProperty("--thumb-opacity","1"),c.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollTop=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollTop=v(b))}}):null});pp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Ax=y.forwardRef((e,t)=>{const n=va(),{forceMount:r,...a}=e,[o,c]=y.useState(!1),u=e.orientation==="horizontal",f=ap(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(u?p:m)}},10);return uc(n.viewport,f),uc(n.content,f),r||o?s.jsx(pp,{"data-state":o?"visible":"hidden",...a,ref:t}):null});Ax.displayName="@mantine/core/ScrollAreaScrollbarAuto";const JR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=va(),[o,c]=y.useState(!1);return y.useEffect(()=>{const{scrollArea:u}=a;let f=0;if(u){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",p),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",p),u.removeEventListener("pointerleave",m)}}},[a.scrollArea,a.scrollHideDelay]),n||o?s.jsx(Ax,{"data-state":o?"visible":"hidden",...r,ref:t}):null});JR.displayName="@mantine/core/ScrollAreaScrollbarHover";const u9=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=va(),o=e.orientation==="horizontal",[c,u]=y.useState("hidden"),f=ap(()=>u("idle"),100);return y.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>u("hidden"),a.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,a.scrollHideDelay]),y.useEffect(()=>{const{viewport:p}=a,m=o?"scrollLeft":"scrollTop";if(p){let g=p[m];const v=()=>{const b=p[m];g!==b&&(u("scrolling"),f()),g=b};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[a.viewport,o,f]),n||c!=="hidden"?s.jsx(pp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Os(e.onPointerEnter,()=>u("interacting")),onPointerLeave:Os(e.onPointerLeave,()=>u("idle"))}):null}),jy=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=va(),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=a,u=e.orientation==="horizontal";return y.useEffect(()=>(u?o(!0):c(!0),()=>{u?o(!1):c(!1)}),[u,o,c]),a.type==="hover"?s.jsx(JR,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(u9,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(Ax,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(pp,{...r,ref:t}):null});jy.displayName="@mantine/core/ScrollAreaScrollbar";function d9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},c=n.left!==o.left,u=n.top!==o.top;(c||u)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)}const e2=y.forwardRef((e,t)=>{const{style:n,...r}=e,a=va(),o=YR(),{onThumbPositionChange:c}=o,u=zn(t,m=>o.onThumbChange(m)),f=y.useRef(void 0),p=ap(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const{viewport:m}=a;if(m){const g=()=>{if(p(),!f.current){const v=d9(m,c);f.current=v,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[a.viewport,p,c]),s.jsx("div",{"data-state":o.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:Os(e.onPointerDownCapture,m=>{const v=m.target.getBoundingClientRect(),b=m.clientX-v.left,S=m.clientY-v.top;o.onThumbPointerDown({x:b,y:S})}),onPointerUp:Os(e.onPointerUp,o.onThumbPointerUp)})});e2.displayName="@mantine/core/ScrollAreaThumb";const Cy=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=YR();return n||a.hasThumb?s.jsx(e2,{ref:t,...r}):null});Cy.displayName="@mantine/core/ScrollAreaThumb";const t2=y.forwardRef(({children:e,style:t,...n},r)=>{const a=va(),o=zn(r,a.onViewportChange);return s.jsx(ce,{...n,ref:o,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t},children:s.jsx("div",{style:{minWidth:"100%"},ref:a.onContentChange,children:e})})});t2.displayName="@mantine/core/ScrollAreaViewport";var _x={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const n2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},f9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Yr=ve((e,t)=>{const n=se("ScrollArea",n2,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:v,viewportRef:b,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:R,onBottomReached:D,onTopReached:E,overscrollBehavior:T,...A}=n,[k,M]=y.useState(!1),[L,$]=y.useState(!1),[V,Y]=y.useState(!1),Q=Ie({name:"ScrollArea",props:n,classes:_x,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:f9}),J=y.useRef(null),G=MM([b,J]);return y.useEffect(()=>{if(!J.current||C!=="present")return;const Z=J.current,P=new ResizeObserver(()=>{const{scrollHeight:I,clientHeight:z,scrollWidth:H,clientWidth:O}=Z;$(I>z),Y(H>O)});return P.observe(Z),()=>P.disconnect()},[J,C]),s.jsxs(qR,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:R,...Q("root"),...A,children:[s.jsx(t2,{...v,...Q("viewport",{style:v==null?void 0:v.style}),ref:G,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":R||void 0,"data-horizontal-hidden":C==="present"&&!V?"true":void 0,"data-vertical-hidden":C==="present"&&!L?"true":void 0,onScroll:Z=>{var H;(H=v==null?void 0:v.onScroll)==null||H.call(v,Z),S==null||S({x:Z.currentTarget.scrollLeft,y:Z.currentTarget.scrollTop});const{scrollTop:P,scrollHeight:I,clientHeight:z}=Z.currentTarget;P-(I-z)>=-.6&&(D==null||D()),P===0&&(E==null||E())},children:j}),(R==="xy"||R==="x")&&s.jsx(jy,{...Q("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!V?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(Cy,{...Q("thumb")})}),(R==="xy"||R==="y")&&s.jsx(jy,{...Q("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(Cy,{...Q("thumb")})}),s.jsx(i9,{...Q("corner"),"data-hovered":k||void 0,"data-hidden":m==="never"||void 0})]})});Yr.displayName="@mantine/core/ScrollArea";const mp=ve((e,t)=>{const{children:n,classNames:r,styles:a,scrollbarSize:o,scrollHideDelay:c,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:v,variant:b,viewportProps:S,scrollbars:j,style:C,vars:R,onBottomReached:D,onTopReached:E,...T}=se("ScrollAreaAutosize",n2,e);return s.jsx(ce,{...T,ref:t,style:[{display:"flex",overflow:"auto"},C],children:s.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(Yr,{classNames:r,styles:a,scrollHideDelay:c,scrollbarSize:o,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:v,variant:b,viewportProps:S,vars:R,scrollbars:j,onBottomReached:D,onTopReached:E,children:n})})})});Yr.classes=_x;mp.displayName="@mantine/core/ScrollAreaAutosize";mp.classes=_x;Yr.Autosize=mp;var r2={root:"m_87cf2631"};const h9={__staticSelector:"UnstyledButton"},tr=lr((e,t)=>{const n=se("UnstyledButton",h9,e),{className:r,component:a="button",__staticSelector:o,unstyled:c,classNames:u,styles:f,style:p,...m}=n,g=Ie({name:o,props:n,classes:r2,className:r,style:p,classNames:u,styles:f,unstyled:c});return s.jsx(ce,{...g("root",{focusable:!0}),component:a,ref:t,type:a==="button"?"button":void 0,...m})});tr.classes=r2;tr.displayName="@mantine/core/UnstyledButton";var a2={root:"m_515a97f8"};const p9={},kx=ve((e,t)=>{const n=se("VisuallyHidden",p9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,...p}=n,m=Ie({name:"VisuallyHidden",classes:a2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u});return s.jsx(ce,{component:"span",ref:t,...m("root"),...p})});kx.classes=a2;kx.displayName="@mantine/core/VisuallyHidden";var i2={root:"m_1b7284a3"};const m9={},g9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Vt(t),"--paper-shadow":sx(n)}}),mr=lr((e,t)=>{const n=se("Paper",m9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,withBorder:f,vars:p,radius:m,shadow:g,variant:v,mod:b,...S}=n,j=Ie({name:"Paper",props:n,classes:i2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:g9});return s.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...j("root"),variant:v,...S})});mr.classes=i2;mr.displayName="@mantine/core/Paper";function o2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),a=n==="right"?"left":"right";return r===void 0?a:`${a}-${r}`}return t}function vC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function yC(e,t,n,r,a){return e==="center"||r==="center"?{left:t}:e==="end"?{[a==="ltr"?"right":"left"]:n}:e==="start"?{[a==="ltr"?"left":"right"]:n}:{}}const v9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function y9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:a,arrowX:o,arrowY:c,dir:u}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[v9[f]]:r},g=-t/2;return f==="left"?{...m,...vC(p,c,n,a),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...vC(p,c,n,a),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...yC(p,o,n,a,u),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...yC(p,o,n,a,u),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Px=y.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:a,visible:o,arrowX:c,arrowY:u,style:f,...p},m)=>{const{dir:g}=Xs();return o?s.jsx("div",{...p,ref:m,style:{...f,...y9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:a,dir:g,arrowX:c,arrowY:u})}}):null});Px.displayName="@mantine/core/FloatingArrow";var s2={root:"m_9814e45f"};const x9={zIndex:Wr("modal")},b9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:a,radius:o,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&la(n||"#000",r??.6)||void 0,"--overlay-filter":a?`blur(${le(a)})`:void 0,"--overlay-radius":o===void 0?void 0:Vt(o),"--overlay-z-index":c==null?void 0:c.toString()}}),dc=lr((e,t)=>{const n=se("Overlay",x9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,fixed:p,center:m,children:g,radius:v,zIndex:b,gradient:S,blur:j,color:C,backgroundOpacity:R,mod:D,...E}=n,T=Ie({name:"Overlay",props:n,classes:s2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:b9});return s.jsx(ce,{ref:t,...T("root"),mod:[{center:m,fixed:p},D],...E,children:g})});dc.classes=s2;dc.displayName="@mantine/core/Overlay";function Ov(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 S9({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Ov(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const a=Ov(n);return a.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(a),a}return Ov(n)}const w9={},l2=ve((e,t)=>{const{children:n,target:r,reuseTargetNode:a,...o}=se("Portal",w9,e),[c,u]=y.useState(!1),f=y.useRef(null);return Sc(()=>(u(!0),f.current=S9({target:r,reuseTargetNode:a,...o}),Ku(t,f.current),!r&&!a&&f.current&&document.body.appendChild(f.current),()=>{!r&&!a&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:mx.createPortal(s.jsx(s.Fragment,{children:n}),f.current)});l2.displayName="@mantine/core/Portal";const qo=ve(({withinPortal:e=!0,children:t,...n},r)=>gR()==="test"||!e?s.jsx(s.Fragment,{children:t}):s.jsx(l2,{ref:r,...n,children:t}));qo.displayName="@mantine/core/OptionalPortal";const Ou=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),rh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...Ou("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Ou("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Ou("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Ou("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Ou("top"),common:{transformOrigin:"top right"}}},xC={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function j9({transition:e,state:t,duration:n,timingFunction:r}){const a={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in rh?{transitionProperty:rh[e].transitionProperty,...a,...rh[e].common,...rh[e][xC[t]]}:{}:{transitionProperty:e.transitionProperty,...a,...e.common,...e[xC[t]]}}function C9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:a,onExit:o,onEntered:c,onExited:u,enterDelay:f,exitDelay:p}){const m=Sn(),g=cx(),v=m.respectReducedMotion?g:!1,[b,S]=y.useState(v?0:e),[j,C]=y.useState(r?"entered":"exited"),R=y.useRef(-1),D=y.useRef(-1),E=y.useRef(-1);function T(){window.clearTimeout(R.current),window.clearTimeout(D.current),cancelAnimationFrame(E.current)}const A=M=>{T();const L=M?a:o,$=M?c:u,V=v?0:M?e:t;S(V),V===0?(typeof L=="function"&&L(),typeof $=="function"&&$(),C(M?"entered":"exited")):E.current=requestAnimationFrame(()=>{Vu.flushSync(()=>{C(M?"pre-entering":"pre-exiting")}),E.current=requestAnimationFrame(()=>{typeof L=="function"&&L(),C(M?"entering":"exiting"),R.current=window.setTimeout(()=>{typeof $=="function"&&$(),C(M?"entered":"exited")},V)})})},k=M=>{if(T(),typeof(M?f:p)!="number"){A(M);return}D.current=window.setTimeout(()=>{A(M)},M?f:p)};return zi(()=>{k(r)},[r]),y.useEffect(()=>()=>{T()},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function di({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:a,children:o,timingFunction:c="ease",onExit:u,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:v}){const b=gR(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=C9({mounted:a,exitDuration:r,duration:n,timingFunction:c,onExit:u,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:v});return S===0||b==="test"?a?s.jsx(s.Fragment,{children:o({})}):e?o({display:"none"}):null:j==="exited"?e?o({display:"none"}):null:s.jsx(s.Fragment,{children:o(j9({transition:t,duration:S,state:j,timingFunction:C}))})}di.displayName="@mantine/core/Transition";const[E9,c2]=vr("Popover component was not found in the tree");function gp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const a=lN(t),o=zn(a,r);return Fi(e)?y.cloneElement(e,{[n]:o}):e}function u2(e){return s.jsx(kx,{tabIndex:-1,"data-autofocus":!0,...e})}gp.displayName="@mantine/core/FocusTrap";u2.displayName="@mantine/core/FocusTrapInitialFocus";gp.InitialFocus=u2;var d2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const T9={},Nx=ve((e,t)=>{var C,R,D,E;const n=se("PopoverDropdown",T9,e),{className:r,style:a,vars:o,children:c,onKeyDownCapture:u,variant:f,classNames:p,styles:m,...g}=n,v=c2(),b=cR({opened:v.opened,shouldReturnFocus:v.returnFocus}),S=v.withRoles?{"aria-labelledby":v.getTargetId(),id:v.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=zn(t,v.floating);return v.disabled?null:s.jsx(qo,{...v.portalProps,withinPortal:v.withinPortal,children:s.jsx(di,{mounted:v.opened,...v.transitionProps,transition:((C=v.transitionProps)==null?void 0:C.transition)||"fade",duration:((R=v.transitionProps)==null?void 0:R.duration)??150,keepMounted:v.keepMounted,exitDuration:typeof((D=v.transitionProps)==null?void 0:D.exitDuration)=="number"?v.transitionProps.exitDuration:(E=v.transitionProps)==null?void 0:E.duration,children:T=>s.jsx(gp,{active:v.trapFocus&&v.opened,innerRef:j,children:s.jsxs(ce,{...S,...g,variant:f,onKeyDownCapture:Y3(()=>{var A,k;(A=v.onClose)==null||A.call(v),(k=v.onDismiss)==null||k.call(v)},{active:v.closeOnEscape,onTrigger:b,onKeyDown:u}),"data-position":v.placement,"data-fixed":v.floatingStrategy==="fixed"||void 0,...v.getStyles("dropdown",{className:r,props:n,classNames:p,styles:m,style:[{...T,zIndex:v.zIndex,top:v.y??0,left:v.x??0,width:v.width==="target"?void 0:le(v.width)},v.resolvedStyles.dropdown,m==null?void 0:m.dropdown,a]}),children:[c,s.jsx(Px,{ref:v.arrowRef,arrowX:v.arrowX,arrowY:v.arrowY,visible:v.withArrow,position:v.placement,arrowSize:v.arrowSize,arrowRadius:v.arrowRadius,arrowOffset:v.arrowOffset,arrowPosition:v.arrowPosition,...v.getStyles("arrow",{props:n,classNames:p,styles:m})})]})})})})});Nx.classes=d2;Nx.displayName="@mantine/core/PopoverDropdown";const R9={refProp:"ref",popupType:"dialog"},f2=ve((e,t)=>{const{children:n,refProp:r,popupType:a,...o}=se("PopoverTarget",R9,e);if(!Fi(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=o,u=c2(),f=zn(u.reference,op(n),t),p=u.withRoles?{"aria-haspopup":a,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return y.cloneElement(n,{...c,...p,...u.targetProps,className:Ut(u.targetProps.className,c.className,n.props.className),[r]:f,...u.controlled?null:{onClick:u.onToggle}})});f2.displayName="@mantine/core/PopoverTarget";function h2({opened:e,floating:t,position:n,positionDependencies:r}){const[a,o]=y.useState(0);y.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return wM(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,a,n]),zi(()=>{t.update()},r),zi(()=>{o(c=>c+1)},[e])}function D9(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 A9(e,t){const n=D9(e.middlewares),r=[UR(e.offset)];return n.shift&&r.push(Cx(typeof n.shift=="boolean"?{limiter:cC(),padding:5}:{limiter:cC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?kh():kh(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Gu():Gu(n.inline)),r.push(BR({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(OM({...typeof n.size=="boolean"?{}:n.size,apply({rects:a,availableWidth:o,availableHeight:c,...u}){var m;const p=((m=t().refs.floating.current)==null?void 0:m.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:a,availableWidth:o,availableHeight:c,...u}):Object.assign(p,{maxWidth:`${o}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(p,{width:`${a.reference.width}px`})}})),r}function _9(e){const[t,n]=Yn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=y.useRef(t),a=()=>{t&&!e.disabled&&n(!1)},o=()=>!e.disabled&&n(!t),c=Dx({strategy:e.strategy,placement:e.position,middleware:A9(e,()=>c)});return h2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),zi(()=>{var u;(u=e.onPositionChange)==null||u.call(e,c.placement)},[c.placement]),zi(()=>{var u,f;t!==r.current&&(t?(f=e.onOpen)==null||f.call(e):(u=e.onClose)==null||u.call(e)),r.current=t},[t,e.onClose,e.onOpen]),{floating:c,controlled:typeof e.opened=="boolean",opened:t,onClose:a,onToggle:o}}const k9={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Wr("popover"),__staticSelector:"Popover",width:"max-content"},P9=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Vt(t),"--popover-shadow":sx(n)}});function za(e){var $e,vt,ft,Gt,_t,un;const t=se("Popover",k9,e),{children:n,position:r,offset:a,onPositionChange:o,positionDependencies:c,opened:u,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:v,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,unstyled:D,classNames:E,styles:T,closeOnClickOutside:A,withinPortal:k,portalProps:M,closeOnEscape:L,clickOutsideEvents:$,trapFocus:V,onClose:Y,onDismiss:Q,onOpen:J,onChange:G,zIndex:Z,radius:P,shadow:I,id:z,defaultOpened:H,__staticSelector:O,withRoles:U,disabled:K,returnFocus:ee,variant:be,keepMounted:xe,vars:ye,floatingStrategy:qe,withOverlay:Ne,overlayProps:tt,...Ae}=t,gt=Ie({name:O,props:t,classes:d2,classNames:E,styles:T,unstyled:D,rootSelector:"dropdown",vars:ye,varsResolver:P9}),{resolvedStyles:Mt}=Ws({classNames:E,styles:T,props:t}),It=y.useRef(null),[mt,Dt]=y.useState(null),[nn,Ce]=y.useState(null),{dir:Re}=Xs(),Ge=yr(z),Te=_9({middlewares:v,width:g,position:o2(Re,r),offset:typeof a=="number"?a+(b?S/2:0):a,arrowRef:It,arrowOffset:j,onPositionChange:o,positionDependencies:c,opened:u,defaultOpened:H,onChange:G,onOpen:J,onClose:Y,onDismiss:Q,strategy:qe,disabled:K});J3(()=>{A&&(Te.onClose(),Q==null||Q())},$,[mt,nn]);const me=y.useCallback(wt=>{Dt(wt),Te.floating.refs.setReference(wt)},[Te.floating.refs.setReference]),ge=y.useCallback(wt=>{Ce(wt),Te.floating.refs.setFloating(wt)},[Te.floating.refs.setFloating]),ke=y.useCallback(()=>{var wt;(wt=f==null?void 0:f.onExited)==null||wt.call(f),p==null||p()},[f==null?void 0:f.onExited,p]),Se=y.useCallback(()=>{var wt;(wt=f==null?void 0:f.onEntered)==null||wt.call(f),m==null||m()},[f==null?void 0:f.onEntered,m]);return s.jsxs(E9,{value:{returnFocus:ee,disabled:K,controlled:Te.controlled,reference:me,floating:ge,x:Te.floating.x,y:Te.floating.y,arrowX:(ft=(vt=($e=Te.floating)==null?void 0:$e.middlewareData)==null?void 0:vt.arrow)==null?void 0:ft.x,arrowY:(un=(_t=(Gt=Te.floating)==null?void 0:Gt.middlewareData)==null?void 0:_t.arrow)==null?void 0:un.y,opened:Te.opened,arrowRef:It,transitionProps:{...f,onExited:ke,onEntered:Se},width:g,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,placement:Te.floating.placement,trapFocus:V,withinPortal:k,portalProps:M,zIndex:Z,radius:P,shadow:I,closeOnEscape:L,onDismiss:Q,onClose:Te.onClose,onToggle:Te.onToggle,getTargetId:()=>`${Ge}-target`,getDropdownId:()=>`${Ge}-dropdown`,withRoles:U,targetProps:Ae,__staticSelector:O,classNames:E,styles:T,unstyled:D,variant:be,keepMounted:xe,getStyles:gt,resolvedStyles:Mt,floatingStrategy:qe},children:[n,Ne&&s.jsx(di,{transition:"fade",mounted:Te.opened,duration:(f==null?void 0:f.duration)||250,exitDuration:(f==null?void 0:f.exitDuration)||250,children:wt=>s.jsx(qo,{withinPortal:k,children:s.jsx(dc,{...tt,...gt("overlay",{className:tt==null?void 0:tt.className,style:[wt,tt==null?void 0:tt.style]})})})})]})}za.Target=f2;za.Dropdown=Nx;za.displayName="@mantine/core/Popover";za.extend=e=>e;var Pa={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 p2=y.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:Ut(Pa.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Pa.bar}),s.jsx("span",{className:Pa.bar}),s.jsx("span",{className:Pa.bar})]}));p2.displayName="@mantine/core/Bars";const m2=y.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:Ut(Pa.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Pa.dot}),s.jsx("span",{className:Pa.dot}),s.jsx("span",{className:Pa.dot})]}));m2.displayName="@mantine/core/Dots";const g2=y.forwardRef(({className:e,...t},n)=>s.jsx(ce,{component:"span",className:Ut(Pa.ovalLoader,e),...t,ref:n}));g2.displayName="@mantine/core/Oval";const v2={bars:p2,oval:g2,dots:m2},N9={loaders:v2,type:"oval"},O9=(e,{size:t,color:n})=>({root:{"--loader-size":rt(t,"loader-size"),"--loader-color":n?Ht(n,e):void 0}}),_r=ve((e,t)=>{const n=se("Loader",N9,e),{size:r,color:a,type:o,vars:c,className:u,style:f,classNames:p,styles:m,unstyled:g,loaders:v,variant:b,children:S,...j}=n,C=Ie({name:"Loader",props:n,classes:Pa,className:u,style:f,classNames:p,styles:m,unstyled:g,vars:c,varsResolver:O9});return S?s.jsx(ce,{...C("root"),ref:t,...j,children:S}):s.jsx(ce,{...C("root"),ref:t,component:v[o],variant:b,size:r,...j})});_r.defaultLoaders=v2;_r.classes=Pa;_r.displayName="@mantine/core/Loader";var Cc={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const bC={orientation:"horizontal"},M9=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Ox=ve((e,t)=>{const n=se("ActionIconGroup",bC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,orientation:f,vars:p,borderWidth:m,variant:g,mod:v,...b}=se("ActionIconGroup",bC,e),S=Ie({name:"ActionIconGroup",props:n,classes:Cc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:p,varsResolver:M9,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},v],role:"group",...b})});Ox.classes=Cc;Ox.displayName="@mantine/core/ActionIconGroup";const SC={},I9=(e,{radius:t,color:n,gradient:r,variant:a,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:o});return{groupSection:{"--section-height":rt(c,"section-height"),"--section-padding-x":rt(c,"section-padding-x"),"--section-fz":On(c),"--section-radius":t===void 0?void 0:Vt(t),"--section-bg":n||a?u.background:void 0,"--section-color":u.color,"--section-bd":n||a?u.border:void 0}}},Mx=ve((e,t)=>{const n=se("ActionIconGroupSection",SC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,variant:p,gradient:m,radius:g,autoContrast:v,...b}=se("ActionIconGroupSection",SC,e),S=Ie({name:"ActionIconGroupSection",props:n,classes:Cc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:I9,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});Mx.classes=Cc;Mx.displayName="@mantine/core/ActionIconGroupSection";const L9={},z9=(e,{size:t,radius:n,variant:r,gradient:a,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:a,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":rt(t,"ai-size"),"--ai-radius":n===void 0?void 0:Vt(n),"--ai-bg":o||r?u.background:void 0,"--ai-hover":o||r?u.hover:void 0,"--ai-hover-color":o||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":o||r?u.border:void 0}}},_n=lr((e,t)=>{const n=se("ActionIcon",L9,e),{className:r,unstyled:a,variant:o,classNames:c,styles:u,style:f,loading:p,loaderProps:m,size:g,color:v,radius:b,__staticSelector:S,gradient:j,vars:C,children:R,disabled:D,"data-disabled":E,autoContrast:T,mod:A,...k}=n,M=Ie({name:["ActionIcon",S],props:n,className:r,style:f,classes:Cc,classNames:c,styles:u,unstyled:a,vars:C,varsResolver:z9});return s.jsxs(tr,{...M("root",{active:!D&&!p&&!E}),...k,unstyled:a,variant:o,size:g,disabled:D||p,ref:t,mod:[{loading:p,disabled:D||E},A],children:[s.jsx(di,{mounted:!!p,transition:"slide-down",duration:150,children:L=>s.jsx(ce,{component:"span",...M("loader",{style:L}),"aria-hidden":!0,children:s.jsx(_r,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),s.jsx(ce,{component:"span",mod:{loading:p},...M("icon"),children:R})]})});_n.classes=Cc;_n.displayName="@mantine/core/ActionIcon";_n.Group=Ox;_n.GroupSection=Mx;const y2=y.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>s.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:s.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));y2.displayName="@mantine/core/CloseIcon";var x2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const $9={variant:"subtle"},U9=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":rt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Vt(n),"--cb-icon-size":le(r)}}),Go=lr((e,t)=>{const n=se("CloseButton",$9,e),{iconSize:r,children:a,vars:o,radius:c,className:u,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":v,disabled:b,variant:S,icon:j,mod:C,__staticSelector:R,...D}=n,E=Ie({name:R||"CloseButton",props:n,className:u,style:p,classes:x2,classNames:f,styles:m,unstyled:g,vars:o,varsResolver:U9});return s.jsxs(tr,{ref:t,...D,unstyled:g,variant:S,disabled:b,mod:[{disabled:b||v},C],...E("root",{variant:S,active:!b&&!v}),children:[j||s.jsx(y2,{}),a]})});Go.classes=x2;Go.displayName="@mantine/core/CloseButton";function B9(e){return y.Children.toArray(e).filter(Boolean)}var b2={root:"m_4081bf90"};const V9={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},F9=(e,{grow:t,preventGrowOverflow:n,gap:r,align:a,justify:o,wrap:c},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":Nn(r),"--group-align":a,"--group-justify":o,"--group-wrap":c}}),je=ve((e,t)=>{const n=se("Group",V9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,children:f,gap:p,align:m,justify:g,wrap:v,grow:b,preventGrowOverflow:S,vars:j,variant:C,__size:R,mod:D,...E}=n,T=B9(f),A=T.length,k=Nn(p??"md"),L={childWidth:`calc(${100/A}% - (${k} - ${k} / ${A}))`},$=Ie({name:"Group",props:n,stylesCtx:L,className:a,style:o,classes:b2,classNames:r,styles:c,unstyled:u,vars:j,varsResolver:F9});return s.jsx(ce,{...$("root"),ref:t,variant:C,mod:[{grow:b},D],size:R,...E,children:T})});je.classes=b2;je.displayName="@mantine/core/Group";const[H9,Wi]=vr("ModalBase component was not found in tree");function q9({opened:e,transitionDuration:t}){const[n,r]=y.useState(e),a=y.useRef(-1),c=cx()?0:t;return y.useEffect(()=>(e?(r(!0),window.clearTimeout(a.current)):c===0?r(!1):a.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(a.current)),[e,c]),n}function G9({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:a,onClose:o,returnFocus:c}){const u=yr(e),[f,p]=y.useState(!1),[m,g]=y.useState(!1),v=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,b=q9({opened:n,transitionDuration:v});return hR("keydown",S=>{var j;S.key==="Escape"&&a&&!S.isComposing&&n&&((j=S.target)==null?void 0:j.getAttribute("data-mantine-stop-propagation"))!=="true"&&o()},{capture:!0}),cR({opened:n,shouldReturnFocus:r&&c}),{_id:u,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const S2=y.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:a,onExitTransitionEnd:o,onEnterTransitionEnd:c,trapFocus:u,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:v,lockScroll:b,children:S,zIndex:j,shadow:C,padding:R,__vars:D,unstyled:E,removeScrollProps:T,...A},k)=>{const{_id:M,titleMounted:L,bodyMounted:$,shouldLockScroll:V,setTitleMounted:Y,setBodyMounted:Q}=G9({id:r,transitionProps:a,opened:t,trapFocus:u,closeOnEscape:f,onClose:n,returnFocus:p}),{key:J,...G}=T||{};return s.jsx(qo,{...v,withinPortal:g,children:s.jsx(H9,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:o,onEnterTransitionEnd:c,transitionProps:{...a,keepMounted:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:L,bodyMounted:$,setTitleMounted:Y,setBodyMounted:Q,trapFocus:u,closeOnEscape:f,zIndex:j,unstyled:E},children:s.jsx(lc,{enabled:V&&b,...G,children:s.jsx(ce,{ref:k,...A,__vars:{...D,"--mb-z-index":(j||Wr("modal")).toString(),"--mb-shadow":sx(C),"--mb-padding":Nn(R)},children:S})},J)})})});S2.displayName="@mantine/core/ModalBase";function Q9(){const e=Wi();return y.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var fc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const w2=y.forwardRef(({className:e,...t},n)=>{const r=Q9(),a=Wi();return s.jsx(ce,{ref:n,...t,id:r,className:Ut({[fc.body]:!a.unstyled},e)})});w2.displayName="@mantine/core/ModalBaseBody";const j2=y.forwardRef(({className:e,onClick:t,...n},r)=>{const a=Wi();return s.jsx(Go,{ref:r,...n,onClick:o=>{a.onClose(),t==null||t(o)},className:Ut({[fc.close]:!a.unstyled},e),unstyled:a.unstyled})});j2.displayName="@mantine/core/ModalBaseCloseButton";const C2=y.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:a,...o},c)=>{const u=Wi();return s.jsx(di,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{var f,p,m;(f=u.onExitTransitionEnd)==null||f.call(u),(m=(p=u.transitionProps)==null?void 0:p.onExited)==null||m.call(p)},onEntered:()=>{var f,p,m;(f=u.onEnterTransitionEnd)==null||f.call(u),(m=(p=u.transitionProps)==null?void 0:p.onEntered)==null||m.call(p)},...e,children:f=>s.jsx("div",{...n,className:Ut({[fc.inner]:!u.unstyled},n.className),children:s.jsx(gp,{active:u.opened&&u.trapFocus,innerRef:c,children:s.jsx(mr,{...o,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":u.bodyMounted?u.getBodyId():void 0,"aria-labelledby":u.titleMounted?u.getTitleId():void 0,style:[a,f],className:Ut({[fc.content]:!u.unstyled},t),unstyled:u.unstyled,children:o.children})})})})});C2.displayName="@mantine/core/ModalBaseContent";const E2=y.forwardRef(({className:e,...t},n)=>{const r=Wi();return s.jsx(ce,{component:"header",ref:n,className:Ut({[fc.header]:!r.unstyled},e),...t})});E2.displayName="@mantine/core/ModalBaseHeader";const W9={duration:200,timingFunction:"ease",transition:"fade"};function Y9(e){const t=Wi();return{...W9,...t.transitionProps,...e}}const T2=y.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...a},o)=>{const c=Wi(),u=Y9(t);return s.jsx(di,{mounted:r!==void 0?r:c.opened,...u,transition:"fade",children:f=>s.jsx(dc,{ref:o,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e==null||e(p),c.closeOnClickOutside&&c.onClose()},...a})})});T2.displayName="@mantine/core/ModalBaseOverlay";function K9(){const e=Wi();return y.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const R2=y.forwardRef(({className:e,...t},n)=>{const r=K9(),a=Wi();return s.jsx(ce,{component:"h2",ref:n,className:Ut({[fc.title]:!a.unstyled},e),...t,id:r})});R2.displayName="@mantine/core/ModalBaseTitle";function X9({children:e}){return s.jsx(s.Fragment,{children:e})}const[Z9,J9]=Hi({size:"sm"}),e5={},D2=ve((e,t)=>{const n=se("InputClearButton",e5,e),{size:r,variant:a,vars:o,classNames:c,styles:u,...f}=n,p=J9(),{resolvedClassNames:m,resolvedStyles:g}=Ws({classNames:c,styles:u,props:n});return s.jsx(Go,{variant:a||"transparent",ref:t,size:r||(p==null?void 0:p.size)||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});D2.displayName="@mantine/core/InputClearButton";const[t5,Ec]=Hi({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var ya={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 wC={},n5=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),vp=ve((e,t)=>{const n=se("InputDescription",wC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:v,...b}=se("InputDescription",wC,n),S=Ec(),j=Ie({name:["InputWrapper",m],props:n,classes:ya,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"description",vars:f,varsResolver:n5}),C=g&&(S==null?void 0:S.getStyles)||j;return s.jsx(ce,{component:"p",ref:t,variant:v,size:p,...C("description",S!=null&&S.getStyles?{className:a,style:o}:void 0),...b})});vp.classes=ya;vp.displayName="@mantine/core/InputDescription";const r5={},a5=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),yp=ve((e,t)=>{const n=se("InputError",r5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:v,...b}=n,S=Ie({name:["InputWrapper",m],props:n,classes:ya,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"error",vars:f,varsResolver:a5}),j=Ec(),C=g&&(j==null?void 0:j.getStyles)||S;return s.jsx(ce,{component:"p",ref:t,variant:v,size:p,...C("error",j!=null&&j.getStyles?{className:a,style:o}:void 0),...b})});yp.classes=ya;yp.displayName="@mantine/core/InputError";const jC={labelElement:"label"},i5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0}}),fd=ve((e,t)=>{const n=se("InputLabel",jC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,labelElement:p,size:m,required:g,htmlFor:v,onMouseDown:b,children:S,__staticSelector:j,variant:C,mod:R,...D}=se("InputLabel",jC,n),E=Ie({name:["InputWrapper",j],props:n,classes:ya,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"label",vars:f,varsResolver:i5}),T=Ec(),A=(T==null?void 0:T.getStyles)||E;return s.jsxs(ce,{...A("label",T!=null&&T.getStyles?{className:a,style:o}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?v:void 0,mod:[{required:g},R],onMouseDown:k=>{b==null||b(k),!k.defaultPrevented&&k.detail>1&&k.preventDefault()},...D,children:[S,g&&s.jsx("span",{...A("required"),"aria-hidden":!0,children:" *"})]})});fd.classes=ya;fd.displayName="@mantine/core/InputLabel";const CC={},Ix=ve((e,t)=>{const n=se("InputPlaceholder",CC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,__staticSelector:p,variant:m,error:g,mod:v,...b}=se("InputPlaceholder",CC,n),S=Ie({name:["InputPlaceholder",p],props:n,classes:ya,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"placeholder"});return s.jsx(ce,{...S("placeholder"),mod:[{error:!!g},v],component:"span",variant:m,ref:t,...b})});Ix.classes=ya;Ix.displayName="@mantine/core/InputPlaceholder";function o5(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),a=e.slice(0,r),o=e.slice(r+1),c=t&&a.includes("description")||n&&a.includes("error");return{offsetBottom:t&&o.includes("description")||n&&o.includes("error"),offsetTop:c}}const s5={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},l5=(e,{size:t})=>({label:{"--input-label-size":On(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${On(t)} - ${le(2)})`}}),Lx=ve((e,t)=>{const n=se("InputWrapper",s5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:v,inputWrapperOrder:b,label:S,error:j,description:C,labelProps:R,descriptionProps:D,errorProps:E,labelElement:T,children:A,withAsterisk:k,id:M,required:L,__stylesApiProps:$,mod:V,...Y}=n,Q=Ie({name:["InputWrapper",g],props:$||n,classes:ya,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:l5}),J={size:p,variant:m,__staticSelector:g},G=yr(M),Z=typeof k=="boolean"?k:L,P=(E==null?void 0:E.id)||`${G}-error`,I=(D==null?void 0:D.id)||`${G}-description`,z=G,H=!!j&&typeof j!="boolean",O=!!C,U=`${H?P:""} ${O?I:""}`,K=U.trim().length>0?U.trim():void 0,ee=(R==null?void 0:R.id)||`${G}-label`,be=S&&s.jsx(fd,{labelElement:T,id:ee,htmlFor:z,required:Z,...J,...R,children:S},"label"),xe=O&&s.jsx(vp,{...D,...J,size:(D==null?void 0:D.size)||J.size,id:(D==null?void 0:D.id)||I,children:C},"description"),ye=s.jsx(y.Fragment,{children:v(A)},"input"),qe=H&&y.createElement(yp,{...E,...J,size:(E==null?void 0:E.size)||J.size,key:"error",id:(E==null?void 0:E.id)||P},j),Ne=b.map(tt=>{switch(tt){case"label":return be;case"input":return ye;case"description":return xe;case"error":return qe;default:return null}});return s.jsx(t5,{value:{getStyles:Q,describedBy:K,inputId:z,labelId:ee,...o5(b,{hasDescription:O,hasError:H})},children:s.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},V],...Q("root"),...Y,children:Ne})})});Lx.classes=ya;Lx.displayName="@mantine/core/InputWrapper";const c5={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},u5=(e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":rt(t.size,"input-height"),"--input-fz":On(t.size),"--input-radius":t.radius===void 0?void 0:Vt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?le(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?le(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?rt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),mn=lr((e,t)=>{const n=se("Input",c5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:v,error:b,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:R,rightSection:D,rightSectionProps:E,rightSectionWidth:T,rightSectionPointerEvents:A,leftSectionPointerEvents:k,variant:M,vars:L,pointer:$,multiline:V,radius:Y,id:Q,withAria:J,withErrorStyles:G,mod:Z,inputSize:P,__clearSection:I,__clearable:z,__defaultRightSection:H,...O}=n,{styleProps:U,rest:K}=Qi(O),ee=Ec(),be={offsetBottom:ee==null?void 0:ee.offsetBottom,offsetTop:ee==null?void 0:ee.offsetTop},xe=Ie({name:["Input",p],props:m||n,classes:ya,className:a,style:o,classNames:r,styles:c,unstyled:u,stylesCtx:be,rootSelector:"wrapper",vars:L,varsResolver:u5}),ye=J?{required:f,disabled:S,"aria-invalid":!!b,"aria-describedby":ee==null?void 0:ee.describedBy,id:(ee==null?void 0:ee.inputId)||Q}:{},qe=D||z&&I||H;return s.jsx(Z9,{value:{size:g||"sm"},children:s.jsxs(ce,{...xe("wrapper"),...U,...v,mod:[{error:!!b&&G,pointer:$,disabled:S,multiline:V,"data-with-right-section":!!qe,"data-with-left-section":!!j},Z],variant:M,size:g,children:[j&&s.jsx("div",{...C,"data-position":"left",...xe("section",{className:C==null?void 0:C.className,style:C==null?void 0:C.style}),children:j}),s.jsx(ce,{component:"input",...K,...ye,ref:t,required:f,mod:{disabled:S,error:!!b&&G},variant:M,__size:P,...xe("input")}),qe&&s.jsx("div",{...E,"data-position":"right",...xe("section",{className:E==null?void 0:E.className,style:E==null?void 0:E.style}),children:qe})]})})});mn.classes=ya;mn.Wrapper=Lx;mn.Label=fd;mn.Error=yp;mn.Description=vp;mn.Placeholder=Ix;mn.ClearButton=D2;mn.displayName="@mantine/core/Input";function d5(e,t,n){const r=se(e,t,n),{label:a,description:o,error:c,required:u,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:v,__stylesApiProps:b,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:R,id:D,size:E,style:T,inputContainer:A,inputWrapperOrder:k,withAsterisk:M,variant:L,vars:$,mod:V,...Y}=r,{styleProps:Q,rest:J}=Qi(Y),G={label:a,description:o,error:c,required:u,classNames:f,className:m,__staticSelector:v,__stylesApiProps:b||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:E,style:T,inputContainer:A,inputWrapperOrder:k,withAsterisk:M,variant:L,id:D,mod:V,...R};return{...J,classNames:f,styles:p,unstyled:g,wrapperProps:{...G,...Q},inputProps:{required:u,classNames:f,styles:p,unstyled:g,size:E,__staticSelector:v,__stylesApiProps:b||r,error:c,variant:L,id:D}}}const f5={__staticSelector:"InputBase",withAria:!0},Pr=lr((e,t)=>{const{inputProps:n,wrapperProps:r,...a}=d5("InputBase",f5,e);return s.jsx(mn.Wrapper,{...r,children:s.jsx(mn,{...n,...a,ref:t})})});Pr.classes={...mn.classes,...mn.Wrapper.classes};Pr.displayName="@mantine/core/InputBase";const h5={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 A2={root:"m_8bffd616"};const p5={},Bo=lr((e,t)=>{const n=se("Flex",p5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,gap:p,rowGap:m,columnGap:g,align:v,justify:b,wrap:S,direction:j,...C}=n,R=Ie({name:"Flex",classes:A2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f}),D=Sn(),E=ud(),T=SR({styleProps:{gap:p,rowGap:m,columnGap:g,align:v,justify:b,wrap:S,direction:j},theme:D,data:h5});return s.jsxs(s.Fragment,{children:[T.hasResponsiveStyles&&s.jsx(Ks,{selector:`.${E}`,styles:T.styles,media:T.media}),s.jsx(ce,{ref:t,...R("root",{className:E,style:Ho(T.inlineStyles)}),...C})]})});Bo.classes=A2;Bo.displayName="@mantine/core/Flex";function m5(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 g5({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const a=y.useRef(-1),[o,c]=y.useState(!1),[u,f]=y.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const b=e.getBoundingClientRect(),S=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),R=$o(j.borderTopWidth)+$o(C.borderTopWidth),D=$o(j.borderLeftWidth)+$o(C.borderLeftWidth),E={top:b.top-S.top-R,left:b.left-S.left-D,width:b.width,height:b.height};n.current.style.transform=`translateY(${E.top}px) translateX(${E.left}px)`,n.current.style.width=`${E.width}px`,n.current.style.height=`${E.height}px`},m=()=>{window.clearTimeout(a.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),a.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=y.useRef(null),v=y.useRef(null);return y.useEffect(()=>{if(p(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(v.current=new ResizeObserver(m),v.current.observe(t)),()=>{var b,S;(b=g.current)==null||b.disconnect(),(S=v.current)==null||S.disconnect()}},[t,e]),y.useEffect(()=>{if(t){const b=S=>{m5(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),yN(()=>{pR()!=="test"&&c(!0)},20,{autoInvoke:!0}),xN(b=>{b.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:o,hidden:u}}var _2={root:"m_96b553a6"};const v5={},y5=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),zx=ve((e,t)=>{const n=se("FloatingIndicator",v5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,target:p,parent:m,transitionDuration:g,mod:v,displayAfterTransitionEnd:b,...S}=n,j=Ie({name:"FloatingIndicator",classes:_2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:y5}),C=y.useRef(null),{initialized:R,hidden:D}=g5({target:p,parent:m,ref:C,displayAfterTransitionEnd:b}),E=zn(t,C);return!p||!m?null:s.jsx(ce,{ref:E,mod:[{initialized:R,hidden:D},v],...j("root"),...S})});zx.displayName="@mantine/core/FloatingIndicator";zx.classes=_2;var k2={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 x5={},b5=(e,{radius:t,color:n,variant:r,autoContrast:a})=>{const o=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:a});return{root:{"--alert-radius":t===void 0?void 0:Vt(t),"--alert-bg":n||r?o.background:void 0,"--alert-color":o.color,"--alert-bd":n||r?o.border:void 0}}},Yi=ve((e,t)=>{const n=se("Alert",x5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,radius:p,color:m,title:g,children:v,id:b,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:R,variant:D,autoContrast:E,...T}=n,A=Ie({name:"Alert",classes:k2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:b5}),k=yr(b),M=g&&`${k}-title`||void 0,L=`${k}-body`;return s.jsx(ce,{id:k,...A("root",{variant:D}),variant:D,ref:t,...T,role:"alert","aria-describedby":L,"aria-labelledby":M,children:s.jsxs("div",{...A("wrapper"),children:[S&&s.jsx("div",{...A("icon"),children:S}),s.jsxs("div",{...A("body"),children:[g&&s.jsx("div",{...A("title"),"data-with-close-button":j||void 0,children:s.jsx("span",{id:M,...A("label"),children:g})}),v&&s.jsx("div",{id:L,...A("message"),"data-variant":D,children:v})]}),j&&s.jsx(Go,{...A("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":R,unstyled:u})]})})});Yi.classes=k2;Yi.displayName="@mantine/core/Alert";var P2={root:"m_b6d8b162"};function S5(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const w5={inherit:!1},j5=(e,{variant:t,lineClamp:n,gradient:r,size:a,color:o})=>({root:{"--text-fz":On(a),"--text-lh":oR(a),"--text-gradient":t==="gradient"?py(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":o?Ht(o,e):void 0}}),De=lr((e,t)=>{const n=se("Text",w5,e),{lineClamp:r,truncate:a,inline:o,inherit:c,gradient:u,span:f,__staticSelector:p,vars:m,className:g,style:v,classNames:b,styles:S,unstyled:j,variant:C,mod:R,size:D,...E}=n,T=Ie({name:["Text",p],props:n,classes:P2,className:g,style:v,classNames:b,styles:S,unstyled:j,vars:m,varsResolver:j5});return s.jsx(ce,{...T("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":S5(a),"data-line-clamp":typeof r=="number","data-inline":o,"data-inherit":c},R],size:D,...E})});De.classes=P2;De.displayName="@mantine/core/Text";var N2={root:"m_849cf0da"};const C5={underline:"hover"},Pt=lr((e,t)=>{const{underline:n,className:r,unstyled:a,mod:o,...c}=se("Anchor",C5,e);return s.jsx(De,{component:"a",ref:t,className:Ut({[N2.root]:!a},r),...c,mod:[{underline:n},o],__staticSelector:"Anchor",unstyled:a})});Pt.classes=N2;Pt.displayName="@mantine/core/Anchor";const[E5,Tc]=vr("AppShell was not found in tree");var Qo={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const T5={},$x=ve((e,t)=>{const n=se("AppShellAside",T5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Tc();return b.disabled?null:s.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("aside",{className:a,classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});$x.classes=Qo;$x.displayName="@mantine/core/AppShellAside";const R5={},Ux=ve((e,t)=>{var S;const n=se("AppShellFooter",R5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Tc();return b.disabled?null:s.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("footer",{className:Ut({[lc.classNames.zeroRight]:b.offsetScrollbars},a),classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-footer-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Ux.classes=Qo;Ux.displayName="@mantine/core/AppShellFooter";const D5={},Bx=ve((e,t)=>{var S;const n=se("AppShellHeader",D5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Tc();return b.disabled?null:s.jsx(ce,{component:"header",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("header",{className:Ut({[lc.classNames.zeroRight]:b.offsetScrollbars},a),classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-header-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Bx.classes=Qo;Bx.displayName="@mantine/core/AppShellHeader";const A5={},Vx=ve((e,t)=>{const n=se("AppShellMain",A5,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=Tc();return s.jsx(ce,{component:"main",ref:t,...p.getStyles("main",{className:a,style:o,classNames:r,styles:c}),...f})});Vx.classes=Qo;Vx.displayName="@mantine/core/AppShellMain";function hd(e){return typeof e=="object"?e.base:e}function pd(e){const t=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||t}function md(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function _5({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:a}){var f,p,m;const o=r==null?void 0:r.width,c="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-aside-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-aside-offset"]="0px"),pd(o)){const g=le(hd(o));e["--app-shell-aside-width"]=g,e["--app-shell-aside-offset"]=g}if(md(o)&&(typeof o.base<"u"&&(e["--app-shell-aside-width"]=le(o.base),e["--app-shell-aside-offset"]=le(o.base)),sn(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-aside-width"]=le(o[g]),t[g]["--app-shell-aside-offset"]=le(o[g]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-aside-transform"]=c,t[g]["--app-shell-aside-transform-rtl"]=u,t[g]["--app-shell-aside-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=lx(r.breakpoint,a.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-aside-width"]="100%",n[g]["--app-shell-aside-offset"]="0px",n[g]["--app-shell-aside-transform"]=c,n[g]["--app-shell-aside-transform-rtl"]=u}}function k5({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,a="translateY(var(--app-shell-footer-height))",o=(n==null?void 0:n.offset)??!0;if(pd(r)){const c=le(hd(r));e["--app-shell-footer-height"]=c,o&&(e["--app-shell-footer-offset"]=c)}md(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),o&&(e["--app-shell-footer-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),o&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=a,e["--app-shell-footer-offset"]="0px !important")}function P5({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,a="translateY(calc(var(--app-shell-header-height) * -1))",o=(n==null?void 0:n.offset)??!0;if(pd(r)){const c=le(hd(r));e["--app-shell-header-height"]=c,o&&(e["--app-shell-header-offset"]=c)}md(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),o&&(e["--app-shell-header-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),o&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=a,e["--app-shell-header-offset"]="0px !important")}function N5({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:a}){var f,p,m;const o=r==null?void 0:r.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-navbar-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-navbar-offset"]="0px"),pd(o)){const g=le(hd(o));e["--app-shell-navbar-width"]=g,e["--app-shell-navbar-offset"]=g}if(md(o)&&(typeof o.base<"u"&&(e["--app-shell-navbar-width"]=le(o.base),e["--app-shell-navbar-offset"]=le(o.base)),sn(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-navbar-width"]=le(o[g]),t[g]["--app-shell-navbar-offset"]=le(o[g]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-navbar-transform"]=c,t[g]["--app-shell-navbar-transform-rtl"]=u,t[g]["--app-shell-navbar-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=lx(r.breakpoint,a.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-navbar-width"]="100%",n[g]["--app-shell-navbar-offset"]="0px",n[g]["--app-shell-navbar-transform"]=c,n[g]["--app-shell-navbar-transform-rtl"]=u}}function Mv(e){return Number(e)===0?"0px":Nn(e)}function O5({padding:e,baseStyles:t,minMediaStyles:n}){pd(e)&&(t["--app-shell-padding"]=Mv(hd(e))),md(e)&&(e.base&&(t["--app-shell-padding"]=Mv(e.base)),sn(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Mv(e[r]))}))}function M5({navbar:e,header:t,footer:n,aside:r,padding:a,theme:o}){const c={},u={},f={};N5({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,navbar:e,theme:o}),_5({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,aside:r,theme:o}),P5({baseStyles:f,minMediaStyles:c,header:t}),k5({baseStyles:f,minMediaStyles:c,footer:n}),O5({baseStyles:f,minMediaStyles:c,padding:a});const p=Yu(sn(c),o.breakpoints).map(v=>({query:`(min-width: ${jh(v.px)})`,styles:c[v.value]})),m=Yu(sn(u),o.breakpoints).map(v=>({query:`(max-width: ${jh(v.px)})`,styles:u[v.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function I5({navbar:e,header:t,aside:n,footer:r,padding:a}){const o=Sn(),c=qi(),{media:u,baseStyles:f}=M5({navbar:e,header:t,footer:r,aside:n,padding:a,theme:o});return s.jsx(Ks,{media:u,styles:f,selector:c.cssVariablesSelector})}const L5={},Fx=ve((e,t)=>{const n=se("AppShellNavbar",L5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Tc();return b.disabled?null:s.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("navbar",{className:a,classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});Fx.classes=Qo;Fx.displayName="@mantine/core/AppShellNavbar";const z5={},Hx=lr((e,t)=>{const n=se("AppShellSection",z5,e),{classNames:r,className:a,style:o,styles:c,vars:u,grow:f,mod:p,...m}=n,g=Tc();return s.jsx(ce,{ref:t,mod:[{grow:f},p],...g.getStyles("section",{className:a,style:o,classNames:r,styles:c}),...m})});Hx.classes=Qo;Hx.displayName="@mantine/core/AppShellSection";function $5({transitionDuration:e,disabled:t}){const[n,r]=y.useState(!0),a=y.useRef(-1),o=y.useRef(-1);return hR("resize",()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),200)}),Sc(()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const U5={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Wr("app")},B5=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Ar=ve((e,t)=>{const n=se("AppShell",U5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:v,transitionTimingFunction:b,header:S,zIndex:j,layout:C,disabled:R,aside:D,footer:E,offsetScrollbars:T=C!=="alt",mod:A,...k}=n,M=Ie({name:"AppShell",classes:Qo,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:B5}),L=$5({disabled:R,transitionDuration:v});return s.jsxs(E5,{value:{getStyles:M,withBorder:m,zIndex:j,disabled:R,offsetScrollbars:T},children:[s.jsx(I5,{navbar:p,header:S,aside:D,footer:E,padding:g}),s.jsx(ce,{ref:t,...M("root"),mod:[{resizing:L,layout:C,disabled:R},A],...k})]})});Ar.classes=Qo;Ar.displayName="@mantine/core/AppShell";Ar.Navbar=Fx;Ar.Header=Bx;Ar.Main=Vx;Ar.Aside=$x;Ar.Footer=Ux;Ar.Section=Hx;function O2(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=>O2(t))}:e}function M2(e){return e?e.map(t=>O2(t)):[]}function I2(e){return e.reduce((t,n)=>"group"in n?{...t,...I2(n.items)}:(t[n.value]=n,t),{})}var kr={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const V5={error:null},F5=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":rt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Ht(n,e):void 0}}),xp=ve((e,t)=>{const n=se("ComboboxChevron",V5,e),{size:r,error:a,style:o,className:c,classNames:u,styles:f,unstyled:p,vars:m,mod:g,...v}=n,b=Ie({name:"ComboboxChevron",classes:kr,props:n,style:o,className:c,classNames:u,styles:f,unstyled:p,vars:m,varsResolver:F5,rootSelector:"chevron"});return s.jsx(ce,{component:"svg",...v,...b("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:a},g],ref:t,children:s.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});xp.classes=kr;xp.displayName="@mantine/core/ComboboxChevron";const[H5,xa]=vr("Combobox component was not found in tree"),L2=y.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...a},o)=>s.jsx(mn.ClearButton,{ref:o,tabIndex:-1,"aria-hidden":!0,...a,onMouseDown:c=>{c.preventDefault(),t==null||t(c)},onClick:c=>{r(),n==null||n(c)}}));L2.displayName="@mantine/core/ComboboxClearButton";const q5={},qx=ve((e,t)=>{const{classNames:n,styles:r,className:a,style:o,hidden:c,...u}=se("ComboboxDropdown",q5,e),f=xa();return s.jsx(za.Dropdown,{...u,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:a,style:o,classNames:n,styles:r})})});qx.classes=kr;qx.displayName="@mantine/core/ComboboxDropdown";const G5={refProp:"ref"},z2=ve((e,t)=>{const{children:n,refProp:r}=se("ComboboxDropdownTarget",G5,e);if(xa(),!Fi(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return s.jsx(za.Target,{ref:t,refProp:r,children:n})});z2.displayName="@mantine/core/ComboboxDropdownTarget";const Q5={},Gx=ve((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("ComboboxEmpty",Q5,e),f=xa();return s.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:o,style:a}),...u})});Gx.classes=kr;Gx.displayName="@mantine/core/ComboboxEmpty";function Qx({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:a,autoComplete:o}){const c=xa(),[u,f]=y.useState(null),p=g=>{if(e==null||e(g),!c.readOnly&&t){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectNextOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectPreviousOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const v=c.store.getSelectedOptionIndex();c.store.dropdownOpened&&v!==-1?(g.preventDefault(),c.store.clickSelectedOption()):a==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&a==="button"&&(g.preventDefault(),c.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(c.store.listId&&c.store.dropdownOpened)||void 0,"aria-controls":c.store.dropdownOpened?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&u||void 0,autoComplete:o,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const W5={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},$2=ve((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...p}=se("ComboboxEventsTarget",W5,e);if(!Fi(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=xa(),g=Qx({targetType:u,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return y.cloneElement(n,{...g,...p,[r]:zn(t,m.store.targetRef,op(n))})});$2.displayName="@mantine/core/ComboboxEventsTarget";const Y5={},Wx=ve((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("ComboboxFooter",Y5,e),f=xa();return s.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:a,styles:o}),...u,onMouseDown:p=>{p.preventDefault()}})});Wx.classes=kr;Wx.displayName="@mantine/core/ComboboxFooter";const K5={},Yx=ve((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,children:u,label:f,...p}=se("ComboboxGroup",K5,e),m=xa();return s.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:a,styles:o}),...p,children:[f&&s.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:o}),children:f}),u]})});Yx.classes=kr;Yx.displayName="@mantine/core/ComboboxGroup";const X5={},Kx=ve((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("ComboboxHeader",X5,e),f=xa();return s.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:a,styles:o}),...u,onMouseDown:p=>{p.preventDefault()}})});Kx.classes=kr;Kx.displayName="@mantine/core/ComboboxHeader";function U2({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}U2.displayName="@mantine/core/ComboboxHiddenInput";const Z5={},Xx=ve((e,t)=>{const n=se("ComboboxOption",Z5,e),{classNames:r,className:a,style:o,styles:c,vars:u,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:v,disabled:b,selected:S,mod:j,...C}=n,R=xa(),D=y.useId(),E=p||D;return s.jsx(ce,{...R.getStyles("option",{className:a,classNames:r,styles:c,style:o}),...C,ref:t,id:E,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":S},j],role:"option",onClick:T=>{var A;b?T.preventDefault():((A=R.onOptionSubmit)==null||A.call(R,n.value,n),f==null||f(T))},onMouseDown:T=>{T.preventDefault(),g==null||g(T)},onMouseOver:T=>{R.resetSelectionOnOptionHover&&R.store.resetSelectedOption(),v==null||v(T)}})});Xx.classes=kr;Xx.displayName="@mantine/core/ComboboxOption";const J5={},Zx=ve((e,t)=>{const n=se("ComboboxOptions",J5,e),{classNames:r,className:a,style:o,styles:c,id:u,onMouseDown:f,labelledBy:p,...m}=n,g=xa(),v=yr(u);return y.useEffect(()=>{g.store.setListId(v)},[v]),s.jsx(ce,{ref:t,...g.getStyles("options",{className:a,style:o,classNames:r,styles:c}),...m,id:v,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f==null||f(b)}})});Zx.classes=kr;Zx.displayName="@mantine/core/ComboboxOptions";const e7={withAriaAttributes:!0,withKeyboardNavigation:!0},Jx=ve((e,t)=>{const n=se("ComboboxSearch",e7,e),{classNames:r,styles:a,unstyled:o,vars:c,withAriaAttributes:u,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,v=xa(),b=v.getStyles("search"),S=Qx({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return s.jsx(mn,{ref:zn(t,v.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},a],size:m||v.size,...S,...g,__staticSelector:"Combobox"})});Jx.classes=kr;Jx.displayName="@mantine/core/ComboboxSearch";const t7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},B2=ve((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...p}=se("ComboboxTarget",t7,e);if(!Fi(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=xa(),g=Qx({targetType:u,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),v=y.cloneElement(n,{...g,...p});return s.jsx(za.Target,{ref:zn(t,m.store.targetRef),children:v})});B2.displayName="@mantine/core/ComboboxTarget";function n7(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 r7(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 a7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function gd({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:a,loop:o=!0,scrollBehavior:c="instant"}={}){const[u,f]=Yn({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=y.useRef(null),m=y.useRef(-1),g=y.useRef(null),v=y.useRef(null),b=y.useRef(-1),S=y.useRef(-1),j=y.useRef(-1),C=y.useCallback((P="unknown")=>{u||(f(!0),a==null||a(P))},[f,a,u]),R=y.useCallback((P="unknown")=>{u&&(f(!1),r==null||r(P))},[f,r,u]),D=y.useCallback((P="unknown")=>{u?R(P):C(P)},[R,C,u]),E=y.useCallback(()=>{const P=document.querySelector(`#${p.current} [data-combobox-selected]`);P==null||P.removeAttribute("data-combobox-selected"),P==null||P.removeAttribute("aria-selected")},[]),T=y.useCallback(P=>{const I=document.getElementById(p.current),z=I==null?void 0:I.querySelectorAll("[data-combobox-option]");if(!z)return null;const H=P>=z.length?0:P<0?z.length-1:P;return m.current=H,z!=null&&z[H]&&!z[H].hasAttribute("data-combobox-disabled")?(E(),z[H].setAttribute("data-combobox-selected","true"),z[H].setAttribute("aria-selected","true"),z[H].scrollIntoView({block:"nearest",behavior:c}),z[H].id):null},[c,E]),A=y.useCallback(()=>{const P=document.querySelector(`#${p.current} [data-combobox-active]`);if(P){const I=document.querySelectorAll(`#${p.current} [data-combobox-option]`),z=Array.from(I).findIndex(H=>H===P);return T(z)}return T(0)},[T]),k=y.useCallback(()=>T(r7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),o)),[T,o]),M=y.useCallback(()=>T(n7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),o)),[T,o]),L=y.useCallback(()=>T(a7(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[T]),$=y.useCallback((P="selected",I)=>{j.current=window.setTimeout(()=>{var O;const z=document.querySelectorAll(`#${p.current} [data-combobox-option]`),H=Array.from(z).findIndex(U=>U.hasAttribute(`data-combobox-${P}`));m.current=H,I!=null&&I.scrollIntoView&&((O=z[H])==null||O.scrollIntoView({block:"nearest",behavior:c}))},0)},[]),V=y.useCallback(()=>{m.current=-1,E()},[E]),Y=y.useCallback(()=>{const P=document.querySelectorAll(`#${p.current} [data-combobox-option]`),I=P==null?void 0:P[m.current];I==null||I.click()},[]),Q=y.useCallback(P=>{p.current=P},[]),J=y.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),G=y.useCallback(()=>{S.current=window.setTimeout(()=>v.current.focus(),0)},[]),Z=y.useCallback(()=>m.current,[]);return y.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(S.current),window.clearTimeout(j.current)},[]),{dropdownOpened:u,openDropdown:C,closeDropdown:R,toggleDropdown:D,selectedOptionIndex:m.current,getSelectedOptionIndex:Z,selectOption:T,selectFirstOption:L,selectActiveOption:A,selectNextOption:k,selectPreviousOption:M,resetSelectedOption:V,updateSelectedOptionIndex:$,listId:p.current,setListId:Q,clickSelectedOption:Y,searchRef:g,focusSearchInput:J,targetRef:v,focusTarget:G}}const i7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},o7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":On(t),"--combobox-option-padding":rt(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":On(t),"--combobox-option-padding":rt(t,"combobox-option-padding")}});function ct(e){const t=se("Combobox",i7,e),{classNames:n,styles:r,unstyled:a,children:o,store:c,vars:u,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:v,__staticSelector:b,readOnly:S,...j}=t,C=gd(),R=c||C,D=Ie({name:b||"Combobox",classes:kr,props:t,classNames:n,styles:r,unstyled:a,vars:u,varsResolver:o7}),E=()=>{p==null||p(),R.closeDropdown()};return s.jsx(H5,{value:{getStyles:D,store:R,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:v,readOnly:S},children:s.jsx(za,{opened:R.dropdownOpened,...j,onChange:T=>!T&&E(),withRoles:!1,unstyled:a,children:o})})}const s7=e=>e;ct.extend=s7;ct.classes=kr;ct.displayName="@mantine/core/Combobox";ct.Target=B2;ct.Dropdown=qx;ct.Options=Zx;ct.Option=Xx;ct.Search=Jx;ct.Empty=Gx;ct.Chevron=xp;ct.Footer=Wx;ct.Header=Kx;ct.EventsTarget=$2;ct.DropdownTarget=z2;ct.Group=Yx;ct.ClearButton=L2;ct.HiddenInput=U2;var V2={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const F2=V2,bp=y.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:a,unstyled:o,children:c,label:u,description:f,id:p,disabled:m,error:g,size:v,labelPosition:b="left",bodyElement:S="div",labelElement:j="label",variant:C,style:R,vars:D,mod:E,...T},A)=>{const k=Ie({name:e,props:t,className:n,style:R,classes:V2,classNames:r,styles:a,unstyled:o});return s.jsx(ce,{...k("root"),ref:A,__vars:{"--label-fz":On(v),"--label-lh":rt(v,"label-lh")},mod:[{"label-position":b},E],variant:C,size:v,...T,children:s.jsxs(ce,{component:S,htmlFor:S==="label"?p:void 0,...k("body"),children:[c,s.jsxs("div",{...k("labelWrapper"),"data-disabled":m||void 0,children:[u&&s.jsx(ce,{component:j,htmlFor:j==="label"?p:void 0,...k("label"),"data-disabled":m||void 0,children:u}),f&&s.jsx(mn.Description,{size:v,__inheritStyles:!1,...k("description"),children:f}),g&&typeof g!="boolean"&&s.jsx(mn.Error,{size:v,__inheritStyles:!1,...k("error"),children:g})]})]})})});bp.displayName="@mantine/core/InlineInput";const H2=y.createContext(null),l7=H2.Provider,q2=()=>y.useContext(H2),[c7,u7]=Hi();var G2={card:"m_26775b0a"};const d7={withBorder:!0},f7=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),e0=ve((e,t)=>{const n=se("CheckboxCard",d7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,checked:p,mod:m,withBorder:g,value:v,onClick:b,defaultChecked:S,onChange:j,...C}=n,R=Ie({name:"CheckboxCard",classes:G2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:f7,rootSelector:"card"}),D=q2(),E=typeof p=="boolean"?p:D?D.value.includes(v||""):void 0,[T,A]=Yn({value:E,defaultValue:S,finalValue:!1,onChange:j});return s.jsx(c7,{value:{checked:T},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:T},m],...R("card"),...C,role:"checkbox","aria-checked":T,onClick:k=>{b==null||b(k),D==null||D.onChange(v||""),A(!T)}})})});e0.displayName="@mantine/core/CheckboxCard";e0.classes=G2;function t0({children:e,role:t}){const n=Ec();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const h7={},n0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:a,size:o,wrapperProps:c,children:u,readOnly:f,...p}=se("CheckboxGroup",h7,e),[m,g]=Yn({value:n,defaultValue:r,finalValue:[],onChange:a}),v=b=>{const S=typeof b=="string"?b:b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return s.jsx(l7,{value:{value:m,onChange:v,size:o},children:s.jsx(mn.Wrapper,{size:o,ref:t,...c,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(t0,{role:"group",children:u})})})});n0.classes=mn.Wrapper.classes;n0.displayName="@mantine/core/CheckboxGroup";function Sp({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(e),...t}:t;return s.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:s.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function Q2({indeterminate:e,...t}){return e?s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:s.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):s.jsx(Sp,{...t})}var W2={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const p7={icon:Q2},m7=(e,{radius:t,color:n,size:r,iconColor:a,variant:o,autoContrast:c})=>{const u=fa({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--checkbox-size":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Vt(t),"--checkbox-color":o==="outline"?f:Ht(n,e),"--checkbox-icon-color":a?Ht(a,e):Ys(c,e)?Gi({color:n,theme:e,autoContrast:c}):void 0}}},r0=ve((e,t)=>{const n=se("CheckboxIndicator",p7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,icon:p,indeterminate:m,radius:g,color:v,iconColor:b,autoContrast:S,checked:j,mod:C,variant:R,disabled:D,...E}=n,T=p,A=Ie({name:"CheckboxIndicator",classes:W2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:m7,rootSelector:"indicator"}),k=u7(),M=typeof j=="boolean"||typeof m=="boolean"?j||m:(k==null?void 0:k.checked)||!1;return s.jsx(ce,{ref:t,...A("indicator",{variant:R}),variant:R,mod:[{checked:M,disabled:D},C],...E,children:s.jsx(T,{indeterminate:m,...A("icon")})})});r0.displayName="@mantine/core/CheckboxIndicator";r0.classes=W2;var Y2={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const g7={labelPosition:"right",icon:Q2},v7=(e,{radius:t,color:n,size:r,iconColor:a,variant:o,autoContrast:c})=>{const u=fa({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--checkbox-size":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Vt(t),"--checkbox-color":o==="outline"?f:Ht(n,e),"--checkbox-icon-color":a?Ht(a,e):Ys(c,e)?Gi({color:n,theme:e,autoContrast:c}):void 0}}},Fn=ve((e,t)=>{const n=se("Checkbox",g7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,label:m,id:g,size:v,radius:b,wrapperProps:S,checked:j,labelPosition:C,description:R,error:D,disabled:E,variant:T,indeterminate:A,icon:k,rootRef:M,iconColor:L,onChange:$,autoContrast:V,mod:Y,...Q}=n,J=q2(),G=v||(J==null?void 0:J.size),Z=k,P=Ie({name:"Checkbox",props:n,classes:Y2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:v7}),{styleProps:I,rest:z}=Qi(Q),H=yr(g),O=J?{checked:J.value.includes(z.value),onChange:ee=>{J.onChange(ee),$==null||$(ee)}}:{},U=y.useRef(null),K=t||U;return y.useEffect(()=>{K&&"current"in K&&K.current&&(K.current.indeterminate=A||!1)},[A,K]),s.jsx(bp,{...P("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:H,size:G,labelPosition:C,label:m,description:R,error:D,disabled:E,classNames:r,styles:c,unstyled:u,"data-checked":O.checked||j||void 0,variant:T,ref:M,mod:Y,...I,...S,children:s.jsxs(ce,{...P("inner"),mod:{"data-label-position":C},children:[s.jsx(ce,{component:"input",id:H,ref:K,checked:j,disabled:E,mod:{error:!!D,indeterminate:A},...P("input",{focusable:!0,variant:T}),onChange:$,...z,...O,type:"checkbox"}),s.jsx(Z,{indeterminate:A,...P("icon")})]})})});Fn.classes={...Y2,...F2};Fn.displayName="@mantine/core/Checkbox";Fn.Group=n0;Fn.Indicator=r0;Fn.Card=e0;function hc(e){return"group"in e}function K2({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),a=[];for(let o=0;o<e.length;o+=1){const c=e[o];if(a.length===n)return a;hc(c)&&a.push({group:c.group,items:K2({options:c.items,search:t,limit:n-a.length})}),hc(c)||c.label.toLowerCase().includes(r)&&a.push(c)}return a}function y7(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 X2(e,t=new Set){if(Array.isArray(e))for(const n of e)if(hc(n))X2(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 x7(e,t){return Array.isArray(e)?e.includes(t):e===t}function Z2({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:a,renderOption:o}){if(!hc(e)){const u=x7(n,e.value),f=t&&u&&s.jsx(Sp,{className:kr.optionsDropdownCheckIcon}),p=s.jsxs(s.Fragment,{children:[r==="left"&&f,s.jsx("span",{children:e.label}),r==="right"&&f]});return s.jsx(ct.Option,{value:e.value,disabled:e.disabled,className:Ut({[kr.optionsDropdownOption]:!a}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof o=="function"?o({option:e,checked:u}):p})}const c=e.items.map(u=>s.jsx(Z2,{data:u,value:n,unstyled:a,withCheckIcon:t,checkIconPosition:r,renderOption:o},u.value));return s.jsx(ct.Group,{label:e.group,children:c})}function b7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:a,limit:o,maxDropdownHeight:c,withScrollArea:u=!0,filterOptions:f=!0,withCheckIcon:p=!1,value:m,checkIconPosition:g,nothingFoundMessage:v,unstyled:b,labelId:S,renderOption:j,scrollAreaProps:C,"aria-label":R}){X2(e);const E=typeof a=="string"?(r||K2)({options:e,search:f?a:"",limit:o??1/0}):e,T=y7(E),A=E.map(k=>s.jsx(Z2,{data:k,withCheckIcon:p,value:m,checkIconPosition:g,unstyled:b,renderOption:j},hc(k)?k.group:k.value));return s.jsx(ct.Dropdown,{hidden:t||n&&T,"data-composed":!0,children:s.jsxs(ct.Options,{labelledBy:S,"aria-label":R,children:[u?s.jsx(Yr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:A}):A,T&&v&&s.jsx(ct.Empty,{children:v})]})})}const J2=y.createContext(null),S7=J2.Provider;function w7(){return{withinGroup:!!y.useContext(J2)}}var wp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const j7={},C7=(e,{spacing:t})=>({group:{"--ag-spacing":Nn(t)}}),a0=ve((e,t)=>{const n=se("AvatarGroup",j7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,spacing:p,...m}=n,g=Ie({name:"AvatarGroup",classes:wp,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:C7,rootSelector:"group"});return s.jsx(S7,{value:!0,children:s.jsx(ce,{ref:t,...g("group"),...m})})});a0.classes=wp;a0.displayName="@mantine/core/AvatarGroup";function E7(e){return s.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function T7(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 R7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function D7(e,t=R7){const n=T7(e),r=Math.abs(n)%t.length;return t[r]}function A7(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 _7={},k7=(e,{size:t,radius:n,variant:r,gradient:a,color:o,autoContrast:c,name:u,allowedInitialsColors:f})=>{const p=o==="initials"&&typeof u=="string"?D7(u,f):o,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:a,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":rt(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Vt(n),"--avatar-bg":p||r?m.background:void 0,"--avatar-color":p||r?m.color:void 0,"--avatar-bd":p||r?m.border:void 0}}},Ls=lr((e,t)=>{const n=se("Avatar",_7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,src:p,alt:m,radius:g,color:v,gradient:b,imageProps:S,children:j,autoContrast:C,mod:R,name:D,allowedInitialsColors:E,...T}=n,A=w7(),[k,M]=y.useState(!p),L=Ie({name:"Avatar",props:n,classes:wp,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:k7});return y.useEffect(()=>M(!p),[p]),s.jsx(ce,{...L("root"),mod:[{"within-group":A.withinGroup},R],ref:t,...T,children:k?s.jsx("span",{...L("placeholder"),title:m,children:j||typeof D=="string"&&A7(D)||s.jsx(E7,{})}):s.jsx("img",{...S,...L("image"),src:p,alt:m,onError:$=>{var V;M(!0),(V=S==null?void 0:S.onError)==null||V.call(S,$)}})})});Ls.classes=wp;Ls.displayName="@mantine/core/Avatar";Ls.Group=a0;var eD={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const P7={},N7=(e,{radius:t,color:n,gradient:r,variant:a,size:o,autoContrast:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:c});return{root:{"--badge-height":rt(o,"badge-height"),"--badge-padding-x":rt(o,"badge-padding-x"),"--badge-fz":rt(o,"badge-fz"),"--badge-radius":t===void 0?void 0:Vt(t),"--badge-bg":n||a?u.background:void 0,"--badge-color":n||a?u.color:void 0,"--badge-bd":n||a?u.border:void 0,"--badge-dot-color":a==="dot"?Ht(n,e):void 0}}},jp=lr((e,t)=>{const n=se("Badge",P7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,radius:p,color:m,gradient:g,leftSection:v,rightSection:b,children:S,variant:j,fullWidth:C,autoContrast:R,circle:D,mod:E,...T}=n,A=Ie({name:"Badge",props:n,classes:eD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:N7});return s.jsxs(ce,{variant:j,mod:[{block:C,circle:D,"with-right-section":!!b,"with-left-section":!!v},E],...A("root",{variant:j}),ref:t,...T,children:[v&&s.jsx("span",{...A("section"),"data-position":"left",children:v}),s.jsx("span",{...A("label"),children:S}),b&&s.jsx("span",{...A("section"),"data-position":"right",children:b})]})});jp.classes=eD;jp.displayName="@mantine/core/Badge";var tD={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const O7={iconSize:48},M7=(e,{color:t,iconSize:n,radius:r})=>{const a=fa({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),o=fa({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":la(o.value,.07),"--bq-bg-dark":la(a.value,.06),"--bq-bd":Ht(t,e),"--bq-icon-size":le(n),"--bq-radius":Vt(r)}}},i0=ve((e,t)=>{const n=se("Blockquote",O7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,icon:m,iconSize:g,cite:v,...b}=n,S=Ie({name:"Blockquote",classes:tD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:M7});return s.jsxs(ce,{component:"blockquote",ref:t,...S("root"),...b,children:[m&&s.jsx("span",{...S("icon"),children:m}),p,v&&s.jsx("cite",{...S("cite"),children:v})]})});i0.classes=tD;i0.displayName="@mantine/core/Blockquote";var Rc={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const EC={orientation:"horizontal"},I7=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),o0=ve((e,t)=>{const n=se("ButtonGroup",EC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,orientation:f,vars:p,borderWidth:m,variant:g,mod:v,...b}=se("ButtonGroup",EC,e),S=Ie({name:"ButtonGroup",props:n,classes:Rc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:p,varsResolver:I7,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},v],role:"group",...b})});o0.classes=Rc;o0.displayName="@mantine/core/ButtonGroup";const TC={},L7=(e,{radius:t,color:n,gradient:r,variant:a,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:o});return{groupSection:{"--section-height":rt(c,"section-height"),"--section-padding-x":rt(c,"section-padding-x"),"--section-fz":c!=null&&c.includes("compact")?On(c.replace("compact-","")):On(c),"--section-radius":t===void 0?void 0:Vt(t),"--section-bg":n||a?u.background:void 0,"--section-color":u.color,"--section-bd":n||a?u.border:void 0}}},s0=ve((e,t)=>{const n=se("ButtonGroupSection",TC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,variant:p,gradient:m,radius:g,autoContrast:v,...b}=se("ButtonGroupSection",TC,e),S=Ie({name:"ButtonGroupSection",props:n,classes:Rc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:L7,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});s0.classes=Rc;s0.displayName="@mantine/core/ButtonGroupSection";const z7={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},$7={},U7=(e,{radius:t,color:n,gradient:r,variant:a,size:o,justify:c,autoContrast:u})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:u});return{root:{"--button-justify":c,"--button-height":rt(o,"button-height"),"--button-padding-x":rt(o,"button-padding-x"),"--button-fz":o!=null&&o.includes("compact")?On(o.replace("compact-","")):On(o),"--button-radius":t===void 0?void 0:Vt(t),"--button-bg":n||a?f.background:void 0,"--button-hover":n||a?f.hover:void 0,"--button-color":f.color,"--button-bd":n||a?f.border:void 0,"--button-hover-color":n||a?f.hoverColor:void 0}}},Oe=lr((e,t)=>{const n=se("Button",$7,e),{style:r,vars:a,className:o,color:c,disabled:u,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:v,radius:b,loading:S,loaderProps:j,gradient:C,classNames:R,styles:D,unstyled:E,"data-disabled":T,autoContrast:A,mod:k,...M}=n,L=Ie({name:"Button",props:n,classes:Rc,className:o,style:r,classNames:R,styles:D,unstyled:E,vars:a,varsResolver:U7}),$=!!p,V=!!m;return s.jsxs(tr,{ref:t,...L("root",{active:!u&&!S&&!T}),unstyled:E,variant:v,disabled:u||S,mod:[{disabled:u||T,loading:S,block:g,"with-left-section":$,"with-right-section":V},k],...M,children:[s.jsx(di,{mounted:!!S,transition:z7,duration:150,children:Y=>s.jsx(ce,{component:"span",...L("loader",{style:Y}),"aria-hidden":!0,children:s.jsx(_r,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),s.jsxs("span",{...L("inner"),children:[p&&s.jsx(ce,{component:"span",...L("section"),mod:{position:"left"},children:p}),s.jsx(ce,{component:"span",mod:{loading:S},...L("label"),children:f}),m&&s.jsx(ce,{component:"span",...L("section"),mod:{position:"right"},children:m})]})]})});Oe.classes=Rc;Oe.displayName="@mantine/core/Button";Oe.Group=o0;Oe.GroupSection=s0;var nD={root:"m_4451eb3a"};const B7={},er=lr((e,t)=>{const n=se("Center",B7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,inline:p,mod:m,...g}=n,v=Ie({name:"Center",props:n,classes:nD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f});return s.jsx(ce,{ref:t,mod:[{inline:p},m],...v("root"),...g})});er.classes=nD;er.displayName="@mantine/core/Center";const[V7,F7]=Hi(),H7={};function rD(e){const{value:t,defaultValue:n,onChange:r,multiple:a,children:o}=se("ChipGroup",H7,e),[c,u]=Yn({value:t,defaultValue:n,finalValue:a?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,p=m=>{const g=m.currentTarget.value;Array.isArray(c)?u(c.includes(g)?c.filter(v=>v!==g):[...c,g]):u(g)};return s.jsx(V7,{value:{isChipSelected:f,onChange:p,multiple:a},children:o})}rD.displayName="@mantine/core/ChipGroup";var aD={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 q7={type:"checkbox"},G7=(e,{size:t,radius:n,variant:r,color:a,autoContrast:o})=>{const c=e.variantColorResolver({color:a||e.primaryColor,theme:e,variant:r||"filled",autoContrast:o});return{root:{"--chip-fz":On(t),"--chip-size":rt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Vt(n),"--chip-checked-padding":rt(t,"chip-checked-padding"),"--chip-padding":rt(t,"chip-padding"),"--chip-icon-size":rt(t,"chip-icon-size"),"--chip-bg":a||r?c.background:void 0,"--chip-hover":a||r?c.hover:void 0,"--chip-color":a||r?c.color:void 0,"--chip-bd":a||r?c.border:void 0,"--chip-spacing":rt(t,"chip-spacing")}}},Ju=ve((e,t)=>{const n=se("Chip",q7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,id:p,checked:m,defaultChecked:g,onChange:v,value:b,wrapperProps:S,type:j,disabled:C,children:R,size:D,variant:E,icon:T,rootRef:A,autoContrast:k,mod:M,...L}=n,$=Ie({name:"Chip",classes:aD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:G7}),V=F7(),Y=yr(p),{styleProps:Q,rest:J}=Qi(L),[G,Z]=Yn({value:m,defaultValue:g,finalValue:!1,onChange:v}),P=V?{checked:V.isChipSelected(b),onChange:z=>{V.onChange(z),v==null||v(z.currentTarget.checked)},type:V.multiple?"checkbox":"radio"}:{},I=P.checked||G;return s.jsxs(ce,{size:D,variant:E,ref:A,mod:M,...$("root"),...Q,...S,children:[s.jsx("input",{type:j,...$("input"),checked:I,onChange:z=>Z(z.currentTarget.checked),id:Y,disabled:C,ref:t,value:b,...P,...J}),s.jsxs("label",{htmlFor:Y,"data-checked":I||void 0,"data-disabled":C||void 0,...$("label",{variant:E||"filled"}),children:[I&&s.jsx("span",{...$("iconWrapper"),children:T||s.jsx(Sp,{...$("checkIcon")})}),s.jsx("span",{children:R})]})]})});Ju.classes=aD;Ju.displayName="@mantine/core/Chip";Ju.Group=rD;var iD={root:"m_b183c0a2"};const Q7={},W7=(e,{color:t})=>({root:{"--code-bg":t?Ht(t,e):void 0}}),l0=ve((e,t)=>{const n=se("Code",Q7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,block:m,variant:g,mod:v,...b}=n,S=Ie({name:"Code",props:n,classes:iD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:W7});return s.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},v],...S("root"),...b,dir:"ltr"})});l0.classes=iD;l0.displayName="@mantine/core/Code";var oD={root:"m_7485cace"};const Y7={},K7=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:rt(t,"container-size")}}),c0=ve((e,t)=>{const n=se("Container",Y7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,fluid:p,mod:m,...g}=n,v=Ie({name:"Container",classes:oD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:K7});return s.jsx(ce,{ref:t,mod:[{fluid:p},m],...v("root"),...g})});c0.classes=oD;c0.displayName="@mantine/core/Container";const X7={timeout:1e3};function sD(e){const{children:t,timeout:n,value:r,...a}=se("CopyButton",X7,e),o=sR({timeout:n}),c=()=>o.copy(r);return s.jsx(s.Fragment,{children:t({copy:c,copied:o.copied,...a})})}sD.displayName="@mantine/core/CopyButton";var lD={root:"m_3eebeb36",label:"m_9e365f20"};const Z7={orientation:"horizontal"},J7=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Ht(t,e):void 0,"--divider-border-style":n,"--divider-size":rt(r,"divider-size")}}),jn=ve((e,t)=>{const n=se("Divider",Z7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,orientation:m,label:g,labelPosition:v,mod:b,...S}=n,j=Ie({name:"Divider",classes:lD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:J7});return s.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...j("root"),...S,role:"separator",children:g&&s.jsx(ce,{component:"span",mod:{position:v},...j("label"),children:g})})});jn.classes=lD;jn.displayName="@mantine/core/Divider";function eI({open:e,close:t,openDelay:n,closeDelay:r}){const a=y.useRef(-1),o=y.useRef(-1),c=()=>{window.clearTimeout(a.current),window.clearTimeout(o.current)},u=()=>{c(),n===0||n===void 0?e():a.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():o.current=window.setTimeout(t,r)};return y.useEffect(()=>c,[]),{openDropdown:u,closeDropdown:f}}const[RC,cD]=vr("Grid component was not found in tree"),Ey=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,DC=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Ey(e,t),AC=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},_C=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function tI({span:e,order:t,offset:n,selector:r}){var b;const a=Sn(),o=cD(),c=o.breakpoints||a.breakpoints,f=_a(e)===void 0?12:_a(e),p=Ho({"--col-order":(b=_a(t))==null?void 0:b.toString(),"--col-flex-grow":AC(f,o.grow),"--col-flex-basis":Ey(f,o.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":DC(f,o.columns,o.grow),"--col-offset":_C(_a(n),o.columns)}),m=sn(c).reduce((S,j)=>{var C;return S[j]||(S[j]={}),typeof t=="object"&&t[j]!==void 0&&(S[j]["--col-order"]=(C=t[j])==null?void 0:C.toString()),typeof e=="object"&&e[j]!==void 0&&(S[j]["--col-flex-grow"]=AC(e[j],o.grow),S[j]["--col-flex-basis"]=Ey(e[j],o.columns),S[j]["--col-width"]=e[j]==="content"?"auto":void 0,S[j]["--col-max-width"]=DC(e[j],o.columns,o.grow)),typeof n=="object"&&n[j]!==void 0&&(S[j]["--col-offset"]=_C(n[j],o.columns)),S},{}),v=Yu(sn(m),c).filter(S=>sn(m[S.value]).length>0).map(S=>({query:o.type==="container"?`mantine-grid (min-width: ${c[S.value]})`:`(min-width: ${c[S.value]})`,styles:m[S.value]}));return s.jsx(Ks,{styles:p,media:o.type==="container"?void 0:v,container:o.type==="container"?v:void 0,selector:r})}var u0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const nI={span:12},d0=ve((e,t)=>{const n=se("GridCol",nI,e),{classNames:r,className:a,style:o,styles:c,vars:u,span:f,order:p,offset:m,...g}=n,v=cD(),b=ud();return s.jsxs(s.Fragment,{children:[s.jsx(tI,{selector:`.${b}`,span:f,order:p,offset:m}),s.jsx(ce,{ref:t,...v.getStyles("col",{className:Ut(a,b),style:o,classNames:r,styles:c}),...g})]})});d0.classes=u0;d0.displayName="@mantine/core/GridCol";function kC({gutter:e,selector:t,breakpoints:n,type:r}){const a=Sn(),o=n||a.breakpoints,c=Ho({"--grid-gutter":Nn(_a(e))}),u=sn(o).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=Nn(e[g])),m),{}),p=Yu(sn(u),o).filter(m=>sn(u[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${o[m.value]})`:`(min-width: ${o[m.value]})`,styles:u[m.value]}));return s.jsx(Ks,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const rI={gutter:"md",grow:!1,columns:12},aI=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),or=ve((e,t)=>{const n=se("Grid",rI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,grow:p,gutter:m,columns:g,align:v,justify:b,children:S,breakpoints:j,type:C,...R}=n,D=Ie({name:"Grid",classes:u0,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:aI}),E=ud();return C==="container"&&j?s.jsxs(RC,{value:{getStyles:D,grow:p,columns:g||12,breakpoints:j,type:C},children:[s.jsx(kC,{selector:`.${E}`,...n}),s.jsx("div",{...D("container"),children:s.jsx(ce,{ref:t,...D("root",{className:E}),...R,children:s.jsx("div",{...D("inner"),children:S})})})]}):s.jsxs(RC,{value:{getStyles:D,grow:p,columns:g||12,breakpoints:j,type:C},children:[s.jsx(kC,{selector:`.${E}`,...n}),s.jsx(ce,{ref:t,...D("root",{className:E}),...R,children:s.jsx("div",{...D("inner"),children:S})})]})});or.classes=u0;or.displayName="@mantine/core/Grid";or.Col=d0;function Ph(){return Ph=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},Ph.apply(null,arguments)}function f0(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 iI=y.useLayoutEffect,oI=function(t){var n=Cn.useRef(t);return iI(function(){n.current=t}),n},PC=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},sI=function(t,n){var r=Cn.useRef();return Cn.useCallback(function(a){t.current=a,r.current&&PC(r.current,null),r.current=n,n&&PC(n,a)},[n])},NC={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},lI=function(t){Object.keys(NC).forEach(function(n){t.style.setProperty(n,NC[n],"important")})},OC=lI,dr=null,MC=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function cI(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),dr||(dr=document.createElement("textarea"),dr.setAttribute("tabindex","-1"),dr.setAttribute("aria-hidden","true"),OC(dr)),dr.parentNode===null&&document.body.appendChild(dr);var a=e.paddingSize,o=e.borderSize,c=e.sizingStyle,u=c.boxSizing;Object.keys(c).forEach(function(v){var b=v;dr.style[b]=c[b]}),OC(dr),dr.value=t;var f=MC(dr,e);dr.value=t,f=MC(dr,e),dr.value="x";var p=dr.scrollHeight-a,m=p*n;u==="border-box"&&(m=m+a+o),f=Math.max(m,f);var g=p*r;return u==="border-box"&&(g=g+a+o),f=Math.min(g,f),[f,p]}var IC=function(){},uI=function(t,n){return t.reduce(function(r,a){return r[a]=n[a],r},{})},dI=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],fI=!!document.documentElement.currentStyle,hI=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=uI(dI,n),a=r.boxSizing;if(a==="")return null;fI&&a==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:c}},pI=hI;function h0(e,t,n){var r=oI(n);y.useLayoutEffect(function(){var a=function(c){return r.current(c)};if(e)return e.addEventListener(t,a),function(){return e.removeEventListener(t,a)}},[])}var mI=function(t,n){h0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},gI=function(t){h0(window,"resize",t)},vI=function(t){h0(document.fonts,"loadingdone",t)},yI=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],xI=function(t,n){var r=t.cacheMeasurements,a=t.maxRows,o=t.minRows,c=t.onChange,u=c===void 0?IC:c,f=t.onHeightChange,p=f===void 0?IC:f,m=f0(t,yI),g=m.value!==void 0,v=y.useRef(null),b=sI(v,n),S=y.useRef(0),j=y.useRef(),C=function(){var E=v.current,T=r&&j.current?j.current:pI(E);if(T){j.current=T;var A=cI(T,E.value||E.placeholder||"x",o,a),k=A[0],M=A[1];S.current!==k&&(S.current=k,E.style.setProperty("height",k+"px","important"),p(k,{rowHeight:M}))}},R=function(E){g||C(),u(E)};return y.useLayoutEffect(C),mI(v,function(){if(!g){var D=v.current.value;requestAnimationFrame(function(){var E=v.current;E&&D!==E.value&&C()})}}),gI(C),vI(C),y.createElement("textarea",Ph({},m,{onChange:R,ref:b}))},bI=y.forwardRef(xI);const SI={},Zs=ve((e,t)=>{const{autosize:n,maxRows:r,minRows:a,__staticSelector:o,resize:c,...u}=se("Textarea",SI,e),f=n&&pR()!=="test",p=f?{maxRows:r,minRows:a}:{};return s.jsx(Pr,{component:f?bI:"textarea",ref:t,...u,__staticSelector:o||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});Zs.classes=Pr.classes;Zs.displayName="@mantine/core/Textarea";function LC(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const wI={serialize:JSON.stringify,deserialize:JSON.parse},Dc=ve((e,t)=>{const{value:n,defaultValue:r,onChange:a,formatOnBlur:o,validationError:c,serialize:u,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:v,...b}=se("JsonInput",wI,e),[S,j]=Yn({value:n,defaultValue:r,finalValue:"",onChange:a}),[C,R]=y.useState(LC(S,f)),D=T=>{p==null||p(T),R(!0)},E=T=>{typeof m=="function"&&m(T);const A=LC(T.currentTarget.value,f);o&&!g&&A&&T.currentTarget.value.trim()!==""&&j(u(f(T.currentTarget.value),null,2)),R(A)};return s.jsx(Zs,{value:S,onChange:T=>j(T.currentTarget.value),onFocus:D,onBlur:E,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?v:c||!0,"data-monospace":!0})});Dc.classes=Pr.classes;Dc.displayName="@mantine/core/JsonInput";const[jI,CI]=vr("List component was not found in tree");var p0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const EI={},m0=ve((e,t)=>{const n=se("ListItem",EI,e),{classNames:r,className:a,style:o,styles:c,vars:u,icon:f,children:p,mod:m,...g}=n,v=CI(),b=f||v.icon,S={classNames:r,styles:c};return s.jsx(ce,{...v.getStyles("item",{...S,className:a,style:o}),component:"li",mod:[{"with-icon":!!b,centered:v.center},m],ref:t,...g,children:s.jsxs("div",{...v.getStyles("itemWrapper",S),children:[b&&s.jsx("span",{...v.getStyles("itemIcon",S),children:b}),s.jsx("span",{...v.getStyles("itemLabel",S),children:p})]})})});m0.classes=p0;m0.displayName="@mantine/core/ListItem";const TI={type:"unordered"},RI=(e,{size:t,spacing:n})=>({root:{"--list-fz":On(t),"--list-lh":oR(t),"--list-spacing":Nn(n)}}),pr=ve((e,t)=>{const n=se("List",TI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,type:m,withPadding:g,icon:v,spacing:b,center:S,listStyleType:j,mod:C,...R}=n,D=Ie({name:"List",classes:p0,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:RI});return s.jsx(jI,{value:{center:S,icon:v,getStyles:D},children:s.jsx(ce,{...D("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g},C],ref:t,...R,children:p})})});pr.classes=p0;pr.displayName="@mantine/core/List";pr.Item=m0;var uD={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const zC={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Wr("overlay")},DI=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),g0=ve((e,t)=>{const n=se("LoadingOverlay",zC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:v,zIndex:b,...S}=n,j=Sn(),C=Ie({name:"LoadingOverlay",classes:uD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:DI}),R={...zC.overlayProps,...g};return s.jsx(di,{transition:"fade",...p,mounted:!!v,children:D=>s.jsxs(ce,{...C("root",{style:D}),ref:t,...S,children:[s.jsx(_r,{...C("loader"),unstyled:u,...m}),s.jsx(dc,{...R,...C("overlay"),darkHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.white}),s.jsx(dc,{...R,...C("overlay"),lightHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.colors.dark[5]})]})})});g0.classes=uD;g0.displayName="@mantine/core/LoadingOverlay";const[AI,vd]=vr("Menu component was not found in the tree");var Ac={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const _I={},v0=ve((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("MenuDivider",_I,e),f=vd();return s.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:a,styles:o,classNames:n}),...u})});v0.classes=Ac;v0.displayName="@mantine/core/MenuDivider";const kI={},y0=ve((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,onMouseEnter:u,onMouseLeave:f,onKeyDown:p,children:m,...g}=se("MenuDropdown",kI,e),v=y.useRef(null),b=vd(),S=Rr(p,R=>{var D,E;(R.key==="ArrowUp"||R.key==="ArrowDown")&&(R.preventDefault(),(E=(D=v.current)==null?void 0:D.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||E.focus())}),j=Rr(u,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=Rr(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return s.jsxs(za.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:zn(t,v),...b.getStyles("dropdown",{className:r,style:a,styles:o,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[b.withInitialFocusPlaceholder&&s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});y0.classes=Ac;y0.displayName="@mantine/core/MenuDropdown";const PI={},x0=lr((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,color:u,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:v,"data-disabled":b,...S}=se("MenuItem",PI,e),j=vd(),C=Sn(),{dir:R}=Xs(),D=y.useRef(null),E=j.getItemIndex(D.current),T=S,A=Rr(T.onMouseLeave,()=>j.setHovered(-1)),k=Rr(T.onMouseEnter,()=>j.setHovered(j.getItemIndex(D.current))),M=Rr(T.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),L=Rr(T.onFocus,()=>j.setHovered(j.getItemIndex(D.current))),$=u?C.variantColorResolver({color:u,theme:C,variant:"light"}):void 0,V=u?fa({color:u,theme:C}):null;return s.jsxs(tr,{...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,onFocus:L,...j.getStyles("item",{className:r,style:a,styles:o,classNames:n}),ref:zn(D,t),role:"menuitem",disabled:v,"data-menu-item":!0,"data-disabled":v||b||void 0,"data-hovered":j.hovered===E?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:k,onMouseLeave:A,onClick:M,onKeyDown:iR({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:T.onKeyDown}),__vars:{"--menu-item-color":V!=null&&V.isThemeColor&&(V==null?void 0:V.shade)===void 0?`var(--mantine-color-${V.color}-6)`:$==null?void 0:$.color,"--menu-item-hover":$==null?void 0:$.hover},children:[p&&s.jsx("div",{...j.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"left",children:p}),g&&s.jsx("div",{...j.getStyles("itemLabel",{styles:o,classNames:n}),children:g}),m&&s.jsx("div",{...j.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"right",children:m})]})});x0.classes=Ac;x0.displayName="@mantine/core/MenuItem";const NI={},b0=ve((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("MenuLabel",NI,e),f=vd();return s.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:a,styles:o,classNames:n}),...u})});b0.classes=Ac;b0.displayName="@mantine/core/MenuLabel";const OI={refProp:"ref"},dD=y.forwardRef((e,t)=>{const{children:n,refProp:r,...a}=se("MenuTarget",OI,e);if(!Fi(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const o=vd(),c=n.props,u=Rr(c.onClick,()=>{o.trigger==="click"?o.toggleDropdown():o.trigger==="click-hover"&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),f=Rr(c.onMouseEnter,()=>(o.trigger==="hover"||o.trigger==="click-hover")&&o.openDropdown()),p=Rr(c.onMouseLeave,()=>{(o.trigger==="hover"||o.trigger==="click-hover"&&!o.openedViaClick)&&o.closeDropdown()});return s.jsx(za.Target,{refProp:r,popupType:"menu",ref:t,...a,children:y.cloneElement(n,{onClick:u,onMouseEnter:f,onMouseLeave:p,"data-expanded":o.opened?!0:void 0})})});dD.displayName="@mantine/core/MenuTarget";const MI={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=se("Menu",MI,e),{children:n,onOpen:r,onClose:a,opened:o,defaultOpened:c,trapFocus:u,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:v,openDelay:b,closeDelay:S,classNames:j,styles:C,unstyled:R,variant:D,vars:E,menuItemTabIndex:T,keepMounted:A,withInitialFocusPlaceholder:k,...M}=t,L=Ie({name:"Menu",classes:Ac,props:t,classNames:j,styles:C,unstyled:R}),[$,{setHovered:V,resetHovered:Y}]=X3(),[Q,J]=Yn({value:o,defaultValue:c,finalValue:!1,onChange:f}),[G,Z]=y.useState(!1),P=()=>{J(!1),Z(!1),Q&&(a==null||a())},I=()=>{J(!0),!Q&&(r==null||r())},z=()=>{Q?P():I()},{openDropdown:H,closeDropdown:O}=eI({open:I,close:P,closeDelay:S,openDelay:b}),U=be=>K3("[data-menu-item]","[data-menu-dropdown]",be),{resolvedClassNames:K,resolvedStyles:ee}=Ws({classNames:j,styles:C,props:t});return zi(()=>{Y()},[Q]),s.jsx(AI,{value:{getStyles:L,opened:Q,toggleDropdown:z,getItemIndex:U,hovered:$,setHovered:V,openedViaClick:G,setOpenedViaClick:Z,closeOnItemClick:p,closeDropdown:v==="click"?P:O,openDropdown:v==="click"?I:H,closeDropdownImmediately:P,loop:m,trigger:v,unstyled:R,menuItemTabIndex:T,withInitialFocusPlaceholder:k},children:s.jsx(za,{...M,opened:Q,onChange:z,defaultOpened:c,trapFocus:A?!1:u,closeOnEscape:g,__staticSelector:"Menu",classNames:K,styles:ee,unstyled:R,variant:D,keepMounted:A,children:n})})}we.extend=e=>e;we.withProps=kO(we);we.classes=Ac;we.displayName="@mantine/core/Menu";we.Item=x0;we.Label=b0;we.Dropdown=y0;we.Target=dD;we.Divider=v0;const[II,_c]=vr("Modal component was not found in tree");var Ki={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const LI={},Cp=ve((e,t)=>{const n=se("ModalBody",LI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(w2,{ref:t,...p.getStyles("body",{classNames:r,style:o,styles:c,className:a}),...f})});Cp.classes=Ki;Cp.displayName="@mantine/core/ModalBody";const zI={},Ep=ve((e,t)=>{const n=se("ModalCloseButton",zI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(j2,{ref:t,...p.getStyles("close",{classNames:r,style:o,styles:c,className:a}),...f})});Ep.classes=Ki;Ep.displayName="@mantine/core/ModalCloseButton";const $I={},Tp=ve((e,t)=>{const n=se("ModalContent",$I,e),{classNames:r,className:a,style:o,styles:c,vars:u,children:f,__hidden:p,...m}=n,g=_c(),v=g.scrollAreaComponent||X9;return s.jsx(C2,{...g.getStyles("content",{className:a,style:o,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:a,style:o,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...m,children:s.jsx(v,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});Tp.classes=Ki;Tp.displayName="@mantine/core/ModalContent";const UI={},Rp=ve((e,t)=>{const n=se("ModalHeader",UI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(E2,{ref:t,...p.getStyles("header",{classNames:r,style:o,styles:c,className:a}),...f})});Rp.classes=Ki;Rp.displayName="@mantine/core/ModalHeader";const BI={},Dp=ve((e,t)=>{const n=se("ModalOverlay",BI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(T2,{ref:t,...p.getStyles("overlay",{classNames:r,style:o,styles:c,className:a}),...f})});Dp.classes=Ki;Dp.displayName="@mantine/core/ModalOverlay";const VI={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},FI=(e,{radius:t,size:n,yOffset:r,xOffset:a})=>({root:{"--modal-radius":t===void 0?void 0:Vt(t),"--modal-size":rt(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(a)}}),Ap=ve((e,t)=>{const n=se("ModalRoot",VI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:v,centered:b,xOffset:S,__staticSelector:j,...C}=n,R=Ie({name:j,classes:Ki,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:FI});return s.jsx(II,{value:{yOffset:p,scrollAreaComponent:m,getStyles:R,fullScreen:v},children:s.jsx(S2,{ref:t,...R("root"),"data-full-screen":v||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Yr.Autosize||void 0,unstyled:u,...C})})});Ap.classes=Ki;Ap.displayName="@mantine/core/ModalRoot";const[HI,qI]=Hi();function fD({children:e}){const[t,n]=y.useState([]),[r,a]=y.useState(Wr("modal"));return s.jsx(HI,{value:{stack:t,addModal:(o,c)=>{n(u=>[...new Set([...u,o])]),a(u=>typeof c=="number"&&typeof u=="number"?Math.max(u,c):u)},removeModal:o=>n(c=>c.filter(u=>u!==o)),getZIndex:o=>`calc(${r} + ${t.indexOf(o)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}fD.displayName="@mantine/core/ModalStack";const GI={},_p=ve((e,t)=>{const n=se("ModalTitle",GI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(R2,{ref:t,...p.getStyles("title",{classNames:r,style:o,styles:c,className:a}),...f})});_p.classes=Ki;_p.displayName="@mantine/core/ModalTitle";const QI={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},$n=ve((e,t)=>{const{title:n,withOverlay:r,overlayProps:a,withCloseButton:o,closeButtonProps:c,children:u,radius:f,opened:p,stackId:m,zIndex:g,...v}=se("Modal",QI,e),b=qI(),S=!!n||o,j=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:p;return y.useEffect(()=>{b&&m&&(p?b.addModal(m,g||Wr("modal")):b.removeModal(m))},[p,m,g]),s.jsxs(Ap,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...v,...j,children:[r&&s.jsx(Dp,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...a}),s.jsxs(Tp,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[S&&s.jsxs(Rp,{children:[n&&s.jsx(_p,{children:n}),o&&s.jsx(Ep,{...c})]}),s.jsx(Cp,{children:u})]})]})});$n.classes=Ki;$n.displayName="@mantine/core/Modal";$n.Root=Ap;$n.Overlay=Dp;$n.Content=Tp;$n.Body=Cp;$n.Header=Rp;$n.Title=_p;$n.CloseButton=Ep;$n.Stack=fD;const[WI,S0]=Hi(),[YI,KI]=Hi();var kp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const XI={},ZI=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?rt(t):rt(n,"pg-gap")}}),w0=ve((e,t)=>{const n=se("PillGroup",XI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,disabled:m,...g}=n,v=S0(),b=(v==null?void 0:v.size)||p||void 0,S=Ie({name:"PillGroup",classes:kp,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:ZI,stylesCtx:{size:b},rootSelector:"group"});return s.jsx(YI,{value:{size:b,disabled:m},children:s.jsx(ce,{ref:t,size:b,...S("group"),...g})})});w0.classes=kp;w0.displayName="@mantine/core/PillGroup";const JI={variant:"default"},eL=(e,{radius:t},{size:n})=>({root:{"--pill-fz":rt(n,"pill-fz"),"--pill-height":rt(n,"pill-height"),"--pill-radius":t===void 0?void 0:Vt(t)}}),zs=ve((e,t)=>{const n=se("Pill",JI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:v,removeButtonProps:b,radius:S,size:j,disabled:C,mod:R,...D}=n,E=KI(),T=S0(),A=j||(E==null?void 0:E.size)||void 0,k=(T==null?void 0:T.variant)==="filled"?"contrast":p||"default",M=Ie({name:"Pill",classes:kp,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:eL,stylesCtx:{size:A}});return s.jsxs(ce,{component:"span",ref:t,variant:k,size:A,...M("root",{variant:k}),mod:[{"with-remove":g&&!C,disabled:C||(E==null?void 0:E.disabled)},R],...D,children:[s.jsx("span",{...M("label"),children:m}),g&&s.jsx(Go,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:u,...b,...M("remove",{className:b==null?void 0:b.className,style:b==null?void 0:b.style}),onMouseDown:L=>{var $;L.preventDefault(),L.stopPropagation(),($=b==null?void 0:b.onMouseDown)==null||$.call(b,L)},onClick:L=>{var $;L.stopPropagation(),v==null||v(),($=b==null?void 0:b.onClick)==null||$.call(b,L)}})]})});zs.classes=kp;zs.displayName="@mantine/core/Pill";zs.Group=w0;var hD={field:"m_45c4369d"};const tL={type:"visible"},j0=ve((e,t)=>{const n=se("PillsInputField",tL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,type:p,disabled:m,id:g,pointer:v,mod:b,...S}=n,j=S0(),C=Ec(),R=Ie({name:"PillsInputField",classes:hD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"field"}),D=m||(j==null?void 0:j.disabled);return s.jsx(ce,{component:"input",ref:zn(t,j==null?void 0:j.fieldRef),"data-type":p,disabled:D,mod:[{disabled:D,pointer:v},b],...R("field"),...S,id:(C==null?void 0:C.inputId)||g,"aria-invalid":j==null?void 0:j.hasError,"aria-describedby":C==null?void 0:C.describedBy,type:"text",onMouseDown:E=>!v&&E.stopPropagation()})});j0.classes=hD;j0.displayName="@mantine/core/PillsInputField";const nL={},pc=ve((e,t)=>{const n=se("PillsInput",nL,e),{children:r,onMouseDown:a,onClick:o,size:c,disabled:u,__staticSelector:f,error:p,variant:m,...g}=n,v=y.useRef(null);return s.jsx(WI,{value:{fieldRef:v,size:c,disabled:u,hasError:!!p,variant:m},children:s.jsx(Pr,{size:c,error:p,variant:m,component:"div",ref:t,onMouseDown:b=>{var S;b.preventDefault(),a==null||a(b),(S=v.current)==null||S.focus()},onClick:b=>{var j;b.preventDefault();const S=b.currentTarget.closest("fieldset");S!=null&&S.disabled||((j=v.current)==null||j.focus(),o==null||o(b))},...g,multiline:!0,disabled:u,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});pc.displayName="@mantine/core/PillsInput";pc.Field=j0;function rL({data:e,value:t}){const n=t.map(a=>a.trim().toLowerCase());return e.reduce((a,o)=>(hc(o)?a.push({group:o.group,items:o.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(o.value.toLowerCase().trim())===-1&&a.push(o),a),[])}const aL={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Pp=ve((e,t)=>{const n=se("MultiSelect",aL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,value:m,defaultValue:g,onChange:v,onKeyDown:b,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:R,onDropdownOpen:D,onDropdownClose:E,selectFirstOptionOnChange:T,onOptionSubmit:A,comboboxProps:k,filter:M,limit:L,withScrollArea:$,maxDropdownHeight:V,searchValue:Y,defaultSearchValue:Q,onSearchChange:J,readOnly:G,disabled:Z,onFocus:P,onBlur:I,radius:z,rightSection:H,rightSectionWidth:O,rightSectionPointerEvents:U,rightSectionProps:K,leftSection:ee,leftSectionWidth:be,leftSectionPointerEvents:xe,leftSectionProps:ye,inputContainer:qe,inputWrapperOrder:Ne,withAsterisk:tt,labelProps:Ae,descriptionProps:gt,errorProps:Mt,wrapperProps:It,description:mt,label:Dt,error:nn,maxValues:Ce,searchable:Re,nothingFoundMessage:Ge,withCheckIcon:Te,checkIconPosition:me,hidePickedOptions:ge,withErrorStyles:ke,name:Se,form:$e,id:vt,clearable:ft,clearButtonProps:Gt,hiddenInputProps:_t,placeholder:un,hiddenInputValuesDivider:wt,required:Va,mod:Sa,renderOption:pi,onRemove:Un,onClear:wa,scrollAreaProps:Kr,chevronColor:sl,...mi}=n,no=yr(vt),Fa=M2(j),xr=I2(Fa),qn=gd({opened:C,defaultOpened:R,onDropdownOpen:D,onDropdownClose:()=>{E==null||E(),qn.resetSelectedOption()}}),{styleProps:gi,rest:{type:ro,autoComplete:Jo,...es}}=Qi(mi),[F,X]=Yn({value:m,defaultValue:g,finalValue:[],onChange:v}),[re,he]=Yn({value:Y,defaultValue:Q,finalValue:"",onChange:J}),Ee=Ke=>{he(Ke),qn.resetSelectedOption()},Be=Ie({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:u}),{resolvedClassNames:nt,resolvedStyles:Ue}=Ws({props:n,styles:c,classNames:r}),Ze=Ke=>{b==null||b(Ke),Ke.key===" "&&!Re&&(Ke.preventDefault(),qn.toggleDropdown()),Ke.key==="Backspace"&&re.length===0&&F.length>0&&(Un==null||Un(F[F.length-1]),X(F.slice(0,F.length-1)))},Je=F.map((Ke,Wt)=>{var dn,kt;return s.jsx(zs,{withRemoveButton:!G&&!((dn=xr[Ke])!=null&&dn.disabled),onRemove:()=>{X(F.filter(Et=>Ke!==Et)),Un==null||Un(Ke)},unstyled:u,disabled:Z,...Be("pill"),children:((kt=xr[Ke])==null?void 0:kt.label)||Ke},`${Ke}-${Wt}`)});y.useEffect(()=>{T&&qn.selectFirstOption()},[T,re]);const at=s.jsx(ct.ClearButton,{...Gt,onClear:()=>{wa==null||wa(),X([]),Ee("")}}),Ye=rL({data:Fa,value:F}),st=ft&&F.length>0&&!Z&&!G;return s.jsxs(s.Fragment,{children:[s.jsxs(ct,{store:qn,classNames:nt,styles:Ue,unstyled:u,size:p,readOnly:G,__staticSelector:"MultiSelect",onOptionSubmit:Ke=>{A==null||A(Ke),Ee(""),qn.updateSelectedOptionIndex("selected"),F.includes(xr[Ke].value)?(X(F.filter(Wt=>Wt!==xr[Ke].value)),Un==null||Un(xr[Ke].value)):F.length<Ce&&X([...F,xr[Ke].value])},...k,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(pc,{...gi,__staticSelector:"MultiSelect",classNames:nt,styles:Ue,unstyled:u,size:p,className:a,style:o,variant:S,disabled:Z,radius:z,__defaultRightSection:s.jsx(ct.Chevron,{size:p,error:nn,unstyled:u,color:sl}),__clearSection:at,__clearable:st,rightSection:H,rightSectionPointerEvents:U||(at?"all":"none"),rightSectionWidth:O,rightSectionProps:K,leftSection:ee,leftSectionWidth:be,leftSectionPointerEvents:xe,leftSectionProps:ye,inputContainer:qe,inputWrapperOrder:Ne,withAsterisk:tt,labelProps:Ae,descriptionProps:gt,errorProps:Mt,wrapperProps:It,description:mt,label:Dt,error:nn,withErrorStyles:ke,__stylesApiProps:{...n,rightSectionPointerEvents:U||(st?"all":"none"),multiline:!0},pointer:!Re,onClick:()=>Re?qn.openDropdown():qn.toggleDropdown(),"data-expanded":qn.dropdownOpened||void 0,id:no,required:Va,mod:Sa,children:s.jsxs(zs.Group,{disabled:Z,unstyled:u,...Be("pillsList"),children:[Je,s.jsx(ct.EventsTarget,{autoComplete:Jo,children:s.jsx(pc.Field,{...es,ref:t,id:no,placeholder:un,type:!Re&&!un?"hidden":"visible",...Be("inputField"),unstyled:u,onFocus:Ke=>{P==null||P(Ke),Re&&qn.openDropdown()},onBlur:Ke=>{I==null||I(Ke),qn.closeDropdown(),Ee("")},onKeyDown:Ze,value:re,onChange:Ke=>{Ee(Ke.currentTarget.value),Re&&qn.openDropdown(),T&&qn.selectFirstOption()},disabled:Z,readOnly:G||!Re,pointer:!Re})})]})})}),s.jsx(b7,{data:ge?Ye:Fa,hidden:G||Z,filter:M,search:re,limit:L,hiddenWhenEmpty:!Ge,withScrollArea:$,maxDropdownHeight:V,filterOptions:Re,value:F,checkIconPosition:me,withCheckIcon:Te,nothingFoundMessage:Ge,unstyled:u,labelId:Dt?`${no}-label`:void 0,"aria-label":Dt?void 0:mi["aria-label"],renderOption:pi,scrollAreaProps:Kr})]}),s.jsx(ct.HiddenInput,{name:Se,valuesDivider:wt,value:F,form:$e,disabled:Z,..._t})]})});Pp.classes={...Pr.classes,...ct.classes};Pp.displayName="@mantine/core/MultiSelect";function iL(e){return"group"in e}function C0({data:e}){if(iL(e)){const a=e.items.map(o=>s.jsx(C0,{data:o},o.value));return s.jsx("optgroup",{label:e.group,children:a})}const{value:t,label:n,...r}=e;return s.jsx("option",{value:e.value,...r,children:e.label},e.value)}C0.displayName="@mantine/core/NativeSelectOption";const oL={rightSectionPointerEvents:"none"},ln=ve((e,t)=>{const{data:n,children:r,size:a,error:o,rightSection:c,unstyled:u,...f}=se("NativeSelect",oL,e),p=M2(n).map((m,g)=>s.jsx(C0,{data:m},g));return s.jsx(Pr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:a,pointer:!0,error:o,unstyled:u,rightSection:c||s.jsx(xp,{size:a,error:o,unstyled:u}),children:r||p})});ln.classes=Pr.classes;ln.displayName="@mantine/core/NativeSelect";var pD={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const sL={withCloseButton:!0},lL=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Vt(t),"--notification-color":n?Ht(n,e):void 0}}),E0=ve((e,t)=>{const n=se("Notification",sL,e),{className:r,color:a,radius:o,loading:c,withCloseButton:u,withBorder:f,title:p,icon:m,children:g,onClose:v,closeButtonProps:b,classNames:S,style:j,styles:C,unstyled:R,variant:D,vars:E,mod:T,loaderProps:A,role:k,...M}=n,L=Ie({name:"Notification",classes:pD,props:n,className:r,style:j,classNames:S,styles:C,unstyled:R,vars:E,varsResolver:lL});return s.jsxs(ce,{...L("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},T],ref:t,variant:D,role:k||"alert",...M,children:[m&&!c&&s.jsx("div",{...L("icon"),children:m}),c&&s.jsx(_r,{size:28,color:a,...A,...L("loader")}),s.jsxs("div",{...L("body"),children:[p&&s.jsx("div",{...L("title"),children:p}),s.jsx(ce,{...L("description"),mod:{"data-with-title":!!p},children:g})]}),u&&s.jsx(Go,{iconSize:16,color:"gray",...b,unstyled:R,onClick:v,...L("closeButton")})]})});E0.classes=pD;E0.displayName="@mantine/core/Notification";function mD(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}var ed;(function(e){e.event="event",e.props="prop"})(ed||(ed={}));function Lo(){}function cL(e){var t,n=void 0;return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return t&&r.length===t.length&&r.every(function(o,c){return o===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function td(e){return!!(e||"").match(/\d/)}function ac(e){return e==null}function uL(e){return typeof e=="number"&&isNaN(e)}function gD(e){return ac(e)||uL(e)||typeof e=="number"&&!isFinite(e)}function vD(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function dL(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function fL(e,t,n){var r=dL(n),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(r,"$1"+t)}function hL(e){var t=y.useRef(e);t.current=e;var n=y.useRef(function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return t.current.apply(t,r)});return n.current}function T0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var a=e.split("."),o=a[0],c=a[1]||"";return{beforeDecimal:o,afterDecimal:c,hasNegation:n,addNegation:r}}function pL(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",a=n[1]||"";return(t?"-":"")+r+(a?"."+a:"")}function yD(e,t,n){for(var r="",a=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||a;return r}function $C(e,t){return Array(t+1).join(e)}function xD(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),a=r[0],o=r[1];if(o=Number(o),!o)return n+a;a=a.replace(".","");var c=1+o,u=a.length;return c<0?a="0."+$C("0",Math.abs(c))+a:c>=u?a=a+$C("0",c-u):a=(a.substring(0,c)||"0")+"."+a.substring(c),n+a}function UC(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,a=T0(e),o=a.beforeDecimal,c=a.afterDecimal,u=a.hasNegation,f=parseFloat("0."+(c||"0")),p=c.length<=t?"0."+c:f.toFixed(t),m=p.split("."),g=o;o&&Number(m[0])&&(g=o.split("").reverse().reduce(function(j,C,R){return j.length>R?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var v=yD(m[1]||"",t,n),b=u?"-":"",S=r?".":"";return""+b+g+S+v}function Cs(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 bD=cL(function(e,t){for(var n=0,r=0,a=e.length,o=t.length;e[n]===t[n]&&n<a;)n++;for(;e[a-1-r]===t[o-1-r]&&o-r>n&&a-r>n;)r++;return{from:{start:n,end:a-r},to:{start:n,end:o-r}}}),mL=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function gL(e,t,n){return Math.min(Math.max(e,t),n)}function Iv(e){return Math.max(e.selectionStart,e.selectionEnd)}function vL(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function yL(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function xL(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,a=e.formattedValueIndex;return t[r]===n[a]}function bL(e,t,n,r,a,o,c){c===void 0&&(c=xL);var u=a.findIndex(function(T){return T}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var p=n.length,m=e.length,g={},v=new Array(p),b=0;b<p;b++){v[b]=-1;for(var S=0,j=m;S<j;S++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:S});if(C&&g[S]!==!0){v[b]=S,g[S]=!0;break}}}for(var R=r;R<p&&(v[R]===-1||!o(n[R]));)R++;var D=R===p||v[R]===-1?m:v[R];for(R=r-1;R>0&&v[R]===-1;)R--;var E=R===-1||v[R]===-1?0:v[R]+1;return E>D?D:r-E<D-r?E:D}function BC(e,t,n,r){var a=e.length;if(t=gL(t,0,a),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=a&&!n[t];)t++;t>a&&(t=n.lastIndexOf(!0))}return t===-1&&(t=a),t}function SL(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(td(e[n])||td(e[n-1]));return t}function SD(e,t,n,r,a,o){o===void 0&&(o=Lo);var c=hL(function(S,j){var C,R;return gD(S)?(R="",C=""):typeof S=="number"||j?(R=typeof S=="number"?xD(S):S,C=r(R)):(R=a(S,void 0),C=r(R)),{formattedValue:C,numAsString:R}}),u=y.useState(function(){return c(ac(e)?t:e,n)}),f=u[0],p=u[1],m=function(S,j){S.formattedValue!==f.formattedValue&&p({formattedValue:S.formattedValue,numAsString:S.value}),o(S,j)},g=e,v=n;ac(e)&&(g=f.numAsString,v=!0);var b=c(g,v);return y.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function wL(e){return e.replace(/[^0-9]/g,"")}function jL(e){return e}function CL(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,a=e.renderText,o=e.getInputRef,c=e.format;c===void 0&&(c=jL);var u=e.removeFormatting;u===void 0&&(u=wL);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,v=e.onChange;v===void 0&&(v=Lo);var b=e.onKeyDown;b===void 0&&(b=Lo);var S=e.onMouseUp;S===void 0&&(S=Lo);var j=e.onFocus;j===void 0&&(j=Lo);var C=e.onBlur;C===void 0&&(C=Lo);var R=e.value,D=e.getCaretBoundary;D===void 0&&(D=SL);var E=e.isValidInputCharacter;E===void 0&&(E=td);var T=e.isCharacterSame,A=mD(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),k=SD(R,f,!!p,c,u,m),M=k[0],L=M.formattedValue,$=M.numAsString,V=k[1],Y=y.useRef(),Q=y.useRef({formattedValue:L,numAsString:$}),J=function(Ce,Re){Q.current={formattedValue:Ce.formattedValue,numAsString:Ce.value},V(Ce,Re)},G=y.useState(!1),Z=G[0],P=G[1],I=y.useRef(null),z=y.useRef({setCaretTimeout:null,focusTimeout:null});y.useEffect(function(){return P(!0),function(){clearTimeout(z.current.setCaretTimeout),clearTimeout(z.current.focusTimeout)}},[]);var H=c,O=function(Ce,Re){var Ge=parseFloat(Re);return{formattedValue:Ce,value:Re,floatValue:isNaN(Ge)?void 0:Ge}},U=function(Ce,Re,Ge){Ce.selectionStart===0&&Ce.selectionEnd===Ce.value.length||(Cs(Ce,Re),z.current.setCaretTimeout=setTimeout(function(){Ce.value===Ge&&Ce.selectionStart!==Re&&Cs(Ce,Re)},0))},K=function(Ce,Re,Ge){return BC(Ce,Re,D(Ce),Ge)},ee=function(Ce,Re,Ge){var Te=D(Re),me=bL(Re,L,Ce,Ge,Te,E,T);return me=BC(Re,me,Te),me},be=function(Ce){var Re=Ce.formattedValue;Re===void 0&&(Re="");var Ge=Ce.input,Te=Ce.source,me=Ce.event,ge=Ce.numAsString,ke;if(Ge){var Se=Ce.inputValue||Ge.value,$e=Iv(Ge);Ge.value=Re,ke=ee(Se,Re,$e),ke!==void 0&&U(Ge,ke,Re)}Re!==L&&J(O(Re,ge),{event:me,source:Te})};y.useEffect(function(){var Ce=Q.current,Re=Ce.formattedValue,Ge=Ce.numAsString;(L!==Re||$!==Ge)&&J(O(L,$),{event:void 0,source:ed.props})},[L,$]);var xe=I.current?Iv(I.current):void 0,ye=typeof window<"u"?y.useLayoutEffect:y.useEffect;ye(function(){var Ce=I.current;if(L!==Q.current.formattedValue&&Ce){var Re=ee(Q.current.formattedValue,L,xe);Ce.value=L,U(Ce,Re,L)}},[L]);var qe=function(Ce,Re,Ge){var Te=Re.target,me=Y.current?mL(Y.current,Te.selectionEnd):bD(L,Ce),ge=Object.assign(Object.assign({},me),{lastValue:L}),ke=u(Ce,ge),Se=H(ke);if(ke=u(Se,void 0),g&&!g(O(Se,ke))){var $e=Re.target,vt=Iv($e),ft=ee(Ce,L,vt);return $e.value=L,U($e,ft,L),!1}return be({formattedValue:Se,numAsString:ke,inputValue:Ce,event:Re,source:Ge,input:Re.target}),!0},Ne=function(Ce,Re){Re===void 0&&(Re=0);var Ge=Ce.selectionStart,Te=Ce.selectionEnd;Y.current={selectionStart:Ge,selectionEnd:Te+Re}},tt=function(Ce){var Re=Ce.target,Ge=Re.value,Te=qe(Ge,Ce,ed.event);Te&&v(Ce),Y.current=void 0},Ae=function(Ce){var Re=Ce.target,Ge=Ce.key,Te=Re.selectionStart,me=Re.selectionEnd,ge=Re.value;ge===void 0&&(ge="");var ke;Ge==="ArrowLeft"||Ge==="Backspace"?ke=Math.max(Te-1,0):Ge==="ArrowRight"?ke=Math.min(Te+1,ge.length):Ge==="Delete"&&(ke=Te);var Se=0;Ge==="Delete"&&Te===me&&(Se=1);var $e=Ge==="ArrowLeft"||Ge==="ArrowRight";if(ke===void 0||Te!==me&&!$e){b(Ce),Ne(Re,Se);return}var vt=ke;if($e){var ft=Ge==="ArrowLeft"?"left":"right";vt=K(ge,ke,ft),vt!==ke&&Ce.preventDefault()}else Ge==="Delete"&&!E(ge[ke])?vt=K(ge,ke,"right"):Ge==="Backspace"&&!E(ge[ke])&&(vt=K(ge,ke,"left"));vt!==ke&&U(Re,vt,ge),b(Ce),Ne(Re,Se)},gt=function(Ce){var Re=Ce.target,Ge=function(){var Te=Re.selectionStart,me=Re.selectionEnd,ge=Re.value;if(ge===void 0&&(ge=""),Te===me){var ke=K(ge,Te);ke!==Te&&U(Re,ke,ge)}};Ge(),requestAnimationFrame(function(){Ge()}),S(Ce),Ne(Re)},Mt=function(Ce){Ce.persist&&Ce.persist();var Re=Ce.target,Ge=Ce.currentTarget;I.current=Re,z.current.focusTimeout=setTimeout(function(){var Te=Re.selectionStart,me=Re.selectionEnd,ge=Re.value;ge===void 0&&(ge="");var ke=K(ge,Te);ke!==Te&&!(Te===0&&me===ge.length)&&U(Re,ke,ge),j(Object.assign(Object.assign({},Ce),{currentTarget:Ge}))},0)},It=function(Ce){I.current=null,clearTimeout(z.current.focusTimeout),clearTimeout(z.current.setCaretTimeout),C(Ce)},mt=Z&&vL()?"numeric":void 0,Dt=Object.assign({inputMode:mt},A,{type:t,value:L,onChange:tt,onKeyDown:Ae,onMouseUp:gt,onFocus:Mt,onBlur:It});if(n==="text")return a?Cn.createElement(Cn.Fragment,null,a(L,A)||null):Cn.createElement("span",Object.assign({},A,{ref:o}),L);if(r){var nn=r;return Cn.createElement(nn,Object.assign({},Dt,{ref:o}))}return Cn.createElement("input",Object.assign({},Dt,{ref:o}))}function VC(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var o=t.suffix;o===void 0&&(o="");var c=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=Np(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,v=T0(e,c),b=v.beforeDecimal,S=v.afterDecimal,j=v.addNegation;return n!==void 0&&(S=yD(S,n,!!r)),p&&(b=fL(b,p,u)),a&&(b=a+b),o&&(S=S+o),j&&(b="-"+b),e=b+(g&&m||"")+S,e}function Np(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 EL(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),a=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),a&&!o&&t&&(e="-"+e),e}function TL(e,t){return new RegExp("(^-)|[0-9]|"+vD(e),"g")}function RL(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function DL(e,t,n){var r;t===void 0&&(t=yL(e));var a=n.allowNegative,o=n.prefix;o===void 0&&(o="");var c=n.suffix;c===void 0&&(c="");var u=n.decimalScale,f=t.from,p=t.to,m=p.start,g=p.end,v=Np(n),b=v.allowedDecimalSeparators,S=v.decimalSeparator,j=e[g]===S;if(td(e)&&(e===o||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=u===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var R=function(I,z,H){var O=!1,U=!1;o.startsWith("-")?O=!1:I.startsWith("--")?(O=!1,U=!0):c.startsWith("-")&&I.length===c.length?O=!1:I[0]==="-"&&(O=!0);var K=O?1:0;return U&&(K=2),K&&(I=I.substring(K),z-=K,H-=K),{value:I,start:z,end:H,hasNegation:O}},D=R(e,m,g),E=D.hasNegation;r=D,e=r.value,m=r.start,g=r.end;var T=R(t.lastValue,f.start,f.end),A=T.start,k=T.end,M=T.value,L=e.substring(m,g);e.length&&M.length&&(A>M.length-c.length||k<o.length)&&!(L&&c.startsWith(L))&&(e=M);var $=0;e.startsWith(o)?$+=o.length:m<o.length&&($=m),e=e.substring($),g-=$;var V=e.length,Y=e.length-c.length;e.endsWith(c)?V=Y:(g>Y||g>e.length-c.length)&&(V=g),e=e.substring(0,V),e=EL(E?"-"+e:e,a),e=(e.match(TL(S))||[]).join("");var Q=e.indexOf(S);e=e.replace(new RegExp(vD(S),"g"),function(I,z){return z===Q?".":""});var J=T0(e,a),G=J.beforeDecimal,Z=J.afterDecimal,P=J.addNegation;return p.end-p.start<f.end-f.start&&G===""&&j&&!parseFloat(Z)&&(e=P?"-":""),e}function AL(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var a=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";a.fill(!1,0,n.length+(o?1:0));var c=e.length;return a.fill(!1,c-r.length+1,c+1),a}function _L(e){var t=Np(e),n=t.thousandSeparator,r=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
69
- Decimal separator can't be same as thousand separator.
70
- thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
71
- decimalSeparator: `+r+` (default value for decimalSeparator is .)
72
- `);return a.startsWith("-")&&o&&(console.error(`
73
- Prefix can't start with '-' when allowNegative is true.
74
- prefix: `+a+`
75
- allowNegative: `+o+`
76
- `),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function kL(e){e=_L(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,a=e.onKeyDown;a===void 0&&(a=Lo);var o=e.onBlur;o===void 0&&(o=Lo);var c=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var m=e.defaultValue,g=e.value,v=e.valueIsNumericString,b=e.onValueChange,S=mD(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Np(e),C=j.decimalSeparator,R=j.allowedDecimalSeparators,D=function(P){return VC(P,e)},E=function(P,I){return DL(P,I,e)},T=ac(g)?m:g,A=v??RL(T,p,t);ac(g)?ac(m)||(A=A||typeof m=="number"):A=A||typeof g=="number";var k=function(P){return gD(P)?P:(typeof P=="number"&&(P=xD(P)),A&&typeof u=="number"?UC(P,u,!!f):P)},M=SD(k(g),k(m),!!A,D,E,b),L=M[0],$=L.numAsString,V=L.formattedValue,Y=M[1],Q=function(P){var I=P.target,z=P.key,H=I.selectionStart,O=I.selectionEnd,U=I.value;if(U===void 0&&(U=""),(z==="Backspace"||z==="Delete")&&O<p.length){P.preventDefault();return}if(H!==O){a(P);return}z==="Backspace"&&U[0]==="-"&&H===p.length+1&&n&&Cs(I,1),u&&f&&(z==="Backspace"&&U[H-1]===C?(Cs(I,H-1),P.preventDefault()):z==="Delete"&&U[H]===C&&P.preventDefault()),R!=null&&R.includes(z)&&U[H]===C&&Cs(I,H+1);var K=c===!0?",":c;z==="Backspace"&&U[H-1]===K&&Cs(I,H-1),z==="Delete"&&U[H]===K&&Cs(I,H+1),a(P)},J=function(P){var I=$;if(I.match(/\d/g)||(I=""),r||(I=pL(I)),f&&u&&(I=UC(I,u,f)),I!==$){var z=VC(I,e);Y({formattedValue:z,value:I,floatValue:parseFloat(I)},{event:P,source:ed.event})}o(P)},G=function(P){return P===C?!0:td(P)},Z=function(P){var I=P.currentValue,z=P.lastValue,H=P.formattedValue,O=P.currentValueIndex,U=P.formattedValueIndex,K=I[O],ee=H[U],be=bD(z,I),xe=be.to,ye=function(qe){return E(qe).indexOf(".")+p.length};return g===0&&f&&u&&I[xe.start]===C&&ye(I)<O&&ye(H)>U?!1:O>=xe.start&&O<xe.end&&R&&R.includes(K)&&ee===C?!0:K===ee};return Object.assign(Object.assign({},S),{value:V,valueIsNumericString:!1,isValidInputCharacter:G,isCharacterSame:Z,onValueChange:Y,format:D,removeFormatting:E,getCaretBoundary:function(P){return AL(P,e)},onKeyDown:Q,onBlur:J})}function PL(e){var t=kL(e);return Cn.createElement(CL,Object.assign({},t))}function FC({direction:e,style:t,...n}){return s.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:e==="up"?"rotate(180deg)":void 0,...t},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:s.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var Ty={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const NL=/^(0\.0*|-0(\.0*)?)$/,OL=/^-?0\d+(\.\d+)?\.?$/;function Ry(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function Lv(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Ry(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function ML(e){return e.toString().replace(".","").length}function IL(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&ML(t)<14&&t!==""}function HC(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,a=n===void 0||e<=n;return r&&a}const LL={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},zL=(e,{size:t})=>({controls:{"--ni-chevron-size":rt(t,"ni-chevron-size")}});function $L(e,t,n){const r=e.toString().replace(/^0+/,""),a=parseFloat(r);return Number.isNaN(a)?r:a>Number.MAX_SAFE_INTEGER?t!==void 0?String(t):r:ph(a,n,t)}const Op=ve((e,t)=>{const n=se("NumberInput",LL,e),{className:r,classNames:a,styles:o,unstyled:c,vars:u,onChange:f,onValueChange:p,value:m,defaultValue:g,max:v,min:b,step:S,hideControls:j,rightSection:C,isAllowed:R,clampBehavior:D,onBlur:E,allowDecimal:T,decimalScale:A,onKeyDown:k,onKeyDownCapture:M,handlersRef:L,startValue:$,disabled:V,rightSectionPointerEvents:Y,allowNegative:Q,readOnly:J,size:G,rightSectionWidth:Z,stepHoldInterval:P,stepHoldDelay:I,allowLeadingZeros:z,withKeyboardEvents:H,trimLeadingZeroesOnBlur:O,...U}=n,K=Ie({name:"NumberInput",classes:Ty,props:n,classNames:a,styles:o,unstyled:c,vars:u,varsResolver:zL}),{resolvedClassNames:ee,resolvedStyles:be}=Ws({classNames:a,styles:o,props:n}),[xe,ye]=Yn({value:m,defaultValue:g,finalValue:"",onChange:f}),qe=I!==void 0&&P!==void 0,Ne=y.useRef(null),tt=y.useRef(null),Ae=y.useRef(0),gt=(Se,$e)=>{$e.source==="event"&&ye(IL(Se.floatValue,Se.value)&&!NL.test(Se.value)&&!(z&&OL.test(Se.value))?Se.floatValue:Se.value),p==null||p(Se,$e)},Mt=Se=>{const $e=String(Se).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return $e?Math.max(0,($e[1]?$e[1].length:0)-($e[2]?+$e[2]:0)):0},It=Se=>{Ne.current&&typeof Se<"u"&&Ne.current.setSelectionRange(Se,Se)},mt=y.useRef(Eh);mt.current=()=>{if(!Lv(xe))return;let Se;const $e=Mt(xe),vt=Mt(S),ft=Math.max($e,vt),Gt=10**ft;if(!Ry(xe)&&(typeof xe!="number"||Number.isNaN(xe)))Se=ph($,b,v);else if(v!==void 0){const un=(Math.round(Number(xe)*Gt)+Math.round(S*Gt))/Gt;Se=un<=v?un:v}else Se=(Math.round(Number(xe)*Gt)+Math.round(S*Gt))/Gt;const _t=Se.toFixed(ft);ye(parseFloat(_t)),p==null||p({floatValue:parseFloat(_t),formattedValue:_t,value:_t},{source:"increment"}),setTimeout(()=>{var un;return It((un=Ne.current)==null?void 0:un.value.length)},0)};const Dt=y.useRef(Eh);Dt.current=()=>{if(!Lv(xe))return;let Se;const $e=b!==void 0?b:Q?Number.MIN_SAFE_INTEGER:0,vt=Mt(xe),ft=Mt(S),Gt=Math.max(vt,ft),_t=10**Gt;if(!Ry(xe)&&typeof xe!="number"||Number.isNaN(xe))Se=ph($,$e,v);else{const wt=(Math.round(Number(xe)*_t)-Math.round(S*_t))/_t;Se=$e!==void 0&&wt<$e?$e:wt}const un=Se.toFixed(Gt);ye(parseFloat(un)),p==null||p({floatValue:parseFloat(un),formattedValue:un,value:un},{source:"decrement"}),setTimeout(()=>{var wt;return It((wt=Ne.current)==null?void 0:wt.value.length)},0)};const nn=Se=>{k==null||k(Se),!(J||!H)&&(Se.key==="ArrowUp"&&(Se.preventDefault(),mt.current()),Se.key==="ArrowDown"&&(Se.preventDefault(),Dt.current()))},Ce=Se=>{if(M==null||M(Se),Se.key==="Backspace"){const $e=Ne.current;$e.selectionStart===0&&$e.selectionStart===$e.selectionEnd&&(Se.preventDefault(),window.setTimeout(()=>It(0),0))}},Re=Se=>{let $e=xe;D==="blur"&&typeof $e=="number"&&($e=ph($e,b,v)),O&&typeof $e=="string"&&Mt($e)<15&&($e=$L($e,v,b)),xe!==$e&&ye($e),E==null||E(Se)};Ku(L,{increment:mt.current,decrement:Dt.current});const Ge=Se=>{Se?mt.current():Dt.current(),Ae.current+=1},Te=Se=>{if(Ge(Se),qe){const $e=typeof P=="number"?P:P(Ae.current);tt.current=window.setTimeout(()=>Te(Se),$e)}},me=(Se,$e)=>{var vt;Se.preventDefault(),(vt=Ne.current)==null||vt.focus(),Ge($e),qe&&(tt.current=window.setTimeout(()=>Te($e),I))},ge=()=>{tt.current&&window.clearTimeout(tt.current),tt.current=null,Ae.current=0},ke=s.jsxs("div",{...K("controls"),children:[s.jsx(tr,{...K("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof xe=="number"&&v!==void 0&&xe>=v,mod:{direction:"up"},onMouseDown:Se=>Se.preventDefault(),onPointerDown:Se=>{me(Se,!0)},onPointerUp:ge,onPointerLeave:ge,children:s.jsx(FC,{direction:"up"})}),s.jsx(tr,{...K("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof xe=="number"&&b!==void 0&&xe<=b,mod:{direction:"down"},onMouseDown:Se=>Se.preventDefault(),onPointerDown:Se=>{me(Se,!1)},onPointerUp:ge,onPointerLeave:ge,children:s.jsx(FC,{direction:"down"})})]});return s.jsx(Pr,{component:PL,allowNegative:Q,className:Ut(Ty.root,r),size:G,...U,readOnly:J,disabled:V,value:xe,getInputRef:zn(t,Ne),onValueChange:gt,rightSection:j||J||!Lv(xe)?C:C||ke,classNames:ee,styles:be,unstyled:c,__staticSelector:"NumberInput",decimalScale:T?A:0,onKeyDown:nn,onKeyDownCapture:Ce,rightSectionPointerEvents:Y??(V?"none":void 0),rightSectionWidth:Z??`var(--ni-right-section-width-${G||"sm"})`,allowLeadingZeros:z,onBlur:Re,isAllowed:Se=>D==="strict"?R?R(Se)&&HC(Se.floatValue,b,v):HC(Se.floatValue,b,v):R?R(Se):!0})});Op.classes={...Pr.classes,...Ty};Op.displayName="@mantine/core/NumberInput";const[UL,Mp]=vr("Pagination.Root component was not found in tree");var yd={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const BL={withPadding:!0},xd=ve((e,t)=>{const n=se("PaginationControl",BL,e),{classNames:r,className:a,style:o,styles:c,vars:u,active:f,disabled:p,withPadding:m,mod:g,...v}=n,b=Mp(),S=p||b.disabled;return s.jsx(tr,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...b.getStyles("control",{className:a,style:o,classNames:r,styles:c,active:!S}),...v})});xd.classes=yd;xd.displayName="@mantine/core/PaginationControl";function bd({style:e,children:t,path:n,...r}){return s.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...e},...r,children:s.jsx("path",{d:n,fill:"currentColor"})})}const VL=e=>s.jsx(bd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),FL=e=>s.jsx(bd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),HL=e=>s.jsx(bd,{...e,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),qL=e=>s.jsx(bd,{...e,path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"}),GL=e=>s.jsx(bd,{...e,path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}),QL={icon:GL},Ip=ve((e,t)=>{const n=se("PaginationDots",QL,e),{classNames:r,className:a,style:o,styles:c,vars:u,icon:f,...p}=n,m=Mp(),g=f;return s.jsx(ce,{ref:t,...m.getStyles("dots",{className:a,style:o,styles:c,classNames:r}),...p,children:s.jsx(g,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Ip.classes=yd;Ip.displayName="@mantine/core/PaginationDots";function Lp({icon:e,name:t,action:n,type:r}){const a={icon:e},o=y.forwardRef((c,u)=>{const{icon:f,...p}=se(t,a,c),m=f,g=Mp(),v=r==="next"?g.active===g.total:g.active===1;return s.jsx(xd,{disabled:g.disabled||v,ref:u,onClick:g[n],withPadding:!1,...p,children:s.jsx(m,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return o.displayName=`@mantine/core/${t}`,o}const wD=Lp({icon:VL,name:"PaginationNext",action:"onNext",type:"next"}),jD=Lp({icon:FL,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),CD=Lp({icon:HL,name:"PaginationFirst",action:"onFirst",type:"previous"}),ED=Lp({icon:qL,name:"PaginationLast",action:"onLast",type:"next"});function R0({dotsIcon:e}){const t=Mp(),n=t.range.map((r,a)=>{var o,c,u;return r==="dots"?s.jsx(Ip,{icon:e},a):s.jsx(xd,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(o=t.getItemProps)==null?void 0:o.call(t,r),children:((u=(c=t.getItemProps)==null?void 0:c.call(t,r))==null?void 0:u.children)??r},a)});return s.jsx(s.Fragment,{children:n})}R0.displayName="@mantine/core/PaginationItems";const WL={siblings:1,boundaries:1},YL=(e,{size:t,radius:n,color:r,autoContrast:a})=>({root:{"--pagination-control-radius":n===void 0?void 0:Vt(n),"--pagination-control-size":rt(t,"pagination-control-size"),"--pagination-control-fz":On(t),"--pagination-active-bg":r?Ht(r,e):void 0,"--pagination-active-color":Ys(a,e)?Gi({color:r,theme:e,autoContrast:a}):void 0}}),zp=ve((e,t)=>{const n=se("PaginationRoot",WL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,total:p,value:m,defaultValue:g,onChange:v,disabled:b,siblings:S,boundaries:j,color:C,radius:R,onNextPage:D,onPreviousPage:E,onFirstPage:T,onLastPage:A,getItemProps:k,autoContrast:M,...L}=n,$=Ie({name:"Pagination",classes:yd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:YL}),{range:V,setPage:Y,next:Q,previous:J,active:G,first:Z,last:P}=pN({page:m,initialPage:g,onChange:v,total:p,siblings:S,boundaries:j}),I=Rr(D,Q),z=Rr(E,J),H=Rr(T,Z),O=Rr(A,P);return s.jsx(UL,{value:{total:p,range:V,active:G,disabled:b,getItemProps:k,onChange:Y,onNext:I,onPrevious:z,onFirst:H,onLast:O,getStyles:$},children:s.jsx(ce,{ref:t,...$("root"),...L})})});zp.classes=yd;zp.displayName="@mantine/core/PaginationRoot";const KL={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},$a=ve((e,t)=>{const n=se("Pagination",KL,e),{withEdges:r,withControls:a,getControlProps:o,nextIcon:c,previousIcon:u,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:v,hideWithOnePage:b,withPages:S,...j}=n;return g<=0||b&&g===1?null:s.jsx(zp,{ref:t,total:g,...j,children:s.jsxs(je,{gap:v,children:[r&&s.jsx(CD,{icon:p,...o==null?void 0:o("first")}),a&&s.jsx(jD,{icon:u,...o==null?void 0:o("previous")}),S&&s.jsx(R0,{dotsIcon:m}),a&&s.jsx(wD,{icon:c,...o==null?void 0:o("next")}),r&&s.jsx(ED,{icon:f,...o==null?void 0:o("last")})]})})});$a.classes=yd;$a.displayName="@mantine/core/Pagination";$a.Root=zp;$a.Control=xd;$a.Dots=Ip;$a.First=CD;$a.Last=ED;$a.Next=wD;$a.Previous=jD;$a.Items=R0;const XL=({reveal:e})=>s.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:s.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var Dy={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const ZL={visibilityToggleIcon:XL},JL=(e,{size:t})=>({root:{"--psi-icon-size":rt(t,"psi-icon-size"),"--psi-button-size":rt(t,"psi-button-size")}}),Na=ve((e,t)=>{const n=se("PasswordInput",ZL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,required:p,error:m,leftSection:g,disabled:v,id:b,variant:S,inputContainer:j,description:C,label:R,size:D,errorProps:E,descriptionProps:T,labelProps:A,withAsterisk:k,inputWrapperOrder:M,wrapperProps:L,radius:$,rightSection:V,rightSectionWidth:Y,rightSectionPointerEvents:Q,leftSectionWidth:J,visible:G,defaultVisible:Z,onVisibilityChange:P,visibilityToggleIcon:I,visibilityToggleButtonProps:z,rightSectionProps:H,leftSectionProps:O,leftSectionPointerEvents:U,withErrorStyles:K,mod:ee,...be}=n,xe=yr(b),[ye,qe]=Yn({value:G,defaultValue:Z,finalValue:!1,onChange:P}),Ne=()=>qe(!ye),tt=Ie({name:"PasswordInput",classes:Dy,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:JL}),{resolvedClassNames:Ae,resolvedStyles:gt}=Ws({classNames:r,styles:c,props:n}),{styleProps:Mt,rest:It}=Qi(be),mt=I,Dt=(E==null?void 0:E.id)||`${xe}-error`,nn=(T==null?void 0:T.id)||`${xe}-description`,Ge=`${!!m&&typeof m!="boolean"?Dt:""} ${!!C?nn:""}`,Te=Ge.trim().length>0?Ge.trim():void 0,me=s.jsx(_n,{...tt("visibilityToggle"),disabled:v,radius:$,"aria-hidden":!z,tabIndex:-1,...z,variant:(z==null?void 0:z.variant)??"subtle",color:"gray",unstyled:u,onTouchEnd:ge=>{var ke;ge.preventDefault(),(ke=z==null?void 0:z.onTouchEnd)==null||ke.call(z,ge),Ne()},onMouseDown:ge=>{var ke;ge.preventDefault(),(ke=z==null?void 0:z.onMouseDown)==null||ke.call(z,ge),Ne()},onKeyDown:ge=>{var ke;(ke=z==null?void 0:z.onKeyDown)==null||ke.call(z,ge),ge.key===" "&&(ge.preventDefault(),Ne())},children:s.jsx(mt,{reveal:ye})});return s.jsx(mn.Wrapper,{required:p,id:xe,label:R,error:m,description:C,size:D,classNames:Ae,styles:gt,__staticSelector:"PasswordInput",unstyled:u,withAsterisk:k,inputWrapperOrder:M,inputContainer:j,variant:S,labelProps:{...A,htmlFor:xe},descriptionProps:{...T,id:nn},errorProps:{...E,id:Dt},mod:ee,...tt("root"),...Mt,...L,children:s.jsx(mn,{component:"div",error:m,leftSection:g,size:D,classNames:{...Ae,input:Ut(Dy.input,Ae.input)},styles:gt,radius:$,disabled:v,__staticSelector:"PasswordInput",rightSectionWidth:Y,rightSection:V??me,variant:S,unstyled:u,leftSectionWidth:J,rightSectionPointerEvents:Q||"all",rightSectionProps:H,leftSectionProps:O,leftSectionPointerEvents:U,withAria:!1,withErrorStyles:K,children:s.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...tt("innerInput"),disabled:v,id:xe,ref:t,...It,"aria-describedby":Te,autoComplete:It.autoComplete||"off",type:ye?"text":"password"})})})});Na.classes={...Pr.classes,...Dy};Na.displayName="@mantine/core/PasswordInput";const[e6,TD]=Hi(),[t6,n6]=Hi();var RD={card:"m_9dc8ae12"};const r6={withBorder:!0},a6=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),D0=ve((e,t)=>{const n=se("RadioCard",r6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,checked:p,mod:m,withBorder:g,value:v,onClick:b,name:S,onKeyDown:j,...C}=n,R=Ie({name:"RadioCard",classes:RD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:a6,rootSelector:"card"}),{dir:D}=Xs(),E=TD(),T=typeof p=="boolean"?p:(E==null?void 0:E.value)===v||!1,A=S||(E==null?void 0:E.name),k=M=>{if(j==null||j(M),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(M.nativeEvent.code)){M.preventDefault();const L=Array.from(document.querySelectorAll(`[role="radio"][name="${A||"__mantine"}"]`)),$=L.findIndex(Q=>Q===M.target),V=$+1>=L.length?0:$+1,Y=$-1<0?L.length-1:$-1;M.nativeEvent.code==="ArrowDown"&&(L[V].focus(),L[V].click()),M.nativeEvent.code==="ArrowUp"&&(L[Y].focus(),L[Y].click()),M.nativeEvent.code==="ArrowLeft"&&(L[D==="ltr"?Y:V].focus(),L[D==="ltr"?Y:V].click()),M.nativeEvent.code==="ArrowRight"&&(L[D==="ltr"?V:Y].focus(),L[D==="ltr"?V:Y].click())}};return s.jsx(t6,{value:{checked:T},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:T},m],...R("card"),...C,role:"radio","aria-checked":T,name:A,onClick:M=>{b==null||b(M),E==null||E.onChange(v||"")},onKeyDown:k})})});D0.displayName="@mantine/core/RadioCard";D0.classes=RD;const i6={},A0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:a,size:o,wrapperProps:c,children:u,name:f,readOnly:p,...m}=se("RadioGroup",i6,e),g=yr(f),[v,b]=Yn({value:n,defaultValue:r,finalValue:"",onChange:a}),S=j=>!p&&b(typeof j=="string"?j:j.currentTarget.value);return s.jsx(e6,{value:{value:v,onChange:S,size:o,name:g},children:s.jsx(mn.Wrapper,{size:o,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(t0,{role:"radiogroup",children:u})})})});A0.classes=mn.Wrapper.classes;A0.displayName="@mantine/core/RadioGroup";function DD({size:e,style:t,...n}){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:le(e),height:le(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var AD={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const o6={icon:DD},s6=(e,{radius:t,color:n,size:r,iconColor:a,variant:o,autoContrast:c})=>{const u=fa({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--radio-size":rt(r,"radio-size"),"--radio-radius":t===void 0?void 0:Vt(t),"--radio-color":o==="outline"?f:Ht(n,e),"--radio-icon-size":rt(r,"radio-icon-size"),"--radio-icon-color":a?Ht(a,e):Ys(c,e)?Gi({color:n,theme:e,autoContrast:c}):void 0}}},_0=ve((e,t)=>{const n=se("RadioIndicator",o6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,icon:p,radius:m,color:g,iconColor:v,autoContrast:b,checked:S,mod:j,variant:C,disabled:R,...D}=n,E=p,T=Ie({name:"RadioIndicator",classes:AD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:s6,rootSelector:"indicator"}),A=n6(),k=typeof S=="boolean"?S:(A==null?void 0:A.checked)||!1;return s.jsx(ce,{ref:t,...T("indicator",{variant:C}),variant:C,mod:[{checked:k,disabled:R},j],...D,children:s.jsx(E,{...T("icon")})})});_0.displayName="@mantine/core/RadioIndicator";_0.classes=AD;var _D={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const l6={labelPosition:"right"},c6=(e,{size:t,radius:n,color:r,iconColor:a,variant:o,autoContrast:c})=>{const u=fa({color:r||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--radio-size":rt(t,"radio-size"),"--radio-radius":n===void 0?void 0:Vt(n),"--radio-color":o==="outline"?f:Ht(r,e),"--radio-icon-color":a?Ht(a,e):Ys(c,e)?Gi({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":rt(t,"radio-icon-size")}}},$s=ve((e,t)=>{const n=se("Radio",l6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,id:p,size:m,label:g,labelPosition:v,description:b,error:S,radius:j,color:C,variant:R,disabled:D,wrapperProps:E,icon:T=DD,rootRef:A,iconColor:k,onChange:M,mod:L,...$}=n,V=Ie({name:"Radio",classes:_D,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:c6}),Y=TD(),Q=(Y==null?void 0:Y.size)??m,J=n.size?m:Q,{styleProps:G,rest:Z}=Qi($),P=yr(p),I=Y?{checked:Y.value===Z.value,name:Z.name??Y.name,onChange:z=>{Y.onChange(z),M==null||M(z)}}:{};return s.jsx(bp,{...V("root"),__staticSelector:"Radio",__stylesApiProps:n,id:P,size:J,labelPosition:v,label:g,description:b,error:S,disabled:D,classNames:r,styles:c,unstyled:u,"data-checked":I.checked||void 0,variant:R,ref:A,mod:L,...G,...E,children:s.jsxs(ce,{...V("inner"),mod:{"label-position":v},children:[s.jsx(ce,{...V("radio",{focusable:!0,variant:R}),onChange:M,...Z,...I,component:"input",mod:{error:!!S},ref:t,id:P,disabled:D,type:"radio"}),s.jsx(T,{...V("icon"),"aria-hidden":!0})]})})});$s.classes=_D;$s.displayName="@mantine/core/Radio";$s.Group=A0;$s.Card=D0;$s.Indicator=_0;const u6={duration:100,transition:"fade"};function d6(e,t){return{...u6,...t,...e}}function f6({offset:e,position:t,defaultOpened:n}){const[r,a]=y.useState(n),o=y.useRef(null),{x:c,y:u,elements:f,refs:p,update:m,placement:g}=Dx({placement:t,middleware:[Cx({crossAxis:!0,padding:5,rootBoundary:"document"})]}),v=g.includes("right")?e:t.includes("left")?e*-1:0,b=g.includes("bottom")?e:t.includes("top")?e*-1:0,S=y.useCallback(({clientX:j,clientY:C})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+v,top:C+b,right:j,bottom:C}}})},[f.reference]);return y.useEffect(()=>{if(p.floating.current){const j=o.current;j.addEventListener("mousemove",S);const C=Ii(p.floating.current);return C.forEach(R=>{R.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(R=>{R.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:u,opened:r,setOpened:a,boundaryRef:o,floating:p.setFloating}}var $p={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const h6={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Wr("popover")},p6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Vt(t),"--tooltip-bg":n?Ht(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),k0=ve((e,t)=>{const n=se("TooltipFloating",h6,e),{children:r,refProp:a,withinPortal:o,style:c,className:u,classNames:f,styles:p,unstyled:m,radius:g,color:v,label:b,offset:S,position:j,multiline:C,zIndex:R,disabled:D,defaultOpened:E,variant:T,vars:A,portalProps:k,...M}=n,L=Sn(),$=Ie({name:"TooltipFloating",props:n,classes:$p,className:u,style:c,classNames:f,styles:p,unstyled:m,rootSelector:"tooltip",vars:A,varsResolver:p6}),{handleMouseMove:V,x:Y,y:Q,opened:J,boundaryRef:G,floating:Z,setOpened:P}=f6({offset:S,position:j,defaultOpened:E});if(!Fi(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const I=zn(G,op(r),t),z=r.props,H=U=>{var K;(K=z.onMouseEnter)==null||K.call(z,U),V(U),P(!0)},O=U=>{var K;(K=z.onMouseLeave)==null||K.call(z,U),P(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(qo,{...k,withinPortal:o,children:s.jsx(ce,{...M,...$("tooltip",{style:{...wR(c,L),zIndex:R,display:!D&&J?"block":"none",top:(Q&&Math.round(Q))??"",left:(Y&&Math.round(Y))??""}}),variant:T,ref:Z,mod:{multiline:C},children:b})}),y.cloneElement(r,{...z,[a]:I,onMouseEnter:H,onMouseLeave:O})]})});k0.classes=$p;k0.displayName="@mantine/core/TooltipFloating";const kD=y.createContext(!1),m6=kD.Provider,g6=()=>y.useContext(kD),v6={openDelay:0,closeDelay:0};function P0(e){const{openDelay:t,closeDelay:n,children:r}=se("TooltipGroup",v6,e);return s.jsx(m6,{value:!0,children:s.jsx(GM,{delay:{open:t,close:n},children:r})})}P0.displayName="@mantine/core/TooltipGroup";P0.extend=e=>e;function y6(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 x6(e){const t=y6(e.middlewares),n=[UR(e.offset)];return t.shift&&n.push(Cx(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?kh():kh(t.flip)),n.push(BR({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Gu():Gu(t.inline)):e.inline&&n.push(Gu()),n}function b6(e){var k,M,L;const[t,n]=y.useState(e.defaultOpened),a=typeof e.opened=="boolean"?e.opened:t,o=g6(),c=yr(),u=y.useCallback($=>{n($),$&&D(c)},[c]),{x:f,y:p,context:m,refs:g,update:v,placement:b,middlewareData:{arrow:{x:S,y:j}={}}}=Dx({strategy:e.strategy,placement:e.position,open:a,onOpenChange:u,middleware:x6(e)}),{delay:C,currentId:R,setCurrentId:D}=QM(m,{id:c}),{getReferenceProps:E,getFloatingProps:T}=e9([HM(m,{enabled:(k=e.events)==null?void 0:k.hover,delay:o?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((M=e.events)!=null&&M.touch)}),JM(m,{enabled:(L=e.events)==null?void 0:L.focus,visibleOnly:!0}),n9(m,{role:"tooltip"}),XM(m,{enabled:typeof e.opened>"u"})]);h2({opened:a,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),zi(()=>{var $;($=e.onPositionChange)==null||$.call(e,b)},[b]);const A=a&&R&&R!==c;return{x:f,y:p,arrowX:S,arrowY:j,reference:g.setReference,floating:g.setFloating,getFloatingProps:T,getReferenceProps:E,isGroupPhase:A,opened:a,placement:b}}const qC={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Wr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},S6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Vt(t),"--tooltip-bg":n?Ht(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Js=ve((e,t)=>{const n=se("Tooltip",qC,e),{children:r,position:a,refProp:o,label:c,openDelay:u,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:v,radius:b,color:S,classNames:j,styles:C,unstyled:R,style:D,className:E,withArrow:T,arrowSize:A,arrowOffset:k,arrowRadius:M,arrowPosition:L,offset:$,transitionProps:V,multiline:Y,events:Q,zIndex:J,disabled:G,positionDependencies:Z,onClick:P,onMouseEnter:I,onMouseLeave:z,inline:H,variant:O,keepMounted:U,vars:K,portalProps:ee,mod:be,floatingStrategy:xe,middlewares:ye,...qe}=se("Tooltip",qC,n),{dir:Ne}=Xs(),tt=y.useRef(null),Ae=b6({position:o2(Ne,a),closeDelay:f,openDelay:u,onPositionChange:p,opened:m,defaultOpened:g,events:Q,arrowRef:tt,arrowOffset:k,offset:typeof $=="number"?$+(T?A/2:0):$,positionDependencies:[...Z,r],inline:H,strategy:xe,middlewares:ye}),gt=Ie({name:"Tooltip",props:n,classes:$p,className:E,style:D,classNames:j,styles:C,unstyled:R,rootSelector:"tooltip",vars:K,varsResolver:S6});if(!Fi(r))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Mt=zn(Ae.reference,op(r),t),It=d6(V,{duration:100,transition:"fade"}),mt=r.props;return s.jsxs(s.Fragment,{children:[s.jsx(qo,{...ee,withinPortal:v,children:s.jsx(di,{...It,keepMounted:U,mounted:!G&&!!Ae.opened,duration:Ae.isGroupPhase?10:It.duration,children:Dt=>s.jsxs(ce,{...qe,"data-fixed":xe==="fixed"||void 0,variant:O,mod:[{multiline:Y},be],...Ae.getFloatingProps({ref:Ae.floating,className:gt("tooltip").className,style:{...gt("tooltip").style,...Dt,zIndex:J,top:Ae.y??0,left:Ae.x??0}}),children:[c,s.jsx(Px,{ref:tt,arrowX:Ae.arrowX,arrowY:Ae.arrowY,visible:T,position:Ae.placement,arrowSize:A,arrowOffset:k,arrowRadius:M,arrowPosition:L,...gt("arrow")})]})})}),y.cloneElement(r,Ae.getReferenceProps({onClick:P,onMouseEnter:I,onMouseLeave:z,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:Ut(E,mt.className),...mt,[o]:Mt}))]})});Js.classes=$p;Js.displayName="@mantine/core/Tooltip";Js.Floating=k0;Js.Group=P0;function w6({size:e,thickness:t,sum:n,value:r,root:a,offset:o}){const c=(e*.9-t*2)/2,u=Math.PI*c*2/100,f=a||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:a?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:a?0:o||0}}function PD({size:e,value:t,offset:n,sum:r,thickness:a,root:o,color:c,lineRoundCaps:u,tooltip:f,getStyles:p,display:m,...g}){const v=Sn();return s.jsx(Js.Floating,{disabled:!f,label:f,children:s.jsx(ce,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Ht(c,v):void 0},fill:"none",strokeLinecap:u?"round":"butt",...w6({sum:r,size:e,thickness:a,value:t,offset:n,root:o})})})}PD.displayName="@mantine/core/Curve";function j6({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:a}){const o=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let u=c;const f=[],p=[];for(let m=0;m<n.length;m+=1)f.push({sum:o,offset:u,data:n[m],root:!1}),u-=n[m].value/100*c;if(f.push({sum:o,offset:u,data:{color:a},root:!0}),p.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){p.push({...f[0],lineRoundCaps:r}),p.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)p.push({...f[m],lineRoundCaps:!1})}else p.push({...f[0],lineRoundCaps:r});return p}var ND={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function C6(e,t){return Math.min(e||12,(t||120)/4)}const E6={size:120,thickness:12},T6=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":le(t),"--rp-label-offset":le(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Up=ve((e,t)=>{const n=se("RingProgress",E6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,label:p,sections:m,size:g,thickness:v,roundCaps:b,rootColor:S,transitionDuration:j,...C}=n,R=Ie({name:"RingProgress",classes:ND,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:T6}),D=C6(v,g),E=j6({size:g,thickness:D,sections:m,renderRoundedLineCaps:b,rootColor:S}).map(({data:T,sum:A,root:k,lineRoundCaps:M,offset:L},$)=>y.createElement(PD,{...T,key:$,size:g,thickness:D,sum:A,offset:L,color:T==null?void 0:T.color,root:k,lineRoundCaps:M,getStyles:R}));return s.jsxs(ce,{...R("root"),size:g,ref:t,...C,children:[s.jsx("svg",{...R("svg"),children:E}),p&&s.jsx("div",{...R("label"),children:p})]})});Up.classes=ND;Up.displayName="@mantine/core/RingProgress";var OD={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const R6={withItemsBorders:!0},D6=(e,{radius:t,color:n,transitionDuration:r,size:a,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:Vt(t),"--sc-color":n?Ht(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":o,"--sc-padding":rt(a,"sc-padding"),"--sc-font-size":On(a)}}),Bp=ve((e,t)=>{var Ne,tt;const n=se("SegmentedControl",R6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,data:p,value:m,defaultValue:g,onChange:v,size:b,name:S,disabled:j,readOnly:C,fullWidth:R,orientation:D,radius:E,color:T,transitionDuration:A,transitionTimingFunction:k,variant:M,autoContrast:L,withItemsBorders:$,mod:V,...Y}=n,Q=Ie({name:"SegmentedControl",props:n,classes:OD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:D6}),J=Sn(),G=p.map(Ae=>typeof Ae=="string"?{label:Ae,value:Ae}:Ae),Z=bN(),[P,I]=y.useState(Th()),[z,H]=y.useState(null),[O,U]=y.useState({}),K=(Ae,gt)=>{O[gt]=Ae,U(O)},[ee,be]=Yn({value:m,defaultValue:g,finalValue:Array.isArray(p)?((Ne=G.find(Ae=>!Ae.disabled))==null?void 0:Ne.value)??((tt=p[0])==null?void 0:tt.value)??null:null,onChange:v}),xe=yr(S),ye=G.map(Ae=>y.createElement(ce,{...Q("control"),mod:{active:ee===Ae.value,orientation:D},key:Ae.value},y.createElement("input",{...Q("input"),disabled:j||Ae.disabled,type:"radio",name:xe,value:Ae.value,id:`${xe}-${Ae.value}`,checked:ee===Ae.value,onChange:()=>!C&&be(Ae.value),"data-focus-ring":J.focusRing,key:`${Ae.value}-input`}),y.createElement(ce,{component:"label",...Q("label"),mod:{active:ee===Ae.value&&!(j||Ae.disabled),disabled:j||Ae.disabled,"read-only":C},htmlFor:`${xe}-${Ae.value}`,ref:gt=>K(gt,Ae.value),__vars:{"--sc-label-color":T!==void 0?Gi({color:T,theme:J,autoContrast:L}):void 0},key:`${Ae.value}-label`},s.jsx("span",{...Q("innerLabel"),children:Ae.label})))),qe=zn(t,Ae=>H(Ae));return vN(()=>{I(Th())},[p.length]),p.length===0?null:s.jsxs(ce,{...Q("root"),variant:M,size:b,ref:qe,mod:[{"full-width":R,orientation:D,initialized:Z,"with-items-borders":$},V],...Y,role:"radiogroup","data-disabled":j,children:[typeof ee=="string"&&s.jsx(zx,{target:O[ee],parent:z,component:"span",transitionDuration:"var(--sc-transition-duration)",...Q("indicator")},P),ye]})});Bp.classes=OD;Bp.displayName="@mantine/core/SegmentedControl";function A6({spacing:e,verticalSpacing:t,cols:n,selector:r}){var m;const a=Sn(),o=t===void 0?e:t,c=Ho({"--sg-spacing-x":Nn(_a(e)),"--sg-spacing-y":Nn(_a(o)),"--sg-cols":(m=_a(n))==null?void 0:m.toString()}),u=sn(a.breakpoints).reduce((g,v)=>(g[v]||(g[v]={}),typeof e=="object"&&e[v]!==void 0&&(g[v]["--sg-spacing-x"]=Nn(e[v])),typeof o=="object"&&o[v]!==void 0&&(g[v]["--sg-spacing-y"]=Nn(o[v])),typeof n=="object"&&n[v]!==void 0&&(g[v]["--sg-cols"]=n[v]),g),{}),p=Yu(sn(u),a.breakpoints).filter(g=>sn(u[g.value]).length>0).map(g=>({query:`(min-width: ${a.breakpoints[g.value]})`,styles:u[g.value]}));return s.jsx(Ks,{styles:c,media:p,selector:r})}function zv(e){return typeof e=="object"&&e!==null?sn(e):[]}function _6(e){return e.sort((t,n)=>Wu(t)-Wu(n))}function k6({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...zv(e),...zv(t),...zv(n)]));return _6(r)}function P6({spacing:e,verticalSpacing:t,cols:n,selector:r}){var p;const a=t===void 0?e:t,o=Ho({"--sg-spacing-x":Nn(_a(e)),"--sg-spacing-y":Nn(_a(a)),"--sg-cols":(p=_a(n))==null?void 0:p.toString()}),c=k6({spacing:e,verticalSpacing:t,cols:n}),u=c.reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=Nn(e[g])),typeof a=="object"&&a[g]!==void 0&&(m[g]["--sg-spacing-y"]=Nn(a[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),f=c.map(m=>({query:`simple-grid (min-width: ${m})`,styles:u[m]}));return s.jsx(Ks,{styles:o,container:f,selector:r})}var MD={container:"m_925c2d2c",root:"m_2415a157"};const N6={cols:1,spacing:"md",type:"media"},N0=ve((e,t)=>{const n=se("SimpleGrid",N6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,cols:p,verticalSpacing:m,spacing:g,type:v,...b}=n,S=Ie({name:"SimpleGrid",classes:MD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f}),j=ud();return v==="container"?s.jsxs(s.Fragment,{children:[s.jsx(P6,{...n,selector:`.${j}`}),s.jsx("div",{...S("container"),children:s.jsx(ce,{ref:t,...S("root",{className:j}),...b})})]}):s.jsxs(s.Fragment,{children:[s.jsx(A6,{...n,selector:`.${j}`}),s.jsx(ce,{ref:t,...S("root",{className:j}),...b})]})});N0.classes=MD;N0.displayName="@mantine/core/SimpleGrid";const O6={},Vp=ve((e,t)=>{const{w:n,h:r,miw:a,mih:o,...c}=se("Space",O6,e);return s.jsx(ce,{ref:t,...c,w:n,miw:a??n,h:r,mih:o??r})});Vp.displayName="@mantine/core/Space";var ID={root:"m_6d731127"};const M6={gap:"md",align:"stretch",justify:"flex-start"},I6=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Nn(t),"--stack-align":n,"--stack-justify":r}}),We=ve((e,t)=>{const n=se("Stack",M6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,align:p,justify:m,gap:g,variant:v,...b}=n,S=Ie({name:"Stack",props:n,classes:ID,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:I6});return s.jsx(ce,{ref:t,...S("root"),variant:v,...b})});We.classes=ID;We.displayName="@mantine/core/Stack";const[L6,z6]=vr("Stepper component was not found in tree"),Nh=()=>null;Nh.displayName="@mantine/core/StepperCompleted";var O0={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 ah=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,$6={withIcon:!0,allowStepClick:!0,iconPosition:"left"},M0=ve((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,step:u,state:f,color:p,icon:m,completedIcon:g,progressIcon:v,label:b,description:S,withIcon:j,iconSize:C,loading:R,allowStepClick:D,allowStepSelect:E,iconPosition:T,orientation:A,mod:k,...M}=se("StepperStep",$6,e),L=z6(),$=Sn(),V={classNames:n,styles:o},Y=f==="stepCompleted"?null:f==="stepProgress"?v:m,Q={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return s.jsxs(tr,{...L.getStyles("step",{className:r,style:a,variant:L.orientation,...V}),mod:[{"icon-position":T||L.iconPosition,"allow-click":D},k],ref:t,...Q,...M,__vars:{"--step-color":p?Ht(p,$):void 0},tabIndex:D?0:-1,children:[j&&s.jsxs("span",{...L.getStyles("stepWrapper",V),children:[s.jsxs("span",{...L.getStyles("stepIcon",V),...Q,children:[s.jsx(di,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:J=>s.jsx("span",{...L.getStyles("stepCompletedIcon",{style:J,...V}),children:R?s.jsx(_r,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...L.getStyles("stepLoader",V)}):ah(g,u)||s.jsx(Sp,{size:"60%"})})}),f!=="stepCompleted"?R?s.jsx(_r,{...L.getStyles("stepLoader",V),size:"calc(var(--stepper-icon-size) / 2)",color:p}):ah(Y||m,u):null]}),A==="vertical"&&s.jsx("span",{...L.getStyles("verticalSeparator",V),"data-active":f==="stepCompleted"||void 0})]}),(b||S)&&s.jsxs("span",{...L.getStyles("stepBody",V),"data-orientation":L.orientation,"data-icon-position":T||L.iconPosition,children:[b&&s.jsx("span",{...L.getStyles("stepLabel",V),children:ah(b,u)}),S&&s.jsx("span",{...L.getStyles("stepDescription",V),children:ah(S,u)})]})]})});M0.classes=O0;M0.displayName="@mantine/core/StepperStep";const U6={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},B6=(e,{color:t,iconSize:n,size:r,contentPadding:a,radius:o,autoContrast:c})=>({root:{"--stepper-color":t?Ht(t,e):void 0,"--stepper-icon-color":Ys(c,e)?Gi({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?rt(r,"stepper-icon-size"):le(n),"--stepper-content-padding":Nn(a),"--stepper-radius":o===void 0?void 0:Vt(o),"--stepper-fz":On(r),"--stepper-spacing":Nn(r)}}),mc=ve((e,t)=>{var z,H,O;const n=se("Stepper",U6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,onStepClick:m,active:g,icon:v,completedIcon:b,progressIcon:S,color:j,iconSize:C,contentPadding:R,orientation:D,iconPosition:E,size:T,radius:A,allowNextStepsSelect:k,wrap:M,autoContrast:L,...$}=n,V=Ie({name:"Stepper",classes:O0,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:B6}),Y=y.Children.toArray(p),Q=Y.filter(U=>U.type!==Nh),J=Y.find(U=>U.type===Nh),G=Q.reduce((U,K,ee)=>{const be=g===ee?"stepProgress":g>ee?"stepCompleted":"stepInactive",ye=typeof m!="function"?!1:typeof K.props.allowStepSelect=="boolean"?K.props.allowStepSelect:be==="stepCompleted"||k;return U.push(y.cloneElement(K,{icon:K.props.icon||v||ee+1,key:ee,step:ee,state:be,onClick:()=>ye&&(m==null?void 0:m(ee)),allowStepClick:ye,completedIcon:K.props.completedIcon||b,progressIcon:K.props.progressIcon||S,color:K.props.color||j,iconSize:C,iconPosition:K.props.iconPosition||E,orientation:D})),D==="horizontal"&&ee!==Q.length-1&&U.push(y.createElement("div",{...V("separator"),"data-active":ee<g||void 0,"data-orientation":D,key:`separator-${ee}`})),U},[]),Z=(H=(z=Q[g])==null?void 0:z.props)==null?void 0:H.children,P=(O=J==null?void 0:J.props)==null?void 0:O.children,I=g>Q.length-1?P:Z;return s.jsx(L6,{value:{getStyles:V,orientation:D,iconPosition:E},children:s.jsxs(ce,{...V("root"),ref:t,size:T,...$,children:[s.jsx(ce,{...V("steps"),mod:{orientation:D,"icon-position":E,wrap:M&&D!=="vertical"},children:G}),I&&s.jsx("div",{...V("content"),children:I})]})})});mc.classes=O0;mc.displayName="@mantine/core/Stepper";mc.Completed=Nh;mc.Step=M0;const LD=y.createContext(null),V6=LD.Provider,F6=()=>y.useContext(LD),H6={},I0=ve((e,t)=>{const{value:n,defaultValue:r,onChange:a,size:o,wrapperProps:c,children:u,readOnly:f,...p}=se("SwitchGroup",H6,e),[m,g]=Yn({value:n,defaultValue:r,finalValue:[],onChange:a}),v=b=>{const S=b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return s.jsx(V6,{value:{value:m,onChange:v,size:o},children:s.jsx(mn.Wrapper,{size:o,ref:t,...c,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(t0,{role:"group",children:u})})})});I0.classes=mn.Wrapper.classes;I0.displayName="@mantine/core/SwitchGroup";var zD={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const q6={labelPosition:"right"},G6=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Vt(t),"--switch-height":rt(r,"switch-height"),"--switch-width":rt(r,"switch-width"),"--switch-thumb-size":rt(r,"switch-thumb-size"),"--switch-label-font-size":rt(r,"switch-label-font-size"),"--switch-track-label-padding":rt(r,"switch-track-label-padding"),"--switch-color":n?Ht(n,e):void 0}}),Sd=ve((e,t)=>{const n=se("Switch",q6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,label:m,offLabel:g,onLabel:v,id:b,size:S,radius:j,wrapperProps:C,thumbIcon:R,checked:D,defaultChecked:E,onChange:T,labelPosition:A,description:k,error:M,disabled:L,variant:$,rootRef:V,mod:Y,...Q}=n,J=F6(),G=S||(J==null?void 0:J.size),Z=Ie({name:"Switch",props:n,classes:zD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:G6}),{styleProps:P,rest:I}=Qi(Q),z=yr(b),H=J?{checked:J.value.includes(I.value),onChange:J.onChange}:{},[O,U]=Yn({value:H.checked??D,defaultValue:E,finalValue:!1});return s.jsxs(bp,{...Z("root"),__staticSelector:"Switch",__stylesApiProps:n,id:z,size:G,labelPosition:A,label:m,description:k,error:M,disabled:L,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:u,"data-checked":H.checked||D||void 0,variant:$,ref:V,mod:Y,...P,...C,children:[s.jsx("input",{...I,disabled:L,checked:O,"data-checked":H.checked||D||void 0,onChange:K=>{var ee;J?(ee=H.onChange)==null||ee.call(H,K):T==null||T(K),U(K.currentTarget.checked)},id:z,ref:t,type:"checkbox",role:"switch",...Z("input")}),s.jsxs(ce,{"aria-hidden":"true",component:"span",mod:{error:M,"label-position":A,"without-labels":!v&&!g},...Z("track"),children:[s.jsx(ce,{component:"span",mod:"reduce-motion",...Z("thumb"),children:R}),s.jsx("span",{...Z("trackLabel"),children:O?v:g})]})]})});Sd.classes={...zD,...F2};Sd.displayName="@mantine/core/Switch";Sd.Group=I0;const[Q6,W6]=vr("Table component was not found in the tree");var wd={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function Y6(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 el(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ve((a,o)=>{const c=se(n,{},a),{classNames:u,className:f,style:p,styles:m,...g}=c,v=W6();return s.jsx(ce,{component:e,ref:o,...Y6(v,t),...v.getStyles(e,{className:f,classNames:u,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=wd,r}const Ay=el("th",{columnBorder:!0}),$D=el("td",{columnBorder:!0}),vh=el("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),UD=el("thead",{stickyHeader:!0}),BD=el("tbody"),VD=el("tfoot"),FD=el("caption",{captionSide:!0});function L0({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(FD,{children:e.caption}),e.head&&s.jsx(UD,{children:s.jsx(vh,{children:e.head.map((t,n)=>s.jsx(Ay,{children:t},n))})}),e.body&&s.jsx(BD,{children:e.body.map((t,n)=>s.jsx(vh,{children:t.map((r,a)=>s.jsx($D,{children:r},a))},n))}),e.foot&&s.jsx(VD,{children:s.jsx(vh,{children:e.foot.map((t,n)=>s.jsx(Ay,{children:t},n))})})]})}L0.displayName="@mantine/core/TableDataRenderer";const K6={type:"scrollarea"},X6=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":le(t),"--table-max-height":le(n),"--table-overflow":r==="native"?"auto":void 0}}),z0=ve((e,t)=>{const n=se("TableScrollContainer",K6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,minWidth:m,maxHeight:g,type:v,scrollAreaProps:b,...S}=n,j=Ie({name:"TableScrollContainer",classes:wd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:X6,rootSelector:"scrollContainer"});return s.jsx(ce,{component:v==="scrollarea"?Yr:"div",...v==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...j("scrollContainer"),...S,children:s.jsx("div",{...j("scrollContainerInner"),children:p})})});z0.classes=wd;z0.displayName="@mantine/core/TableScrollContainer";const Z6={withRowBorders:!0,verticalSpacing:7},J6=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:a,borderColor:o,stripedColor:c,highlightOnHoverColor:u,striped:f,highlightOnHover:p,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Nn(r),"--table-vertical-spacing":Nn(a),"--table-border-color":o?Ht(o,e):void 0,"--table-striped-color":f&&c?Ht(c,e):void 0,"--table-highlight-on-hover-color":p&&u?Ht(u,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),Me=ve((e,t)=>{const n=se("Table",Z6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:v,highlightOnHoverColor:b,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,withTableBorder:D,borderColor:E,layout:T,variant:A,data:k,children:M,stickyHeader:L,stickyHeaderOffset:$,mod:V,tabularNums:Y,...Q}=n,J=Ie({name:"Table",props:n,className:a,style:o,classes:wd,classNames:r,styles:c,unstyled:u,rootSelector:"table",vars:f,varsResolver:J6});return s.jsx(Q6,{value:{getStyles:J,stickyHeader:L,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,captionSide:g||"bottom"},children:s.jsx(ce,{component:"table",variant:A,ref:t,mod:[{"data-with-table-border":D,"data-tabular-nums":Y},V],...J("table"),...Q,children:M||!!k&&s.jsx(L0,{data:k})})})});Me.classes=wd;Me.displayName="@mantine/core/Table";Me.Td=$D;Me.Th=Ay;Me.Tr=vh;Me.Thead=UD;Me.Tbody=BD;Me.Tfoot=VD;Me.Caption=FD;Me.ScrollContainer=z0;Me.DataRenderer=L0;const[ez,$0]=vr("Tabs component was not found in the tree");var jd={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",panel:"m_b0c91715",tab:"m_4ec4dce6",tabSection:"m_fc420b1f","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const tz={},U0=ve((e,t)=>{const n=se("TabsList",tz,e),{children:r,className:a,grow:o,justify:c,classNames:u,styles:f,style:p,mod:m,...g}=n,v=$0();return s.jsx(ce,{...g,...v.getStyles("list",{className:a,style:p,classNames:u,styles:f,props:n,variant:v.variant}),ref:t,role:"tablist",variant:v.variant,mod:[{grow:o,orientation:v.orientation,placement:v.orientation==="vertical"&&v.placement,inverted:v.inverted},m],"aria-orientation":v.orientation,__vars:{"--tabs-justify":c},children:r})});U0.classes=jd;U0.displayName="@mantine/core/TabsList";const nz={},B0=ve((e,t)=>{const n=se("TabsPanel",nz,e),{children:r,className:a,value:o,classNames:c,styles:u,style:f,mod:p,keepMounted:m,...g}=n,v=$0(),b=v.value===o,S=v.keepMounted||m||b?r:null;return s.jsx(ce,{...g,...v.getStyles("panel",{className:a,classNames:c,styles:u,style:[f,b?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:v.orientation},p],role:"tabpanel",id:v.getPanelId(o),"aria-labelledby":v.getTabId(o),children:S})});B0.classes=jd;B0.displayName="@mantine/core/TabsPanel";const rz={},V0=ve((e,t)=>{const n=se("TabsTab",rz,e),{className:r,children:a,rightSection:o,leftSection:c,value:u,onClick:f,onKeyDown:p,disabled:m,color:g,style:v,classNames:b,styles:S,vars:j,mod:C,tabIndex:R,...D}=n,E=Sn(),{dir:T}=Xs(),A=$0(),k=u===A.value,M=$=>{A.onChange(A.allowTabDeactivation&&u===A.value?null:u),f==null||f($)},L={classNames:b,styles:S,props:n};return s.jsxs(tr,{...D,...A.getStyles("tab",{className:r,style:v,variant:A.variant,...L}),disabled:m,unstyled:A.unstyled,variant:A.variant,mod:[{active:k,disabled:m,orientation:A.orientation,inverted:A.inverted,placement:A.orientation==="vertical"&&A.placement},C],ref:t,role:"tab",id:A.getTabId(u),"aria-selected":k,tabIndex:R!==void 0?R:k||A.value===null?0:-1,"aria-controls":A.getPanelId(u),onClick:M,__vars:{"--tabs-color":g?Ht(g,E):void 0},onKeyDown:iR({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:A.activateTabWithKeyboard,loop:A.loop,orientation:A.orientation||"horizontal",dir:T,onKeyDown:p}),children:[c&&s.jsx("span",{...A.getStyles("tabSection",L),"data-position":"left",children:c}),a&&s.jsx("span",{...A.getStyles("tabLabel",L),children:a}),o&&s.jsx("span",{...A.getStyles("tabSection",L),"data-position":"right",children:o})]})});V0.classes=jd;V0.displayName="@mantine/core/TabsTab";const GC="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",az={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},iz=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Vt(t),"--tabs-color":Ht(n,e),"--tabs-text-color":Ys(r,e)?Gi({color:n,theme:e,autoContrast:r}):void 0}}),Lt=ve((e,t)=>{const n=se("Tabs",az,e),{defaultValue:r,value:a,onChange:o,orientation:c,children:u,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:v,color:b,radius:S,inverted:j,placement:C,keepMounted:R,classNames:D,styles:E,unstyled:T,className:A,style:k,vars:M,autoContrast:L,mod:$,...V}=n,Y=yr(p),[Q,J]=Yn({value:a,defaultValue:r,finalValue:null,onChange:o}),G=Ie({name:"Tabs",props:n,classes:jd,className:A,style:k,classNames:D,styles:E,unstyled:T,vars:M,varsResolver:iz});return s.jsx(ez,{value:{placement:C,value:Q,orientation:c,id:Y,loop:f,activateTabWithKeyboard:m,getTabId:Vj(`${Y}-tab`,GC),getPanelId:Vj(`${Y}-panel`,GC),onChange:J,allowTabDeactivation:g,variant:v,color:b,radius:S,inverted:j,keepMounted:R,unstyled:T,getStyles:G},children:s.jsx(ce,{ref:t,id:Y,variant:v,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},$],...G("root"),...V,children:u})})});Lt.classes=jd;Lt.displayName="@mantine/core/Tabs";Lt.Tab=V0;Lt.Panel=B0;Lt.List=U0;const oz={},ze=ve((e,t)=>{const n=se("TextInput",oz,e);return s.jsx(Pr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ze.classes=Pr.classes;ze.displayName="@mantine/core/TextInput";var HD={root:"m_7341320d"};const sz={},lz=(e,{size:t,radius:n,variant:r,gradient:a,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:a,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":rt(t,"ti-size"),"--ti-radius":n===void 0?void 0:Vt(n),"--ti-bg":o||r?u.background:void 0,"--ti-color":o||r?u.color:void 0,"--ti-bd":o||r?u.border:void 0}}},F0=ve((e,t)=>{const n=se("ThemeIcon",sz,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,autoContrast:p,...m}=n,g=Ie({name:"ThemeIcon",classes:HD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:lz});return s.jsx(ce,{ref:t,...g("root"),...m})});F0.classes=HD;F0.displayName="@mantine/core/ThemeIcon";const cz=["h1","h2","h3","h4","h5","h6"],uz=["xs","sm","md","lg","xl"];function dz(e,t){const n=t!==void 0?t:`h${e}`;return cz.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:uz.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:le(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var qD={root:"m_8a5d1357"};const fz={order:1},hz=(e,{order:t,size:n,lineClamp:r,textWrap:a})=>{const o=dz(t,n);return{root:{"--title-fw":o.fontWeight,"--title-lh":o.lineHeight,"--title-fz":o.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":a}}},Le=ve((e,t)=>{const n=se("Title",fz,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,order:f,vars:p,size:m,variant:g,lineClamp:v,textWrap:b,mod:S,...j}=n,C=Ie({name:"Title",props:n,classes:qD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:hz});return[1,2,3,4,5,6].includes(f)?s.jsx(ce,{...C("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof v=="number"},S],size:m,...j}):null});Le.classes=qD;Le.displayName="@mantine/core/Title";function pz(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(a){t=typeof a=="function"?a(t):a},setState(a){this.updateState(a),r.forEach(o=>o(t))},initialize(a){n||(t=a,n=!0)},subscribe(a){return r.add(a),()=>r.delete(a)}}}function mz(e){return y.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function gz(e,t,n){const r=[],a=[],o={};for(const c of e){const u=c.position||t;o[u]=o[u]||0,o[u]+=1,o[u]<=n?a.push(c):r.push(c)}return{notifications:a,queue:r}}const vz=()=>pz({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),tl=vz(),yz=(e=tl)=>mz(e);function kc(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),a=gz(r,n.defaultPosition,n.limit);e.setState({notifications:a.notifications,queue:a.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Pe(e,t=tl){const n=e.id||Th();return kc(t,r=>e.id&&r.some(a=>a.id===e.id)?r:[...r,{...e,id:n}]),n}function GD(e,t=tl){return kc(t,n=>n.filter(r=>{var a;return r.id===e?((a=r.onClose)==null||a.call(r,r),!1):!0})),e}function Ds(e,t=tl){return kc(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function xz(e=tl){kc(e,()=>[])}function bz(e=tl){kc(e,t=>t.slice(0,e.getState().limit))}const ua={show:Pe,hide:GD,update:Ds,clean:xz,cleanQueue:bz,updateState:kc};function _y(e,t){return _y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},_y(e,t)}function QD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_y(e,t)}var $v={exports:{}},Uv,QC;function Sz(){if(QC)return Uv;QC=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Uv=e,Uv}var Bv,WC;function wz(){if(WC)return Bv;WC=1;var e=Sz();function t(){}function n(){}return n.resetWarningCache=t,Bv=function(){function r(c,u,f,p,m,g){if(g!==e){var v=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 v.name="Invariant Violation",v}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Bv}var YC;function jz(){return YC||(YC=1,$v.exports=wz()()),$v.exports}var Cz=jz();const an=ax(Cz),KC={disabled:!1},Oh=Cn.createContext(null);var Ez=function(t){return t.scrollTop},Fu="unmounted",Ss="exited",ws="entering",Jl="entered",ky="exiting",Xi=function(e){QD(t,e);function t(r,a){var o;o=e.call(this,r,a)||this;var c=a,u=c&&!c.isMounting?r.enter:r.appear,f;return o.appearStatus=null,r.in?u?(f=Ss,o.appearStatus=ws):f=Jl:r.unmountOnExit||r.mountOnEnter?f=Fu:f=Ss,o.state={status:f},o.nextCallback=null,o}t.getDerivedStateFromProps=function(a,o){var c=a.in;return c&&o.status===Fu?{status:Ss}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(a){var o=null;if(a!==this.props){var c=this.state.status;this.props.in?c!==ws&&c!==Jl&&(o=ws):(c===ws||c===Jl)&&(o=ky)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var a=this.props.timeout,o,c,u;return o=c=u=a,a!=null&&typeof a!="number"&&(o=a.exit,c=a.enter,u=a.appear!==void 0?a.appear:c),{exit:o,enter:c,appear:u}},n.updateStatus=function(a,o){if(a===void 0&&(a=!1),o!==null)if(this.cancelNextCallback(),o===ws){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:Vu.findDOMNode(this);c&&Ez(c)}this.performEnter(a)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ss&&this.setState({status:Fu})},n.performEnter=function(a){var o=this,c=this.props.enter,u=this.context?this.context.isMounting:a,f=this.props.nodeRef?[u]:[Vu.findDOMNode(this),u],p=f[0],m=f[1],g=this.getTimeouts(),v=u?g.appear:g.enter;if(!a&&!c||KC.disabled){this.safeSetState({status:Jl},function(){o.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:ws},function(){o.props.onEntering(p,m),o.onTransitionEnd(v,function(){o.safeSetState({status:Jl},function(){o.props.onEntered(p,m)})})})},n.performExit=function(){var a=this,o=this.props.exit,c=this.getTimeouts(),u=this.props.nodeRef?void 0:Vu.findDOMNode(this);if(!o||KC.disabled){this.safeSetState({status:Ss},function(){a.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:ky},function(){a.props.onExiting(u),a.onTransitionEnd(c.exit,function(){a.safeSetState({status:Ss},function(){a.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(a,o){o=this.setNextCallback(o),this.setState(a,o)},n.setNextCallback=function(a){var o=this,c=!0;return this.nextCallback=function(u){c&&(c=!1,o.nextCallback=null,a(u))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(a,o){this.setNextCallback(o);var c=this.props.nodeRef?this.props.nodeRef.current:Vu.findDOMNode(this),u=a==null&&!this.props.addEndListener;if(!c||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],p=f[0],m=f[1];this.props.addEndListener(p,m)}a!=null&&setTimeout(this.nextCallback,a)},n.render=function(){var a=this.state.status;if(a===Fu)return null;var o=this.props,c=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var u=f0(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Cn.createElement(Oh.Provider,{value:null},typeof c=="function"?c(a,u):Cn.cloneElement(Cn.Children.only(c),u))},t}(Cn.Component);Xi.contextType=Oh;Xi.propTypes={};function Gl(){}Xi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Gl,onEntering:Gl,onEntered:Gl,onExit:Gl,onExiting:Gl,onExited:Gl};Xi.UNMOUNTED=Fu;Xi.EXITED=Ss;Xi.ENTERING=ws;Xi.ENTERED=Jl;Xi.EXITING=ky;function Tz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H0(e,t){var n=function(o){return t&&y.isValidElement(o)?t(o):o},r=Object.create(null);return e&&y.Children.map(e,function(a){return a}).forEach(function(a){r[a.key]=n(a)}),r}function Rz(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),a=[];for(var o in e)o in t?a.length&&(r[o]=a,a=[]):a.push(o);var c,u={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var p=r[f][c];u[r[f][c]]=n(p)}u[f]=n(f)}for(c=0;c<a.length;c++)u[a[c]]=n(a[c]);return u}function As(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Dz(e,t){return H0(e.children,function(n){return y.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:As(n,"appear",e),enter:As(n,"enter",e),exit:As(n,"exit",e)})})}function Az(e,t,n){var r=H0(e.children),a=Rz(t,r);return Object.keys(a).forEach(function(o){var c=a[o];if(y.isValidElement(c)){var u=o in t,f=o in r,p=t[o],m=y.isValidElement(p)&&!p.props.in;f&&(!u||m)?a[o]=y.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:As(c,"exit",e),enter:As(c,"enter",e)}):!f&&u&&!m?a[o]=y.cloneElement(c,{in:!1}):f&&u&&y.isValidElement(p)&&(a[o]=y.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:As(c,"exit",e),enter:As(c,"enter",e)}))}}),a}var _z=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},kz={component:"div",childFactory:function(t){return t}},Oo=function(e){QD(t,e);function t(r,a){var o;o=e.call(this,r,a)||this;var c=o.handleExited.bind(Tz(o));return o.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},o}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(a,o){var c=o.children,u=o.handleExited,f=o.firstRender;return{children:f?Dz(a,u):Az(a,c,u),firstRender:!1}},n.handleExited=function(a,o){var c=H0(this.props.children);a.key in c||(a.props.onExited&&a.props.onExited(o),this.mounted&&this.setState(function(u){var f=Ph({},u.children);return delete f[a.key],{children:f}}))},n.render=function(){var a=this.props,o=a.component,c=a.childFactory,u=f0(a,["component","childFactory"]),f=this.state.contextValue,p=_z(this.state.children).map(c);return delete u.appear,delete u.enter,delete u.exit,o===null?Cn.createElement(Oh.Provider,{value:f},p):Cn.createElement(Oh.Provider,{value:f},Cn.createElement(o,u,p))},t}(Cn.Component);Oo.propTypes={};Oo.defaultProps=kz;const WD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function Pz(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),WD.reduce((n,r)=>(n[r]=[],n),{}))}const XC={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Nz={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Oz({state:e,maxHeight:t,position:n,transitionDuration:r}){const[a,o]=n.split("-"),c=o==="center"?`${a}-center`:o,u={opacity:0,maxHeight:t,transform:XC[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:Nz[c]},p={opacity:0,maxHeight:0,transform:XC[c]};return{...u,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function Mz(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const YD=y.forwardRef(({data:e,onHide:t,autoClose:n,...r},a)=>{const{autoClose:o,message:c,...u}=e,f=Mz(n,e.autoClose),p=y.useRef(-1),m=()=>window.clearTimeout(p.current),g=()=>{t(e.id),m()},v=()=>{typeof f=="number"&&(p.current=window.setTimeout(g,f))};return y.useEffect(()=>{var b;(b=e.onOpen)==null||b.call(e,e)},[]),y.useEffect(()=>(v(),m),[f]),s.jsx(E0,{...r,...u,onClose:g,ref:a,onMouseEnter:m,onMouseLeave:v,children:c})});YD.displayName="@mantine/notifications/NotificationContainer";var KD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const Iz=Xi,Lz={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Wr("overlay"),store:tl,withinPortal:!0},zz=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":le(n)}}),Zi=ve((e,t)=>{const n=se("Notifications",Lz,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:v,notificationMaxHeight:b,limit:S,zIndex:j,store:C,portalProps:R,withinPortal:D,...E}=n,T=Sn(),A=yz(C),k=uN(),M=cx(),L=y.useRef({}),$=y.useRef(0),Y=(T.respectReducedMotion?M:!1)?1:g,Q=Ie({name:"Notifications",classes:KD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:zz});y.useEffect(()=>{C==null||C.updateState(Z=>({...Z,limit:S||5,defaultPosition:p}))},[S,p]),zi(()=>{A.notifications.length>$.current&&setTimeout(()=>k(),0),$.current=A.notifications.length},[A.notifications]);const J=Pz(A.notifications,p),G=WD.reduce((Z,P)=>(Z[P]=J[P].map(({style:I,...z})=>s.jsx(Iz,{timeout:Y,onEnter:()=>L.current[z.id].offsetHeight,nodeRef:{current:L.current[z.id]},children:H=>s.jsx(YD,{ref:O=>{L.current[z.id]=O},data:z,onHide:O=>GD(O,C),autoClose:m,...Q("notification",{style:{...Oz({state:H,position:P,transitionDuration:Y,maxHeight:b}),...I}})})},z.id)),Z),{});return s.jsxs(qo,{withinPortal:D,...R,children:[s.jsx(ce,{...Q("root"),"data-position":"top-center",ref:t,...E,children:s.jsx(Oo,{children:G["top-center"]})}),s.jsx(ce,{...Q("root"),"data-position":"top-left",...E,children:s.jsx(Oo,{children:G["top-left"]})}),s.jsx(ce,{...Q("root",{className:lc.classNames.fullWidth}),"data-position":"top-right",...E,children:s.jsx(Oo,{children:G["top-right"]})}),s.jsx(ce,{...Q("root",{className:lc.classNames.fullWidth}),"data-position":"bottom-right",...E,children:s.jsx(Oo,{children:G["bottom-right"]})}),s.jsx(ce,{...Q("root"),"data-position":"bottom-left",...E,children:s.jsx(Oo,{children:G["bottom-left"]})}),s.jsx(ce,{...Q("root"),"data-position":"bottom-center",...E,children:s.jsx(Oo,{children:G["bottom-center"]})})]})});Zi.classes=KD;Zi.displayName="@mantine/notifications/Notifications";Zi.show=ua.show;Zi.hide=ua.hide;Zi.update=ua.update;Zi.clean=ua.clean;Zi.cleanQueue=ua.cleanQueue;Zi.updateState=ua.updateState;class $z{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Cd{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class Uz{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(a,o){const c=a.consumeAndParse(n);return r(o,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(a,o,c){const u=a.consumeAndParse(n);return r(o,c,u)},precedence:n})}construct(t){return new Bz(t,this.prefixParselets,this.infixParselets)}}class Bz{constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){const n=this.peek();return(n==null?void 0:n.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let a=r.parse(this,n);for(;t>this.getPrecedence();){const o=this.consume();a=this.getInfixParselet(o).parse(this,a,o)}return a}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){var r,a;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const o=this.peek();throw Error(`Expected ${t} but got "${o.id}" (${o.value}) at line ${o.line} column ${o.column}.`)}if(n&&((a=this.peek())==null?void 0:a.value)!==n){const o=this.peek();throw Error(`Expected "${n}" but got "${o.value}" at line ${o.line} column ${o.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}class XD{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 Ed="http://hl7.org",ZD="ok",Vz="created",Fz="gone",Hz="not-modified",qz="not-found",Gz="unauthorized",Qz="forbidden",Wz="accepted",Yz={resourceType:"OperationOutcome",id:ZD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Kz={resourceType:"OperationOutcome",id:qz,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},nd={resourceType:"OperationOutcome",id:Gz,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},Xz={...nd,issue:[...nd.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},ZC={...nd,issue:[...nd.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},JD={resourceType:"OperationOutcome",id:Qz,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function ri(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function yn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function Zz(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Jz(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 Fp(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function eA(e){return e.id===ZD||e.id===Vz||e.id===Hz||e.id===Wz}function e8(e){return e.id===Fz}class dt extends Error{constructor(t,n){super(tA(t)),this.outcome=t,this.cause=n}}function Zt(e){return e instanceof dt?e.outcome:Fp(e)?e:ri(Xe(e))}function Xe(e){return e?typeof e=="string"?e:Jz(e)?e.message:Fp(e)?tA(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function tA(e){var n;const t=((n=e.issue)==null?void 0:n.map(nA))??[];return t.length>0?t.join("; "):"Unknown error"}function nA(e){var n,r;let t;return(n=e.details)!=null&&n.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(r=e.expression)!=null&&r.length&&(t+=` (${e.expression.join(", ")})`),t}function t8(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 n8(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(([a,o])=>[a,t8(a,o)])),constraints:[],innerTypes:[]};return t}const r8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},a8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},i8={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"}]}}},o8={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"}]}}},s8={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"}]}}},l8={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"}]}}},c8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},u8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},code:{type:[{code:"code"}]},display:{type:[{code:"string"}]},userSelected:{type:[{code:"boolean"}]}}},d8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},f8={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"}]}}},h8={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"}]}}},p8={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"}]}}},m8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},"subject[x]":{type:[{code:"CodeableConcept"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Group"]}]},mustSupport:{max:9007199254740991,type:[{code:"string"}]},codeFilter:{max:9007199254740991,type:[{code:"DataRequirementCodeFilter"}]},dateFilter:{max:9007199254740991,type:[{code:"DataRequirementDateFilter"}]},limit:{type:[{code:"positiveInt"}]},sort:{max:9007199254740991,type:[{code:"DataRequirementSort"}]}}},g8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]},code:{max:9007199254740991,type:[{code:"Coding"}]}}},v8={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"}]}}},y8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},x8={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"}]}}},b8={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"]}]}}},S8={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"]}]}}},w8={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"}]}}},j8={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"}]}}},C8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},E8={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"}]}}},T8={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"}]}}},R8={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"}]}}},D8={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"}]}}},A8={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"]}]}}},_8={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"]}]}}},k8={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"}]}}},P8={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"}]}}},N8={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"}]}}},O8={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"}]}}},M8={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"]}]}}},I8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},country:{min:1,type:[{code:"CodeableConcept"}]},jurisdiction:{type:[{code:"CodeableConcept"}]},status:{min:1,type:[{code:"CodeableConcept"}]},dateRange:{min:1,type:[{code:"Period"}]},restoreDate:{type:[{code:"dateTime"}]}}},L8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},onBehalfOf:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},accounts:{max:9007199254740991,type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},z8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},$8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},U8={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"]}]}}},B8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},V8={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"}]}}},F8={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"}]}}},H8={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"}]}}},q8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},G8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},high:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},Q8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},W8={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"}]}}},Y8={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"]}]}}},K8={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"}]}}},X8={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"}]}}},Z8={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"}]}}},J8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},e$={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"}]}}},t$={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"}]}}},n$={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"}]}}},r$={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"]}]}}},a$={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"}]}}},i$={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"}]}}},o$={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"}]}}},s$={Element:r8,BackboneElement:a8,Address:i8,Age:o8,Annotation:s8,Attachment:l8,CodeableConcept:c8,Coding:u8,ContactDetail:d8,ContactPoint:f8,Contributor:h8,Count:p8,DataRequirement:m8,DataRequirementCodeFilter:g8,DataRequirementDateFilter:v8,DataRequirementSort:y8,Distance:x8,Dosage:b8,DosageDoseAndRate:S8,Duration:w8,ElementDefinition:j8,ElementDefinitionSlicingDiscriminator:C8,ElementDefinitionSlicing:E8,ElementDefinitionBase:T8,ElementDefinitionType:R8,ElementDefinitionExample:D8,ElementDefinitionConstraint:A8,ElementDefinitionBinding:_8,ElementDefinitionMapping:k8,Expression:P8,Extension:N8,HumanName:O8,Identifier:M8,MarketingStatus:I8,Meta:L8,Money:z8,Narrative:$8,ParameterDefinition:U8,Period:B8,Population:V8,ProdCharacteristic:F8,ProductShelfLife:H8,Quantity:q8,Range:G8,Ratio:Q8,Reference:W8,RelatedArtifact:Y8,SampledData:K8,Signature:X8,SubstanceAmount:Z8,SubstanceAmountReferenceRange:J8,Timing:e$,TimingRepeat:t$,TriggerDefinition:n$,UsageContext:r$,MoneyQuantity:a$,SimpleQuantity:i$,IdentityProvider:o$};function l$(e){return new u$(e).parse()}const Mh=n8(s$),q0=Object.create(null),JC=Object.create(null),c$={"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 rA(e){let t;return t=JC[e],t||(t=JC[e]=Object.create(null)),t}function eE(e){var r;const n=(Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(a=>a.resource))??[]).filter(a=>(a==null?void 0:a.resourceType)==="StructureDefinition");tU(n);for(const a of n)aA(a)}function aA(e){var o,c;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=l$(e),n=c$[e.url];let r,a;n?(r=Mh,a=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(o=e.type)!=null&&o.startsWith("http://")||(c=e.type)!=null&&c.startsWith("https://")?(r=Mh,a=e.type):(r=rA(e.url),a=e.type),r[a]=t;for(const u of t.innerTypes)u.parentType=t,r[u.name]=u;q0[e.url]=t}function iA(e){return!!Mh[e]}function Hp(e,t){if(t){const n=rA(t)[e];if(n)return n}return Mh[e]}function oA(e,t){const n=Hp(e,t);if(!n)throw new dt(ri("Unknown data type: "+e));return n}function G0(e){return!!q0[e]}function Pc(e){return q0[e]}class u${constructor(t){var n;if(!((n=t.snapshot)!=null&&n.element)||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,path:this.root.path,title:t.title,type:t.type,url:t.url,version:t.version,kind:t.kind,description:h$(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,a,o,c;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((n=t.id)!=null&&n.includes(":")){if((r=this.slicingContext)!=null&&r.current){const u=Vv(t,this.slicingContext.path);this.slicingContext.current.elements[u]=this.parseElementDefinition(t)}}else{const u=this.parseElementDefinition(t);this.checkFieldEnter(t,u);let f=this.backboneContext;for(;f;){if((a=t.path)!=null&&a.startsWith(f.path+".")){f.type.elements[Vv(t,f.path)]=u;break}f=f.parent}if(!f){const p=Vv(t,this.root.path);t.isSummary&&((o=this.resourceSchema.summaryProperties)==null||o.add(p.replace("[x]",""))),u.min>0&&((c=this.resourceSchema.mandatoryProperties)==null||c.add(p.replace("[x]",""))),this.resourceSchema.elements[p]=u}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),this.slicingContext&&!Ql(this.slicingContext.path,t==null?void 0:t.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var r,a,o;for(;this.backboneContext&&!Ql((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=cE(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:Ql((a=this.backboneContext)==null?void 0:a.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,n){var r,a,o,c;f$(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((a=t.slicing)==null?void 0:a.discriminator)??[]).map(u=>{if(u.type!=="value"&&u.type!=="pattern"&&u.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${u.type}`);return{path:u.path,type:u.type}}),slices:[],ordered:((o=t.slicing)==null?void 0:o.ordered)??!1,rule:(c=t.slicing)==null?void 0:c.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!Ql(this.backboneContext.path,t==null?void 0:t.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!Ql(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){const t=this.peek();if(t)return this.index++,t}peek(){var n,r,a,o,c;const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const u=t.contentReference.slice(t.contentReference.indexOf("#")+1),f=this.elementIndex[u];return f?{...f,id:t.id,path:t.path,min:t.min??f.min,max:t.max??f.max,base:{path:((n=f.base)==null?void 0:n.path)??u,min:((r=t.base)==null?void 0:r.min)??((a=f.base)==null?void 0:a.min)??f.min,max:((o=t.base)==null?void 0:o.max)??((c=f.base)==null?void 0:c.max)??f.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(Ql(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(a=>["BackboneElement","Element"].includes(a.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var a;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=cE(t)),r||(r=(a=Ji(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:a.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var o,c;const n=tE(t.max),r=(o=t.base)!=null&&o.max?tE(t.base.max):n,a={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((c=t.base)==null?void 0:c.path)||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(u=>({key:u.key??"",severity:u.severity??"error",expression:u.expression??"",description:u.human??""})),type:this.parseElementDefinitionType(t),fixed:nE(gc(a,"fixed[x]")),pattern:nE(gc(a,"pattern[x]")),binding:t.binding}}}function tE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Vv(e,t=""){return d$(e.path,t)}function d$(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Ql(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function nE(e){return Array.isArray(e)&&e.length>0?e[0]:Tn(e)?void 0:e}function f$(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(a=>a.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function h$(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function p$(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?m$:gc,[a,...o]=t.split(".");let c=[r(e,a,n)];for(const u of o){const f=[];for(const p of c)if(Array.isArray(p))for(const m of p)f.push(r(m,u,n));else(n!=null&&n.withPath&&p&&p.value!==void 0||!(n!=null&&n.withPath)&&p!==void 0)&&f.push(r(p,u,n));c=f}return c}function m$(e,t,n){const r=e.path;return g$(gc(e,t,n),r,t)}function g$(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((a,o)=>({...a,path:`${r}${n}[${o}]`})):{...e,path:`${r}${n}`}}const sA={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 v$(e,t,n,r){var c;if(Array.isArray(e))return!1;let a;t.path==="$this"?a=n:a=(r??n.elements)[t.path];const o=n.type;switch(t.type){case"value":case"pattern":if(!e||!a)return!1;if(a.pattern)return Y0(e,a.pattern);if(a.fixed)return si(e,a.fixed);if(((c=a.binding)==null?void 0:c.strength)==="required"&&a.binding.valueSet)return!0;break;case"type":return!e||!(o!=null&&o.length)?!1:o.some(u=>u.code===e.type)}return!1}function Qe(e){return[{type:oe.boolean,value:e}]}function pa(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:oe.integer,value:e}:typeof e=="number"?{type:oe.decimal,value:e}:typeof e=="boolean"?{type:oe.boolean,value:e}:typeof e=="string"?{type:oe.string,value:e}:da(e)?{type:oe.Quantity,value:e}:fi(e)?{type:e.resourceType,value:e}:vA(e)?{type:oe.CodeableConcept,value:e}:gA(e)?{type:oe.Coding,value:e}:{type:oe.BackboneElement,value:e}}function ei(e){return e.length===0?!1:!!e[0].value}function Bi(e,t){if(e.length!==0){if(e.length===1&&(!t||e[0].type===t))return e[0];throw new Error(`Expected singleton of type ${t}, but found ${JSON.stringify(e)}`)}}function gc(e,t,n){if(!e.value)return;const r=Wo(e.type,t,n==null?void 0:n.profileUrl);return r?lA(e,t,r):Td(e,t)}function lA(e,t,n){const r=e.value,a=n.type;if(!a||a.length===0)return;let o,c="undefined",u;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of a){const g=p.replace("[x]",Hn(m.code));if(o=r[g],u=r["_"+g],o!==void 0||u!==void 0){c=m.code;break}}if(u)if(Array.isArray(o)){o=o.slice();for(let m=0;m<Math.max(o.length,u.length);m++)o[m]=oE(o[m],u[m])}else o=oE(o,u);if(!Tn(o))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(o)?o.map(m=>rE(m,c)):rE(o,c)}function rE(e,t){return t==="Resource"&&fi(e)&&(t=e.resourceType),{type:t,value:e}}function Td(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const a=n[t];Array.isArray(a)?r=a.map(pa):r=pa(a)}else{const a=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const o of Object.values(oe)){const c=a+Hn(o);if(c in n){const u=n[c];Array.isArray(u)?r=u.map(f=>({type:o,value:f})):r={type:o,value:u};break}}}if(Array.isArray(r)){if(r.length===0||Tn(r[0]))return}else if(Tn(r))return;return r}function cA(e){const t=[];for(const n of e){let r=!1;for(const a of t)if(ei(qp(n,a))){r=!0;break}r||t.push(n)}return t}function y$(e){return Qe(!ei(e))}function x$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Qe(!1):Qe(e.every((n,r)=>ei(qp(n,t[r]))))}function b$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Qe(!0):Qe(e.some((n,r)=>!ei(qp(n,t[r]))))}function qp(e,t){var a,o;const n=(a=e.value)==null?void 0:a.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?Qe(Math.abs(n-r)<1e-8):da(n)&&da(r)?Qe(hA(n,r)):Qe(typeof n=="object"&&typeof r=="object"?Q0(e,t):n===r)}function uA(e,t){return e.length===0&&t.length===0?Qe(!0):e.length!==t.length?Qe(!1):(e.sort(aE),t.sort(aE),Qe(e.every((n,r)=>ei(S$(n,t[r])))))}function S$(e,t){const{type:n,value:r}=e,{type:a,value:o}=t,c=r==null?void 0:r.valueOf(),u=o==null?void 0:o.valueOf();return typeof c=="number"&&typeof u=="number"?Qe(Math.abs(c-u)<.01):da(c)&&da(u)?Qe(hA(c,u)):Qe(n==="Coding"&&a==="Coding"?typeof c!="object"||typeof u!="object"?!1:c.code===u.code&&c.system===u.system:typeof c=="object"&&typeof u=="object"?Q0({...c,id:void 0},{...u,id:void 0}):typeof c=="string"&&typeof u=="string"?c.toLowerCase()===u.toLowerCase():c===u)}function aE(e,t){var a,o;const n=(a=e.value)==null?void 0:a.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function dA(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 w$(n);case"DateTime":return Ih(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return fA(n);case"Quantity":return da(n);default:return e.type===r||typeof n=="object"&&(n==null?void 0:n.resourceType)===r}}function w$(e){return typeof e=="string"&&!!sA.date.exec(e)}function Ih(e){return typeof e=="string"&&!!sA.dateTime.exec(e)}function fA(e){return!!(e&&typeof e=="object"&&("start"in e&&Ih(e.start)||"end"in e&&Ih(e.end)))}function da(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function hA(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 Q0(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n){const o=e[a],c=t[a];if(iE(o)&&iE(c)){if(!Q0(o,c))return!1}else if(o!==c)return!1}return!0}function iE(e){return e!==null&&typeof e=="object"}function oE(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return j$(e??{},t)}return e}function j$(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function C$(e,t){return fi(e,t)&&"id"in e&&typeof e.id=="string"}function on(e){const t=zt(e)??"undefined/undefined",n=Vi(e);return n===t?{reference:t}:{reference:t,display:n}}function zt(e){if(Yo(e))return e.reference;if(C$(e))return`${e.resourceType}/${e.id}`}function Us(e){if(e)return Yo(e)?e.reference.split("/")[1]:e.id}function E$(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Vi(e){if(E$(e)){const t=T$(e);if(t)return t}if(e.resourceType==="Device"){const t=R$(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Vo(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]),vA(t))return Vo(t);if(L$(t))return t.text}return zt(e)??""}function T$(e){const t=e.name;if(t&&t.length>0)return Nc(t[0])}function R$(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function D$(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=sE(n);if(r)return r}else return sE(t)}function sE(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function pA(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 a=n.getUTCFullYear(),o=n.getUTCMonth(),c=n.getUTCDate(),u=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=u-a;(f<o||f===o&&p<c)&&m--;let g=u*12+f-(a*12+o);p<c&&g--;const v=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:v}}function A$(e,t){const{years:n,months:r,days:a}=pA(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":a.toString().padStart(3,"0")+"D"}function Ji(e,...t){var r;let n=e;for(let a=0;a<t.length&&n;a++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(o=>o.url===t[a]);return n}function Ia(e,t){const n=W0(e);return JSON.stringify(n,null,t?2:void 0)??""}function W0(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?_$(e):k$(e):e}function _$(e){const t=e.length;if(t===0)return;let n,r=0;for(let a=0;a<t;a++){const o=e[a],c=W0(o);c!==o&&!n&&(n=Array.from(e)),c===void 0?n&&(n[a]=null):(n&&(n[a]=c),r++)}if(r!==0)return n??e}function k$(e){let t,n=0;for(const r in e){const a=e[r],o=W0(a);o!==a&&!t&&(t={...e}),o===void 0?t&&delete t[r]:(t&&(t[r]=o),n++)}if(n!==0)return t??e}function Tn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!En(e):!1}function En(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 si(e,t,n){return e===t||Tn(e)&&Tn(t)?!0:Tn(e)||Tn(t)?!1:Array.isArray(e)&&Array.isArray(t)?P$(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?N$(e,t,n):(sr(e)||sr(t),!1)}function P$(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!si(e[n],t[n]))return!1;return!0}function N$(e,t,n){const r=new Set;Object.keys(e).forEach(a=>r.add(a)),Object.keys(t).forEach(a=>r.add(a)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const a of r){const o=e[a],c=t[a];if(!si(o,c,a))return!1}return!0}function Y0(e,t){return Tn(e)?!0:Tn(t)?!1:Array.isArray(e)&&Array.isArray(t)?O$(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?M$(e,t):sr(e)||sr(t)?!1:e===t}function O$(e,t){return t.every(n=>e.some(r=>Y0(r,n)))}function M$(e,t){return Object.entries(t).every(([n,r])=>n in e&&Y0(e[n],r))}function Qr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function mA(e){return/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i.test(e)}function sr(e){return e!==null&&typeof e=="object"}function I$(e){return typeof e=="string"}function gA(e){return sr(e)&&"code"in e&&typeof e.code=="string"}function vA(e){return sr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(gA)}function L$(e){return sr(e)&&"text"in e&&typeof e.text=="string"}const yA=[];for(let e=0;e<256;e++)yA.push(e.toString(16).padStart(2,"0"));function z$(e){const t=xA(e),n=new Uint8Array(t),r=new Array(n.length);for(let a=0;a<n.length;a++)r[a]=yA[n[a]];return r.join("")}function $$(e){const t=xA(e),n=new Uint8Array(t),r=new Array(n.length);for(let a=0;a<n.length;a++)r[a]=String.fromCharCode(n[a]);return window.btoa(r.join(""))}function xA(e){return ArrayBuffer.isView(e)?e.buffer:e}function Hn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function K0(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function _s(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function U$(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(a=>a.system===t))==null?void 0:r.code}function B$(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const lE=e=>new Promise(t=>{setTimeout(t,e)});function Py(e,t,n){const r=[];for(let a=0;a<n-1;a++){const o=e.indexOf(t);if(o<0)break;r.push(e.slice(0,o)),e=e.slice(o+t.length)}return r.push(e),r}function V$(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Mu(e,t){return e?(e.push(t),e):[t]}function rd(e){return e.sort((t,n)=>t.localeCompare(n))}function X0(e){return e.endsWith("/")?e:e+"/"}function F$(e){return e.startsWith("/")?e.slice(1):e}function Xa(e,t){return new URL(F$(t),X0(e.toString())).toString()}function H$(e,t){return Xa(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function q$(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 bA(e,t){var n,r;return(r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function G$(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const a=e.meta.profile.indexOf(t);e.meta.profile.splice(a,1)}return e}function vc(e){if(!e)return"";switch(e.type){case"Address":return SA(e.value);case"CodeableConcept":return Vo(e.value);case"Coding":return Rd(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Nc(e.value);case"Quantity":return ks(e.value);case"Reference":return Q$(e.value);default:return e.value.toString()}}function Q$(e){return e?e.display??e.reference??Ia(e):""}function SA(e,t){if(!e)return"";const n=[];if(e.line&&n.push(...e.line),e.city||e.state||e.postalCode){const r=[];e.city&&r.push(e.city),e.state&&r.push(e.state),e.postalCode&&r.push(e.postalCode),n.push(r.join(", "))}return e.use&&(t!=null&&t.use)&&n.push("["+e.use+"]"),n.join(", ").trim()}function Nc(e,t){if(!e)return"";const n=[];if(e.prefix&&(t==null?void 0:t.prefix)!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&n.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&n.push("["+e.use+"]"),n.length===0){const r=id(e.text);if(r)return r}return n.join(" ").trim()}function Gp(e){return e instanceof Date&&!isNaN(e.getTime())}function W$(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Gp(r)?r.toLocaleTimeString(t,n):""}function gr(e,t,n){if(!e)return"";const r=new Date(e);return Gp(r)?r.toLocaleString(t,n):""}function Y$(e,t,n){return!e||!e.start&&!e.end?"":gr(e.start,t,n)+" - "+gr(e.end,t,n)}const K$={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},X$={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},Z$={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function wA(e){if(!e)return"";const t=[];return J$(t,e.repeat),e.event&&t.push(e.event.map(n=>gr(n)).join(", ")),Hn(t.join(" ").trim())}function J$(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,a=t.periodUnit;n===1&&r===1?e.push(K$[a]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+X$[a]):e.push("per "+r+" "+Z$[a])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Hn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(o=>W$(o)).join(", "))}function ad(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},a=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(a==null?void 0:a.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(a==null?void 0:a.value)===void 0?`>= ${ks(r)}`:(r==null?void 0:r.value)===void 0&&(a==null?void 0:a.value)!==void 0?`<= ${ks(a)}`:((r==null?void 0:r.unit)===(a==null?void 0:a.unit)&&(r==null||delete r.unit),`${ks(r)} - ${ks(a)}`)}function ks(e,t){if(!e)return"";const n=[];return e.comparator&&(n.push(e.comparator),n.push(" ")),e.value!==void 0&&n.push(e.value),e.unit&&(e.unit!=="%"&&n[n.length-1]!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function eU(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Vo(e){if(!e)return"";const t=id(e.text);return t||(e.coding?e.coding.map(n=>Rd(n)).join(", "):"")}function Rd(e,t){const n=id(e==null?void 0:e.display);return n?`${n}`:id(e==null?void 0:e.code)??""}function jA(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(ks(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Vo(e.valueCodeableConcept));else{const n=id(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>jA(n)).join(" / ")),t.join(" / ").trim()}function id(e){return typeof e=="string"?e:void 0}const oe={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function tU(e){var n;const t=Array.isArray(e)?e:((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];for(const r of t)(r==null?void 0:r.resourceType)==="StructureDefinition"&&r.kind==="resource"&&CA(r.type)}function CA(e){let t=li.types[e];return t||(t={searchParamsDetails:{}},li.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 nU(e){for(const t of e.base??[]){const n=CA(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function cE(e){var n,r,a,o;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?rU((o=((a=e.base)==null?void 0:a.path)??e.path)==null?void 0:o.split(".")):t}function rU(e){return e.length===1?e[0]:e.map(Hn).join("")}function Z0(e){var t;return(t=li.types[e])==null?void 0:t.searchParams}function aU(e,t){var n,r;return(r=(n=li.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function Bs(e){const t=e.replaceAll("[x]","").split(".").pop();return EA(t)}function EA(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(oU).join(" ").replace("_"," ").replace(/\s+/g," ")}const iU=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function oU(e){const t=e.toUpperCase();return e===t?e:iU.has(t)?t:t.charAt(0)+e.slice(1)}function Wo(e,t,n){const r=Hp(e,n);if(r)return sU(r.elements,t)}function sU(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const a=t[r];if(a>="A"&&a<="Z"){const o=t.slice(0,r)+"[x]",c=e[o];if(c)return c}}}function fi(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function Yo(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const li={types:{}};function yh(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 Pi=()=>[],Tr={empty:(e,t)=>Qe(t.length===0||t.every(n=>Tn(n.value))),hasValue:(e,t)=>Qe(t.length!==0),exists:(e,t,n)=>Qe(n?t.filter(r=>ei(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Tn(r.value))),all:(e,t,n)=>Qe(t.every(r=>ei(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Qe(!1);return Qe(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Qe(!0);return Qe(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Qe(!1);return Qe(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Qe(!0);return Qe(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Qe(!0);const r=n.eval(e,ys(e));return r.length===0?Qe(!1):Qe(t.every(a=>r.some(o=>o.value===a.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,ys(e));return r.length===0?Qe(!0):t.length===0?Qe(!1):Qe(r.every(a=>t.some(o=>o.value===a.value)))},count:(e,t)=>[{type:oe.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(a=>a.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Qe(t.length===Tr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>ei(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:Pi,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{var a;const r=(a=n.eval(e,t)[0])==null?void 0:a.value;if(typeof r!="number")throw new Error("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{var a;const r=(a=n.eval(e,t)[0])==null?void 0:a.value;if(typeof r!="number")throw new Error("Expected a number for take(num)");return r>=t.length?t:r<=0?[]:t.slice(0,r)},intersect:(e,t,n)=>{if(!n)return t;const r=n.eval(e,ys(e)),a=[];for(const o of t)!a.some(c=>c.value===o.value)&&r.some(c=>c.value===o.value)&&a.push(o);return a},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,ys(e)),a=[];for(const o of t)r.some(c=>c.value===o.value)||a.push(o);return a},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,ys(e));return cA([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,ys(e));return[...t,...r]},htmlChecks:(e,t,n)=>[pa(!0)],iif:(e,t,n,r,a)=>{const o=n.eval(e,t);if(o.length>1||o.length===1&&typeof o[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ei(o)?r.eval(e,t):a?a.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);if(typeof n=="boolean")return[{type:oe.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Qe(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Qe(!0);if(["false","f","no","n","0","0.0"].includes(r))return Qe(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Qe(Tr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return typeof n=="number"?[{type:oe.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:oe.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:oe.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Qe(Tr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:oe.date,value:yh(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Qe(Tr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:oe.dateTime,value:yh(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Qe(Tr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return typeof n=="number"?[{type:oe.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:oe.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:oe.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Qe(Tr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return da(n)?[{type:oe.Quantity,value:n}]:typeof n=="number"?[{type:oe.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:oe.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:oe.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Qe(Tr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);return n==null?[]:da(n)?[{type:oe.string,value:`${n.value} '${n.unit}'`}]:[{type:oe.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Qe(Tr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Za(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:oe.time,value:yh("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Qe(Tr.toTime(e,t).length===1),indexOf:(e,t,n)=>sa((r,a)=>r.indexOf(a),e,t,n),substring:(e,t,n,r)=>sa((a,o,c)=>{const u=o,f=c?u+c:a.length;return u<0||u>=a.length?void 0:a.substring(u,f)},e,t,n,r),startsWith:(e,t,n)=>sa((r,a)=>r.startsWith(a),e,t,n),endsWith:(e,t,n)=>sa((r,a)=>r.endsWith(a),e,t,n),contains:(e,t,n)=>sa((r,a)=>r.includes(a),e,t,n),upper:(e,t)=>sa(n=>n.toUpperCase(),e,t),lower:(e,t)=>sa(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>sa((a,o,c)=>a.replaceAll(o,c),e,t,n,r),matches:(e,t,n)=>sa((r,a)=>!!new RegExp(a).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>sa((a,o,c)=>a.replaceAll(new RegExp(o,"g"),c),e,t,n,r),length:(e,t)=>sa(n=>n.length,e,t),toChars:(e,t)=>sa(n=>n?n.split(""):void 0,e,t),encode:Pi,decode:Pi,escape:Pi,unescape:Pi,trim:Pi,split:Pi,join:(e,t,n)=>{var a;const r=((a=n==null?void 0:n.eval(e,ys(e))[0])==null?void 0:a.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:oe.string,value:t.map(o=>{var c;return((c=o.value)==null?void 0:c.toString())??""}).join(r)}]},abs:(e,t)=>Ya(Math.abs,e,t),ceiling:(e,t)=>Ya(Math.ceil,e,t),exp:(e,t)=>Ya(Math.exp,e,t),floor:(e,t)=>Ya(Math.floor,e,t),ln:(e,t)=>Ya(Math.log,e,t),log:(e,t,n)=>Ya((r,a)=>Math.log(r)/Math.log(a),e,t,n),power:(e,t,n)=>Ya(Math.pow,e,t,n),round:(e,t)=>Ya(Math.round,e,t),sqrt:(e,t)=>Ya(Math.sqrt,e,t),truncate:(e,t)=>Ya(n=>n|0,e,t),children:Pi,descendants:Pi,trace:(e,t,n)=>t,now:()=>[{type:oe.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:oe.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:oe.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,a)=>{var p;const o=Tr.toDateTime(e,n.eval(e,t));if(o.length===0)throw new Error("Invalid start date");const c=Tr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const u=(p=a.eval(e,t)[0])==null?void 0:p.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const f=pA(o[0].value,c[0].value);return[{type:oe.Quantity,value:{value:f[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof Lh?r=n.name:n instanceof J0&&(r=n.left.name+"."+n.right.name),r?t.map(a=>({type:oe.boolean,value:dA(a,r)})):[]},not:(e,t)=>Tr.toBoolean(e,t).map(n=>({type:oe.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let a;if(typeof r=="string")a=r;else if(typeof r=="object"){const o=r;if(o.resource)return pa(o.resource);o.reference?a=o.reference:o.type&&o.identifier&&(a=`${o.type}?identifier=${o.identifier.system}|${o.identifier.value}`)}if(a!=null&&a.includes("?")){const[o]=a.split("?");return{type:o,value:{resourceType:o}}}if(a!=null&&a.includes("/")){const[o,c]=a.split("/");return{type:o,value:{resourceType:o,id:c}}}return{type:oe.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:oe.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:oe.BackboneElement,value:{namespace:"System",name:"Integer"}}:fi(n)?{type:oe.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:oe.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const a=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(o=>{var c;return{type:oe.boolean,value:((c=o.value)==null?void 0:c.resourceType)===a}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:oe.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let a="";return n instanceof Lh&&(a=n.name),a&&!r.reference.startsWith(a+"/")?[]:[{type:oe.id,value:Us(r)}]},extension:(e,t,n)=>{var o;const r=n.eval(e,t)[0].value,a=(o=t==null?void 0:t[0])==null?void 0:o.value;if(a){const c=Ji(a,r);if(c)return[{type:oe.Extension,value:c}]}return[]}};function sa(e,t,n,...r){if(n.length===0)return[];const[{value:a}]=Za(n,1);if(typeof a!="string")throw new Error("String function cannot be called with non-string");const o=e(a,...r.map(c=>{var u;return(u=c==null?void 0:c.eval(t,n)[0])==null?void 0:u.value}));return o===void 0?[]:Array.isArray(o)?o.map(pa):[pa(o)]}function Ya(e,t,n,...r){if(n.length===0)return[];const[{value:a}]=Za(n,1),o=da(a),c=o?a.value:a;if(typeof c!="number")throw new Error("Math function cannot be called with non-number");const u=e(c,...r.map(m=>{var g;return(g=m.eval(t,n)[0])==null?void 0:g.value})),f=o?oe.Quantity:n[0].type,p=o?{...a,value:u}:u;return[{type:f,value:p}]}function Za(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 ys(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class TA{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const a of n)r.push(this.child.eval({parent:t,variables:{$this:a}},[a]));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 Wl{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Lh{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(a=>this.evalValue(a)).filter(a=>(a==null?void 0:a.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 fi(n,this.name)?t:gc(t,this.name)}toString(){return this.name}}class lU{eval(){return[]}toString(){return"{}"}}class cU extends $z{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 zh extends Cd{constructor(t,n){super("as",t,n)}eval(t,n){return Tr.ofType(t,this.left.eval(t,n),this.right)}}class Nr extends Cd{}class Da extends Nr{constructor(t,n,r,a){super(t,n,r),this.impl=a}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const a=this.right.eval(t,n);if(a.length!==1)return[];const o=r[0].value,c=a[0].value,u=da(o)?o.value:o,f=da(c)?c.value:c,p=this.impl(u,f);return typeof p=="boolean"?Qe(p):da(o)?[{type:oe.Quantity,value:{...o,value:p}}]:[pa(p)]}}class uU extends Cd{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n),o=[...r,...a];return o.length>0&&o.every(c=>typeof c.value=="string")?[{type:oe.string,value:o.map(c=>c.value).join("")}]:o}}class dU extends Nr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return Qe(r.some(o=>o.value===a[0].value))}}class fU extends Nr{constructor(t,n){super("in",t,n)}eval(t,n){const r=Bi(this.left.eval(t,n)),a=this.right.eval(t,n);return r?Qe(a.some(o=>qp(r,o)[0].value)):[]}}class J0 extends Cd{constructor(t,n){super(".",t,n)}eval(t,n){return this.right.eval(t,this.left.eval(t,n))}toString(){return`${this.left.toString()}.${this.right.toString()}`}}class eb extends Cd{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return cA([...r,...a])}}class hU extends Nr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return x$(r,a)}}class pU extends Nr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return b$(r,a)}}class mU extends Nr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return uA(r,a)}}class gU extends Nr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return y$(uA(r,a))}}class tb extends Nr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const a=this.right.name;return Qe(dA(r[0],a))}}class vU extends Nr{constructor(t,n){super("and",t,n)}eval(t,n){const r=Bi(this.left.eval(t,n),"boolean"),a=Bi(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(a==null?void 0:a.value)===!0?Qe(!0):(r==null?void 0:r.value)===!1||(a==null?void 0:a.value)===!1?Qe(!1):[]}}class yU extends Nr{constructor(t,n){super("or",t,n)}eval(t,n){const r=Bi(this.left.eval(t,n),"boolean"),a=Bi(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(a==null?void 0:a.value)===!1?Qe(!1):r!=null&&r.value||a!=null&&a.value?Qe(!0):[]}}class xU extends Nr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Bi(this.left.eval(t,n),"boolean"),a=Bi(this.right.eval(t,n),"boolean");return!r||!a?[]:Qe(r.value!==a.value)}}class bU extends Nr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Bi(this.left.eval(t,n),"boolean"),a=Bi(this.right.eval(t,n),"boolean");return(a==null?void 0:a.value)===!0||(r==null?void 0:r.value)===!1?Qe(!0):!r||!a?[]:Qe(!1)}}class nb{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Tr[this.name];if(!r)throw new Error("Unrecognized function: "+this.name);return r(t,n,...this.args)}toString(){return`${this.name}(${this.args.map(t=>t.toString()).join(", ")})`}}class rb{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 a=r[0].value;if(typeof a!="number")throw new Error("Invalid indexer expression: should return integer}");const o=this.left.eval(t,n);return a in o?[o[a]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const SU=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class wU{constructor(t,n,r,a){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(a!=null&&a.dateTimeLiterals),this.symbolRegex=(a==null?void 0:a.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
77
- `))}consumeString(t){this.advance();const r=this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t).replace(/\\u([0-9a-fA-F]{4})/g,(o,c)=>String.fromCodePoint(parseInt(c,16))),a=this.buildToken(t==="`"?"Symbol":"String",r);return this.advance(),a}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 a=this.str.substring(t,this.pos.index);return a.endsWith("T")?a=a.substring(0,a.length-1):!a.startsWith("T")&&n&&!r&&(a+="Z"),this.buildToken("DateTime",a)}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()===" "&&jU(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){var n;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((n=this.prevToken())==null?void 0:n.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
78
- `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,n){const r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:t,value:n,...r}}}function jU(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&SU.includes(e.value)))}const CU=["true","false"],EU=["!=","!~","<=",">=","{}","->"];function TU(e){return new wU(e,CU,EU).tokenize()}const Xt={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,Modulo:4,Add:5,Subtract:5,Ampersand:5,Is:6,As:6,Union:7,GreaterThan:8,GreaterThanOrEquals:8,LessThan:8,LessThanOrEquals:8,Equals:9,Equivalent:9,NotEquals:9,NotEquivalent:9,In:10,Contains:10,And:11,Xor:12,Or:12,Implies:13},RU={parse(e){var n;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((n=e.peek())==null?void 0:n.value)+"`");return t}},DU={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new rb(t,n)},precedence:Xt.Indexer},AU={parse(e,t){if(!(t instanceof Lh))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new nb(t.name,n)},precedence:Xt.FunctionCall};function _U(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r!=null&&r.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function kU(){return new Uz().registerPrefix("String",{parse:(e,t)=>new Wl({type:oe.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Wl({type:oe.dateTime,value:yh(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Wl({type:oe.Quantity,value:_U(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Wl({type:t.value.includes(".")?oe.decimal:oe.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Wl({type:oe.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Wl({type:oe.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Lh(t.value)}).registerPrefix("{}",{parse:()=>new lU}).registerPrefix("(",RU).registerInfix("[",DU).registerInfix("(",AU).prefix("+",Xt.UnaryAdd,(e,t)=>new cU("+",t,n=>n)).prefix("-",Xt.UnarySubtract,(e,t)=>new Da("-",t,t,(n,r)=>-r)).infixLeft(".",Xt.Dot,(e,t,n)=>new J0(e,n)).infixLeft("/",Xt.Divide,(e,t,n)=>new Da("/",e,n,(r,a)=>r/a)).infixLeft("*",Xt.Multiply,(e,t,n)=>new Da("*",e,n,(r,a)=>r*a)).infixLeft("+",Xt.Add,(e,t,n)=>new Da("+",e,n,(r,a)=>r+a)).infixLeft("-",Xt.Subtract,(e,t,n)=>new Da("-",e,n,(r,a)=>r-a)).infixLeft("|",Xt.Union,(e,t,n)=>new eb(e,n)).infixLeft("=",Xt.Equals,(e,t,n)=>new hU(e,n)).infixLeft("!=",Xt.NotEquals,(e,t,n)=>new pU(e,n)).infixLeft("~",Xt.Equivalent,(e,t,n)=>new mU(e,n)).infixLeft("!~",Xt.NotEquivalent,(e,t,n)=>new gU(e,n)).infixLeft("<",Xt.LessThan,(e,t,n)=>new Da("<",e,n,(r,a)=>r<a)).infixLeft("<=",Xt.LessThanOrEquals,(e,t,n)=>new Da("<=",e,n,(r,a)=>r<=a)).infixLeft(">",Xt.GreaterThan,(e,t,n)=>new Da(">",e,n,(r,a)=>r>a)).infixLeft(">=",Xt.GreaterThanOrEquals,(e,t,n)=>new Da(">=",e,n,(r,a)=>r>=a)).infixLeft("&",Xt.Ampersand,(e,t,n)=>new uU(e,n)).infixLeft("and",Xt.And,(e,t,n)=>new vU(e,n)).infixLeft("as",Xt.As,(e,t,n)=>new zh(e,n)).infixLeft("contains",Xt.Contains,(e,t,n)=>new dU(e,n)).infixLeft("div",Xt.Divide,(e,t,n)=>new Da("div",e,n,(r,a)=>r/a|0)).infixLeft("in",Xt.In,(e,t,n)=>new fU(e,n)).infixLeft("is",Xt.Is,(e,t,n)=>new tb(e,n)).infixLeft("mod",Xt.Modulo,(e,t,n)=>new Da("mod",e,n,(r,a)=>r%a)).infixLeft("or",Xt.Or,(e,t,n)=>new yU(e,n)).infixLeft("xor",Xt.Xor,(e,t,n)=>new xU(e,n)).infixLeft("implies",Xt.Implies,(e,t,n)=>new bU(e,n))}const PU=kU();function ab(e){return new TA(e,PU.construct(TU(e)).consumeAndParse())}function Oc(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const a=n[r];typeof a=="object"&&"type"in a&&"value"in a||(n[r]=pa(n[r]))}return Vs(e,n).map(r=>r.value)}function Vs(e,t,n={},r=void 0){let a;if(typeof e=="string"){const o=r==null?void 0:r.get(e);a=o??ab(e),r&&!o&&r.set(e,a)}else a=e;return a.eval({variables:n},t).map(o=>{var c;return{type:o.type,value:(c=o.value)==null?void 0:c.valueOf()}})}const Jn={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Mc(e,t){var r,a;let n=(a=(r=li.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:a[t.code];return n||(n=OU(e,t)),n}function NU(e,t,n){let r=li.types[e];r||(r={},li.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function OU(e,t){const n=t.code,r=zU(e,t.expression),a={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const u=xh(c),f=V$(()=>u.join("."));u.length===1&&u[0]instanceof Nr?a.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?a.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(a.array=!0,a.propertyTypes.add("code")):RA(a,u,e,1),f().endsWith("extension.valueDateTime")&&(a.array=!1)}const o={type:LU(t,a.propertyTypes),elementDefinitions:a.elementDefinitions,parsedExpression:$U(e,t.expression),array:a.array};return NU(e,n,o),o}function RA(e,t,n,r){const a=t[r];if(a instanceof zh){e.propertyTypes.add(a.right.toString());return}if(a instanceof nb){MU(e,a);return}const o=a.toString(),c=Wo(n,o);if(!c)throw new Error(`Element definition not found for ${n} ${o}`);let u=!1,f=r+1;f<t.length&&t[f]instanceof rb&&(u=!0,f++);const p=t[f];if(c.isArray&&!u&&(e.array=!0),f===t.length-1&&p instanceof zh){e.elementDefinitions.push(c),e.propertyTypes.add(p.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type)e.propertyTypes.add(m.code);return}for(const m of c.type){let g=m.code;IU(g)&&(g=c.type[0].code),RA(e,t,g,f)}}function MU(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 tb){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function IU(e){return e==="Element"||e==="BackboneElement"}function LU(e,t){switch(e.type){case"date":return t.size===1&&t.has(oe.date)?Jn.DATE:Jn.DATETIME;case"number":return Jn.NUMBER;case"quantity":return Jn.QUANTITY;case"reference":return t.has(oe.canonical)?Jn.CANONICAL:Jn.REFERENCE;case"token":return t.size===1&&t.has(oe.boolean)?Jn.BOOLEAN:Jn.TEXT;default:return Jn.TEXT}}function zU(e,t){const n=[],r=ab(t);return $h(e,r.child,n),n}function $U(e,t){const n=[],r=ab(t);if($h(e,r.child,n),n.length===0)return r;let a=n[0];for(let o=1;o<n.length;o++)a=new eb(a,n[o]);return new TA("<original-not-available>",a)}function $h(e,t,n){t instanceof eb?($h(e,t.left,n),$h(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function xh(e){if(e instanceof zh||e instanceof rb)return[xh(e.left),e].flat();if(e instanceof Nr)return[e];if(e instanceof J0)return[xh(e.left),xh(e.right)].flat();if(e instanceof nb){if(e.name==="where"&&!(e.args[0]instanceof tb))return[];if(e.name==="last")return[]}return[e]}const Qp=20,de={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"},DA={contains:de.CONTAINS,exact:de.EXACT,above:de.ABOVE,below:de.BELOW,text:de.TEXT,not:de.NOT,in:de.IN,"not-in":de.NOT_IN,"of-type":de.OF_TYPE,missing:de.MISSING,identifier:de.IDENTIFIER,iterate:de.ITERATE},ib={eq:de.EQUALS,ne:de.NOT_EQUALS,lt:de.LESS_THAN,le:de.LESS_THAN_OR_EQUALS,gt:de.GREATER_THAN,ge:de.GREATER_THAN_OR_EQUALS,sa:de.STARTS_AFTER,eb:de.ENDS_BEFORE,ap:de.APPROXIMATELY,sw:de.STARTS_WITH};function AA(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 a;n.includes("/")?a=n.split("/").filter(Boolean).pop():a=n;const o=[];return r&&o.push(...r.entries()),UU(a,o)}function UU(e,t){const n={resourceType:e};for(const[r,a]of t)BU(n,r,a);return n}function BU(e,t,n){var c,u;let r,a;const o=t.indexOf(":");if(o>=0?(r=t.substring(0,o),a=t.substring(o+1)):(r=t,a=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Mu(e.filters,{code:t,operator:de.EQUALS,value:n});return}switch(r){case"_sort":VU(e,n);break;case"_cursor":e.cursor=n;break;case"_count":e.count=parseInt(n,10);break;case"_offset":e.offset=parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const f=uE(n);a==="iterate"&&(f.modifier=de.ITERATE),e.include=Mu(e.include,f);break}case"_revinclude":{const f=uE(n);a==="iterate"&&(f.modifier=de.ITERATE),e.revInclude=Mu(e.revInclude,f);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const f=(u=(c=li.types[e.resourceType])==null?void 0:c.searchParams)==null?void 0:u[r];f?e.filters=Mu(e.filters,HU(f,a,n)):e.filters=Mu(e.filters,qU(r,a,n))}}}}function VU(e,t){for(const n of t.split(",")){let r,a=!1;n.startsWith("-")?(r=n.substring(1),a=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:a})}}const FU=[de.MISSING,de.PRESENT];function HU(e,t,n){if(FU.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:a}=GU(n);if(!dE(e,a))throw new dt(ri(`Invalid format for ${e.type} search parameter: ${a}`));return{code:e.code,operator:r,value:a}}case"reference":case"string":case"token":case"uri":if(!dE(e,n))throw new dt(ri(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:QU(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function qU(e,t,n){var a;let r=de.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in ib&&(n.length===2||(a=n.at(2))!=null&&a.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function GU(e){const t=e.substring(0,2),n=ib[t];return n?{operator:n,value:e.substring(2)}:{operator:de.EQUALS,value:e}}function QU(e){return DA[e]??de.EQUALS}function uE(e){const t=e.split(":");if(t.includes("*"))throw new dt(ri("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new dt(ri(`Invalid include value '${e}': must be of the form ResourceType:search-parameter`));if(t.length===2)return{resourceType:t[0],searchParam:t[1]};if(t.length===3)return{resourceType:t[0],searchParam:t[1],targetType:t[2]};throw new dt(ri(`Invalid include value '${e}'`))}function dE(e,t){switch(e.type){case"date":return Ih(t);default:return!0}}function tc(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(WU(n))),e.sortRules&&e.sortRules.length>0&&t.push(YU(e.sortRules)),e.cursor!==void 0&&t.push("_cursor="+encodeURIComponent(e.cursor)),e.offset!==void 0&&e.offset!==0&&t.push("_offset="+e.offset),e.count!==void 0&&t.push("_count="+e.count),e.total!==void 0&&t.push("_total="+e.total),e.types&&e.types.length>0&&t.push("_type="+e.types.join(",")),e.include&&e.include.forEach(n=>t.push(fE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(fE("_revinclude",n))),t.length===0?"":(rd(t),"?"+t.join("&"))}function WU(e){const t=e.operator in DA?":"+e.operator:"",n=e.operator!==de.EQUALS&&e.operator in ib?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function YU(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function fE(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function ob(e){const t=[];let n="",r=!1;for(const a of e)r?(n+=a,r=!1):a==="\\"?r=!0:a===","?(t.push(n),n=""):n+=a;return t.push(n),t}function KU(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!XU(e,t,n))return!1}return!0}function XU(e,t,n){var a,o;const r=(o=(a=li.types[t.resourceType])==null?void 0:a.searchParams)==null?void 0:o[n.code];if(!r)return!1;if(n.operator===de.MISSING||n.operator===de.PRESENT)return ZU(e,n,r);switch(r.type){case"reference":return JU(e,n,r);case"string":case"uri":return _A(e,n,r);case"token":return eB(e,n,r);case"date":return aB(e,n,r);default:return!1}}function ZU(e,t,n){const a=Oc(n.expression,e).length>0;return(t.operator===de.MISSING&&t.value==="false"||t.operator===de.PRESENT&&t.value==="true")===a}function JU(e,t,n){const r=Oc(n.expression,e),a=Wp(t.operator);if(t.value===""&&r.length===0)return t.operator===de.EQUALS;const o=r.map(c=>typeof c=="string"?c:c.reference);for(const c of ob(t.value)){let u=o.includes(c);if(!u&&t.code==="_compartment"&&(u=o.some(f=>f==null?void 0:f.endsWith("/"+c))),u)return!a}return a}function eB(e,t,n){return Mc(e.resourceType,n).type===Jn.BOOLEAN?tB(e,t,n):_A(e,t,n,!0)}function tB(e,t,n){const r=Oc(n.expression,e),a=t.value==="true",o=r.includes(a);return Wp(t.operator)?!o:o}function _A(e,t,n,r){var p,m,g,v;const o=(v=(g=(m=(p=Mc(e.resourceType,n).elementDefinitions)==null?void 0:p[0])==null?void 0:m.type)==null?void 0:g[0])==null?void 0:v.code,c=Oc(n.expression,e),u=ob(t.value),f=Wp(t.operator);for(const b of c)for(const S of u){let j;if(o===oe.Identifier?j=nB(b,t.operator,S):o===oe.CodeableConcept?j=rB(b,t.operator,S):j=Ny(b,t.operator,S,r),j)return!f}return f}function Ny(e,t,n,r){if(r&&n.includes("|")){const[o,c]=n.split("|");return Ny(e,t,o,!1)&&(!c||Ny(e,t,c,!1))}let a="";return e&&(typeof e=="string"?a=e:typeof e=="object"&&(a=JSON.stringify(e))),a.toLowerCase().includes(n.toLowerCase())}function nB(e,t,n){var r,a,o,c;if(n.includes("|")){const[u,f]=n.split("|").map(p=>p.toLowerCase());return!u&&!f?!1:u?((a=e.system)==null?void 0:a.toLowerCase())===u&&(!f||((o=e.value)==null?void 0:o.toLowerCase())===f):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===f}return((c=e.value)==null?void 0:c.toLowerCase())===n.toLowerCase()}function rB(e,t,n){var r,a,o,c;if(n.includes("|")){const[u,f]=n.split("|").map(p=>p.toLowerCase());return!u&&!f?!1:u?((a=e.coding)==null?void 0:a.some(p=>{var m,g;return((m=p.system)==null?void 0:m.toLowerCase())===u&&(!f||((g=p.code)==null?void 0:g.toLowerCase())===f)}))??!1:((r=e.coding)==null?void 0:r.some(p=>{var m;return!p.system&&((m=p.code)==null?void 0:m.toLowerCase())===f}))??!1}return((o=e.text)==null?void 0:o.toLowerCase())===n.toLowerCase()||(((c=e.coding)==null?void 0:c.some(u=>{var f;return((f=u.code)==null?void 0:f.toLowerCase())===n.toLowerCase()}))??!1)}function aB(e,t,n){const r=Oc(n.expression,e),a=ob(t.value),o=Wp(t.operator);for(const c of r)for(const u of a)if(iB(Uh(c),t.operator,Uh(u)))return!o;return o}function iB(e,t,n){if(!e)return!1;switch(t){case de.STARTS_AFTER:case de.GREATER_THAN:return e>n;case de.GREATER_THAN_OR_EQUALS:return e>=n;case de.ENDS_BEFORE:case de.LESS_THAN:return e<n;case de.LESS_THAN_OR_EQUALS:return e<=n;case de.EQUALS:case de.NOT_EQUALS:return e===n;default:return!1}}function Uh(e){if(I$(e))try{return new Date(e).toISOString()}catch(t){console.debug("Failed to parse date",e,t)}else if(fA(e)){if("start"in e)return Uh(e.start);if("end"in e)return Uh(e.end)}}function Wp(e){return e===de.NOT_EQUALS||e===de.NOT}const oB={resourceType:"*"},sB=["DomainConfiguration","JsonWebKey","Login"],lB=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],Ps={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},cB=[Ps.READ,Ps.VREAD,Ps.HISTORY,Ps.SEARCH];function uB(e,t){return sB.includes(t)?!1:dB(e,Ps.UPDATE,t)}function dB(e,t,n){var r;return!!((r=e.resource)!=null&&r.some(a=>PA(a,n,t)))}function kA(e,t,n){var r;return n?(r=n.resource)==null?void 0:r.find(a=>fB(e,t,a)):oB}function fB(e,t,n){var a,o;const r=e.resourceType;return!(!PA(n,r,t)||n.compartment&&!((o=(a=e.meta)==null?void 0:a.compartment)!=null&&o.some(c=>{var u;return c.reference===((u=n.compartment)==null?void 0:u.reference)}))||n.criteria&&!KU(e,AA(n.criteria)))}function PA(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||lB.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||cB.includes(n)}function hB(e){if(typeof window<"u"){const t=window.atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new window.TextDecoder().decode(n)}if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function hE(e){if(typeof window<"u"){const t=new window.TextEncoder().encode(e),n=String.fromCharCode.apply(null,t);return window.btoa(n)}if(typeof Buffer<"u")return Buffer.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function pB(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replace(/-/g,"+").replace(/_/g,"/");return hB(t)}function pE(){const e=new Uint32Array(28);return crypto.getRandomValues(e),z$(e.buffer)}async function mB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function NA(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function OA(e){var a;const t={};e=Qr(e);for(const o of e.entry||[]){const c=o.resource;if(!c)continue;c.meta!==void 0&&(delete c.meta.author,delete c.meta.compartment,delete c.meta.lastUpdated,delete c.meta.project,delete c.meta.versionId,Object.keys(c.meta).length===0&&delete c.meta);const u=c==null?void 0:c.id;u&&(t[u]=NA(),o.fullUrl="urn:uuid:"+t[u],(a=o.resource)==null||delete a.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(o=>{var c;return{fullUrl:o.fullUrl,request:{method:"POST",url:(c=o.resource)==null?void 0:c.resourceType},resource:o.resource}})},(o,c)=>gB(o,c,t),2);return vB(JSON.parse(r))}function gB(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 a=n[r];if(a)return"urn:uuid:"+a}}return t}function vB(e){const t=xB(e),{sorted:n,cycles:r}=yB(t),a={};for(const c of e.entry??[])c.fullUrl&&(a[c.fullUrl]=c);const o=n.map(c=>a[c]);for(const c of r)for(const u of c){const f=a[u],p={...f,request:{...f.request,method:"PUT"}};o.push(p)}return{...e,entry:o}}const Yl={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function yB(e){const t=[],n={},r=[];for(const o of Object.keys(e))n[o]=Yl.NotVisited;function a(o,c){if(n[o]===Yl.Visited)return!0;if(n[o]===Yl.Visiting){const f=c.lastIndexOf(o);return f!==-1&&r.push(c.slice(f)),!0}n[o]=Yl.Visiting,c.push(o);let u=!1;for(const f of e[o])a(f,c)||(u=!0);return n[o]=Yl.Visited,c.pop(),t.unshift(o),!u}for(const o in e)n[o]===Yl.NotVisited&&a(o,[]);return{sorted:t,cycles:r}}function MA(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Yo(r)){const a=r.reference;a.startsWith("urn:uuid:")&&t(a)}else MA(r,t)}}function xB(e){const t={};for(const n of e.entry||[])n.fullUrl&&(t[n.fullUrl]=[]);for(const n of e.entry||[]){const r=n.fullUrl;n.resource&&MA(n.resource,a=>{t[a]&&t[a].push(r)})}return t}const hn={FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",JSON:"application/json",JSON_PATCH:"application/json-patch+json",TEXT:"text/plain",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml"};class bB{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 a=0;a<r.length;a++)if(r[a]===n){r.splice(a,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}}class Yp{constructor(){this.emitter=new bB}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,n){this.emitter.addEventListener(t,n)}removeEventListener(t,n){this.emitter.removeEventListener(t,n)}removeAllListeners(){this.emitter.removeAllListeners()}}const Oy={"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"},SB=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],sb=["DiagnosticReport-update"];function wB(e){return sb.includes(e)}function jB(e){if(sb.includes(e))throw new dt(yn(`'context.version' is required for '${e}'.`))}const CB={"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 EB(e){return SB.includes(e)}function IA(e){return!!e.endpoint}function mE(e){if(!lb(e))throw new dt(yn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:a}=e,o={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":a.join(",")};return IA(e)&&(o.endpoint=e.endpoint),new URLSearchParams(o).toString()}function lb(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:a}=e;if(!(t&&n&&r&&a)||typeof r!="string"||typeof a!="object"||!Array.isArray(a)||a.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const o of a)if(!Oy[o])return!1;return!(IA(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function TB(e,t,n,r){if(typeof t!="object")throw new dt(yn(`context[${n}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new dt(yn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new dt(yn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const a=r.resourceType;if(a!=="*"){if(!EB(t.resourceType))throw new dt(yn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(a&&t.resourceType!==a)throw new dt(yn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${a}.`))}}function RB(e,t,n,r,a){if(a.set(t.key,(a.get(t.key)??0)+1),r.reference){if(!Yo(t.reference))throw new dt(yn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else TB(e,t.resource,n,r)}function DB(e,t){const n=new Map,r=CB[e];for(let a=0;a<t.length;a++){const o=t[a].key;if(!r[o])throw new dt(yn(`Key '${o}' not found for event '${e}'. Make sure to add only valid keys.`));RB(e,t[a],a,r[o],n)}for(const[a,o]of Object.entries(r)){if(!(o.optional||n.has(a)))throw new dt(yn(`Missing required key '${a}' on context for '${e}' event.`));if(!o.manyAllowed&&(n.get(a)??0)>1)throw new dt(yn(`${n.get(a)} context entries with key '${a}' found for the '${e}' event when schema only allows for 1.`))}}function gE(e,t,n,r){if(!(e&&typeof e=="string"))throw new dt(yn("Must provide a topic."));if(!Oy[t])throw new dt(yn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Oy).join(", ")}`));if(typeof n!="object")throw new dt(yn("context must be a context object or array of context objects."));if(sb.includes(t)&&!r)throw new dt(yn(`The '${t}' event must contain a 'context.versionId'.`));const a=Array.isArray(n)?n:[n];return DB(t,a),{timestamp:new Date().toISOString(),id:NA(),event:{"hub.topic":e,"hub.event":t,context:a,...r?{"context.versionId":r}:{}}}}class AB extends Yp{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new dt(yn("Subscription request should contain an endpoint."));if(!lb(t))throw new dt(yn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const a=JSON.parse(r.data);if(a["hub.topic"])return;const o=a;o.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:o}),n.send(JSON.stringify({id:a==null?void 0:a.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function _B(e){return JSON.parse(pB(e))}function kB(e){return e.split(".").length===3}function cb(e){const[t,n,r]=e.split(".");return _B(n)}function PB(e){try{return typeof cb(e).login_id=="string"}catch{return!1}}function NB(e){try{const n=cb(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class OB{constructor(t){this.medplum=t}async get(t){return this.medplum.get(`keyvalue/v1/${t}`)}async set(t,n){await this.medplum.put(`keyvalue/v1/${t}`,n,hn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var LA;LA=Symbol.toStringTag;class Aa{constructor(t){this[LA]="ReadablePromise",this.status="pending",this.suspender=t.then(n=>(this.status="success",this.response=n,n),n=>{throw this.status="error",this.error=n,n})}isPending(){return this.status==="pending"}isOk(){return this.status==="success"}read(){switch(this.status){case"pending":throw this.suspender;case"error":throw this.error;default:return this.response}}then(t,n){return this.suspender.then(t,n)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}class MB{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new IB)}clear(){this.storage.clear()}getString(t){return this.storage.getItem(t)??void 0}setString(t,n){n?this.storage.setItem(t,n):this.storage.removeItem(t)}getObject(t){const n=this.getString(t);return n?JSON.parse(n):void 0}setObject(t,n){this.setString(t,n?Ia(n):void 0)}}class IB{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}/*!
79
- * Reconnecting WebSocket
80
- * by Pedro Ladaria <pedro.ladaria@gmail.com>
81
- * https://github.com/pladaria/reconnecting-websocket
82
- * License MIT
83
- *
84
- * Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
85
- * https://github.com/partykit/partykit/blob/main/packages/partysocket
86
- */const ic={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let vE=!1;function LB(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");ic.Event=globalThis.Event,ic.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},ic.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function zB(e,t){if(!e)throw new Error(t)}function ih(e){return new e.constructor(e.type,e)}const xs={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let yE=!1;class Mo extends Yp{constructor(t,n,r={}){vE||(LB(),vE=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._closeCalled=!1,this._messageQueue=[],this._debugLogger=console.log.bind(console),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=a=>{this._debug("open event");const{minUptime:o=xs.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),o),zB(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(c=>{var u;return(u=this._ws)==null?void 0:u.send(c)}),this._messageQueue=[],this.onopen&&this.onopen(a),this.dispatchEvent(ih(a))},this._handleMessage=a=>{this._debug("message event"),this.onmessage&&this.onmessage(a),this.dispatchEvent(ih(a))},this._handleError=a=>{this._debug("error event",a.message),this._disconnect(void 0,a.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(a),this._debug("exec error listeners"),this.dispatchEvent(ih(a)),this._connect()},this._handleClose=a=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(a),this.dispatchEvent(ih(a))},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.binaryType?this._binaryType=this._options.binaryType:this._binaryType="blob",this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return Mo.CONNECTING}get OPEN(){return Mo.OPEN}get CLOSING(){return Mo.CLOSING}get CLOSED(){return Mo.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){var n;return this._messageQueue.reduce((r,a)=>(typeof a=="string"?r+=a.length:a instanceof Blob?r+=a.size:r+=a.byteLength,r),0)+(((n=this._ws)==null?void 0:n.bufferedAmount)??0)}get extensions(){var t;return((t=this._ws)==null?void 0:t.extensions)??""}get protocol(){var t;return((t=this._ws)==null?void 0:t.protocol)??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Mo.CLOSED:Mo.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(t=1e3,n){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)}reconnect(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=xs.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=xs.reconnectionDelayGrowFactor,minReconnectionDelay:n=xs.minReconnectionDelay,maxReconnectionDelay:r=xs.maxReconnectionDelay}=this._options;let a=0;return this._retryCount>0&&(a=n*Math.pow(t,this._retryCount-1),a>r&&(a=r)),this._debug("next delay",a),a}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=xs.maxRetries,connectionTimeout:n=xs.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"&&!yE&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),yE=!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 ic.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new ic.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new ic.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}}const $B=5e3;class My extends Yp{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 UB{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new My(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class BB{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof $A))throw new dt(yn("First arg of constructor should be a `MedplumClient`"));let a;try{a=new URL(n).toString()}catch{throw new dt(yn("Not a valid URL"))}const o=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(a,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new Mo(a,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=o,this.masterSubEmitter=new My,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??$B,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,a,o,c,u,f;try{const p=JSON.parse(n.data);if(p.type==="pong"){this.waitingForPong=!1;return}const m=p,g=(a=(r=m==null?void 0:m.entry)==null?void 0:r[0])==null?void 0:a.resource;if(g.type==="heartbeat"){(o=this.masterSubEmitter)==null||o.dispatchEvent({type:"heartbeat",payload:m});return}if(g.type==="handshake"){const b=Us(g.subscription),S={type:"connect",payload:{subscriptionId:b}};(c=this.masterSubEmitter)==null||c.dispatchEvent(S);const j=this.criteriaEntriesBySubscriptionId.get(b);if(!j){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}j.connecting=!1,j.emitter.dispatchEvent({...S});return}(u=this.masterSubEmitter)==null||u.dispatchEvent({type:"message",payload:m});const v=this.criteriaEntriesBySubscriptionId.get(Us(g.subscription));if(!v){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}v.emitter.dispatchEvent({type:"message",payload:m})}catch(p){console.error(p);const m={type:"error",payload:p};(f=this.masterSubEmitter)==null||f.dispatchEvent(m);for(const g of this.getAllCriteriaEmitters())g.dispatchEvent({...m})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new dt(Zz(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const a of this.getAllCriteriaEmitters())a.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,a;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(a=this.masterSubEmitter)==null||a.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const a of this.getAllCriteriaEmitters())a.dispatchEvent({...n});this.refreshAllSubscriptions().catch(console.error),this.pingTimer||(this.pingTimer=setInterval(()=>{if(this.waitingForPong){this.waitingForPong=!1,t.reconnect();return}t.send(JSON.stringify({type:"ping"})),this.waitingForPong=!0},this.pingIntervalMs))}),this.medplum.addEventListener("change",()=>{var r;const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&((r=this.currentProfile)==null?void 0:r.id)!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){var a;const r={type:"error",payload:n};(a=this.masterSubEmitter)==null||a.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const a={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(a),t.emitter.dispatchEvent({...a})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var c,u;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${zt(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),a=(c=r==null?void 0:r.find(f=>f.name==="token"))==null?void 0:c.valueString,o=(u=r==null?void 0:r.find(f=>f.name==="websocket-url"))==null?void 0:u.valueUrl;if(!a)throw new dt(yn("Failed to get token"));if(!o)throw new dt(yn("Failed to get URL from $get-ws-binding-token"));return[n,a]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const a of r.criteriaWithProps)if(si(n,a.subscriptionProps))return a}}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 a;this.criteriaEntries.has(n)?a=this.criteriaEntries.get(n):(a={criteriaWithProps:[]},this.criteriaEntries.set(n,a)),r?a.criteriaWithProps.push(t):a.bareCriteria=t}removeCriteriaEntry(t){var u;const{criteria:n,subscriptionProps:r,subscriptionId:a,token:o}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(f=>{const p=f.subscriptionProps;return!si(r,p)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(u=this.masterSubEmitter)==null||u._removeCriteria(n)),a&&this.criteriaEntriesBySubscriptionId.delete(a),o&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:o}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Xe(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 a=new UB(t,n);return this.addCriteriaEntry(a),this.subscribeToCriteria(a).catch(console.error),a.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 My(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const zA="4.1.11-9e19da462",VB=hn.FHIR_JSON+", */*; q=0.1",FB="https://api.medplum.com/",HB=1e3,qB=6e4,GB=0,QB=3e5,WB="Binary/",xE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},Kl={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"},YB={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},KB={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class $A extends Yp{constructor(t){if(super(),this.initComplete=!0,t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??XB(),this.storage=(t==null?void 0:t.storage)??new MB,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=X0((t==null?void 0:t.baseUrl)??FB),this.fhirBaseUrl=Xa(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Xa(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Xa(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Xa(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=Xa(this.baseUrl,(t==null?void 0:t.fhircastHubUrl)??"fhircast/STU3"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.credentialsInHeader=(t==null?void 0:t.authCredentialsMethod)==="header",this.defaultHeaders=(t==null?void 0:t.defaultHeaders)??{},this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.refreshGracePeriod=(t==null?void 0:t.refreshGracePeriod)??QB,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?GB:qB),this.cacheTime>0?this.requestCache=new XD((t==null?void 0:t.resourceCacheSize)??HB):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initPromise=Promise.resolve(),this.dispatchEvent({type:"storageInitialized"})):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0,this.dispatchEvent({type:"storageInitialized"})}).catch(n=>{console.error(n),this.initComplete=!0,this.dispatchEvent({type:"storageInitFailed",payload:{error:n}})})),this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}getFhircastHubUrl(){return this.fhircastHubUrl}getDefaultHeaders(){return this.defaultHeaders}clear(){this.storage.clear(),typeof window<"u"&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.refreshPromise=void 0,this.accessTokenExpires=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){var n;t=t.toString(),(n=this.requestCache)==null||n.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const n=Xa(this.fhirBaseUrl,t);if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let a;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?a=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))}):a=this.request("GET",t,n);const o=new Aa(a);return this.setCacheEntry(t,o),o}post(t,n,r,a={}){return t=t.toString(),this.setRequestBody(a,n),r&&this.setRequestContentType(a,r),this.invalidateUrl(t),this.request("POST",t,a)}put(t,n,r,a={}){return t=t.toString(),this.setRequestBody(a,n),r&&this.setRequestContentType(a,r),this.invalidateUrl(t),this.request("PUT",t,a)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,hn.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:a}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:a},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(window.location.search).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,a,o=!0){let c=a;o&&(c=await this.ensureCodeChallenge(a)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,c,o))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:Kl.TokenExchange,subject_token_type:YB.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,a,o=!0){const c=new URL(t);if(c.searchParams.set("response_type","code"),c.searchParams.set("client_id",n),c.searchParams.set("redirect_uri",r),c.searchParams.set("scope",a.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(a)),o){const{codeChallenge:u,codeChallengeMethod:f}=a;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(Xa(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=q$(n)),r}search(t,n,r){const a=this.fhirSearchUrl(t,n),o="search-"+a.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=this.getBundle(a,r);return this.setCacheEntry(o,u),u}searchOne(t,n,r){const a=this.fhirSearchUrl(t,n);a.searchParams.set("_count","1"),a.searchParams.sort();const o="searchOne-"+a.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new Aa(this.search(t,a.searchParams,r).then(f=>{var p,m;return(m=(p=f.entry)==null?void 0:p[0])==null?void 0:m.resource}));return this.setCacheEntry(o,u),u}searchResources(t,n,r){const o="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new Aa(this.search(t,n,r).then(wE));return this.setCacheEntry(o,u),u}async*searchResourcePages(t,n,r){var o,c;let a=this.fhirSearchUrl(t,n);for(;a;){const u=new URL(a).searchParams;u.has("_count")||u.set("_count","1000");const f=await this.search(t,u,r),p=(o=f.link)==null?void 0:o.find(m=>m.relation==="next");if(!((c=f.entry)!=null&&c.length)&&!p)break;yield wE(f),a=p!=null&&p.url?new URL(p.url):void 0}}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){var a,o;const r=(o=(a=this.requestCache)==null?void 0:a.get(this.fhirUrl(t,n).toString()))==null?void 0:o.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return xE;const[r,a]=n.split("/");if(!(!r||!a))return this.getCached(r,a)}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 Aa(Promise.reject(new Error("Missing reference")));if(r==="system")return new Aa(Promise.resolve(xE));const[a,o]=r.split("/");return!a||!o?new Aa(Promise.reject(new Error("Invalid reference"))):this.readResource(a,o,n)}requestSchema(t){if(iA(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const a=new Aa((async()=>{const o=`{
87
- StructureDefinitionList(_filter: "name eq ${t}") {
88
- resourceType,
89
- name,
90
- kind,
91
- description,
92
- type,
93
- url,
94
- snapshot {
95
- element {
96
- id,
97
- path,
98
- definition,
99
- min,
100
- max,
101
- base {
102
- path,
103
- min,
104
- max
105
- },
106
- contentReference,
107
- type {
108
- code,
109
- profile,
110
- targetProfile
111
- },
112
- binding {
113
- strength,
114
- valueSet
115
- }
116
- }
117
- }
118
- }
119
- SearchParameterList(base: "${t}", _count: 100) {
120
- base,
121
- code,
122
- type,
123
- expression,
124
- target
125
- }
126
- }`.replace(/\s+/g," "),c=await this.graphql(o);eE(c.data.StructureDefinitionList);for(const u of c.data.SearchParameterList)nU(u)})());return this.setCacheEntry(n,a),a}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&G0(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),a=this.getCacheEntry(r,void 0);if(a)return a.value;const o=new Aa((async()=>{if(n!=null&&n.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const u=await this.post(c.toString(),{});eE(u)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}aA(c)}})());return this.setCacheEntry(r,o),o}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,a){return this.get(this.fhirUrl(t,n,"_history",r),a)}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 a=this.fhirUrl(t.resourceType);r?r.headers?Array.isArray(r.headers)?r.headers.push(["If-None-Exist",n]):r.headers instanceof Headers?r.headers.set("If-None-Exist",n):r.headers["If-None-Exist"]=n:r.headers={"If-None-Exist":n}:r={headers:{"If-None-Exist":n}};const o=await this.post(a,t,void 0,r);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async upsertResource(t,n,r){const a=this.fhirSearchUrl(t.resourceType,n);let o=await this.put(a,t,void 0,r);return o||(o=t),this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async createAttachment(t,n,r,a,o){let c=jE(t,n,r,a);if(c.contentType===hn.XML){const p=c.data;let m;p instanceof Blob?m=await new Promise((g,v)=>{const b=new FileReader;b.onload=()=>{if(!b.result){v(new Error("Failed to load file"));return}g(b.result)},b.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?m=new TextDecoder().decode(p):m=p,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:hn.CDA_XML})}const u=o??(typeof n=="object"?n:{}),f=await this.createBinary(c,u);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,a,o){const c=jE(t,n,r,a),u=o??(typeof n=="object"?n:{}),{data:f,contentType:p,filename:m,securityContext:g,onProgress:v}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g!=null&&g.reference&&this.setRequestHeader(u,"X-Security-Context",g.reference),v?this.uploadwithProgress(b,f,p,v,u):this.post(b,f,p,u)}uploadwithProgress(t,n,r,a,o){return new Promise((c,u)=>{var g;const f=new XMLHttpRequest,p=()=>f.abort();(g=o==null?void 0:o.signal)==null||g.addEventListener("abort",p);const m=v=>{var b;(b=o==null?void 0:o.signal)==null||b.removeEventListener("abort",p),v instanceof Error?u(v):c(v)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),a&&(f.upload.onprogress=v=>a(v),f.upload.onload=v=>a(v)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new dt(Zt(f.response||f.statusText)))},f.open("POST",t),f.withCredentials=!0,f.setRequestHeader("Authorization","Bearer "+this.accessToken),f.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),f.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&f.setRequestHeader("X-Medplum","extended"),o!=null&&o.headers){const v=o.headers;for(const[b,S]of Object.entries(v))f.setRequestHeader(b,S)}f.send(n)})}async createPdf(t,n,r,a){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const o=eV(t,n,r,a),c=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:f,fonts:p,...m}=o,g=await this.createPdfImpl(u,f,p),v={...m,data:g,contentType:"application/pdf"};return this.createBinary(v,c)}createComment(t,n,r){const a=this.getProfile();let o,c;return t.resourceType==="Encounter"&&(o=on(t),c=t.subject),t.resourceType==="ServiceRequest"&&(o=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=on(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[on(t)],encounter:o,subject:c,sender:a?on(a):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,a){const o=await this.patch(this.fhirUrl(t,n),r,a);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),o}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,a){let o;if(typeof t=="string"){const c=t;o=this.fhirUrl("Bot",c,"$execute")}else{const c=t;o=this.fhirUrl("Bot","$execute"),o.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(o,n,r,a)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,hn.JSON,n)}graphql(t,n,r,a){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},hn.JSON,a)}readResourceGraph(t,n,r,a){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,a)}pushToAgent(t,n,r,a,o,c){return this.post(this.fhirUrl("Agent",Us(t),"$push"),{destination:typeof n=="string"?n:zt(n),body:r,contentType:a,waitForResponse:o},hn.FHIR_JSON,c)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||zt(this.sessionDetails.profile)!==((r=t.profile)==null?void 0:r.reference))&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}isAuthenticated(t){return this.accessTokenExpires!==void 0&&Date.now()<this.accessTokenExpires-(t??this.refreshGracePeriod)}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=NB(t),this.medplumServer=PB(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var a,o;return((a=r.profile)==null?void 0:a.reference)!==((o=t.profile)==null?void 0:o.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{var o,c;this.profilePromise=void 0;const a=((c=(o=this.sessionDetails)==null?void 0:o.profile)==null?void 0:c.id)!==r.profile.id;this.sessionDetails=r,a&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){var t;return!this.isInitialized||!!this.profilePromise&&!((t=this.sessionDetails)!=null&&t.profile)}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(WB)&&(t=this.fhirUrl(r));let a=n.headers;return a||(a={},n.headers=a),a.Accept||(a.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...a}=t,o=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});a.securityContext||(a.securityContext=on(o));const c=await this.createAttachment(a,n);return this.updateResource({...o,status:"completed",content:c})}async uploadMedia(t,n,r,a,o){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:a},o)}async createDocumentReference(t,n){const{additionalFields:r,...a}=t,o=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});a.securityContext||(a.securityContext=on(o));const c=await this.createAttachment(a,n);return this.updateResource({...o,content:[{attachment:c}]})}async bulkExport(t="",n,r,a){const o=t&&`${t}/`,c=this.fhirUrl(`${o}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),a)}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 OB(this)),this.keyValueClient}getBundle(t,n){return new Aa((async()=>{const r=await this.get(t,n);if(r.entry)for(const a of r.entry)this.cacheResource(a.resource);return r})())}getCacheEntry(t,n){if(!this.requestCache||(n==null?void 0:n.cache)==="no-cache"||(n==null?void 0:n.cache)==="reload")return;const r=this.requestCache.get(t);if(!(!r||r.requestTime+this.cacheTime<Date.now()))return r}setCacheEntry(t,n){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t){var n,r;t!=null&&t.id&&!((r=(n=t.meta)==null?void 0:n.tag)!=null&&r.some(a=>a.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Aa(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},a={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const o=await this.fetchWithRetry(n,r);if(o.status===401)return this.handleUnauthenticated(t,n,r);if(o.status===204||o.status===304)return;const c=o.headers.get("content-type"),u=c==null?void 0:c.includes("json");if(o.status===404&&!u)throw new dt(Kz);const f=await this.parseBody(o,u);if(o.status===200&&r.followRedirectOnOk||o.status===201&&r.followRedirectOnCreated){const p=await SE(o,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(o.status===202&&r.pollStatusOnAccepted){const m=await SE(o,f)??a.statusUrl;if(m)return this.pollStatus(m,r,a)}if(o.status>=400)throw new dt(Zt(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(a){throw console.error("Error parsing response",t.status,a),a}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Xa(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2;for(let a=0;a<=r;a++)try{this.options.verbose&&this.logRequest(t,n);const o=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(o),this.setCurrentRateLimit(o),a>=r||!tV(o))return o;const c=this.getRetryDelay(a),u=n.maxRetryTime??2e3;if(c>u)return o;await lE(c)}catch(o){if(o.message==="Failed to fetch"&&a===0&&this.dispatchEvent({type:"offline"}),o.name==="AbortError"||a===r)throw o}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const a of rd(Object.keys(r)))console.log(`> ${a}: ${r[a]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){var r;const n=(r=t.headers)==null?void 0:r.get("ratelimit");n&&(this.currentRateLimits=n)}rateLimitStatus(){if(!this.currentRateLimits)return[];const t=this.currentRateLimits;return t.split(/\s*;\s*/g).map(n=>{const r=n.split(/\s*,\s*/g);if(r.length!==3)throw new Error("Could not parse RateLimit header: "+t);const a=r[0].substring(1,r[0].length-1),o=r.find(p=>p.startsWith("r=")),c=o?parseInt(o.substring(2),10):NaN,u=r.find(p=>p.startsWith("t=")),f=u?parseInt(u.substring(2),10):NaN;if(!a||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:a,remainingUnits:c,secondsUntilReset:f}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const a of n)a.remainingUnits||(r=Math.max(r,a.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const a={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(a.headers={...n.headers},delete a.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const o=n.pollStatusPeriod??1e3;await lE(o),r.pollCount++}return this.request("GET",t,a,r)}async executeAutoBatch(){var a,o;if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const c=t[0];try{c.resolve(await this.request(c.method,Xa(this.fhirBaseUrl,c.url),c.options))}catch(u){c.reject(new dt(Zt(u)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(c=>({request:{method:c.method,url:c.url},resource:c.options.body?JSON.parse(c.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let c=0;c<t.length;c++){const u=t[c],f=(a=r.entry)==null?void 0:a[c];(o=f==null?void 0:f.response)!=null&&o.outcome&&!eA(f.response.outcome)?u.reject(new dt(f.response.outcome)):u.resolve(f==null?void 0:f.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",VB,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",hn.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,a=!1){t.headers||(t.headers={});const o=t.headers;a&&o[n]||(o[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||(n==null?void 0:n.constructor.name)==="Blob")||typeof File<"u"&&(n instanceof File||(n==null?void 0:n.constructor.name)==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||(n==null?void 0:n.constructor.name)==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new dt(nd)))}async startPkce(){const t=pE();sessionStorage.setItem("pkceState",t);const n=pE().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await mB(n),a=$$(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",a),{codeChallengeMethod:"S256",codeChallenge:a}}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??bE()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),window.location.assign(r.toString())}processCode(t,n){const r={grant_type:Kl.AuthorizationCode,code:t,client_id:(n==null?void 0:n.clientId)??this.clientId??"",redirect_uri:(n==null?void 0:n.redirectUri)??bE()};if(typeof sessionStorage<"u"){const a=sessionStorage.getItem("codeVerifier");a&&(r.code_verifier=a)}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:Kl.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:Kl.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:Kl.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:Kl.ClientCredentials,client_assertion_type:KB.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=hE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new dt(yn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new dt(yn("Invalid events provided. Events must be an array of event names containing at least one event."));const r={channelType:"websocket",mode:"subscribe",topic:t,events:n},o=(await this.post(this.fhircastHubUrl,mE(r),hn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!o)throw new Error("Invalid response!");return r.endpoint=o,r}async fhircastUnsubscribe(t){if(!lb(t))throw new dt(yn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new dt(yn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,mE(t),hn.FORM_URL_ENCODED)}fhircastConnect(t){return new AB(t)}async fhircastPublish(t,n,r,a){return wB(n)?this.post(this.fhircastHubUrl,gE(t,n,r,a),hn.JSON):(jB(n),this.post(this.fhircastHubUrl,gE(t,n,r),hn.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`,{cache:"no-cache"})}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":hn.FORM_URL_ENCODED};this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`),this.credentialsInHeader&&(n.delete("client_id"),n.delete("client_secret"),!this.basicAuth&&t.client_id&&t.client_secret&&(r.Authorization=`Basic ${hE(t.client_id+":"+t.client_secret)}`));const a={method:"POST",headers:r,body:n.toString(),credentials:"include"};let o;try{o=await this.fetchWithRetry(this.tokenUrl,a)}catch(u){throw this.refreshPromise=void 0,u}if(!o.ok){this.clearActiveLogin();try{const u=await o.json();throw new dt(ri(u.error_description))}catch(u){throw new dt(ri("Failed to fetch tokens"),u)}}const c=await o.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(kB(n)){const r=cb(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new dt(Xz);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new dt(ZC)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new dt(ZC)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){var n,r;return this.sessionDetails&&t?((r=(n=t.profile)==null?void 0:n.reference)==null?void 0:r.endsWith(this.sessionDetails.profile.id))??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)window.location.reload();else if(t.key==="activeLogin"){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;(n==null?void 0:n.profile.reference)!==(r==null?void 0:r.profile.reference)||!this.checkSessionDetailsMatchLogin(r)?window.location.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new BB(this,H$(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 XB(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function bE(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function SE(e,t){var a,o;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Fp(t)&&((o=(a=t.issue)==null?void 0:a[0])!=null&&o.diagnostics))return t.issue[0].diagnostics}function wE(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function ZB(e){return sr(e)&&"data"in e&&"contentType"in e}function jE(e,t,n,r){return ZB(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function JB(e){return sr(e)&&"docDefinition"in e}function eV(e,t,n,r){return JB(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function tV(e){return e.status===429||e.status>=500}function yc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:a,accessPolicyResource:o}){if(t===(e==null?void 0:e.path))return;a??(a=(e==null?void 0:e.debugMode)??!1),o??(o=e==null?void 0:e.accessPolicyResource);let c=nV(t,n,e,!!a);const u=Py(t,".",2)[1];c=rV(c,o,u),c=aV(c,o,u);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const m=Object.create(null);p=g=>{const v=Py(g,".",2)[1];if(v){if(!m[v]){const b=Bh(v,o==null?void 0:o.hiddenFields);m[v]={hidden:b,readonly:b||Bh(v,o==null?void 0:o.readonlyFields)}}return m[v]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:a,getExtendedProps:p,accessPolicyResource:o}}function nV(e,t,n,r){const a=Object.create(null);if(n)for(const[c,u]of Object.entries(n.elementsByPath)){const f=_s(e,c);f!==void 0&&(a[f]=u)}let o=!1;if(t)for(const[c,u]of Object.entries(t))c in a||(a[c]=u,o=!0);return r&&console.assert(o,"Unnecessary ElementsContext; not using any newly provided elements"),a}function rV(e,t,n){var a;if(!((a=t==null?void 0:t.hiddenFields)!=null&&a.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!Bh(r+o,t.hiddenFields)))}function aV(e,t,n){var o;if(!((o=t==null?void 0:t.readonlyFields)!=null&&o.length))return e;const r=Object.create(null),a=n?n+".":"";for(const[c,u]of Object.entries(e))Bh(a+c,t.readonlyFields)?r[c]={...u,readonly:!0}:r[c]=u;return r}function Bh(e,t){if(!(t!=null&&t.length))return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const a=n.slice(0,r).join(".");if(t.includes(a))return!0}return!1}function UA(e){return e.type!==void 0&&e.type.length>0}function iV(e,t,n,r){var o;const a=p$(e,t.path,{profileUrl:r});if(a){const c=((o=n.typeSchema)==null?void 0:o.elements)??n.elements;return a.some(u=>v$(u,t,n,c))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function BA(e,t,n,r){var a,o;if(e)for(const c of t){const u={value:e,type:((a=c.typeSchema)==null?void 0:a.type)??((o=c.type)==null?void 0:o[0].code)};if(n.every(f=>{var p;return iV(u,f,c,((p=c.typeSchema)==null?void 0:p.url)??r)}))return c.name}}class oV{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const a=yc({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(a===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[a],this.visitor=n}get elementsContext(){return this.elementsContextStack[this.elementsContextStack.length-1]}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const a=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([o])=>o.startsWith(n)));this.crawlElementsImpl(a,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const a=this.prepareSlices(r.slices,r);if(!En(a.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(a.slices[0],n.path,a),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=sV(t);for(const a of r)this.crawlElementNode(a,n)}crawlElementNode(t,n){var a,o;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const c of t.children)this.crawlElementNode(c,n);En((o=(a=t.element)==null?void 0:a.slicing)==null?void 0:o.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var o,c;const r=[];for(const u of t){if(!UA(u))continue;const f=(c=(o=u.type.find(p=>En(p.profile)))==null?void 0:o.profile)==null?void 0:c[0];if(En(f)){const p=Pc(f);p&&(u.typeSchema=p)}r.push(u)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const a of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(a))&&this.crawlSliceImpl(a,n,r)}crawlSliceImpl(t,n,r){const a=t.typeSchema;a&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(a),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let o;const c=(a==null?void 0:a.elements)??t.elements;En(c)&&(o=yc({path:n,parentContext:this.elementsContext,elements:c})),o&&this.elementsContextStack.push(o),this.crawlElementsImpl(c,n),o&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),a&&this.visitor.onExitSchema&&this.visitor.onExitSchema(a)}}function sV(e){const t=[];function n(o,c){return c.startsWith(o+".")}function r(o,c){for(const u of o.children)if(n(u.key,c.key)){r(u,c);return}o.children.push(c)}const a=Object.entries(e);a.sort((o,c)=>o[0].localeCompare(c[0]));for(const[o,c]of a){const u={key:o,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,o)){r(p,u),f=!0;break}f||t.push(u)}return t}const Fv="__sliceName";function lV(e,t){const n=new cV(e,e.resourceType,"resource");return new oV(t,n).crawlResource(),n.getDefaultValue()}function CE(e,t,n){for(const[r,a]of Object.entries(t)){if(n===void 0||n===r){Vh(e,r,a,t);continue}const o=_s(n,r);o!==void 0&&Vh(e,o,a,t)}return e}class cV{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Qr(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const a=this.value.values,o=this.value.path,c=_s(o,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${o}`);const u=[];for(const f of a){if(f===void 0)continue;const p=_s(r.path,o),m=Array.isArray(f)?f:[f];for(const g of m){uV(g,c,n,r.elements,p),Vh(g,c,n,r.elements);const v=Ly(g,c,r.elements,p);v!==void 0&&u.push(v)}}this.valueStack.push({type:"element",path:t,values:u})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const o=_s(this.value.path,t);if(o===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=_s(r.path,this.value.path);for(const u of this.value.values){const f=Ly(u,o,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];En(m)||f.splice(p,1)}Tn(f)&&Iy(u,void 0,o,n)}}onEnterSlice(t,n,r){const a=this.value.values,o=[];for(const c of a)if(c!==void 0){const u=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(u,n,r);o.push(f)}this.valueStack.push({type:"slice",path:t,values:o})}getMatchingSliceValues(t,n,r){const a=[];for(const o of t)(o[Fv]??BA(o,[n],r.discriminator,this.schema.url))===n.name&&a.push(o);for(let o=a.length;o<n.min;o++)if(K0(n.type[0].code)){const c=Object.create(null);a.push(c),t.push(c)}return a}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 a=n[r];Fv in a&&delete a[Fv]}}getDefaultValue(){return this.rootValue}}function uV(e,t,n,r,a){const o=Ly(e,t,r,a);n.min>0&&o===void 0&&K0(n.type[0].code)&&(n.isArray?Iy(e,[Object.create(null)],t,n):Iy(e,Object.create(null),t,n))}function Iy(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let a=n;if(n.includes("[x]")){const o=r.type[0].code;a=n.replace("[x]",Hn(o))}t===void 0?delete e[a]:e[a]=t}function Ly(e,t,n,r){const a=t.split(".");let o=e,c;for(let u=0;u<a.length;u++){let f=a[u];if(f.includes("[x]")){const p=(r?r+".":"")+a.slice(0,u+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",Hn(g))}if(u===a.length-1){Array.isArray(o)?c=o.map(p=>p[f]):c=o[f];continue}if(Array.isArray(o))o=o.map(p=>p[f]);else if(sr(o)){if(o[f]===void 0)return;o=o[f]}else return}return c}function Vh(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>Vh(u,t,n,r));e==null&&(e=Object.create(null));const a=e,o=t.split(".");let c=a;for(let u=0;u<o.length;u++){let f=o[u];if(f.includes("[x]")){const m=r[o.slice(0,u+1).join(".")].type[0].code;f=f.replace("[x]",Hn(m))}if(u===o.length-1){const p=Array.isArray(c)?c:[c];for(const m of p)n.fixed?m[f]??(m[f]=n.fixed.value):n.pattern&&(m[f]=VA(m[f],n.pattern.value))}else{if(!(f in c)){const p=o.slice(0,u+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return a}function VA(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Qr(t);if(sr(t)&&(sr(e)&&!Array.isArray(e)||e===void 0)){const n=Qr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=VA(n[r],t[r]);return n}return e}const dV="https://meta.medplum.com/releases",Hv=new Map;function fV(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!(n!=null&&n.length))throw new Error("Manifest missing assets list");for(const r of n){if(!r.browser_download_url)throw new Error("Asset missing browser download URL");if(!r.name)throw new Error("Asset missing name")}}async function hV(e,t,n){let r=Hv.get("latest");if(!r){const a="latest",o=new URL(`${dV}/${a}.json`);o.searchParams.set("a",e),o.searchParams.set("c",zA);const c=await fetch(o.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(p){console.error(`Failed to parse message from body: ${Xe(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const u=await c.json();fV(u),r=u,Hv.set("latest",r),Hv.set(r.tag_name.slice(1),r)}return r}async function pV(e){const t=await hV(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 FA=y.createContext(void 0);function Kp(){return y.useContext(FA)}function _e(){return Kp().medplum}function Xp(){return Kp().navigate}function Zp(){return Kp().profile}const EE=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function mV(e){const t=e.medplum,n=e.navigate??gV,[r,a]=y.useState({profile:t.getProfile(),loading:t.isLoading()});y.useEffect(()=>{function c(){a(u=>({...u,profile:t.getProfile(),loading:t.isLoading()}))}for(const u of EE)t.addEventListener(u,c);return()=>{for(const u of EE)t.removeEventListener(u,c)}},[t]);const o=y.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(FA.Provider,{value:o,children:e.children})}function gV(e){window.location.assign(e)}const TE=new Map,HA=e=>y.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 a=TE.get(t);if(a){const c=new URLSearchParams(new URL(a).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return a}return TE.set(t,e),e},[e]);function vV(e){const t=y.useRef(void 0);return y.useEffect(()=>{t.current=e}),t.current}function Qt(e,t){const n=_e(),[r,a]=y.useState(()=>RE(n,e)),o=y.useCallback(c=>{si(c,r)||a(c)},[r]);return y.useEffect(()=>{let c=!0;const u=RE(n,e);return!u&&Yo(e)?n.readReference(e).then(f=>{c&&o(f)}).catch(f=>{c&&(o(void 0),t&&t(Zt(f)))}):o(u),()=>c=!1},[n,e,o,t]),r}function RE(e,t){if(t){if(fi(t))return t;if(Yo(t))return e.getCachedReference(t)}}function yV(e,t,n={leading:!1}){const[r,a]=y.useState(e),o=y.useRef(!1),c=y.useRef(void 0),u=y.useRef(!1),f=y.useCallback(()=>window.clearTimeout(c.current),[]);return y.useEffect(()=>{o.current&&(!u.current&&n.leading?(u.current=!0,a(e)):(f(),c.current=setTimeout(()=>{u.current=!1,a(e)},t)))},[e,n.leading,t,f]),y.useEffect(()=>(o.current=!0,f),[f]),[r,f]}const xV=250;function bV(e,t,n){return qA("searchOne",e,t)}function xc(e,t,n){return qA("searchResources",e,t)}function qA(e,t,n,r){const a=_e(),[o,c]=y.useState(),[u,f]=y.useState(!0),[p,m]=y.useState(),[g,v]=y.useState(),b=a.fhirSearchUrl(t,n).toString(),[S]=yV(b,xV,{leading:!0});return y.useEffect(()=>{S!==o&&(c(S),a[e](t,n).then(j=>{f(!1),m(j),v(Yz)}).catch(j=>{f(!1),m(void 0),v(Zt(j))}))},[a,e,t,n,o,S]),[p,u,g]}function SV(e){const t=e.value;return t?s.jsx(s.Fragment,{children:SA(t)}):null}const GA=["meta","implicitRules","contained","extension","modifierExtension"],QA=["language","text"],cn=y.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});cn.displayName="ElementsContext";const ub=["extension","modifierExtension"],wV=["id",...GA].filter(e=>!ub.includes(e));function jV(e){return Object.entries(e).filter(([n,r])=>{var a;return!En(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||ub.includes(n)&&!En((a=r.slicing)==null?void 0:a.slices)||wV.includes(n)?!1:!(QA.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function DE(e,t){return e.line&&e.line.length>t?e.line[t]:""}function AE(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function CV(e){const[t,n]=y.useState(e.defaultValue||{}),r=y.useRef(t);r.current=t;const{getExtendedProps:a}=y.useContext(cn),[o,c,u,f,p,m,g]=y.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(T=>a(e.path+"."+T)),[a,e.path]);function v(T){n(T),e.onChange&&e.onChange(T)}function b(T){v({...r.current,use:T})}function S(T){v({...r.current,type:T})}function j(T){v(AE(r.current||{},0,T))}function C(T){v(AE(r.current||{},1,T))}function R(T){v({...r.current,city:T})}function D(T){v({...r.current,state:T})}function E(T){v({...r.current,postalCode:T})}return s.jsxs(je,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(ln,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:T=>b(T.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(ln,{disabled:e.disabled||(c==null?void 0:c.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:T=>S(T.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Line 1",defaultValue:DE(t,0),onChange:T=>j(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Line 2",defaultValue:DE(t,1),onChange:T=>C(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(p==null?void 0:p.readonly),placeholder:"City",defaultValue:t.city,onChange:T=>R(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"State",defaultValue:t.state,onChange:T=>D(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(g==null?void 0:g.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:T=>E(T.currentTarget.value)})]})}function EV(e){const t=Zp(),[n,r]=y.useState(e.defaultValue||{});function a(o){const c=o?{text:o,authorReference:t&&on(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return s.jsx(ze,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:o=>a(o.currentTarget.value)})}/**
127
- * @license @tabler/icons-react v3.17.0 - MIT
128
- *
129
- * This source code is licensed under the MIT license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */var TV={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
132
- * @license @tabler/icons-react v3.17.0 - MIT
133
- *
134
- * This source code is licensed under the MIT license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const Ve=(e,t,n,r)=>{const a=y.forwardRef(({color:o="currentColor",size:c=24,stroke:u=2,title:f,className:p,children:m,...g},v)=>y.createElement("svg",{ref:v,...TV[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:o}:{strokeWidth:u,stroke:o},...g},[f&&y.createElement("title",{key:"svg-title"},f),...r.map(([b,S])=>y.createElement(b,S)),...Array.isArray(m)?m:[m]]));return a.displayName=`${n}`,a};/**
137
- * @license @tabler/icons-react v3.17.0 - MIT
138
- *
139
- * This source code is licensed under the MIT license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */var RV=Ve("outline","adjustments-horizontal","IconAdjustmentsHorizontal",[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]]);/**
142
- * @license @tabler/icons-react v3.17.0 - MIT
143
- *
144
- * This source code is licensed under the MIT license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */var nl=Ve("outline","alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]);/**
147
- * @license @tabler/icons-react v3.17.0 - MIT
148
- *
149
- * This source code is licensed under the MIT license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */var DV=Ve("outline","arrow-down","IconArrowDown",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]]);/**
152
- * @license @tabler/icons-react v3.17.0 - MIT
153
- *
154
- * This source code is licensed under the MIT license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */var AV=Ve("outline","arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);/**
157
- * @license @tabler/icons-react v3.17.0 - MIT
158
- *
159
- * This source code is licensed under the MIT license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */var _V=Ve("outline","bleach-off","IconBleachOff",[["path",{d:"M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]]);/**
162
- * @license @tabler/icons-react v3.17.0 - MIT
163
- *
164
- * This source code is licensed under the MIT license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */var kV=Ve("outline","bleach","IconBleach",[["path",{d:"M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",key:"svg-0"}]]);/**
167
- * @license @tabler/icons-react v3.17.0 - MIT
168
- *
169
- * This source code is licensed under the MIT license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */var PV=Ve("outline","box-multiple","IconBoxMultiple",[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]]);/**
172
- * @license @tabler/icons-react v3.17.0 - MIT
173
- *
174
- * This source code is licensed under the MIT license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */var NV=Ve("outline","brackets-contain","IconBracketsContain",[["path",{d:"M7 4h-4v16h4",key:"svg-0"}],["path",{d:"M17 4h4v16h-4",key:"svg-1"}],["path",{d:"M8 16h.01",key:"svg-2"}],["path",{d:"M12 16h.01",key:"svg-3"}],["path",{d:"M16 16h.01",key:"svg-4"}]]);/**
177
- * @license @tabler/icons-react v3.17.0 - MIT
178
- *
179
- * This source code is licensed under the MIT license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */var OV=Ve("outline","brand-asana","IconBrandAsana",[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]]);/**
182
- * @license @tabler/icons-react v3.17.0 - MIT
183
- *
184
- * This source code is licensed under the MIT license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */var MV=Ve("outline","bucket-off","IconBucketOff",[["path",{d:"M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]);/**
187
- * @license @tabler/icons-react v3.17.0 - MIT
188
- *
189
- * This source code is licensed under the MIT license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */var IV=Ve("outline","bucket","IconBucket",[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]]);/**
192
- * @license @tabler/icons-react v3.17.0 - MIT
193
- *
194
- * This source code is licensed under the MIT license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */var LV=Ve("outline","building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]);/**
197
- * @license @tabler/icons-react v3.17.0 - MIT
198
- *
199
- * This source code is licensed under the MIT license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */var Po=Ve("outline","calendar","IconCalendar",[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]]);/**
202
- * @license @tabler/icons-react v3.17.0 - MIT
203
- *
204
- * This source code is licensed under the MIT license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */var eo=Ve("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
207
- * @license @tabler/icons-react v3.17.0 - MIT
208
- *
209
- * This source code is licensed under the MIT license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */var zV=Ve("outline","checkbox","IconCheckbox",[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]]);/**
212
- * @license @tabler/icons-react v3.17.0 - MIT
213
- *
214
- * This source code is licensed under the MIT license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */var db=Ve("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
217
- * @license @tabler/icons-react v3.17.0 - MIT
218
- *
219
- * This source code is licensed under the MIT license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */var $V=Ve("outline","circle-check","IconCircleCheck",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]);/**
222
- * @license @tabler/icons-react v3.17.0 - MIT
223
- *
224
- * This source code is licensed under the MIT license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */var Fh=Ve("outline","circle-minus","IconCircleMinus",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]]);/**
227
- * @license @tabler/icons-react v3.17.0 - MIT
228
- *
229
- * This source code is licensed under the MIT license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */var Hh=Ve("outline","circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]);/**
232
- * @license @tabler/icons-react v3.17.0 - MIT
233
- *
234
- * This source code is licensed under the MIT license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */var fb=Ve("outline","cloud-upload","IconCloudUpload",[["path",{d:"M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1",key:"svg-0"}],["path",{d:"M9 15l3 -3l3 3",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}]]);/**
237
- * @license @tabler/icons-react v3.17.0 - MIT
238
- *
239
- * This source code is licensed under the MIT license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */var UV=Ve("outline","columns","IconColumns",[["path",{d:"M4 6l5.5 0",key:"svg-0"}],["path",{d:"M4 10l5.5 0",key:"svg-1"}],["path",{d:"M4 14l5.5 0",key:"svg-2"}],["path",{d:"M4 18l5.5 0",key:"svg-3"}],["path",{d:"M14.5 6l5.5 0",key:"svg-4"}],["path",{d:"M14.5 10l5.5 0",key:"svg-5"}],["path",{d:"M14.5 14l5.5 0",key:"svg-6"}],["path",{d:"M14.5 18l5.5 0",key:"svg-7"}]]);/**
242
- * @license @tabler/icons-react v3.17.0 - MIT
243
- *
244
- * This source code is licensed under the MIT license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */var WA=Ve("outline","copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);/**
247
- * @license @tabler/icons-react v3.17.0 - MIT
248
- *
249
- * This source code is licensed under the MIT license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */var BV=Ve("outline","currency-dollar","IconCurrencyDollar",[["path",{d:"M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2",key:"svg-0"}],["path",{d:"M12 3v3m0 12v3",key:"svg-1"}]]);/**
252
- * @license @tabler/icons-react v3.17.0 - MIT
253
- *
254
- * This source code is licensed under the MIT license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */var VV=Ve("outline","device-floppy","IconDeviceFloppy",[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]]);/**
257
- * @license @tabler/icons-react v3.17.0 - MIT
258
- *
259
- * This source code is licensed under the MIT license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */var FV=Ve("outline","dots","IconDots",[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);/**
262
- * @license @tabler/icons-react v3.17.0 - MIT
263
- *
264
- * This source code is licensed under the MIT license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */var YA=Ve("outline","edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);/**
267
- * @license @tabler/icons-react v3.17.0 - MIT
268
- *
269
- * This source code is licensed under the MIT license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */var Dd=Ve("outline","equal-not","IconEqualNot",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]]);/**
272
- * @license @tabler/icons-react v3.17.0 - MIT
273
- *
274
- * This source code is licensed under the MIT license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */var Ad=Ve("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
277
- * @license @tabler/icons-react v3.17.0 - MIT
278
- *
279
- * This source code is licensed under the MIT license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */var _E=Ve("outline","file-alert","IconFileAlert",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]]);/**
282
- * @license @tabler/icons-react v3.17.0 - MIT
283
- *
284
- * This source code is licensed under the MIT license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */var HV=Ve("outline","file-plus","IconFilePlus",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]]);/**
287
- * @license @tabler/icons-react v3.17.0 - MIT
288
- *
289
- * This source code is licensed under the MIT license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */var qV=Ve("outline","filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);/**
292
- * @license @tabler/icons-react v3.17.0 - MIT
293
- *
294
- * This source code is licensed under the MIT license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */var GV=Ve("outline","forms","IconForms",[["path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3",key:"svg-0"}],["path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3",key:"svg-1"}],["path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7",key:"svg-2"}],["path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1",key:"svg-3"}],["path",{d:"M17 12h.01",key:"svg-4"}],["path",{d:"M13 12h.01",key:"svg-5"}]]);/**
297
- * @license @tabler/icons-react v3.17.0 - MIT
298
- *
299
- * This source code is licensed under the MIT license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */var QV=Ve("outline","id","IconId",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 8l2 0",key:"svg-2"}],["path",{d:"M15 12l2 0",key:"svg-3"}],["path",{d:"M7 16l10 0",key:"svg-4"}]]);/**
302
- * @license @tabler/icons-react v3.17.0 - MIT
303
- *
304
- * This source code is licensed under the MIT license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */var kE=Ve("outline","list-details","IconListDetails",[["path",{d:"M13 5h8",key:"svg-0"}],["path",{d:"M13 9h5",key:"svg-1"}],["path",{d:"M13 15h8",key:"svg-2"}],["path",{d:"M13 19h5",key:"svg-3"}],["path",{d:"M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-5"}]]);/**
307
- * @license @tabler/icons-react v3.17.0 - MIT
308
- *
309
- * This source code is licensed under the MIT license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */var WV=Ve("outline","lock-access","IconLockAccess",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M8 11m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]]);/**
312
- * @license @tabler/icons-react v3.17.0 - MIT
313
- *
314
- * This source code is licensed under the MIT license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */var YV=Ve("outline","lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]);/**
317
- * @license @tabler/icons-react v3.17.0 - MIT
318
- *
319
- * This source code is licensed under the MIT license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */var KV=Ve("outline","logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]);/**
322
- * @license @tabler/icons-react v3.17.0 - MIT
323
- *
324
- * This source code is licensed under the MIT license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */var KA=Ve("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
327
- * @license @tabler/icons-react v3.17.0 - MIT
328
- *
329
- * This source code is licensed under the MIT license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */var XA=Ve("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
332
- * @license @tabler/icons-react v3.17.0 - MIT
333
- *
334
- * This source code is licensed under the MIT license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */var XV=Ve("outline","message","IconMessage",[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]]);/**
337
- * @license @tabler/icons-react v3.17.0 - MIT
338
- *
339
- * This source code is licensed under the MIT license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */var ZV=Ve("outline","microscope","IconMicroscope",[["path",{d:"M5 21h14",key:"svg-0"}],["path",{d:"M6 18h2",key:"svg-1"}],["path",{d:"M7 18v3",key:"svg-2"}],["path",{d:"M9 11l3 3l6 -6l-3 -3z",key:"svg-3"}],["path",{d:"M10.5 12.5l-1.5 1.5",key:"svg-4"}],["path",{d:"M17 3l3 3",key:"svg-5"}],["path",{d:"M12 21a6 6 0 0 0 3.715 -10.712",key:"svg-6"}]]);/**
342
- * @license @tabler/icons-react v3.17.0 - MIT
343
- *
344
- * This source code is licensed under the MIT license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */var JV=Ve("outline","packages","IconPackages",[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-0"}],["path",{d:"M2 13.5v5.5l5 3",key:"svg-1"}],["path",{d:"M7 16.545l5 -3.03",key:"svg-2"}],["path",{d:"M17 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-3"}],["path",{d:"M12 19l5 3",key:"svg-4"}],["path",{d:"M17 16.5l5 -3",key:"svg-5"}],["path",{d:"M12 13.5v-5.5l-5 -3l5 -3l5 3v5.5",key:"svg-6"}],["path",{d:"M7 5.03v5.455",key:"svg-7"}],["path",{d:"M12 8l5 -3",key:"svg-8"}]]);/**
347
- * @license @tabler/icons-react v3.17.0 - MIT
348
- *
349
- * This source code is licensed under the MIT license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */var eF=Ve("outline","pin","IconPin",[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]]);/**
352
- * @license @tabler/icons-react v3.17.0 - MIT
353
- *
354
- * This source code is licensed under the MIT license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */var tF=Ve("outline","pinned-off","IconPinnedOff",[["path",{d:"M3 3l18 18",key:"svg-0"}],["path",{d:"M15 4.5l-3.249 3.249m-2.57 1.433l-2.181 .818l-1.5 1.5l7 7l1.5 -1.5l.82 -2.186m1.43 -2.563l3.25 -3.251",key:"svg-1"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-2"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-3"}]]);/**
357
- * @license @tabler/icons-react v3.17.0 - MIT
358
- *
359
- * This source code is licensed under the MIT license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */var nF=Ve("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
362
- * @license @tabler/icons-react v3.17.0 - MIT
363
- *
364
- * This source code is licensed under the MIT license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */var rF=Ve("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
367
- * @license @tabler/icons-react v3.17.0 - MIT
368
- *
369
- * This source code is licensed under the MIT license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */var aF=Ve("outline","receipt","IconReceipt",[["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2m4 -14h6m-6 4h6m-2 4h2",key:"svg-0"}]]);/**
372
- * @license @tabler/icons-react v3.17.0 - MIT
373
- *
374
- * This source code is licensed under the MIT license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */var iF=Ve("outline","refresh","IconRefresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]);/**
377
- * @license @tabler/icons-react v3.17.0 - MIT
378
- *
379
- * This source code is licensed under the MIT license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */var oF=Ve("outline","repeat","IconRepeat",[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]]);/**
382
- * @license @tabler/icons-react v3.17.0 - MIT
383
- *
384
- * This source code is licensed under the MIT license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */var sF=Ve("outline","report-medical","IconReportMedical",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]]);/**
387
- * @license @tabler/icons-react v3.17.0 - MIT
388
- *
389
- * This source code is licensed under the MIT license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */var lF=Ve("outline","router","IconRouter",[["path",{d:"M3 13m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17l0 .01",key:"svg-1"}],["path",{d:"M13 17l0 .01",key:"svg-2"}],["path",{d:"M15 13l0 -2",key:"svg-3"}],["path",{d:"M11.75 8.75a4 4 0 0 1 6.5 0",key:"svg-4"}],["path",{d:"M8.5 6.5a8 8 0 0 1 13 0",key:"svg-5"}]]);/**
392
- * @license @tabler/icons-react v3.17.0 - MIT
393
- *
394
- * This source code is licensed under the MIT license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */var cF=Ve("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);/**
397
- * @license @tabler/icons-react v3.17.0 - MIT
398
- *
399
- * This source code is licensed under the MIT license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */var zy=Ve("outline","settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]);/**
402
- * @license @tabler/icons-react v3.17.0 - MIT
403
- *
404
- * This source code is licensed under the MIT license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */var hb=Ve("outline","sort-ascending","IconSortAscending",[["path",{d:"M4 6l7 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l9 0",key:"svg-2"}],["path",{d:"M15 9l3 -3l3 3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
407
- * @license @tabler/icons-react v3.17.0 - MIT
408
- *
409
- * This source code is licensed under the MIT license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */var pb=Ve("outline","sort-descending","IconSortDescending",[["path",{d:"M4 6l9 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l7 0",key:"svg-2"}],["path",{d:"M15 15l3 3l3 -3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
412
- * @license @tabler/icons-react v3.17.0 - MIT
413
- *
414
- * This source code is licensed under the MIT license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */var uF=Ve("outline","square","IconSquare",[["path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}]]);/**
417
- * @license @tabler/icons-react v3.17.0 - MIT
418
- *
419
- * This source code is licensed under the MIT license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */var dF=Ve("outline","star","IconStar",[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z",key:"svg-0"}]]);/**
422
- * @license @tabler/icons-react v3.17.0 - MIT
423
- *
424
- * This source code is licensed under the MIT license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */var fF=Ve("outline","switch-horizontal","IconSwitchHorizontal",[["path",{d:"M16 3l4 4l-4 4",key:"svg-0"}],["path",{d:"M10 7l10 0",key:"svg-1"}],["path",{d:"M8 13l-4 4l4 4",key:"svg-2"}],["path",{d:"M4 17l9 0",key:"svg-3"}]]);/**
427
- * @license @tabler/icons-react v3.17.0 - MIT
428
- *
429
- * This source code is licensed under the MIT license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */var hF=Ve("outline","table-export","IconTableExport",[["path",{d:"M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-4"}]]);/**
432
- * @license @tabler/icons-react v3.17.0 - MIT
433
- *
434
- * This source code is licensed under the MIT license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */var pF=Ve("outline","text-recognition","IconTextRecognition",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M12 16v-7",key:"svg-4"}],["path",{d:"M9 9h6",key:"svg-5"}]]);/**
437
- * @license @tabler/icons-react v3.17.0 - MIT
438
- *
439
- * This source code is licensed under the MIT license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */var mb=Ve("outline","trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);/**
442
- * @license @tabler/icons-react v3.17.0 - MIT
443
- *
444
- * This source code is licensed under the MIT license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */var PE=Ve("outline","upload","IconUpload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]);/**
447
- * @license @tabler/icons-react v3.17.0 - MIT
448
- *
449
- * This source code is licensed under the MIT license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */var mF=Ve("outline","webhook","IconWebhook",[["path",{d:"M4.876 13.61a4 4 0 1 0 6.124 3.39h6",key:"svg-0"}],["path",{d:"M15.066 20.502a4 4 0 1 0 1.934 -7.502c-.706 0 -1.424 .179 -2 .5l-3 -5.5",key:"svg-1"}],["path",{d:"M16 8a4 4 0 1 0 -8 0c0 1.506 .77 2.818 2 3.5l-3 5.5",key:"svg-2"}]]);/**
452
- * @license @tabler/icons-react v3.17.0 - MIT
453
- *
454
- * This source code is licensed under the MIT license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */var Fs=Ve("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
457
- * @license @tabler/icons-react v3.17.0 - MIT
458
- *
459
- * This source code is licensed under the MIT license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */var gF=Ve("filled","circle-filled","IconCircleFilled",[["path",{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",key:"svg-0"}]]);class ZA extends y.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?s.jsx(Yi,{icon:s.jsx(nl,{size:16}),title:"Something went wrong",color:"red",children:Xe(this.state.error)}):this.props.children}}function ma(){return s.jsx(er,{style:{width:"100%",height:"100vh"},children:s.jsx(_r,{})})}const vF="_main_6f7o5_1",yF={main:vF};function pn(e){e.preventDefault(),e.stopPropagation()}function JA(e){return e.button===1||e.ctrlKey||e.metaKey}function e_(e){if(NE(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&NE(t[0]))return!0}return!1}function NE(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Qu(e,t){return new Promise((n,r)=>{var o;const a=new MessageChannel;a.port1.onmessage=({data:c})=>{a.port1.close(),c.error?r(c.error):n(c.result)},(o=e.contentWindow)==null||o.postMessage(t,new URL(e.src).origin,[a.port2])})}function t_(e,t){const n=new Blob([e],{type:hn.JSON}),r=URL.createObjectURL(n),a=document.createElement("a");a.href=r;const o=t??new Date().toISOString().replace(/\D/g,"");a.download=`${o}.json`,document.body.appendChild(a),a.click(),URL.revokeObjectURL(r)}function bt(e){const t=Xp(),{to:n,suffix:r,label:a,onClick:o,children:c,...u}=e;let f=xF(n);return r&&(f+="/"+r),s.jsx(Pt,{href:f,"aria-label":a,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),o?(p.preventDefault(),o(p)):n&&(JA(p)||(p.preventDefault(),t(f)))},...u,children:c})}function xF(e){if(e){if(typeof e=="string")return bF(e);if(fi(e))return SF(e);if(Yo(e))return wF(e)}return"#"}function bF(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function SF(e){return`/${e.resourceType}/${e.id}`}function wF(e){return`/${e.reference}`}function jF(e){const t=e.split(" ").filter(Boolean);return t.length>1?t[0][0]+t[t.length-1][0]:t.length===1?t[0][0]:""}function Ko(e){const t=Qt(e.value),n=t?Vi(t):e.alt??"",r=jF(n),a=(t&&D$(t))??e.src,o=HA(a??void 0),c=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?s.jsx(bt,{to:t,children:s.jsx(Ls,{src:o,alt:n,radius:c,...u,children:r})}):s.jsx(Ls,{src:o,alt:n,radius:c,...u,children:r})}const CF="_logoButton_189g3_1",EF="_user_189g3_11",TF="_userName_189g3_21",RF="_userActive_189g3_31",oh={logoButton:CF,user:EF,userName:TF,userActive:RF};function gb(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Nc(t,e.options)}):null}function DF(e){var f,p,m;const t=Kp(),{medplum:n,profile:r,navigate:a}=t,o=n.getLogins(),{colorScheme:c,setColorScheme:u}=dO();return s.jsxs(s.Fragment,{children:[s.jsxs(We,{align:"center",p:"xl",children:[s.jsx(Ko,{size:"xl",radius:100,value:t.profile}),s.jsx(gb,{value:(p=(f=t.profile)==null?void 0:f.name)==null?void 0:p[0]}),s.jsx(De,{c:"dimmed",size:"xs",children:(m=n.getActiveLogin())==null?void 0:m.project.display})]}),o.length>1&&s.jsx(we.Divider,{}),o.map(g=>g.profile.reference!==zt(t.profile)&&s.jsx(we.Item,{onClick:()=>{n.setActiveLogin(g).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(je,{children:[s.jsx(Ls,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(De,{size:"sm",fw:500,children:g.profile.display}),s.jsx(De,{c:"dimmed",size:"xs",children:g.project.display})]})]})},g.profile.reference)),s.jsx(we.Divider,{}),s.jsx(je,{justify:"center",children:s.jsx(Bp,{size:"xs",value:c,onChange:g=>u(g),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(fF,{size:14,stroke:1.5}),onClick:()=>a("/signin"),children:"Add another account"}),s.jsx(we.Item,{leftSection:s.jsx(zy,{size:14,stroke:1.5}),onClick:()=>a(`/${zt(r)}`),children:"Account settings"}),s.jsx(we.Item,{leftSection:s.jsx(KV,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),a("/signin")},children:"Sign out"}),s.jsx(De,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const OE={selectedItems:"selected-items",options:"options"};function vb(e){const t=gd({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:a,error:o,defaultValue:c,toOption:u,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:v,onCreate:b,creatable:S,clearable:j,required:C,placeholder:R,leftSection:D,maxValues:E,optionsDropdownMaxHeight:T=320,minInputLength:A=0,...k}=e,M=k.disabled,L=AF(c),[$,V]=y.useState(""),[Y,Q]=y.useState(),[J,G]=y.useState(),[Z,P]=y.useState(),[I,z]=y.useState(L.map(u)),[H,O]=y.useState([]),U=p??_F,K=m??kF,ee=g??PF,be=y.useRef($);be.current=$;const xe=y.useRef(void 0),ye=y.useRef(void 0),qe=y.useRef(Y);qe.current=Y;const Ne=y.useRef(J);Ne.current=J;const tt=y.useRef(Z);tt.current=Z;const Ae=y.useRef(H);Ae.current=H;const gt=y.useCallback(()=>{var me;if(Q(void 0),be.current===ye.current&&f===xe.current||(((me=be.current)==null?void 0:me.length)??0)<A)return;ye.current=be.current,xe.current=f;const Te=new AbortController;G(Te),f(be.current??"",Te.signal).then(ge=>{Te.signal.aborted||(O(ge.map(u)),tt.current?(ge.length>0&&v(ge.slice(0,1)),P(!1)):ge.length>0&&t.openDropdown())}).catch(ge=>{Te.signal.aborted||ge.message.includes("aborted")||Pe({color:"red",message:Xe(ge)})}).finally(()=>{Te.signal.aborted||G(void 0)})},[t,f,v,u,A]),Mt=y.useCallback(Te=>{(H&&H.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),V(Te.currentTarget.value),Ne.current&&(Ne.current.abort(),G(void 0)),qe.current!==void 0&&window.clearTimeout(qe.current);const me=window.setTimeout(()=>gt(),100);Q(me)},[t,H,S,gt]),It=y.useCallback(Te=>{const me=I.some(Se=>Se.value===Te),ge=me?I.filter(Se=>Se.value!==Te):[...I];let ke=H==null?void 0:H.find(Se=>Se.value===Te);if(!ke&&S!==!1&&b){const Se=b(Te);ke=u(Se)}if(ke){if(E===0){v([ke.resource]),I.length>0&&z([]);return}me||ge.push(ke)}if(E!==void 0)for(;ge.length>E;)ge.shift();v(ge.map(Se=>Se.resource)),z(ge)},[S,H,I,E,v,b,u]),mt=y.useMemo(()=>{if(!M)return Te=>{M||(E===1&&(V(""),O([]),t.closeDropdown()),ye.current=void 0,Te==="$create"?(V(""),It($)):It(Te))}},[It,t,M,E,$]),Dt=y.useCallback(Te=>{const me=I.filter(ge=>ge.value!==Te.value);v(me.map(ge=>ge.resource)),z(me)},[I,v]),nn=y.useCallback(Te=>{Te.key==="Enter"?(Y||J)&&P(!0):Te.key==="Backspace"&&$.length===0&&(pn(Te),Dt(I[I.length-1]))},[J,Dt,$.length,I,Y]);y.useEffect(()=>()=>{Ne.current&&Ne.current.abort()},[]);const Ce=!M&&j&&I.length>0&&s.jsx(ct.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{V(""),z([]),v([]),t.closeDropdown()}}),Re=S&&$.trim().length>0,Ge=H.length>0||Re;return s.jsxs(ct,{store:t,onOptionSubmit:mt,withinPortal:!0,shadow:"xl",...k,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(pc,{label:r,description:a,error:o,className:e.className,leftSection:D,rightSection:J?s.jsx(_r,{size:16}):Ce,required:C,disabled:M,children:s.jsxs(zs.Group,{"data-testid":OE.selectedItems,children:[I.map(Te=>s.jsx(K,{item:Te,disabled:M,onRemove:()=>Dt(Te)},Te.value)),!M&&(E===void 0||E===0||I.length<E)&&s.jsx(ct.EventsTarget,{children:s.jsx(pc.Field,{role:"searchbox",name:n,value:$,placeholder:R,onFocus:Mt,onBlur:()=>{t.closeDropdown(),V("")},onKeyDown:nn,onChange:Mt})})]})})}),s.jsx(ct.Dropdown,{hidden:!Ge,"data-testid":OE.options,children:s.jsx(ct.Options,{children:s.jsxs(mp,{type:"scroll",mah:T,children:[H.map(Te=>{const me=I.some(ge=>ge.value===Te.value);return s.jsx(ct.Option,{value:Te.value,active:me,children:s.jsx(U,{...Te,active:me})},Te.value)}),Re&&s.jsxs(ct.Option,{value:"$create",children:["+ Create ",$]}),!S&&$.trim().length>0&&H.length===0&&s.jsx(ee,{search:$})]})})})]})}function AF(e){return e?Array.isArray(e)?e:[e]:[]}function _F(e){return s.jsxs(je,{gap:"xs",children:[e.active&&s.jsx(eo,{size:12}),s.jsx("span",{children:e.label})]})}function kF({item:e,disabled:t,onRemove:n}){return s.jsx(zs,{withRemoveButton:!t,onRemove:n,children:e.label})}function PF(){return s.jsx(ct.Empty,{children:"Nothing found"})}const NF="_searchInput_dick8_1",OF={searchInput:NF};function MF(e){return{value:e.id,label:Vi(e),resource:e}}function IF(e){const t=Xp(),n=_e(),r=y.useCallback(async(o,c)=>{const u=zF(o),f={signal:c},p=await n.graphql(u,void 0,void 0,f);return $F(p,o)},[n]),a=y.useCallback(o=>{o.length>0&&t(`/${zt(o[0])}`)},[t]);return s.jsx(vb,{size:"sm",radius:"md",className:OF.searchInput,leftSection:s.jsx(cF,{size:16}),placeholder:"Search",itemComponent:LF,toOption:MF,onChange:a,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const LF=y.forwardRef(({resource:e,active:t,...n},r)=>{var o;let a;return e.resourceType==="Patient"?a=e.birthDate:e.resourceType==="ServiceRequest"&&(a=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...n,children:s.jsxs(je,{wrap:"nowrap",children:[s.jsx(Ko,{value:e}),s.jsxs("div",{children:[s.jsx(De,{children:Vi(e)}),s.jsx(De,{size:"xs",c:"dimmed",children:a})]})]})})});function zF(e){const t=JSON.stringify(e);return mA(e)?`{
462
- Patients1: PatientList(_id: ${t}, _count: 1) {
463
- resourceType
464
- id
465
- identifier {
466
- system
467
- value
468
- }
469
- name {
470
- given
471
- family
472
- }
473
- birthDate
474
- }
475
- ServiceRequestList(_id: ${t}, _count: 1) {
476
- resourceType
477
- id
478
- identifier {
479
- system
480
- value
481
- }
482
- subject {
483
- display
484
- }
485
- }
486
- }`.replace(/\s+/g," "):`{
487
- Patients1: PatientList(name: ${t}, _count: 5) {
488
- resourceType
489
- id
490
- identifier {
491
- system
492
- value
493
- }
494
- name {
495
- given
496
- family
497
- }
498
- birthDate
499
- }
500
- Patients2: PatientList(identifier: ${t}, _count: 5) {
501
- resourceType
502
- id
503
- identifier {
504
- system
505
- value
506
- }
507
- name {
508
- given
509
- family
510
- }
511
- birthDate
512
- }
513
- ServiceRequestList(identifier: ${t}, _count: 5) {
514
- resourceType
515
- id
516
- identifier {
517
- system
518
- value
519
- }
520
- subject {
521
- display
522
- }
523
- }
524
- }`.replace(/\s+/g," ")}function $F(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),BF(UF(n),t).slice(0,5)}function UF(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 BF(e,t){return e.sort((n,r)=>ME(r,t)-ME(n,t))}function ME(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,IE(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,IE(Nc(r),t));return n}function IE(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function VF(e){var a;const t=Zp(),[n,r]=y.useState(!1);return s.jsx(Ar.Header,{p:8,style:{zIndex:101},children:s.jsxs(je,{justify:"space-between",children:[s.jsxs(je,{gap:"xs",children:[s.jsx(tr,{className:oh.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(IF,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(je,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(we,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(we.Target,{children:s.jsx(tr,{className:Ut(oh.user,{[oh.userActive]:n}),onClick:()=>r(o=>!o),children:s.jsxs(je,{gap:7,children:[s.jsx(Ko,{value:t,radius:"xl",size:24}),s.jsx(De,{size:"sm",className:oh.userName,children:Nc((a=t==null?void 0:t.name)==null?void 0:a[0])}),s.jsx(db,{size:12,stroke:1.5})]})})}),s.jsx(we.Dropdown,{children:s.jsx(DF,{version:e.version})})]})]})]})})}const yb=y.createContext({submitting:!1});yb.displayName="FormContext";function FF(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?HF(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&qF(t,n);return t}function HF(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function qF(e,t){e[t.name]=t.value}function pt(e){const[t,n]=y.useState(!1);return s.jsx(yb.Provider,{value:{submitting:t},children:s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const a=FF(r.target);if(e.onSubmit){n(!0);const o=e.onSubmit(a);o!=null&&o.then?o.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function Or(e){const{children:t,...n}=e,{submitting:r}=y.useContext(yb);return s.jsx(Oe,{type:"submit",loading:r,...n,children:t})}function GF(e){const t=_e(),n=t.getUserConfiguration();function r(a){var m,g;const{menuname:o,bookmarkname:c}=a,u=`${e.pathname}?${e.searchParams.toString()}`,f=Qr(n),p=(m=f.menu)==null?void 0:m.find(({title:v})=>v===o);(g=p==null?void 0:p.link)==null||g.push({name:c,target:u}),t.updateResource(f).then(v=>{n.menu=v.menu,t.dispatchEvent({type:"change"}),Pe({color:"green",message:"Success"}),e.onOk()}).catch(v=>{Pe({color:"red",message:Xe(v)})})}return s.jsx($n,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(pt,{onSubmit:r,children:s.jsxs(We,{children:[s.jsx(QF,{config:n}),s.jsx(ze,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(je,{justify:"flex-end",children:s.jsx(Or,{mt:"sm",children:"OK"})})]})})})}function QF(e){function t(r){var a;return(a=r==null?void 0:r.menu)==null?void 0:a.map(o=>o.title)}const n=t(e.config);return s.jsx(ln,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function n_(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function WF(e){return typeof e.display=="string"?e.display:n_(e)}function YF(e){return{value:n_(e),label:WF(e),resource:e}}function KF(e){return{code:e,display:e}}function Jp(e){const t=_e(),{binding:n,creatable:r,clearable:a,expandParams:o,withHelpText:c,...u}=e,f=y.useCallback(async(p,m)=>{var S;if(!n)return[];const v=((S=(await t.valueSetExpand({...o,url:n,filter:p,count:10},{signal:m})).expansion)==null?void 0:S.contains)??[],b=[];for(const j of v)j.code&&!b.some(C=>C.code===j.code)&&b.push(j);return b},[t,o,n]);return s.jsx(vb,{...u,creatable:r??!0,clearable:a??!0,toOption:YF,loadOptions:f,onCreate:KF,itemComponent:c?XF:void 0})}const XF=y.forwardRef(({label:e,resource:t,active:n,...r},a)=>s.jsx("div",{ref:a,...r,children:s.jsxs(je,{wrap:"nowrap",gap:"xs",children:[n&&s.jsx(eo,{size:12}),s.jsxs("div",{children:[s.jsx(De,{children:e}),s.jsx(De,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function r_(e){const{defaultValue:t,onChange:n,withHelpText:r,...a}=e,[o,c]=y.useState(t);function u(f){const p=f[0],m=JF(p);c(m),n&&n(m)}return s.jsx(Jp,{defaultValue:ZF(o),onChange:u,withHelpText:r??!0,...a})}function ZF(e){return e?{code:e}:void 0}function JF(e){return e==null?void 0:e.code}function xb(e){const[t,n]=y.useState(e.defaultValue),r=e.onChange,a=y.useCallback(o=>{n(o),r&&r(o)},[r]);return s.jsx(r_,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:a,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 eH="_menuTitle_9g6l5_1",tH="_link_9g6l5_9",nH="_linkActive_9g6l5_38",$y={menuTitle:eH,link:tH,linkActive:nH};function rH(e){var u;const t=Xp(),n=oH(e.pathname,e.searchParams,e.menus),[r,a]=y.useState(!1);function o(f,p){f.stopPropagation(),f.preventDefault(),t(p),window.innerWidth<768&&e.closeNavbar()}function c(f){f&&t(`/${f}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Ar.Navbar,{children:s.jsxs(Yr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(Ar.Section,{mb:"sm",children:s.jsx(xb,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:f=>c(f)},window.location.pathname)}),s.jsxs(Ar.Section,{grow:!0,children:[(u=e.menus)==null?void 0:u.map(f=>{var p;return s.jsxs(y.Fragment,{children:[s.jsx(De,{className:$y.menuTitle,children:f.title}),(p=f.links)==null?void 0:p.map(m=>s.jsxs(aH,{to:m.href,active:m.href===(n==null?void 0:n.href),onClick:g=>o(g,m.href),children:[s.jsx(iH,{icon:m.icon}),s.jsx("span",{children:m.label})]},m.href))]},`menu-${f.title}`)}),e.displayAddBookmark&&s.jsx(Oe,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(rF,{size:"0.75rem"}),onClick:()=>a(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(GF,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>a(!1),onCancel:()=>a(!1)})]})}function aH(e){return s.jsx(bt,{onClick:e.onClick,to:e.to,className:Ut($y.link,{[$y.linkActive]:e.active}),children:e.children})}function iH(e){return e.icon?e.icon:s.jsx(Vp,{w:30})}function oH(e,t,n){if(!e||!t||!n)return;let r,a=0;for(const o of n)if(o.links)for(const c of o.links){const u=sH(e,t,c.href);u>a&&(a=u,r=c)}return r}function sH(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const a=["_count","_offset"];for(const[c,u]of r.searchParams.entries())if(!a.includes(c)&&t.get(c)!==u)return 0;let o=1;for(const[c,u]of t.entries())a.includes(c)||r.searchParams.get(c)===u&&o++;return o}function lH(e){const[t,n]=y.useState(localStorage.navbarOpen==="true"),r=_e(),a=Zp();y.useEffect(()=>{function f(){Pe({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",f),()=>r.removeEventListener("offline",f)},[r]);function o(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){o(!1)}function u(){o(!t)}return r.isLoading()?s.jsx(ma,{}):s.jsxs(Ar,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!a||!t,mobile:!a||!t}},padding:0,children:[a&&s.jsx(VF,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:u,notifications:e.notifications}),a&&t?s.jsx(rH,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(Ar.Main,{className:yF.main,children:s.jsx(ZA,{children:s.jsx(y.Suspense,{fallback:s.jsx(ma,{}),children:e.children})})})]})}const cH="https://ccda.medplum.com",uH="https://ccda-validator.medplum.com/";function dH(e){const{url:t}=e,[n,r]=y.useState(!1),a=y.useRef(null),[o,c]=y.useState(),[u,f]=y.useState(!1);y.useEffect(()=>{t&&n&&a.current&&(Qu(a.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{f(!0);const b=await(await fetch(t)).text(),S=new FormData;S.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${uH}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 R=await C.json();c(R)}catch(v){c(void 0),console.error("CCDA validation error:",v)}finally{f(!1)}},m=()=>{if(!o)return;const v=JSON.stringify(o,null,2);t_(v,"ccda-validation-results")},g=()=>o?o.resultsMetaData.resultMetaData.filter(v=>v==null?void 0:v.type.includes("Error")).reduce((v,b)=>v+(b.count||0),0):0;return t?s.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[s.jsx("div",{style:{minHeight:400},children:s.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:a,src:cH,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),s.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[s.jsx(Oe,{type:"button",onClick:p,disabled:u,children:u?"Validating...":"Validate"}),o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{marginLeft:"15px"},children:[s.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),s.jsx(Oe,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function _d(e){const{contentType:t,url:n,title:r}=e.value??{},a=HA(n);return a?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:a,alt:r}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:a})}),((t==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&s.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:a+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===hn.CDA_XML&&s.jsx(dH,{url:a}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Pt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:fH(r),children:r||"Download"})})]}):null}function fH(e){return e!=null&&e.includes(".")?e:void 0}const hH="_root_17n8t_1",pH="_compact_17n8t_25",LE={root:hH,compact:pH};function bb(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:Ut(LE.root,{[LE.compact]:n}),children:t})}function Li(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function mH(e){var r;const t=(r=e.values)==null?void 0:r.map((a,o)=>s.jsx("div",{children:s.jsx(_d,{value:a,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(!En(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const a=e.path.split(".").pop();n=s.jsx(Li,{term:Bs(a),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function Sb(e){const t=_e(),n=y.useRef(null);function r(c){var u;pn(c),(u=n.current)==null||u.click()}function a(c){pn(c);const u=c.target.files;u&&Array.from(u).forEach(o)}function o(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Zt(f))}))}return s.jsxs(s.Fragment,{children:[s.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:c=>a(c)}),e.children({onClick:r,disabled:e.disabled})]})}function gH(e){const[t,n]=y.useState(e.defaultValue??[]),r=y.useRef(t);r.current=t;function a(o){n(o),e.onChange&&e.onChange(o)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((o,c)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(_d,{value:o,maxWidth:200})}),s.jsx("td",{children:s.jsx(_n,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{pn(u);const f=t.slice();f.splice(c,1),a(f)},children:s.jsx(Fh,{})})})]},`${c}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(Sb,{disabled:e.disabled,onUpload:o=>{a([...r.current,o])},children:o=>s.jsx(_n,{...o,title:"Add",variant:"subtle",size:"sm",color:o.disabled?"gray":"green",children:s.jsx(fb,{})})})})]})]})]})}function a_(e){const[t,n]=y.useState(e.defaultValue);function r(a){n(a),e.onChange&&e.onChange(a)}return t?s.jsxs(s.Fragment,{children:[s.jsx(_d,{value:t,maxWidth:200}),s.jsx(Oe,{disabled:e.disabled,onClick:a=>{pn(a),r(void 0)},children:"Remove"})]}):s.jsx(Sb,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:a=>s.jsx(Oe,{...a,children:"Upload..."})})}const vH="_root_1vii2_1",yH={root:vH};function kd(e){const{children:t,...n}=e;return s.jsx(c0,{className:yH.root,...n,children:t})}const xH="_paper_1igaj_1",bH="_fill_1igaj_20",zE={paper:xH,fill:bH};function wb(e){const{width:t,fill:n,className:r,children:a,...o}=e,c=t?{maxWidth:t}:void 0;return s.jsx(mr,{className:Ut(zE.paper,n&&zE.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...o,children:a})}function ot(e){const{children:t,...n}=e;return s.jsx(kd,{children:s.jsx(wb,{...n,children:t})})}function Ua(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),s.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function Nt(e,t){var n,r,a;return(a=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(o=>{var c;return i_((c=o.expression)==null?void 0:c[0],t)}))==null?void 0:r.map(o=>{var c;return(c=o.details)==null?void 0:c.text}))==null?void 0:a.join(`
525
- `)}function Pd(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var a;return i_((a=r.expression)==null?void 0:a[0],t)})}const sh=/\[\d+\]/;function i_(e,t){const n=typeof e=="string"&&sh.test(e),r=typeof t=="string"&&sh.test(t);if(n!==r&&(e=e==null?void 0:e.replace(sh,""),t=t==null?void 0:t.replace(sh,"")),e===t)return!0;if(!e||!t)return!1;const a=e.indexOf(".");if(a>=0&&e.substring(a+1)===t)return!0;const o=t.indexOf(".");return o>=0&&t.substring(o+1)===e}function o_(e){const t=_e(),[n,r]=y.useState();return s.jsxs(pt,{onSubmit:async a=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:a.projectName}))}catch(o){r(Zt(o))}},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Le,{children:"Create project"})]}),s.jsxs(We,{gap:"xl",children:[s.jsx(ze,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Nt(n,"projectName")}),s.jsxs(De,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Or,{children:"Create project"})})]})}function s_(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 l_(e){const t=_e(),{googleClientId:n,handleGoogleCredential:r}=e,a=y.useRef(null),[o,c]=y.useState(typeof google<"u"),[u,f]=y.useState(!1),[p,m]=y.useState(!1);return y.useEffect(()=>{if(typeof google>"u"){s_("https://accounts.google.com/gsi/client",()=>c(!0));return}u||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),a.current&&!p&&(google.accounts.id.renderButton(a.current,{}),m(!0))},[t,n,u,o,a,p,r]),n?s.jsx("div",{ref:a}):null}function c_(e){if(e)return e;if(typeof window<"u"){const t=window.location.protocol+"//"+window.location.host;if([].includes(t))return"__GOOGLE_CLIENT_ID__"}}function ba(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Yi,{icon:s.jsx(nl,{size:16}),color:"red",children:t.map(r=>{var a;return s.jsx("div",{"data-testid":"text-field-error",children:nA(r)},(a=r.details)==null?void 0:a.text)})})}function u_(e){typeof grecaptcha>"u"&&s_("https://www.google.com/recaptcha/api.js?render="+e)}function d_(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function SH(e){const t=c_(e.googleClientId),n=e.recaptchaSiteKey,r=_e(),[a,o]=y.useState(),c=Pd(a,void 0);return y.useEffect(()=>{n&&u_(n)},[n]),s.jsxs(pt,{onSubmit:async u=>{o(void 0);try{let f="";n&&(f=await d_(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:u.firstName,lastName:u.lastName,email:u.email,password:u.password,remember:u.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){o(Zt(f))}},children:[s.jsx(er,{style:{flexDirection:"column"},children:e.children}),s.jsx(ba,{issues:c}),t&&s.jsxs(s.Fragment,{children:[s.jsx(je,{justify:"center",p:"xl",style:{height:70},children:s.jsx(l_,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(f){o(Zt(f))}}})}),s.jsx(jn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(We,{gap:"xl",children:[s.jsx(ze,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Nt(a,"firstName")}),s.jsx(ze,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Nt(a,"lastName")}),s.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Nt(a,"email")}),s.jsx(Na,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Nt(a,"password")}),s.jsxs(De,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(De,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Pt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(je,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Fn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(Or,{children:"Create account"})]})]})}function wH(e){const{type:t,projectId:n,clientId:r,googleClientId:a,recaptchaSiteKey:o,onSuccess:c}=e,u=_e(),[f,p]=y.useState(),[m,g]=y.useState();y.useEffect(()=>{t==="patient"&&f&&u.startNewPatient({login:f,projectId:n}).then(b=>u.processCode(b.code)).then(()=>c()).catch(b=>g(Zt(b)))},[u,t,n,f,c]);function v(b){b.code?u.processCode(b.code).then(()=>c()).catch(console.log):b.login&&p(b.login)}return s.jsxs(ot,{width:450,children:[m&&s.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&s.jsx(SH,{projectId:n,clientId:r,googleClientId:a,recaptchaSiteKey:o,handleAuthResponse:v,children:e.children}),f&&t==="project"&&s.jsx(o_,{login:f,handleAuthResponse:v})]})}function jH(e){const[t,n]=y.useState();return t?s.jsx(EH,{email:t,...e}):s.jsx(CH,{setEmail:n,...e})}function CH(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:a,disableEmailAuth:o,...c}=e,u=_e(),f=!e.disableGoogleAuth&&c_(e.googleClientId),[p,m]=y.useState(),g=Pd(p,void 0),v=y.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await u.ensureCodeChallenge(c),domain:j.domain}),R=new URL(j.authorizeUrl);return R.searchParams.set("state",C),window.location.assign(R.toString()),!0},[u,c]),b=y.useCallback(async j=>{const C=await u.post("auth/method",{email:j.email});await v(C)||t(j.email)},[u,v,t]),S=y.useCallback(async j=>{try{const C=await u.startGoogleLogin({...c,googleCredential:j.credential});await v(C)||r(C)}catch(C){m(Zt(C))}},[u,c,v,r]);return s.jsxs(pt,{onSubmit:b,children:[s.jsx(er,{style:{flexDirection:"column"},children:a}),s.jsx(ba,{issues:g}),f&&s.jsxs(s.Fragment,{children:[s.jsx(je,{justify:"center",p:"xl",style:{height:70},children:s.jsx(l_,{googleClientId:f,handleGoogleCredential:S})}),!o&&s.jsx(jn,{label:"or",labelPosition:"center",my:"lg"})]}),!o&&s.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Nt(p,"email")}),s.jsxs(je,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Pt,{component:"button",type:"button",c:"dimmed",onClick:n,size:"xs","data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:"Register"})}),!o&&s.jsx(Or,{children:"Next"})]})]})}function EH(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...a}=e,o=_e(),[c,u]=y.useState(),f=Pd(c,void 0),p=y.useCallback(m=>{o.startLogin({...a,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>u(Zt(g)))},[o,a,n]);return s.jsxs(pt,{onSubmit:p,children:[s.jsx(er,{style:{flexDirection:"column"},children:r}),s.jsx(ba,{issues:f}),s.jsx(We,{gap:"xl",children:s.jsx(Na,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Nt(c,"password")})}),s.jsxs(je,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Pt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Fn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(Or,{children:"Sign in"})]})]})}function TH(e){const t=_e(),n=gd(),[r,a]=y.useState(""),[o,c]=y.useState();function u(g){var v;return!!((v=g==null?void 0:g.toLowerCase())!=null&&v.includes(r.toLowerCase()))}function f(g){var v,b;return u((v=g.profile)==null?void 0:v.display)||u((b=g.project)==null?void 0:b.display)}function p(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(v=>c(Zt(v)))}const m=e.memberships.filter(f).slice(0,10).map(g=>s.jsx(ct.Option,{value:g.id,children:s.jsx(RH,{...g})},g.id));return s.jsxs(We,{children:[s.jsxs(Bo,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(Ua,{size:32}),s.jsx(Le,{order:3,children:"Choose profile"})]}),s.jsx(ba,{outcome:o}),s.jsxs(ct,{store:n,onOptionSubmit:p,children:[s.jsx(ct.EventsTarget,{children:s.jsx(ze,{placeholder:"Search",value:r,onChange:g=>{a(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(ct.Options,{children:m.length>0?m:s.jsx(ct.Empty,{children:"Nothing found..."})})})]})]})}function RH(e){var t,n;return s.jsxs(je,{children:[s.jsx(Ls,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(De,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(De,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}const DH=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,AH="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",_H="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",kH="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",PH=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,NH="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",OH="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",MH="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",IH="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",LH="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",zH="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function $H(e){const t=_e();return s.jsx(pt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(We,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Le,{children:"Choose scope"})]}),s.jsx(We,{children:(e.scope??"openid").split(" ").map(n=>{let r;return DH.test(n)?r=[n+AH,n+_H,n+kH]:PH.test(n)&&(r=[n+NH,n+OH,n+MH,n+IH,n+LH,n+zH]),s.jsxs(s.Fragment,{children:[s.jsx(Fn,{id:n,name:n,label:n,defaultChecked:!0},n),r==null?void 0:r.map(a=>s.jsx(Fn,{id:a,name:a,label:a},a))]},n+"_group")})}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Or,{children:"Set scope"})})]})})}function f_(e){const[t,n]=y.useState();return s.jsx(pt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(a=>n(Xe(a)))},children:s.jsxs(We,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Le,{children:"Enter MFA code"})]}),t&&s.jsx(Yi,{icon:s.jsx(nl,{size:16}),title:"Error",color:"red",children:t}),s.jsx(We,{children:s.jsx(ze,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Or,{children:"Submit code"})})]})})}function h_(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:a,onRegister:o,onCode:c,...u}=e,f=_e(),[p,m]=y.useState(),g=y.useRef(!1),[v,b]=y.useState(!1),[S,j]=y.useState(),C=y.useCallback(E=>{c?c(E):f.processCode(E).then(()=>{r&&r()}).catch(T=>Pe({color:"red",message:Xe(T)}))},[f,c,r]),R=y.useCallback(E=>{b(!!E.mfaRequired),E.login&&m(E.login),E.memberships&&j(E.memberships),E.code&&(n?j(void 0):C(E.code))},[n,C]),D=y.useCallback(E=>{C(E.code)},[C]);return y.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(R).catch(E=>Pe({color:"red",message:Xe(E)})))},[f,t,g,p,R]),s.jsx(ot,{width:450,px:"sm",py:"md",children:p?v?s.jsx(f_,{onSubmit:async E=>{const T=await f.post("auth/mfa/verify",{login:p,token:E.token});R(T)}}):S?s.jsx(TH,{login:p,memberships:S,handleAuthResponse:R}):e.projectId==="new"?s.jsx(o_,{login:p,handleAuthResponse:R}):e.chooseScopes?s.jsx($H,{login:p,scope:e.scope,handleAuthResponse:D}):s.jsx("div",{children:"Success"}):s.jsx(jH,{onForgotPassword:a,onRegister:o,handleAuthResponse:R,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function ai(e){return s.jsx(s.Fragment,{children:Vo(e.value)})}function UH(e){return s.jsx(s.Fragment,{children:Rd(e.value)})}function p_(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),s.jsx(s.Fragment,{children:n.join("").trim()})}function BH(e){var n;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>s.jsx(p_,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function em(e,t,n){const r=gc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(a=>a.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function VH(e,t,n){const r=lA(e,t,n);return r?Array.isArray(r)?[r.map(a=>a.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function FH(e){const{elementDefinitionType:t}=e,n=_e(),r=y.useContext(cn),[a,o]=y.useState(oA("Extension")),c=y.useMemo(()=>{if(En(t==null?void 0:t.profile))return t.profile[0]},[t]),[u,f]=y.useState(c!==void 0);if(y.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=Pc(c);f(!1),g&&o(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(u||!G0(c)))return s.jsx("div",{children:"Loading..."});const p=a.elements["value[x]"];if((p==null?void 0:p.max)!==0){const[g,v]=em({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return s.jsx(La,{propertyType:v,value:g})}return s.jsx(qh,{path:e.path,value:{type:a.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function HH(e){var t,n;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function qH(e){return s.jsx(s.Fragment,{children:eU(e.value)})}function od(e){return s.jsx(s.Fragment,{children:ks(e.value)})}function jb(e){return s.jsx(s.Fragment,{children:ad(e.value)})}function GH(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(od,{value:t.numerator})," / ",s.jsx(od,{value:t.denominator})]}):null}function Uy(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Ia(e.value);return e.link!==!1&&e.value.reference?s.jsx(bt,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function m_(e,t,n,r){if(!En(n==null?void 0:n.slices))return[e];const a=new Array(t.length+1);for(let o=0;o<a.length;o++)a[o]=[];for(const o of e){const c=BA(o,t,n.discriminator,r);let u=c?t.findIndex(f=>f.name===c):-1;u===-1&&(u=t.length),a[u].push(o)}return a}async function g_({medplum:e,property:t}){return new Promise((n,r)=>{var u,f;if(!t.slicing){n([]);return}const a=[],o=[],c=[];for(const p of t.slicing.slices){if(!UA(p)){console.debug("Unsupported slice definition",p);continue}let m;En(p.elements)||(m=(f=(u=p.type[0])==null?void 0:u.profile)==null?void 0:f[0]),a.push(p),o.push(m),m&&c.push(e.requestProfileSchema(m))}Promise.all(c).then(()=>{for(let p=0;p<a.length;p++){const m=a[p],g=o[p];if(g){const v=Pc(g);m.typeSchema=v}}n(a)}).catch(r)})}function tm(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function QH(e){var c,u;const{slice:t,property:n}=e,r=((c=t.typeSchema)==null?void 0:c.elements)??t.elements,a=y.useContext(cn),o=y.useMemo(()=>{var f;if(En(r))return yc({parentContext:a,elements:r,path:e.path,profileUrl:(f=t.typeSchema)==null?void 0:f.url})},[a,e.path,(u=t.typeSchema)==null?void 0:u.url,r]);return tm(cn.Provider,o,s.jsx(s.Fragment,{children:e.value.map((f,p)=>s.jsx("div",{children:s.jsx(La,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:f,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${p}-${e.value.length}`))}))}function WH(e){var S;const{property:t,propertyType:n}=e,r=_e(),a=y.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[o,c]=y.useState(!0),[u,f]=y.useState([]),[p,m]=y.useState(()=>[a]),g=y.useContext(cn);if(y.useEffect(()=>{g_({medplum:r,property:t}).then(j=>{f(j);const C=m_(a,j,t.slicing,g.profileUrl);m(C),c(!1)}).catch(j=>{console.error(j),c(!1)})},[r,t,g.profileUrl,m,a]),o)return s.jsx("div",{children:"Loading..."});let v;if(((S=t.type[0])==null?void 0:S.code)!=="Extension"){const j=p[u.length],C=j.map((R,D)=>s.jsx("div",{children:s.jsx(La,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:R,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${D}-${j.length}`));if(e.includeDescriptionListEntry){if(!En(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const R=e.path.split(".").pop();v=s.jsx(Li,{term:Bs(R),children:C})}else v=s.jsx(s.Fragment,{children:C})}return s.jsxs(s.Fragment,{children:[u.map((j,C)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let R=s.jsx(QH,{path:e.path,slice:j,property:t,value:p[C],ignoreMissingValues:e.ignoreMissingValues,link:e.link},j.name);return e.includeDescriptionListEntry&&(R=s.jsx(Li,{term:Bs(j.name),children:R},j.name)),R}),v]})}function La(e){var o;const{property:t,propertyType:n,value:r}=e;if((o=t==null?void 0:t.path)==null?void 0:o.endsWith(".id"))return s.jsxs(ce,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Tn(r)&&s.jsx(sD,{value:r,timeout:2e3,children:({copied:c,copy:u})=>s.jsx(Js,{label:c?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(_n,{variant:"subtle",color:c?"teal":"gray",onClick:u,children:c?s.jsx(eo,{size:"1rem"}):s.jsx(WA,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===oe.Attachment?s.jsx(mH,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(WH,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case oe.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case oe.SystemString:case oe.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case oe.code:case oe.date:case oe.decimal:case oe.id:case oe.integer:case oe.positiveInt:case oe.unsignedInt:case oe.uri:case oe.url:return s.jsx(s.Fragment,{children:r});case oe.canonical:return s.jsx(Uy,{value:{reference:r},link:e.link});case oe.dateTime:case oe.instant:return s.jsx(s.Fragment,{children:gr(r)});case oe.markdown:return s.jsx("pre",{children:r});case oe.Address:return s.jsx(SV,{value:r});case oe.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case oe.Attachment:return s.jsx(_d,{value:r,maxWidth:e.maxWidth});case oe.CodeableConcept:return s.jsx(ai,{value:r});case oe.Coding:return s.jsx(UH,{value:r});case oe.ContactDetail:return s.jsx(BH,{value:r});case oe.ContactPoint:return s.jsx(p_,{value:r});case oe.HumanName:return s.jsx(gb,{value:r});case oe.Identifier:return s.jsx(HH,{value:r});case oe.Money:return s.jsx(qH,{value:r});case oe.Period:return s.jsx(s.Fragment,{children:Y$(r)});case oe.Quantity:case oe.Duration:return s.jsx(od,{value:r});case oe.Range:return s.jsx(jb,{value:r});case oe.Ratio:return s.jsx(GH,{value:r});case oe.Reference:return s.jsx(Uy,{value:r,link:e.link});case oe.Timing:return s.jsx(s.Fragment,{children:wA(r)});case oe.Dosage:case oe.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(qh,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case oe.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(FH,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(qh,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const v_=["extension","modifierExtension"],YH=GA.filter(e=>!v_.includes(e));function qh(e){const t=e.value,{value:n,type:r}=t,a=y.useContext(cn),o=e.profileUrl??(a==null?void 0:a.profileUrl),c=y.useMemo(()=>Hp(r,o),[o,r]),u=y.useMemo(()=>{if(c)return yc({parentContext:a,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,a,e.path,e.accessPolicyResource]);if(Tn(n))return null;if(!c)return s.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return s.jsx("div",{children:n.name});const f=u??a;return tm(cn.Provider,u,s.jsx(bb,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{var j;if(v_.includes(p)&&Tn((j=m.slicing)==null?void 0:j.slices))return null;if(YH.includes(p))return null;if(QA.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,v]=em(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Tn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,S=s.jsx(La,{property:m,propertyType:v,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?S:s.jsx(Li,{term:Bs(p),children:S},p)})}))}const KH="_dimmed_11me5_1",XH="_preserveBreaks_11me5_5",By={dimmed:KH,preserveBreaks:XH},y_="Read Only";function x_(e,t){return e?s.jsx(Js.Floating,{label:e,children:t}):t}function b_(e){const{debugMode:t}=y.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,x_(e!=null&&e.readonly?y_:void 0,s.jsxs(je,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(mn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?By.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function $t(e){const{debugMode:t}=y.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,x_(e!=null&&e.readonly?y_:void 0,s.jsx(mn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:Ut({[By.dimmed]:e==null?void 0:e.readonly},By.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Nt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function ZH(e,t,n,r,a){const o=r.type;if(o.length>1)for(const c of o){const u=t.replace("[x]",Hn(c.code));u in e&&delete e[u]}return Tn(a)?e[n]=void 0:e[n]=a,e}function JH(e){return!!e&&!Tn(e.url)&&!Tn(e.name)}function eq(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:a,path:o,valuePath:c,...u}=e,[f,p]=y.useState(t);function m(g){const v=nq(g);p(v),n&&n(v)}return s.jsx(Jp,{defaultValue:f&&tq(f),onChange:m,withHelpText:r??!0,...u})}function tq(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function nq(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function rq(e){var p,m;const{defaultValue:t,onChange:n,withHelpText:r,response:a,...o}=e,[c,u]=y.useState(((m=(p=a==null?void 0:a.answer)==null?void 0:p[0])==null?void 0:m.valueCoding)??t);function f(g){const v=g[0],b=v&&iq(v);u(b),n&&n(b)}return s.jsx(Jp,{defaultValue:c?aq(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...o})}function aq(e){return{system:e.system,code:e.code,display:e.display}}function iq(e){return{system:e.system,code:e.code,display:e.display}}function S_(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:a}=y.useContext(cn),[o,c]=y.useState(e.defaultValue),u=y.useRef(o);u.current=o;const[f,p,m]=y.useMemo(()=>["system","use","value"].map(E=>r[t+"."+E]),[r,t]),[g,v,b]=y.useMemo(()=>["system","use","value"].map(E=>a(t+"."+E)),[a,t]);function S(E){E&&Object.keys(E).length===0&&(E=void 0),c(E),e.onChange&&e.onChange(E)}function j(E){const T={...u.current,system:E};E||delete T.system,S(T)}function C(E){const T={...u.current,use:E};E||delete T.use,S(T)}function R(E){const T={...u.current,value:E};E||delete T.value,S(T)}const D=e.valuePath??t;return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ln,{disabled:e.disabled||(g==null?void 0:g.readonly),"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((f==null?void 0:f.min)??0)>0,onChange:E=>j(E.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Nt(n,D+".system")}),s.jsx(ln,{disabled:e.disabled||(v==null?void 0:v.readonly),"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((p==null?void 0:p.min)??0)>0,onChange:E=>C(E.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Nt(n,D+".use")}),s.jsx(ze,{disabled:e.disabled||(b==null?void 0:b.readonly),placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((m==null?void 0:m.min)??0)>0,onChange:E=>R(E.currentTarget.value),error:Nt(n,D+".value")})]})}function oq(e){var m;const[t,n]=y.useState(e.defaultValue),r=y.useRef(t);r.current=t;const{getExtendedProps:a}=y.useContext(cn),[o,c]=y.useMemo(()=>["name","telecom"].map(g=>a(e.path+"."+g)),[a,e.path]);function u(g){n(g),e.onChange&&e.onChange(g)}function f(g){const v={...r.current,name:g};g||delete v.name,u(v)}function p(g){const v={...r.current,telecom:g&&[g]};g||delete v.telecom,u(v)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ze,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:g=>f(g.currentTarget.value)}),s.jsx(S_,{disabled:e.disabled||(c==null?void 0:c.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(m=t==null?void 0:t.telecom)==null?void 0:m[0],onChange:p,outcome:e.outcome})]})}function sq(e){if(!e)return"";const t=new Date(e);return Gp(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function Cb(e){if(!e)return"";const t=new Date(e);return Gp(t)?t.toISOString():""}function ii(e){return s.jsx(ze,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e["data-testid"]??e.name,placeholder:e.placeholder,required:e.required,disabled:e.disabled,type:lq(),step:1,defaultValue:sq(e.defaultValue),autoFocus:e.autoFocus,error:Nt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(Cb(n))}}})}function lq(){return"datetime-local"}function cq(e){const{propertyType:t}=e,n=_e(),r=y.useMemo(()=>{if(En(t.profile))return t.profile[0]},[t]),[a,o]=y.useState(r!==void 0);return y.useEffect(()=>{r&&(o(!0),n.requestProfileSchema(r).then(()=>o(!1)).catch(c=>{o(!1),console.warn(c)}))},[n,r]),r&&(a||!G0(r))?s.jsx("div",{children:"Loading..."}):s.jsx(Db,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function uq(e){var D,E,T;const{outcome:t,path:n}=e,[r,a]=y.useState(e.defaultValue),{getExtendedProps:o}=y.useContext(cn),[c,u,f,p,m]=y.useMemo(()=>["use","prefix","given","family","suffix"].map(A=>o(e.path+"."+A)),[o,e.path]);function g(A){a(A),e.onChange&&e.onChange(A)}function v(A){g({...r,use:A||void 0})}function b(A){g({...r,prefix:A?A.split(" "):void 0})}function S(A){g({...r,given:A?A.split(" "):void 0})}function j(A){g({...r,family:A||void 0})}function C(A){g({...r,suffix:A?A.split(" "):void 0})}const R=e.valuePath??n;return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ln,{disabled:e.disabled||(c==null?void 0:c.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:A=>v(A.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Nt(t,R+".use")}),s.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(D=r==null?void 0:r.prefix)==null?void 0:D.join(" "),onChange:A=>b(A.currentTarget.value),error:Nt(t,R+".prefix")}),s.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(E=r==null?void 0:r.given)==null?void 0:E.join(" "),onChange:A=>S(A.currentTarget.value),error:Nt(t,R+".given")}),s.jsx(ze,{disabled:e.disabled||(p==null?void 0:p.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:A=>j(A.currentTarget.value),error:Nt(t,R+".family")}),s.jsx(ze,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(T=r==null?void 0:r.suffix)==null?void 0:T.join(" "),onChange:A=>C(A.currentTarget.value),error:Nt(t,R+".suffix")})]})}function dq(e){const[t,n]=y.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:a}=y.useContext(cn),[o,c]=y.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[u,f]=y.useMemo(()=>["system","value"].map(g=>a(e.path+"."+g)),[a,e.path]);function p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"System",required:((o==null?void 0:o.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:Nt(e.outcome,m+".system")}),s.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Value",required:((c==null?void 0:c.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:g=>p({...t,value:g.currentTarget.value}),error:Nt(e.outcome,m+".value")})]})}const fq=["USD","EUR","CAD","GBP","AUD"];function hq(e){var g;const{onChange:t}=e,[n,r]=y.useState(e.defaultValue),{getExtendedProps:a}=y.useContext(cn),[o,c]=y.useMemo(()=>["currency","value"].map(v=>a(e.path+"."+v)),[a,e.path]),u=y.useCallback(v=>{r(v),t&&t(v)},[t]),f=y.useCallback(v=>{u({...n,currency:v.currentTarget.value})},[n,u]),p=y.useCallback(v=>{u({...n,value:v.currentTarget.valueAsNumber})},[n,u]),m=s.jsx(ln,{disabled:e.disabled||(o==null?void 0:o.readonly),defaultValue:n==null?void 0:n.currency,data:fq,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return s.jsx(ze,{disabled:e.disabled||(c==null?void 0:c.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((g=n==null?void 0:n.value)==null?void 0:g.toString())??"USD",leftSection:s.jsx(BV,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function pq(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o]=y.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ii,{disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:u=>c({...t,start:u})}),s.jsx(ii,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:u=>c({...t,end:u})})]})}function Hs(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o,c]=y.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function u(f){n(f),e.onChange&&e.onChange(f)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ln,{disabled:e.disabled||(a==null?void 0:a.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:f=>u({...t,comparator:f.currentTarget.value})}),s.jsx(ze,{disabled:e.disabled||(o==null?void 0:o.readonly),id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{u({...t,value:mq(f.currentTarget.value)})}}),s.jsx(ze,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:f=>u({...t,unit:f.currentTarget.value})})]})}function mq(e){if(e)return parseFloat(e)}function Eb(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o]=y.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Hs,{path:e.path+".low",disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:u=>c({...t,low:u})}),s.jsx(Hs,{path:e.path+".high",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:u=>c({...t,high:u})})]})}function gq(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o]=y.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Hs,{path:e.path+".numerator",disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:u=>c({...t,numerator:u})}),s.jsx(Hs,{path:e.path+".denominator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:u=>c({...t,denominator:u})})]})}const vq={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},yq=["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 xq(e){return{value:zt(e)??"",label:Vi(e),resource:e}}function rl(e){const t=_e(),{resourceType:n,searchCriteria:r}=e,[a,o]=y.useState(),c=Qt(e.defaultValue,o),u=e.itemComponent??bq,f=e.onChange,p=y.useCallback(async(g,v)=>{const b=Sq(n),S=new URLSearchParams({[b]:g??"",_count:"10",...r});return await t.searchResources(n,S,{signal:v})},[t,n,r]),m=y.useCallback(g=>{f&&f(g[0])},[f]);return En(e.defaultValue)&&!a&&!c?null:s.jsx(vb,{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:xq,loadOptions:p,onChange:m,clearable:!0})}const bq=y.forwardRef(({label:e,resource:t,active:n,...r},a)=>s.jsx("div",{ref:a,...r,children:s.jsxs(je,{wrap:"nowrap",children:[s.jsx(Ko,{value:t}),s.jsxs("div",{children:[s.jsx(De,{children:e}),s.jsx(De,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function Sq(e){return vq[e]??(yq.includes(e)?"name":"_id")}function Nd(e){const{onChange:t}=e,n=_e(),[r,a]=y.useState(e.defaultValue),[o,c]=y.useState(()=>wq(e.targetTypes)),[u,f]=y.useState(()=>jq(e.defaultValue,o)),p=y.useRef(new XD),m=y.useMemo(()=>(u==null?void 0:u.type)==="profile"?{...e.searchCriteria,_profile:u.value}:e.searchCriteria,[e.searchCriteria,u]);y.useEffect(()=>{let b=!1;const S=o==null?void 0:o.map(j=>{if(!Eq(j))return Promise.resolve(j);b=!0;const C=j.value,R=p.current.get(C);if(R)return R;const D=Cq(n,j.value).then(T=>{const A={...j};return T?En(T.type)?(A.resourceType=T.type,A.name=T.name,A.title=T.title):(console.error(`StructureDefinition.type missing for ${j.value}`),A.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),A.error="StructureDefinition not found"),A}).catch(T=>(console.error(T),{...j,error:T})),E=new Aa(D);return p.current.set(C,E),E});!S||!b||Promise.all(S).then(j=>{if(c(j),!u)return;const C=j.findIndex(R=>R.value===u.value||R.resourceType===u.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${u.resourceType}`);return}f(j[C])}).catch(console.error)},[n,u,o]);const g=y.useCallback(b=>{const S=b?on(b):void 0;a(S),t&&t(S)},[t]),v=y.useMemo(()=>o?o.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[o]);return s.jsxs(s.Fragment,{children:[e.name&&s.jsx("input",{type:"hidden",name:e.name,value:(r==null?void 0:r.reference)??""}),s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[o&&o.length>1&&s.jsx(ln,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:u==null?void 0:u.resourceType,autoFocus:e.autoFocus,onChange:b=>{const S=b.currentTarget.value,j=o.find(C=>C.value===S);f(j)},data:v}),!o&&s.jsx(xb,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:u==null?void 0:u.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(rl,{resourceType:u==null?void 0:u.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function wq(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 jq(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const a=t==null?void 0:t.find(o=>o.resourceType===n);return a||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function Cq(e,t){const n=Pc(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
526
- StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
527
- type,
528
- name,
529
- title,
530
- }
531
- }`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function Eq(e){return e.type==="profile"&&!(e!=null&&e.error)&&Tn(e.resourceType)}function Tq(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const Rq="_indented_ldk1d_1",w_={indented:Rq};function Tb({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(Oe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(Hh,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(_n,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(Hh,{size:"1.25rem"})})}function j_({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(_n,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(Fh,{size:"1.25rem"})})}function Dq(e){var b,S;const{slice:t,property:n}=e,[r,a]=y.useState(e.defaultValue),o=((b=t.typeSchema)==null?void 0:b.elements)??t.elements,c=y.useContext(cn),u=y.useMemo(()=>{var j;if(En(o))return yc({parentContext:c,elements:o,path:e.path,profileUrl:(j=t.typeSchema)==null?void 0:j.url})},[c,e.path,(S=t.typeSchema)==null?void 0:S.url,o]);function f(j){a(j),e.onChange&&e.onChange(j)}const p=t.min>0,m=Tn(t.elements),g=EA(t.name),v=e.property.readonly&&r.length===0;return tm(cn.Provider,u,s.jsx($t,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:v?s.jsx(De,{c:"dimmed",children:"(empty)"}):s.jsxs(We,{className:m?w_.indented:void 0,children:[r.map((j,C)=>s.jsxs(je,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${C}`,children:s.jsx(Rb,{elementDefinitionType:t.type[0],name:t.name,defaultValue:j,onChange:R=>{const D=[...r];D[C]=R,f(D)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0,readOnly:e.property.readonly})}),!e.property.readonly&&r.length>t.min&&s.jsx(j_,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${C}`,onClick:R=>{pn(R);const D=[...r];D.splice(C,1),f(D)}})]},`${C}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(je,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Tb,{propertyDisplayName:g,onClick:j=>{pn(j);const C=[...r,void 0];f(C)},testId:e.testId&&`${e.testId}-add`})})]})}))}function Aq(e){var D;const{property:t}=e,n=_e(),[r,a]=y.useState(!0),[o,c]=y.useState([]),[u]=y.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=y.useState(()=>[u]),m=y.useContext(cn),g=(D=t.type[0])==null?void 0:D.code;y.useEffect(()=>{g_({medplum:n,property:t}).then(E=>{c(E);const T=m_(u,E,t.slicing,m.profileUrl);_q(T,E),p(T),a(!1)}).catch(E=>{console.error(E),a(!1)})},[n,t,u,m.profileUrl,p]);function v(E,T){const A=[...f];if(A[T]=E,p(A),e.onChange){const k=A.flat().filter(M=>M!==void 0);e.onChange(k)}}if(r)return s.jsx("div",{children:"Loading..."});const b=o.length,S=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&o.length>0)),C=Bs(t.path),R=e.property.readonly&&o.length===0&&u.length===0;return s.jsxs(We,{className:e.indent?w_.indented:void 0,children:[R&&s.jsx(De,{c:"dimmed",children:"(empty)"}),o.map((E,T)=>s.jsx(Dq,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[T],onChange:A=>{v(A,T)},testId:`slice-${E.name}`},E.name)),j&&S.map((E,T)=>s.jsxs(je,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(Od,{arrayElement:!0,property:e.property,name:e.name+"."+T,path:e.path,valuePath:Tq(e.path,e.valuePath,T),defaultValue:E,onChange:A=>{const k=[...S];k[T]=A,v(k,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(j_,{propertyDisplayName:C,testId:`nonsliced-remove-${T}`,onClick:A=>{pn(A);const k=[...S];k.splice(T,1),v(k,b)}})]},`${T}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&s.jsx(je,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Tb,{propertyDisplayName:C,onClick:E=>{pn(E);const T=[...S];T.push(void 0),v(T,b)},testId:"nonsliced-add"})})]})}function _q(e,t){for(let n=0;n<t.length;n++){const r=t[n],a=e[n];for(;a.length<r.min;)a.push(void 0)}}function kq(e){const[t,n]=y.useState(!1),r=sR(),a=y.useRef(null),o={...e.styles};return t||(o.input||(o.input={}),o.input.WebkitTextSecurity="disc"),s.jsxs(Bo,{gap:"xs",children:[s.jsx(Zs,{...e,styles:{...o,root:{...o.root??{},flexGrow:1}},ref:a,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(_n,{title:"Copy secret",onClick:()=>{var c;r.copy((c=a.current)==null?void 0:c.value),Pe({color:"green",message:"Copied"})},children:s.jsx(WA,{})})]})}const Pq=["sun","mon","tue","wed","thu","fri","sat"];function Nq(e){const[t,n]=y.useState(e.defaultValue),[r,a]=y.useState(!e.disabled&&(e.defaultModalOpen??!1)),o=y.useRef(t);return o.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:wA(o.current)||"No repeat"}),s.jsx(Oe,{disabled:e.disabled,onClick:()=>a(!0),children:"Edit"})]}),!e.disabled&&s.jsx(Oq,{path:e.path,visible:r,defaultValue:o.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),a(!1)},onCancel:()=>a(!1)})]})}const $E={repeat:{period:1,periodUnit:"d"}};function Oq(e){const[t,n]=y.useState(e.defaultValue||$E),{getExtendedProps:r}=y.useContext(cn),[a,o,c,u,f]=y.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(j=>r(e.path+"."+j)),[r,e.path]),p=y.useRef(t);p.current=t;function m(j){n({...p.current,event:[j]})}function g(j){n({...p.current,repeat:j})}function v(j){var C;g({...(C=p.current)==null?void 0:C.repeat,period:j})}function b(j){var C;g({...(C=p.current)==null?void 0:C.repeat,periodUnit:j})}function S(j){var C;g({...(C=p.current)==null?void 0:C.repeat,dayOfWeek:j})}return s.jsx($n,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(We,{children:[s.jsx($t,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(ii,{disabled:a==null?void 0:a.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),s.jsx(Sd,{disabled:o==null?void 0:o.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?$E.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx($t,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ze,{disabled:c==null?void 0:c.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:j=>v(parseInt(j.currentTarget.value,10)||1)}),s.jsx(ln,{disabled:u==null?void 0:u.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:j=>b(j.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&s.jsx($t,{title:"Repeat on",children:s.jsx(Ju.Group,{multiple:!0,onChange:S,children:s.jsx(je,{justify:"space-between",mt:"md",gap:"xs",children:Pq.map(j=>s.jsx(Ju,{value:j,size:"xs",radius:"xl",disabled:f==null?void 0:f.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),s.jsx(je,{justify:"flex-end",children:s.jsx(Oe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Od(e){var u;const{property:t,name:n,onChange:r,defaultValue:a}=e,o=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(o===oe.Attachment)return s.jsx(gH,{name:n,defaultValue:a,onChange:r,disabled:t.readonly});const f=((u=c[0])==null?void 0:u.code)!==oe.Extension;return s.jsx(Aq,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:a,indent:f,onChange:r,outcome:e.outcome})}else return c.length>1?s.jsx(Mq,{elementDefinitionTypes:c,...e}):s.jsx(Rb,{name:n,defaultValue:a,onChange:f=>{if(e.onChange){const p=e.name.replace("[x]",Hn(c[0].code));e.onChange(f,p)}},outcome:e.outcome,elementDefinitionType:c[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function Mq(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(o=>o.code===e.defaultPropertyType)),n||(n=t[0]);const[r,a]=y.useState(n);return s.jsxs(je,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ln,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:o=>{a(t.find(c=>c.code===o.currentTarget.value))},data:t.map(o=>({value:o.code,label:o.code}))}),s.jsx(Rb,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:o=>{e.onChange&&e.onChange(o,e.name.replace("[x]",Hn(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath,readOnly:e.property.readonly})]})}function Rb(e){const{name:t,onChange:n,outcome:r,binding:a,path:o,valuePath:c,readOnly:u}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=y.useContext(cn),g=y.useMemo(()=>{if(!K0(p)||!Tn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)CE(S,m.elements);else{const j=_s(m.path,e.path);if(j===void 0)return e.defaultValue;CE(S,m.elements,j)}return En(S)?S:e.defaultValue},[p,m.path,m.elements,e.path,e.defaultValue]);if(!p)return s.jsx("div",{children:"Property type not specified "});function v(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:o,valuePath:c,disabled:u}}function b(){const S=Nt(e.outcome,c??o);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:u}}switch(p){case oe.SystemString:case oe.canonical:case oe.string:case oe.time:case oe.uri:case oe.url:return e.path==="Project.secret.value[x]"?s.jsx(kq,{...b(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):s.jsx(ze,{...b(),onChange:S=>{n&&n(S.currentTarget.value)}});case oe.date:return s.jsx(ze,{...b(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case oe.dateTime:case oe.instant:return s.jsx(ii,{...b(),onChange:n,outcome:r});case oe.decimal:case oe.integer:case oe.positiveInt:case oe.unsignedInt:return s.jsx(ze,{...b(),type:"number",step:p===oe.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case oe.code:return s.jsx(r_,{...b(),error:void 0,onChange:n,binding:a==null?void 0:a.valueSet,creatable:!0,maxValues:1});case oe.boolean:return s.jsx(Fn,{...b(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case oe.base64Binary:case oe.markdown:return s.jsx(Zs,{...b(),spellCheck:p!==oe.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case oe.Address:return s.jsx(CV,{...v()});case oe.Annotation:return s.jsx(EV,{...v()});case oe.Attachment:return s.jsx(a_,{...v()});case oe.CodeableConcept:return s.jsx(eq,{binding:a==null?void 0:a.valueSet,...v()});case oe.Coding:return s.jsx(rq,{binding:a==null?void 0:a.valueSet,...v()});case oe.ContactDetail:return s.jsx(oq,{...v()});case oe.ContactPoint:return s.jsx(S_,{...v()});case oe.Extension:return s.jsx(cq,{...v(),propertyType:e.elementDefinitionType});case oe.HumanName:return s.jsx(uq,{...v()});case oe.Identifier:return s.jsx(dq,{...v()});case oe.Money:return s.jsx(hq,{...v()});case oe.Period:return s.jsx(pq,{...v()});case oe.Duration:case oe.Quantity:return s.jsx(Hs,{...v()});case oe.Range:return s.jsx(Eb,{...v()});case oe.Ratio:return s.jsx(gq,{...v()});case oe.Reference:return s.jsx(Nd,{...v(),targetTypes:Lq(e.elementDefinitionType)});case oe.Timing:return s.jsx(Nq,{...v()});case oe.Dosage:case oe.UsageContext:default:return s.jsx(Db,{...v(),typeName:p})}}const Iq=[`${Ed}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function Lq(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=Iq.find(a=>n.startsWith(a));return r?n.slice(r.length):n})}function zq(e){const[t,n]=y.useState(e.defaultValue??{}),r=y.useContext(cn),a=y.useMemo(()=>jV(r.elements),[r.elements]);function o(u){n(u),e.onChange&&e.onChange(u)}const c={type:e.type,value:t};return s.jsx(We,{style:{flexGrow:1},"data-testid":e.testId,children:a.map(([u,f])=>{const[p,m]=VH(c,u,f),g=f.min!==void 0&&f.min>0,v=e.valuePath?e.valuePath+"."+u:void 0,b=s.jsx(Od,{property:f,name:u,path:e.path+"."+u,valuePath:v,defaultValue:p,defaultPropertyType:m,onChange:(S,j)=>{o(ZH({...t},u,j??u,f,S))},outcome:e.outcome},u);return e.type==="Extension"||ub.includes(u)?b:f.type.length===1&&f.type[0].code==="boolean"?s.jsx(b_,{title:Bs(u),description:f.description,htmlFor:u,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},u):s.jsx($t,{title:Bs(u),description:f.description,withAsterisk:g,htmlFor:u,outcome:e.outcome,fhirPath:f.path,errorExpression:v,readonly:f.readonly,children:b},u)})})}function Db(e){const[t]=y.useState(()=>e.defaultValue??{}),n=y.useContext(cn),r=e.profileUrl??(n==null?void 0:n.profileUrl),a=y.useMemo(()=>Hp(e.typeName,r),[e.typeName,r]),o=(a==null?void 0:a.type)??e.typeName,c=y.useMemo(()=>{if(a)return yc({parentContext:n,elements:a.elements,path:e.path,profileUrl:a.url,accessPolicyResource:e.accessPolicyResource})},[a,n,e.path,e.accessPolicyResource]);return a?tm(cn.Provider,c,s.jsx(zq,{path:e.path,valuePath:e.valuePath,type:o,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[o," not implemented"]})}const $q="_noteCite_10swh_5",Uq="_noteRoot_10swh_10",UE={noteCite:$q,noteRoot:Uq};function C_({value:e}){return e?s.jsx(We,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(i0,{classNames:{cite:UE.noteCite,root:UE.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Ic(e){const{value:t,link:n,...r}=e,[a,o]=y.useState(),c=Qt(t,o);let u;if(a&&!eA(a))u=`[${Xe(a)}]`;else if(c)u=Vi(c);else return null;return n?s.jsx(bt,{to:t,...r,children:u}):s.jsx(De,{component:"span",...r,children:u})}function oc(e){return s.jsxs(je,{gap:"xs",children:[s.jsx(Ko,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Ic,{value:e.value,link:e.link})]})}const Bq={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 nm(e){const{status:t,...n}=e;return s.jsx(jp,{color:e.color||Bq[t],...n,children:t.replace(/-/g," ")})}const Vq="_table_pe9td_1",Fq="_criticalRow_pe9td_12",E_={table:Vq,criticalRow:Fq};Ab.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function Ab(e){var c;const t=_e(),n=Qt(e.value),[r,a]=y.useState();if(y.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(u=>t.readReference(u))).then(u=>u.filter(f=>f.status==="fulfilled").map(f=>f.value)).then(a).catch(console.error)},[t,n]),!n)return null;const o=(r==null?void 0:r.flatMap(u=>u.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const u=n.presentedForm[0];(c=u.contentType)!=null&&c.startsWith("text/plain")&&u.data&&o.push({text:window.atob(u.data)})}return s.jsxs(We,{children:[s.jsx(Le,{children:"Diagnostic Report"}),s.jsx(Hq,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&qq(r),n.result&&s.jsx(Gq,{hideObservationNotes:e.hideObservationNotes,value:n.result}),o.length>0&&s.jsx(C_,{value:o})]})}function Hq({value:e,hideSubject:t=!1}){var n,r;return s.jsxs(je,{mt:"md",gap:30,children:[e.subject&&!t&&s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(oc,{value:e.subject,link:!0})]}),(n=e.resultsInterpreter)==null?void 0:n.map(a=>s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(oc,{value:a,link:!0})]},a.reference)),(r=e.performer)==null?void 0:r.map(a=>s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(oc,{value:a,link:!0})]},a.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(De,{children:gr(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(nm,{status:e.status})]})]})}function qq(e){return s.jsxs(We,{gap:"xs",children:[s.jsx(Le,{order:2,size:"h6",children:"Specimens"}),s.jsx(pr,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(pr.Item,{ml:"sm",children:s.jsxs(je,{gap:20,children:[s.jsxs(je,{gap:5,children:[s.jsx(De,{fw:500,children:"Collected:"})," ",gr((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(je,{gap:5,children:[s.jsx(De,{fw:500,children:"Received:"})," ",gr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function Gq(e){return s.jsxs("table",{className:E_.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(T_,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function T_(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(Qq,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Yo(n)?n.reference:n.id}`))})}function Qq(e){var a,o;const t=Qt(e.value);if(!t||(a=e.ancestorIds)!=null&&a.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=Kq(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:Ut({[E_.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(bt,{to:t,children:s.jsx(ai,{value:t.code})})}),s.jsx("td",{children:s.jsx(Wq,{value:t})}),s.jsx("td",{children:s.jsx(Yq,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(ai,{value:t.interpretation[0]})}),s.jsx("td",{children:t.category&&t.category.length>0&&s.jsx(s.Fragment,{children:t.category.map(c=>s.jsx("div",{children:s.jsx(ai,{value:c})},`category-${Vo(c)}`))})}),s.jsx("td",{children:(o=t.performer)==null?void 0:o.map(c=>s.jsx(Uy,{value:c},c.reference))}),s.jsx("td",{children:t.status&&s.jsx(nm,{status:t.status})})]}),t.hasMember&&s.jsx(T_,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(C_,{value:t.note})})})]})}function Wq(e){const t=e.value;return s.jsx(s.Fragment,{children:jA(t)})}function Yq(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(jb,{value:t}):null}function Kq(e){var n,r,a,o;const t=(o=(a=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:a[0])==null?void 0:o.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var qv={},Ni={},BE;function R_(){if(BE)return Ni;BE=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.Pointer=Ni.escapeToken=Ni.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}Ni.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}Ni.escapeToken=t;var n=function(){function r(a){a===void 0&&(a=[""]),this.tokens=a}return r.fromJSON=function(a){var o=a.split("/").map(e);if(o[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(a));return new r(o)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(a){for(var o=null,c="",u=a,f=1,p=this.tokens.length;f<p;f++)o=u,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(u=(o||{})[c]);return{parent:o,key:c,value:u}},r.prototype.get=function(a){return this.evaluate(a).value},r.prototype.set=function(a,o){var c=this.evaluate(a);c.parent&&(c.parent[c.key]=o)},r.prototype.push=function(a){this.tokens.push(a)},r.prototype.add=function(a){var o=this.tokens.concat(String(a));return new r(o)},r}();return Ni.Pointer=n,Ni}var gn={},Gv={},VE;function D_(){return VE||(VE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(a){return a===void 0?"undefined":a===null?"null":Array.isArray(a)?"array":typeof a}e.objectType=t;function n(a){return a!=null&&typeof a=="object"}function r(a){if(!n(a))return a;if(a.constructor==Array){for(var o=a.length,c=new Array(o),u=0;u<o;u++)c[u]=r(a[u]);return c}if(a.constructor==Date){var f=new Date(+a);return f}var p={};for(var m in a)e.hasOwnProperty.call(a,m)&&(p[m]=r(a[m]));return p}e.clone=r}(Gv)),Gv}var fr={},FE;function A_(){if(FE)return fr;FE=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.diffAny=fr.diffObjects=fr.diffArrays=fr.intersection=fr.subtract=fr.isDestructive=void 0;var e=D_();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}fr.isDestructive=t;function n(m,g){var v={};for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&(v[b]=1);for(var S in g)e.hasOwnProperty.call(g,S)&&g[S]!==void 0&&delete v[S];return Object.keys(v)}fr.subtract=n;function r(m){for(var g=m.length,v={},b=0;b<g;b++){var S=m[b];for(var j in S)e.hasOwnProperty.call(S,j)&&S[j]!==void 0&&(v[j]=(v[j]||0)+1)}for(var j in v)v[j]<g&&delete v[j];return Object.keys(v)}fr.intersection=r;function a(m){return m.op==="add"}function o(m){return m.op==="remove"}function c(m,g){return{operations:m.operations.concat(g),cost:m.cost+1}}function u(m,g,v,b){b===void 0&&(b=p);var S={"0,0":{operations:[],cost:0}};function j(T,A){var k="".concat(T,",").concat(A),M=S[k];if(M===void 0){if(T>0&&A>0&&!b(m[T-1],g[A-1],v.add(String(T-1))).length)M=j(T-1,A-1);else{var L=[];if(T>0){var $=j(T-1,A),V={op:"remove",index:T-1};L.push(c($,V))}if(A>0){var Y=j(T,A-1),Q={op:"add",index:T-1,value:g[A-1]};L.push(c(Y,Q))}if(T>0&&A>0){var J=j(T-1,A-1),G={op:"replace",index:T-1,original:m[T-1],value:g[A-1]};L.push(c(J,G))}var Z=L.sort(function(P,I){return P.cost-I.cost})[0];M=Z}S[k]=M}return M}var C=isNaN(m.length)||m.length<=0?0:m.length,R=isNaN(g.length)||g.length<=0?0:g.length,D=j(C,R).operations,E=D.reduce(function(T,A){var k=T[0],M=T[1];if(a(A)){var L=A.index+1+M,$=L<C+M?String(L):"-",V={op:A.op,path:v.add($).toString(),value:A.value};return[k.concat(V),M+1]}else if(o(A)){var V={op:A.op,path:v.add(String(A.index+M)).toString()};return[k.concat(V),M-1]}else{var Y=v.add(String(A.index+M)),Q=b(A.original,A.value,Y);return[k.concat.apply(k,Q),M]}},[[],0])[0];return E}fr.diffArrays=u;function f(m,g,v,b){b===void 0&&(b=p);var S=[];return n(m,g).forEach(function(j){S.push({op:"remove",path:v.add(j).toString()})}),n(g,m).forEach(function(j){S.push({op:"add",path:v.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){S.push.apply(S,b(m[j],g[j],v.add(j)))}),S}fr.diffObjects=f;function p(m,g,v,b){if(b===void 0&&(b=p),m===g)return[];var S=(0,e.objectType)(m),j=(0,e.objectType)(g);return S=="array"&&j=="array"?u(m,g,v,b):S=="object"&&j=="object"?f(m,g,v,b):[{op:"replace",path:v.toString(),value:g}]}return fr.diffAny=p,fr}var HE;function Xq(){if(HE)return gn;HE=1;var e=gn&&gn.__extends||function(){var C=function(R,D){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var A in T)Object.prototype.hasOwnProperty.call(T,A)&&(E[A]=T[A])},C(R,D)};return function(R,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");C(R,D);function E(){this.constructor=R}R.prototype=D===null?Object.create(D):(E.prototype=D.prototype,new E)}}();Object.defineProperty(gn,"__esModule",{value:!0}),gn.apply=gn.InvalidOperationError=gn.test=gn.copy=gn.move=gn.replace=gn.remove=gn.add=gn.TestError=gn.MissingError=void 0;var t=R_(),n=D_(),r=A_(),a=function(C){e(R,C);function R(D){var E=C.call(this,"Value required at path: ".concat(D))||this;return E.path=D,E.name="MissingError",E}return R}(Error);gn.MissingError=a;var o=function(C){e(R,C);function R(D,E){var T=C.call(this,"Test failed: ".concat(D," != ").concat(E))||this;return T.actual=D,T.expected=E,T.name="TestError",T}return R}(Error);gn.TestError=o;function c(C,R,D){if(Array.isArray(C))if(R=="-")C.push(D);else{var E=parseInt(R,10);C.splice(E,0,D)}else C[R]=D}function u(C,R){if(Array.isArray(C)){var D=parseInt(R,10);C.splice(D,1)}else delete C[R]}function f(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);return D.parent===void 0?new a(R.path):(c(D.parent,D.key,(0,n.clone)(R.value)),null)}gn.add=f;function p(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);return D.value===void 0?new a(R.path):(u(D.parent,D.key),null)}gn.remove=p;function m(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);if(D.parent===null)return new a(R.path);if(Array.isArray(D.parent)){if(parseInt(D.key,10)>=D.parent.length)return new a(R.path)}else if(D.value===void 0)return new a(R.path);return D.parent[D.key]=(0,n.clone)(R.value),null}gn.replace=m;function g(C,R){var D=t.Pointer.fromJSON(R.from).evaluate(C);if(D.value===void 0)return new a(R.from);var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.parent===void 0?new a(R.path):(u(D.parent,D.key),c(E.parent,E.key,D.value),null)}gn.move=g;function v(C,R){var D=t.Pointer.fromJSON(R.from).evaluate(C);if(D.value===void 0)return new a(R.from);var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.parent===void 0?new a(R.path):(c(E.parent,E.key,(0,n.clone)(D.value)),null)}gn.copy=v;function b(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);return(0,r.diffAny)(D.value,R.value,new t.Pointer).length?new o(D.value,R.value):null}gn.test=b;var S=function(C){e(R,C);function R(D){var E=C.call(this,"Invalid operation: ".concat(D.op))||this;return E.operation=D,E.name="InvalidOperationError",E}return R}(Error);gn.InvalidOperationError=S;function j(C,R){switch(R.op){case"add":return f(C,R);case"remove":return p(C,R);case"replace":return m(C,R);case"move":return g(C,R);case"copy":return v(C,R);case"test":return b(C,R)}return new S(R)}return gn.apply=j,gn}var qE;function Zq(){return qE||(qE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=R_();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=Xq(),r=A_();function a(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=a;function o(p){function m(g,v,b){var S=p(g,v,b);return Array.isArray(S)?S:(0,r.diffAny)(g,v,b,m)}return m}function c(p,m,g){var v=new t.Pointer;return(g?o(g):r.diffAny)(p,m,v)}e.createPatch=c;function u(p,m){var g=t.Pointer.fromJSON(m).evaluate(p);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(p,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(v){var b=u(p,v.path);if(b&&g.push(b),"from"in v){var S=u(p,v.from);S&&g.push(S)}}),g}e.createTests=f}(qv)),qv}var __=Zq();const Jq="_removed_el5zk_1",eG="_added_el5zk_6",GE={removed:Jq,added:eG};function tG(e){var m;const{name:t,path:n,property:r,originalValue:a,revisedValue:o}=e,c=!!((m=r==null?void 0:r.type)!=null&&m.find(g=>g.code==="Attachment")),[u,f]=y.useState(c),p=()=>f(g=>!g);return s.jsx(s.Fragment,{children:c&&!u||!c?s.jsx(s.Fragment,{children:s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:t}),s.jsx(Me.Td,{className:GE.removed,children:a&&s.jsx(La,{path:n,property:r,propertyType:a.type,value:a.value,ignoreMissingValues:!0})}),s.jsx(Me.Td,{className:GE.added,children:o&&s.jsx(La,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})})]})}):s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:t}),s.jsx(Me.Td,{colSpan:2,style:{textAlign:"right"},children:s.jsx(Oe,{onClick:p,variant:"light",children:"Expand"})})]})})}const nG="_root_15xvr_1",rG={root:nG};function aG(e){const t=_e(),{original:n,revised:r}=e,[a,o]=y.useState(!1);y.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[t,e.original.resourceType]);const c=y.useMemo(()=>{if(!a)return null;const u=[pa(n)],f=[pa(r)],p=[],m=iG(__.createPatch(n,r));for(const g of m){const v=g.path,b=oG(v),S=sG(n.resourceType,b),j=g.op==="add"?void 0:Vs(b,u),C=g.op==="remove"?void 0:Vs(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${Hn(g.op)} ${b}`,path:(S==null?void 0:S.path)??n.resourceType+"."+b,property:S,originalValue:QE(S,j),revisedValue:QE(S,C)})}return p},[a,n,r]);return c?s.jsxs(Me,{className:rG.root,children:[s.jsx(Me.Thead,{children:s.jsxs(Me.Tr,{children:[s.jsx(Me.Th,{}),s.jsx(Me.Th,{children:"Before"}),s.jsx(Me.Th,{children:"After"})]})}),s.jsx(Me.Tbody,{children:c.map(u=>{const{key:f,...p}=u;return s.jsx(tG,{...p},f)})})]}):null}function iG(e){const t=[];for(const n of e){const{op:r,path:a}=n;if(a.startsWith("/meta/author")||a.startsWith("/meta/compartment")||a.startsWith("/meta/lastUpdated")||a.startsWith("/meta/versionId"))continue;const o=e.filter(u=>u.op===r&&u.path===a).length,c={op:r,path:a};o>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(a)&&(c.op="replace",c.path=a.replace(/\/[^/]+$/,"")),t.some(u=>u.op===c.op&&u.path===c.path)||t.push(c)}return t}function oG(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const a=t[r];a==="-"?n+=".last()":/^\d+$/.test(a)?n+=`[${a}]`:(r>0&&(n+="."),n+=a)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function sG(e,t){var r;const n=Mc(e,{code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function QE(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:lG(t,!!(e!=null&&e.isArray))}}function lG(e,t){const n=B$(e).flatMap(r=>r.value);return t?n:n[0]}function _b(e){const{profileUrl:t}=e,n=_e(),r=n.getAccessPolicy(),a=Qt(e.value),[o,c]=y.useState(!1);y.useEffect(()=>{if(a)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Pc(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=a.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,a]);const u=y.useMemo(()=>a&&kA(a,Ps.READ,r),[r,a]);return!o||!a?null:s.jsx(qh,{path:a.resourceType,value:{type:a.resourceType,value:e.forceUseInput?e.value:a},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const cG="_item_5q6yx_1",uG="_itemPadding_5q6yx_5",WE={item:cG,itemPadding:uG};function dG(e){return s.jsx(kd,{children:e.children})}function qs(e){var f,p;const{resource:t,profile:n,padding:r,popupMenuItems:a,...o}=e,c=n??((f=t.meta)==null?void 0:f.author),u=e.dateTime??((p=t.meta)==null?void 0:p.lastUpdated);return s.jsxs(wb,{"data-testid":"timeline-item",fill:!0,...o,children:[s.jsxs(je,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Ko,{value:c,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(De,{size:"sm",children:s.jsx(Ic,{c:"dark",fw:500,value:c,link:!0})}),s.jsxs(De,{size:"xs",children:[s.jsx(bt,{c:"dimmed",to:e.resource,children:gr(u)}),s.jsx(De,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(bt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),a&&s.jsxs(we,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(we.Target,{children:s.jsx(_n,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${zt(e.resource)}`,children:s.jsx(FV,{})})}),a]})]}),s.jsx(ZA,{children:s.jsx("div",{className:Ut(WE.item,{[WE.itemPadding]:r}),children:e.children})})]})}function k_(e,t){e.sort((n,r)=>{const a=YE(n,t),o=YE(r,t);return a>o?1:a<o?-1:KE(n,t)-KE(r,t)})}function YE(e,t){if(!P_(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function KE(e,t){var r;if(!P_(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const n=(r=e.meta)==null?void 0:r.lastUpdated;return n?new Date(n).getTime():0}function P_(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const fG="_pinnedComment_u08s5_1",hG={pinnedComment:fG};function rm(e){const t=_e(),n=t.getProfile(),r=y.useRef(null),a=Qt(e.value),[o,c]=y.useState(),[u,f]=y.useState([]),p=e.loadTimelineResources,m=y.useRef(u);m.current=u;const g=y.useCallback(T=>{k_(T,a),T.reverse(),f(T)},[a]),v=y.useCallback(T=>{const A=[];for(const k of T){if(k.status!=="fulfilled")continue;const M=k.value;if(M.type==="history"&&c(M),M.entry)for(const L of M.entry)A.push(L.resource)}g(A)},[g]),b=y.useCallback(T=>g([...m.current,T]),[g]),S=y.useCallback(()=>{var k;let T,A;"resourceType"in e.value?(T=e.value.resourceType,A=e.value.id):[T,A]=(k=e.value.reference)==null?void 0:k.split("/"),p(t,T,A).then(v).catch(console.error)},[t,e.value,p,v]);y.useEffect(()=>S(),[S]);function j(T){!a||!e.createCommunication||t.createResource(e.createCommunication(a,n,T)).then(A=>b(A)).catch(console.error)}function C(T){!a||!e.createMedia||t.createResource(e.createMedia(a,n,T)).then(A=>b(A)).then(()=>Ds({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(eo,{size:16}),autoClose:2e3})).catch(A=>Ds({id:"upload-notification",color:"red",title:"Upload error",message:Xe(A),icon:s.jsx(_E,{size:16}),autoClose:2e3}))}function R(){Pe({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function D(T){Ds({id:"upload-notification",loading:!0,title:"Uploading...",message:bG(T),autoClose:!1,withCloseButton:!1})}function E(T){Ds({id:"upload-notification",color:"red",title:"Upload error",message:Xe(T),icon:s.jsx(_E,{size:16}),autoClose:2e3})}return a?s.jsxs(dG,{children:[e.createCommunication&&s.jsx(wb,{children:s.jsx(pt,{testid:"timeline-form",onSubmit:T=>{j(T.text);const A=r.current;A&&(A.value="",A.focus())},children:s.jsxs(je,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Ko,{value:n}),s.jsx(ze,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(_n,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(XV,{size:16})}),s.jsx(Sb,{securityContext:on(a),onUpload:C,onUploadStart:R,onUploadProgress:D,onUploadError:E,children:T=>s.jsx(_n,{...T,radius:"xl",color:"blue",variant:"filled",children:s.jsx(fb,{size:16})})})]})})}),u.map(T=>{var M;if(!T)return null;const A=`${T.resourceType}/${T.id}/${(M=T.meta)==null?void 0:M.versionId}`,k=e.getMenu?e.getMenu({primaryResource:a,currentResource:T,reloadTimeline:S}):void 0;if(T.resourceType===a.resourceType&&T.id===a.id)return s.jsx(pG,{history:o,resource:T,popupMenuItems:k},A);switch(T.resourceType){case"AuditEvent":return s.jsx(yG,{resource:T,popupMenuItems:k},A);case"Communication":return s.jsx(gG,{resource:T,popupMenuItems:k},A);case"DiagnosticReport":return s.jsx(xG,{resource:T,popupMenuItems:k},A);case"Media":return s.jsx(vG,{resource:T,popupMenuItems:k},A);default:return s.jsx(qs,{resource:T,padding:!0,children:s.jsx(_b,{value:T,ignoreMissingValues:!0})},A)}})]}):s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(_r,{})})}function pG(e){const{history:t,resource:n,...r}=e,a=mG(t,n);return a?s.jsx(qs,{resource:n,padding:!0,...r,children:s.jsx(aG,{original:a,revised:e.resource})}):s.jsxs(qs,{resource:n,padding:!0,...r,children:[s.jsx("h3",{children:"Created"}),s.jsx(_b,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function mG(e,t){const n=e.entry??[],r=n.findIndex(a=>{var o,c,u;return((c=(o=a.resource)==null?void 0:o.meta)==null?void 0:c.versionId)===((u=t.meta)==null?void 0:u.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function gG(e){var r,a;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:hG.pinnedComment;return s.jsx(qs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:s.jsx("p",{children:(a=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:a.contentString})})}function vG(e){var r;const t=(r=e.resource.content)==null?void 0:r.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(qs,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:s.jsx(_d,{value:e.resource.content})})}function yG(e){return s.jsx(qs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Yr,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function xG(e){return s.jsx(qs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Ab,{value:e.resource})})}function bG(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Qv(e.loaded)} / ${Qv(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Qv(e.loaded)}`}function Qv(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 SG(e){const{resource:t,...n}=e;return s.jsx(rm,{value:t,loadTimelineResources:async(r,a,o)=>{const c=`${a}/${o}`;return Promise.allSettled([r.readHistory(a,o),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function wG(e){const{encounter:t,...n}=e;return s.jsx(rm,{value:t,loadTimelineResources:async(r,a,o)=>Promise.allSettled([r.readHistory("Encounter",o),r.search("Communication","encounter=Encounter/"+o),r.search("Media","encounter=Encounter/"+o)]),createCommunication:(r,a,o)=>({resourceType:"Communication",status:"completed",encounter:on(r),subject:r.subject,sender:on(a),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,a,o)=>({resourceType:"Media",status:"completed",encounter:on(r),subject:r.subject,operator:on(a),issued:new Date().toISOString(),content:o}),...n})}function jG(e){let t;try{t=Oc(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return s.jsx(La,{value:t[0]||"",propertyType:e.propertyType})}function CG(e){return s.jsxs($n,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(XE,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(XE,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(De,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function XE(e){return s.jsx(Oe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const EG={string:[de.EQUALS,de.NOT,de.CONTAINS,de.EXACT],fulltext:[de.EQUALS,de.NOT,de.CONTAINS,de.EXACT],token:[de.EQUALS,de.NOT],reference:[de.EQUALS,de.NOT],numeric:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS],quantity:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS],date:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS,de.STARTS_AFTER,de.ENDS_BEFORE,de.APPROXIMATELY],datetime:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS,de.STARTS_AFTER,de.ENDS_BEFORE,de.APPROXIMATELY],uri:[de.EQUALS,de.NOT,de.ABOVE,de.BELOW]},TG={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 kb(e,t){return{...e,filters:t,offset:0,name:void 0}}function N_(e,t){return kb(e,(e.filters??[]).filter(n=>n.code!==t))}function am(e,t,n,r,a){const o=[];return e.filters&&o.push(...e.filters),o.push({code:t,operator:n,value:r??""}),kb(e,o)}function RG(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function DG(e,t){return Pb(e,t,-1)}function AG(e,t){return Pb(e,t,0)}function _G(e,t){return Pb(e,t,1)}function Pb(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const a=new Date(r.getTime());return a.setDate(a.getDate()+1),a.setTime(a.getTime()-1),im(e,t,r,a)}function kG(e,t){const n=new Date,r=new Date(n.getTime()+24*60*60*1e3);return im(e,t,n,r)}function PG(e,t){return Nb(e,t,-1)}function NG(e,t){return Nb(e,t,0)}function OG(e,t){return Nb(e,t,1)}function Nb(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const a=new Date(r.getTime());return a.setMonth(a.getMonth()+1),a.setDate(1),a.setHours(0,0,0,0),a.setTime(a.getTime()-1),im(e,t,r,a)}function MG(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),im(e,t,n,new Date)}function im(e,t,n,r){return e=N_(e,t),e=ZE(e,t,de.GREATER_THAN_OR_EQUALS,n),e=ZE(e,t,de.LESS_THAN_OR_EQUALS,r),e}function ZE(e,t,n,r){return am(e,t,n,r.toISOString())}function JE(e,t,n=!0){return am(e,t,de.MISSING,n.toString())}function IG(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function LG(e,t){const n=e.count??Qp,r=(t-1)*n;return IG(e,r)}function zG(e,t,n){return t===$G(e)&&n!==void 0&&n===UG(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function $G(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function UG(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function BG(e){return EG[e.type]}function O_(e){return TG[e]??""}function Gs(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replace(/([A-Z])/g," $1"),t=t.replace(/[-_]/g," "),t=t.replace(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map(Hn).join(" "))}function VG(e,t){var r,a;const n=t.name;return n==="id"?s.jsx(bt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?gr((a=e.meta)==null?void 0:a.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?FG(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?HG(e,t.searchParams[0]):null}function FG(e,t){var o,c,u;const n=((u=(c=(o=t.path)==null?void 0:o.split("."))==null?void 0:c.pop())==null?void 0:u.replaceAll("[x]",""))??"",[r,a]=em({type:e.resourceType,value:e},n);return r?s.jsx(La,{path:t.path,property:t,propertyType:a,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function HG(e,t){const n=Vs(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,a)=>s.jsx(La,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${a}-${n.length}`))})}function qG(e){const t=y.useRef(!1),[n,r]=y.useState({search:JSON.parse(Ia(e.search))}),[a,o]=y.useState(!1);y.useEffect(()=>{r({search:e.search})},[e.search]);const c=y.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,p=oA(f),m=Z0(f);return rd(GG(p,m)).map(g=>({value:g,label:Gs(g)}))},[e.visible,e.search.resourceType]);function u(f){r({search:{...n.search,fields:f}})}return s.jsx($n,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=a},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(We,{children:[s.jsx(Pp,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>o(!0),onDropdownClose:()=>o(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(je,{justify:"flex-end",children:s.jsx(Oe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function GG(e,t){const n=[],r=new Set,a=new Set;for(const o of Object.keys(e.elements))n.push(o),r.add(o.toLowerCase()),a.add(Gs(o));if(t)for(const o of Object.keys(t)){const c=Gs(o);!r.has(o)&&!a.has(c)&&(n.push(o),r.add(o),a.add(c))}return n}function M_(e){const t=Mc(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case Jn.REFERENCE:return s.jsx(Nd,{name:n,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(r.reference):e.onChange("")}});case Jn.BOOLEAN:return s.jsx(Fn,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.checked.toString())});case Jn.DATE:return s.jsx(ze,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case Jn.DATETIME:return s.jsx(ii,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Jn.NUMBER:return s.jsx(ze,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case Jn.QUANTITY:return s.jsx(Hs,{name:n,path:"",defaultValue:QG(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx(ze,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value),placeholder:"Search value"})}}function QG(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function WG(e){const[t,n]=y.useState(Qr(e.search)),r=y.useRef(t);r.current=t,y.useEffect(()=>{n(Qr(e.search))},[e.search]);function a(f){n(am(r.current,f.code,f.operator,f.value))}const o=e.search.resourceType,c=Z0(o)??{},u=t.filters||[];return s.jsx($n,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:s.jsxs(pt,{onSubmit:()=>e.onOk(r.current),children:[s.jsxs("div",{children:[s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:40}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:u.map((f,p)=>s.jsx(YG,{id:`filter-${p}-row`,resourceType:o,searchParams:c,value:f,onChange:m=>{const g=[...u];g[p]=m,n(kb(r.current,g))},onDelete:()=>n(RG(r.current,p))},`filter-${p}-row`))})]}),s.jsx(Tb,{propertyDisplayName:"Filter",onClick:()=>a({})})]}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Or,{children:"OK"})})]})})}function YG(e){const t=e.value,n=y.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=de.EQUALS,n.current.value="",e.onChange(n.current)}function a(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function o(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],u=c&&BG(c);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ln,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:f=>r(f.currentTarget.value),data:["",...Object.keys(e.searchParams).map(f=>({value:f,label:Gs(f)}))]})}),s.jsx("td",{children:u&&s.jsx(ln,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>a(f.currentTarget.value),data:["",...u.map(f=>({value:f,label:O_(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),s.jsx("td",{children:c&&t.operator&&s.jsx(M_,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:o},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),s.jsx("td",{children:e.onDelete&&s.jsx(_n,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:s.jsx(Fs,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function KG(e){const[t,n]=y.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return s.jsx($n,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(pt,{onSubmit:r,children:s.jsxs(or,{children:[s.jsx(or.Col,{span:10,children:s.jsx(M_,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(or.Col,{span:2,children:s.jsx(Oe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function XG(e){var a;const{resourceType:t,filter:n}=e,r=(a=li.types[t].searchParams)==null?void 0:a[n.code];if(r){if(r.type==="reference"&&(n.operator===de.EQUALS||n.operator===de.NOT_EQUALS))return s.jsx(Ic,{value:{reference:n.value}});const o=Mc(t,r);if(n.code==="_lastUpdated"||o.type===Jn.DATETIME)return s.jsx(s.Fragment,{children:gr(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function ZG(e){if(!e.searchParams)return null;function t(o,c){a(zG(e.search,o.code,c))}function n(o){a(N_(e.search,o.code))}function r(o,c){e.onPrompt(o,{code:o.code,operator:c,value:""})}function a(o){e.onChange(o)}return e.searchParams.length===1?s.jsx(JG,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:a,onClear:n}):s.jsx(we.Dropdown,{children:e.searchParams.map(o=>s.jsx(we.Item,{children:Gs(o.code)},o.code))})}function JG(e){switch(e.searchParam.type){case"date":return s.jsx(eQ,{...e});case"number":case"quantity":return s.jsx(tQ,{...e});case"reference":return s.jsx(nQ,{...e});case"string":return s.jsx(rQ,{...e});case"token":case"uri":return s.jsx(aQ,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function eQ(e){const{searchParam:t}=e,n=t.code;return s.jsxs(we.Dropdown,{children:[s.jsx(we.Item,{leftSection:s.jsx(hb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(we.Item,{leftSection:s.jsx(pb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(we.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT_EQUALS),children:"Does not equal..."}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(XA,{size:14}),onClick:()=>e.onPrompt(t,de.ENDS_BEFORE),children:"Before..."}),s.jsx(we.Item,{leftSection:s.jsx(KA,{size:14}),onClick:()=>e.onPrompt(t,de.STARTS_AFTER),children:"After..."}),s.jsx(we.Item,{leftSection:s.jsx(NV,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Between..."}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(Po,{size:14}),onClick:()=>e.onChange(_G(e.search,n)),children:"Tomorrow"}),s.jsx(we.Item,{leftSection:s.jsx(Po,{size:14}),onClick:()=>e.onChange(AG(e.search,n)),children:"Today"}),s.jsx(we.Item,{leftSection:s.jsx(Po,{size:14}),onClick:()=>e.onChange(DG(e.search,n)),children:"Yesterday"}),s.jsx(we.Item,{leftSection:s.jsx(Po,{size:14}),onClick:()=>e.onChange(kG(e.search,n)),children:"Next 24 Hours"}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(Po,{size:14}),onClick:()=>e.onChange(OG(e.search,n)),children:"Next Month"}),s.jsx(we.Item,{leftSection:s.jsx(Po,{size:14}),onClick:()=>e.onChange(NG(e.search,n)),children:"This Month"}),s.jsx(we.Item,{leftSection:s.jsx(Po,{size:14}),onClick:()=>e.onChange(PG(e.search,n)),children:"Last Month"}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(Po,{size:14}),onClick:()=>e.onChange(MG(e.search,n)),children:"Year to date"}),s.jsx(Md,{...e})]})}function tQ(e){const{searchParam:t}=e;return s.jsxs(we.Dropdown,{children:[s.jsx(we.Item,{leftSection:s.jsx(hb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(we.Item,{leftSection:s.jsx(pb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(we.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT_EQUALS),children:"Does not equal..."}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(KA,{size:14}),onClick:()=>e.onPrompt(t,de.GREATER_THAN),children:"Greater than..."}),s.jsx(we.Item,{leftSection:s.jsx(zy,{size:14}),onClick:()=>e.onPrompt(t,de.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(we.Item,{leftSection:s.jsx(XA,{size:14}),onClick:()=>e.onPrompt(t,de.LESS_THAN),children:"Less than..."}),s.jsx(we.Item,{leftSection:s.jsx(zy,{size:14}),onClick:()=>e.onPrompt(t,de.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Md,{...e})]})}function nQ(e){const{searchParam:t}=e;return s.jsxs(we.Dropdown,{children:[s.jsx(we.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(we.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),s.jsx(Md,{...e})]})}function rQ(e){const{searchParam:t}=e;return s.jsxs(we.Dropdown,{children:[s.jsx(we.Item,{leftSection:s.jsx(hb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(we.Item,{leftSection:s.jsx(pb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(we.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(IV,{size:14}),onClick:()=>e.onPrompt(t,de.CONTAINS),children:"Contains..."}),s.jsx(we.Item,{leftSection:s.jsx(MV,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Does not contain..."}),s.jsx(Md,{...e})]})}function aQ(e){const{searchParam:t}=e;return s.jsxs(we.Dropdown,{children:[s.jsx(we.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(we.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),s.jsx(Md,{...e})]})}function Md(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(kV,{size:14}),onClick:()=>e.onChange(JE(e.search,n)),children:"Missing"}),s.jsx(we.Item,{leftSection:s.jsx(_V,{size:14}),onClick:()=>e.onChange(JE(e.search,n,!1)),children:"Not missing"}),s.jsx(we.Divider,{}),s.jsx(we.Item,{leftSection:s.jsx(Fs,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const iQ="_root_vlout_1",oQ="_table_vlout_8",sQ="_tr_vlout_12",lQ="_control_vlout_22",cQ="_icon_vlout_31",Iu={root:iQ,table:oQ,tr:sQ,control:lQ,icon:cQ};function uQ(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(dQ(t,r));return n}function dQ(e,t){var a;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=Wo(e,t),r=aU(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=Z0(e);let c;if(o){const u=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);c=Object.values(o).filter(f=>!!f.expression&&u.test(f==null?void 0:f.expression)),c.length===0&&(c=void 0)}return{name:t,elementDefinition:n,searchParams:c}}if(r){const o=Mc(e,r);return{name:t,elementDefinition:(a=o.elementDefinitions)==null?void 0:a[0],searchParams:[r]}}return{name:t}}class fQ extends Event{constructor(t){super("change"),this.definition=t}}class hQ extends Event{constructor(t){super("load"),this.response=t}}class Gh extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function Id(e){var G,Z;const t=_e(),[n,r]=y.useState(),{search:a,onLoad:o}=e,[c,u]=y.useState(a);si(a,c)||u(a);const[f,p]=y.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=y.useRef(f);m.current=f;const g=c.total??"accurate",v=y.useCallback(P=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,tc({...c,total:g,fields:void 0}),P)).then(I=>{p({...m.current,searchResponse:I}),o&&o(new hQ(I))}).catch(I=>{p({...m.current,searchResponse:void 0}),r(Zt(I))})},[t,c,g,o]),b=y.useCallback(()=>{p({...m.current,searchResponse:void 0}),v({cache:"reload"})},[v]);y.useEffect(()=>{v()},[v]);function S(P,I){P.stopPropagation();const H=P.target.checked,O={...m.current.selected};H?O[I]=!0:delete O[I],p({...m.current,selected:O})}function j(P){P.stopPropagation();const z=P.target.checked,H={},O=m.current.searchResponse;z&&(O!=null&&O.entry)&&O.entry.forEach(U=>{var K;(K=U.resource)!=null&&K.id&&(H[U.resource.id]=!0)}),p({...m.current,selected:H})}function C(){var I,z;const P=m.current;if(!((I=P.searchResponse)!=null&&I.entry)||P.searchResponse.entry.length===0)return!1;for(const H of P.searchResponse.entry)if((z=H.resource)!=null&&z.id&&!P.selected[H.resource.id])return!1;return!0}function R(P){e.onChange&&e.onChange(new fQ(P))}function D(P,I){if(e_(P.target)||P.button===2)return;pn(P);const z=JA(P);!z&&e.onClick&&e.onClick(new Gh(I,P)),z&&e.onAuxClick&&e.onAuxClick(new Gh(I,P))}function E(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return s.jsx(ba,{outcome:n});if(!iA(c.resourceType))return s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(_r,{})});const T=e.checkboxesEnabled,A=uQ(c),k=c.resourceType,M=f.searchResponse,L=M==null?void 0:M.entry,$=L==null?void 0:L.map(P=>P.resource),V="subtle",Y="gray",Q=16,J=window.innerWidth<768;return s.jsxs("div",{className:Iu.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(je,{justify:"space-between",mb:"xl",children:[s.jsxs(je,{gap:2,children:[s.jsx(Oe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(UV,{size:Q}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),s.jsx(Oe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(qV,{size:Q}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&s.jsx(Oe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(HV,{size:Q}),onClick:e.onNew,children:"New..."}),!J&&E()&&s.jsx(Oe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(hF,{size:Q}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!J&&e.onDelete&&s.jsx(Oe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(mb,{size:Q}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!J&&e.onBulk&&s.jsx(Oe,{size:"compact-md",variant:V,color:Y,leftSection:s.jsx(PV,{size:Q}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),s.jsxs(je,{gap:2,children:[M&&s.jsxs(De,{size:"xs",c:"dimmed","data-testid":"count-display",children:[I_(c,M).toLocaleString(),"-",yQ(c,M).toLocaleString(),M.total!==void 0&&` of ${c.total==="estimate"?"~":""}${(G=M.total)==null?void 0:G.toLocaleString()}`]}),s.jsx(_n,{variant:V,color:Y,title:"Refresh",onClick:b,children:s.jsx(iF,{size:Q})})]})]}),s.jsxs(Me,{className:Iu.table,children:[s.jsxs(Me.Thead,{children:[s.jsxs(Me.Tr,{children:[T&&s.jsx(Me.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:P=>j(P)})}),A.map(P=>s.jsx(Me.Th,{children:s.jsxs(we,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(we.Target,{children:s.jsx(tr,{className:Iu.control,p:2,children:s.jsxs(je,{justify:"space-between",wrap:"nowrap",children:[s.jsx(De,{fw:500,children:Gs(P.name)}),s.jsx(er,{className:Iu.icon,children:s.jsx(RV,{size:14,stroke:1.5})})]})})}),s.jsx(ZG,{search:c,searchParams:P.searchParams,onPrompt:(I,z)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:I,filterDialogFilter:z,dialogOpenTime:Date.now()})},onChange:I=>{R(I)}})]})},P.name))]}),!e.hideFilters&&s.jsxs(Me.Tr,{children:[T&&s.jsx(Me.Th,{}),A.map(P=>s.jsx(Me.Th,{children:P.searchParams&&s.jsx(mQ,{resourceType:k,searchParams:P.searchParams,filters:c.filters})},P.name))]})]}),s.jsx(Me.Tbody,{children:$==null?void 0:$.map(P=>P&&s.jsxs(Me.Tr,{className:Iu.tr,"data-testid":"search-control-row",onClick:I=>D(I,P),onAuxClick:I=>D(I,P),children:[T&&s.jsx(Me.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${P.id}`,checked:!!f.selected[P.id],onChange:I=>S(I,P.id)})}),A.map(I=>s.jsx(Me.Td,{children:VG(P,I)},I.name))]},P.id))})]}),!($!=null&&$.length)&&s.jsx(kd,{children:s.jsx(er,{style:{height:150},children:s.jsx(De,{size:"xl",c:"dimmed",children:"No results"})})}),M&&s.jsx(er,{m:"md",p:"md",children:s.jsx($a,{value:gQ(c),total:vQ(c,M),onChange:P=>R(LG(c,P)),getControlProps:P=>{switch(P){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),s.jsx(qG,{search:c,visible:m.current.fieldEditorVisible,onOk:P=>{R(P),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),s.jsx(WG,{search:c,visible:m.current.filterEditorVisible,onOk:P=>{R(P),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),s.jsx(CG,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),s.jsx(KG,{visible:m.current.filterDialogVisible,title:(Z=f.filterDialogSearchParam)!=null&&Z.code?Gs(f.filterDialogSearchParam.code):"",resourceType:k,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:P=>{R(am(c,P.code,P.operator,P.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const pQ=Id;function mQ(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(n=>s.jsxs("div",{children:[O_(n.operator)," ",s.jsx(XG,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function gQ(e){return Math.floor((e.offset??0)/(e.count??Qp))+1}function vQ(e,t){const n=e.count??Qp,r=L_(e,t);return Math.ceil(r/n)}function I_(e,t){return Math.min(L_(e,t),(e.offset??0)+1)}function yQ(e,t){var n;return Math.max(I_(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function L_(e,t){var r,a;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((a=t.link)!=null&&a.some(o=>o.relation==="next")?1:0)),n}function xQ(e){const t=_e(),[n,r]=y.useState(!1),[a,o]=y.useState(),{query:c,fields:u}=e,[f,p]=y.useState(),[m,g]=y.useState({}),v=y.useRef(f);v.current=f;const b=y.useRef({});b.current=m,y.useEffect(()=>{o(void 0),t.graphql(c).then(p).catch(E=>o(Zt(E)))},[t,c]);function S(E,T){E.stopPropagation();const k=E.target.checked,M={...b.current};k?M[T]=!0:delete M[T],g(M)}function j(E){var L;E.stopPropagation();const A=E.target.checked,k={},M=(L=v.current)==null?void 0:L.data.ResourceList;A&&M&&M.forEach($=>{$.id&&(k[$.id]=!0)}),g(k)}function C(){var T;const E=(T=v.current)==null?void 0:T.data.ResourceList;if(!E||E.length===0)return!1;for(const A of E)if(A.id&&!b.current[A.id])return!1;return!0}function R(E,T){e_(E.target)||(pn(E),E.button!==1&&e.onClick&&e.onClick(new Gh(T,E)),E.button===1&&e.onAuxClick&&e.onAuxClick(new Gh(T,E)))}if(y.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(_r,{});const D=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:E=>pn(E),"data-testid":"search-control",children:[s.jsxs(Me,{children:[s.jsx(Me.Thead,{children:s.jsxs(Me.Tr,{children:[D&&s.jsx(Me.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:E=>j(E)})}),u.map(E=>s.jsx(Me.Th,{children:E.name},E.name))]})}),s.jsx(Me.Tbody,{children:f==null?void 0:f.data.ResourceList.map(E=>E&&s.jsxs(Me.Tr,{"data-testid":"search-control-row",onClick:T=>R(T,E),onAuxClick:T=>R(T,E),children:[D&&s.jsx(Me.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${E.id}`,checked:!!m[E.id],onChange:T=>S(T,E.id)})}),u.map(T=>s.jsx(Me.Td,{children:s.jsx(jG,{propertyType:T.propertyType,path:T.fhirPath,resource:E})},T.name))]},E.id))})]}),(f==null?void 0:f.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),a&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(a,void 0,2)})}),e.onBulk&&s.jsx(Oe,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const bQ=y.memo(xQ),SQ="_root_1fbwr_1",wQ="_entry_1fbwr_8",jQ="_key_1fbwr_13",CQ="_value_1fbwr_20",om={root:SQ,entry:wQ,key:jQ,value:CQ};function ht(e){return s.jsx(Yr,{children:s.jsx("div",{className:om.root,children:e.children})})}ht.Entry=function(t){return s.jsx("div",{className:om.entry,children:t.children})};ht.Key=function(t){return s.jsx("div",{className:om.key,children:t.children})};ht.Value=function(t){return s.jsx("div",{className:om.value,children:t.children})};function EQ(e){const{group:t}=e;return s.jsx(mr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(je,{children:[t.measureScore&&s.jsx(DQ,{group:t}),!t.measureScore&&s.jsx(RQ,{group:t})]})})}function TQ(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(De,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(De,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function RQ(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(f=>Vo(f.code)==="numerator"),a=n==null?void 0:n.find(f=>Vo(f.code)==="denominator"),o=r==null?void 0:r.count,c=a==null?void 0:a.count;if(c===0)return s.jsxs(ce,{children:[s.jsx(Le,{order:3,children:"Not Applicable"}),s.jsx(De,{children:`Denominator: ${c}`})]});if(o===void 0||c===void 0)return s.jsxs(ce,{children:[s.jsx(Le,{order:3,children:"Insufficient Data"}),s.jsx(De,{children:`Numerator: ${o}`}),s.jsx(De,{children:`Denominator: ${c}`})]});const u=o/c*100;return s.jsx(Up,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:z_(u)}],label:s.jsx(Bo,{justify:"center",children:s.jsxs(De,{fw:700,fz:18,children:[o," / ",c]})})})}function DQ(e){var r,a,o;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((a=t.measureScore)==null?void 0:a.code);return s.jsx(s.Fragment,{children:n==="%"?s.jsx(Up,{size:120,thickness:12,roundCaps:!0,sections:[{value:AQ(t),color:z_(((o=t==null?void 0:t.measureScore)==null?void 0:o.value)??0)}],label:s.jsx(Bo,{justify:"center",children:s.jsx(De,{fw:700,fz:18,children:s.jsx(od,{value:t.measureScore})})})}):s.jsx(Bo,{h:120,align:"center",children:s.jsx(Le,{order:3,children:s.jsx(od,{value:t.measureScore})})})})}function AQ(e){var r,a;const t=(r=e.measureScore)==null?void 0:r.value,n=(a=e.measureScore)==null?void 0:a.unit;return t?t<=1&&n==="%"?t*100:t:0}function z_(e){return e<=33?"red":e<=67?"yellow":"green"}function _Q(e){var r;const t=Qt(e.measureReport),[n]=bV("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(ce,{children:[n&&s.jsx(TQ,{measure:n}),s.jsx(N0,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((a,o)=>s.jsx(EQ,{group:a},a.id??o))})]}):null}const Wv="patient-export",Yv="Patient Export",kQ={everything:{operation:"$everything",extension:"json",contentType:hn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:hn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:hn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:hn.CDA_XML}};function PQ(e){const t=_e(),{patient:n}=e,r=y.useCallback(async a=>{const o=Us(n),c=a.format,{operation:u,type:f,contentType:p,extension:m}=kQ[c],g=t.fhirUrl("Patient",o,u),v={};f&&(v.type=f),a.author&&(v.author={reference:a.author}),a.authoredOn&&(v.authoredOn=Cb(a.authoredOn)),a.startDate&&(v.start=a.startDate),a.endDate&&(v.end=a.endDate),ua.show({id:Wv,title:Yv,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,v,void 0,{cache:"no-cache",headers:{Accept:p}}),S=`Patient-export-${o}-${new Date().toISOString().replaceAll(":","-")}.${m}`;NQ(b,S,p),ua.update({id:Wv,title:Yv,color:"green",message:"Done",icon:s.jsx(eo,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){ua.update({id:Wv,title:Yv,color:"red",message:Xe(b),icon:s.jsx(Fs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return s.jsx(pt,{onSubmit:r,children:s.jsxs(We,{children:[s.jsx($t,{title:"Export Format",description:"Required",withAsterisk:!0,children:s.jsx(Bp,{name:"format",data:[{label:"FHIR Everything",value:"everything"},{label:"Patient Summary",value:"summary"},{label:"C-CDA",value:"ccda"},{label:"C-CDA Referral",value:"ccdaReferral"}],fullWidth:!0})}),s.jsx($t,{title:"Author",description:"Optional author for composition. Default value is current user.",children:s.jsx(Nd,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),s.jsx($t,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:s.jsx(ii,{name:"authoredOn",placeholder:"Authored on"})}),s.jsx($t,{title:"Start Date",description:"The start date of care. If no start date is provided, all records prior to the end date are in scope.",children:s.jsx(ii,{name:"startDate",placeholder:"Start date"})}),s.jsx($t,{title:"End Date",description:"The end date of care. If no end date is provided, all records subsequent to the start date are in scope.",children:s.jsx(ii,{name:"endDate",placeholder:"End date"})}),s.jsx(je,{justify:"right",children:s.jsx(Or,{children:"Request Export"})})]})})}function NQ(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),a=new Blob([r],{type:n}),o=window.URL.createObjectURL(a),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=o,c.download=t,c.click(),window.URL.revokeObjectURL(o)}function OQ(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function $_(e){var n,r;const t=Qt(e.patient);return t?s.jsxs(ht,{children:[s.jsx(Ko,{value:t,size:"lg",color:OQ(t)}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Name"}),s.jsx(ht.Value,{children:s.jsx(bt,{to:t,fw:500,children:t.name?s.jsx(gb,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"DoB"}),s.jsx(ht.Value,{children:t.birthDate})]}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Age"}),s.jsx(ht.Value,{children:A$(t.birthDate)})]})]}),t.gender&&s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Gender"}),s.jsx(ht.Value,{children:t.gender})]}),t.address&&s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"State"}),s.jsx(ht.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(a=>s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:a==null?void 0:a.system}),s.jsx(ht.Value,{children:a==null?void 0:a.value})]},`${a==null?void 0:a.system}-${a==null?void 0:a.value}`))]}):null}function MQ(e){const{patient:t,...n}=e,r=y.useCallback((a,o,c)=>{const u=`${o}/${c}`,f=100;return Promise.allSettled([a.readHistory("Patient",c),a.search("Communication",{subject:u,_count:f}),a.search("Device",{patient:u,_count:f}),a.search("DeviceRequest",{patient:u,_count:f}),a.search("DiagnosticReport",{subject:u,_count:f}),a.search("Media",{subject:u,_count:f}),a.search("ServiceRequest",{subject:u,_count:f}),a.search("Task",{subject:u,_count:f})])},[]);return s.jsx(rm,{value:t,loadTimelineResources:r,createCommunication:(a,o,c)=>({resourceType:"Communication",status:"completed",subject:on(a),sender:on(o),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(a,o,c)=>({resourceType:"Media",status:"completed",subject:on(a),operator:on(o),issued:new Date().toISOString(),content:c}),...n})}const IQ="_section_pqpwm_1",LQ="_hovering_pqpwm_7",Vy={section:IQ,hovering:LQ};function zQ(e){const t=_e(),n=Qt(e.value),[r,a]=y.useState(!1),[o,c]=y.useState(),[u,f]=y.useState(),[p,m]=y.useState();function g(){f(void 0)}function v(){c(void 0)}const b=y.useRef(p);if(b.current=p,y.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>a(!0)).catch(console.log)},[t]),y.useEffect(()=>(m(FQ(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",v)}),[n]),!r||!p)return null;function S(j,C){m({...b.current,[j]:C})}return s.jsx("div",{children:s.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[s.jsx(ze,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>S("title",j.currentTarget.value)}),s.jsx($Q,{actions:p.action||[],selectedKey:o,setSelectedKey:c,hoverKey:u,setHoverKey:f,onChange:j=>S("action",j)}),s.jsx(Or,{children:"Save"})]})})}function $Q(e){const t=y.useRef(e.actions);t.current=e.actions;function n(o){e.onChange(t.current.map(c=>c.id===o.id?o:c))}function r(o){e.onChange([...t.current,o]),e.setSelectedKey(o.id)}function a(o){e.onChange(t.current.filter(c=>c!==o))}return s.jsxs(We,{gap:"md",className:Vy.section,children:[e.actions.map(o=>s.jsx(UQ,{action:o,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>a(o)},o.id)),s.jsx("div",{children:s.jsx(Oe,{variant:"outline",onClick:o=>{pn(o),r({id:U_()})},children:"Add action"})})]})}function UQ(e){const{action:t}=e,n=VQ(t);function r(o){o.stopPropagation(),e.setSelectedKey(e.action.id)}function a(o){pn(o),e.setHoverKey(e.action.id)}return s.jsx("div",{onClick:r,onMouseOver:a,onFocus:a,children:s.jsx(BQ,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function BQ(e){const{action:t}=e,[n,r]=y.useState(e.actionType),a=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const u=Ut(Vy.section,{[Vy.hovering]:o&&!a});return s.jsxs(mr,{"data-testid":t.id,className:u,p:0,radius:"sm",withBorder:!0,children:[s.jsxs(Bo,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[s.jsx(ze,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),s.jsx(Go,{"data-testid":"close-button",onClick:e.onRemove})]}),a&&s.jsxs(We,{gap:"xl",p:"md",children:[s.jsx(ce,{children:s.jsx(ze,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),s.jsx(ce,{children:s.jsx(ln,{label:"Type of Action",value:n,onChange:f=>{const p=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(p),e.onChange({...e.action,definitionCanonical:p==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&s.jsxs(We,{gap:0,children:[s.jsxs(je,{gap:0,mb:"xs",children:[s.jsx(De,{fw:600,children:"Select questionnaire"}),s.jsx(De,{c:"red",children:"*"})]}),s.jsxs(De,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Pt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),s.jsx(eT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&s.jsxs(We,{gap:0,children:[s.jsxs(je,{gap:0,mb:"xs",children:[s.jsx(De,{fw:600,children:"Select activity definition"}),s.jsx(De,{c:"red",children:"*"})]}),s.jsxs(De,{size:"sm",c:"dimmed",mb:"sm",children:["ActivityDefinition.kind resource to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Pt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),s.jsx(eT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function eT(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(rl,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:a=>{a?e.onChange({...e.action,definitionCanonical:zt(a)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function VQ(e){var t,n;return(t=e.definitionCanonical)!=null&&t.startsWith("Questionnaire")?"questionnaire":(n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let Kv=1;function U_(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Kv=Math.max(Kv,t+1))}return e}return"id-"+Kv++}function FQ(e){return{...e,action:B_(e.action)}}function B_(e){if(e)return e.map(t=>({...t,id:U_(t.id),action:B_(t.action)}))}const At={group:"group",display:"display",boolean:"boolean",decimal:"decimal",integer:"integer",date:"date",dateTime:"dateTime",time:"time",string:"string",text:"text",url:"url",choice:"choice",openChoice:"open-choice",attachment:"attachment",reference:"reference",quantity:"quantity"};function HQ(e){return e.type==="choice"||e.type==="open-choice"}function qQ(e,t){var a;const n=Ji(e,Ed+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression");if(t&&n){const o=(a=n.valueExpression)==null?void 0:a.expression;if(o){const c=pa(t),u=Vs(o,[c],{"%resource":c});return ei(u)}}if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const o of e.enableWhen){const c=F_(t==null?void 0:t.item,o.question);if(o.operator==="exists"&&!o.answerBoolean&&!(c!=null&&c.length)){if(r==="any")return!0;continue}const{anyMatch:u,allMatch:f}=YQ(o,c,r);if(r==="any"&&u)return!0;if(r==="all"&&!f)return!1}return r!=="any"}function Ob(e,t){return e.map(n=>{if(n.item)return{...n,item:Ob(n.item,t)};try{const r=QQ(n,t);if(!r)return null;const a=GQ(n,r);return a?{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[a]}:null}catch(r){return{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[],extension:[{url:`${Ed}/fhir/StructureDefinition/questionnaire-validationError`,valueString:`Expression evaluation failed: ${Xe(r)}`}]}}}).filter(n=>n!==null)}function GQ(e,t){if(e.type)switch(e.type){case At.boolean:return t.type===oe.boolean?{valueBoolean:t.value}:void 0;case At.date:return t.type===oe.date?{valueDate:t.value}:void 0;case At.dateTime:return t.type===oe.dateTime?{valueDateTime:t.value}:void 0;case At.time:return t.type===oe.time?{valueTime:t.value}:void 0;case At.url:return t.type===oe.url?{valueString:t.value}:void 0;case At.text:return t.type===oe.string?{valueString:t.value}:void 0;case At.attachment:return t.type===oe.Attachment?{valueAttachment:t.value}:void 0;case At.reference:return t.type===oe.Reference?{valueReference:t.value}:void 0;case At.quantity:return{valueQuantity:t.value};case At.decimal:return{valueDecimal:t.value};case At.integer:return{valueInteger:t.value};case At.string:return{valueString:t.value};default:return}}function QQ(e,t){var r;if(!t)return;const n=Ji(e,Ed+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression");if(n){const a=(r=n.valueExpression)==null?void 0:r.expression;if(a){const o=pa(t),c=Vs(a,[o],{"%resource":o});return c.length!==0?c[0]:void 0}}}function Mb(e,t){return e.map(n=>{const r=t.find(a=>a.linkId===n.linkId);return r?{...n,item:r.item?Mb(n.item||[],r.item):n.item,answer:r.answer||n.answer,extension:r.extension||n.extension}:n})}function V_(e,t,n){var a;const r=[];for(const o of e){const c=(a=n.answerOption)==null?void 0:a.find(u=>vc(ci(u))===o);if(c){const u=ci(c);u&&r.push({[t]:u.value})}}return r}function F_(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=F_(n.item,t);if(r)return r}}}function WQ(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:a}]=Vs(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return a}else return!1}function YQ(e,t,n){const r=t||[],a=tW(e);let o=!1,c=!0;for(const u of r){const f=nW(u),{operator:p}=e;if(WQ(f,a,p)?o=!0:c=!1,n==="any"&&o)break}return{anyMatch:o,allMatch:c}}function H_(e){var n,r;const t=Ji(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(r=(n=t.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:r.map(a=>a.code)}}function Xv(e,t){var a;const n=Qr(e);let r=Ji(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(a=n.extension)==null?void 0:a.filter(o=>o!==r)),n):(r||(n.extension||(n.extension=[]),r={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(o=>({code:o}))},delete r.valueCode),n)}function KQ(e,t,n){const r=Ji(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(r!=null&&r.valueString))return;let a=r.valueString;t!=null&&t.reference&&(a=a.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(a=a.replaceAll("$encounter",n.reference));const o={},c=a.split("&");for(const u of c){const[f,p]=Py(u,"=",2);o[f]=p}return o}function tT(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??zt(e),item:q_(e.item,t==null?void 0:t.item),status:"in-progress"}}function q_(e,t){return(e==null?void 0:e.map(n=>G_(n,t)))??[]}function G_(e,t){var r;const n=t==null?void 0:t.find(a=>a.linkId===e.linkId);return{id:n?n.id:ZQ(),linkId:e.linkId,text:e.text,item:q_(e.item,n==null?void 0:n.item),answer:n?n.answer:((r=e.initial)==null?void 0:r.map(JQ))??[]}}let XQ=1;function ZQ(){return"id-"+XQ++}function JQ(e){return{...e}}function eW(e){var n,r,a,o;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const c=Ji(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((o=(a=(r=c==null?void 0:c.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:a[0])==null?void 0:o.code)==="page")return e.item.length}return 1}function Ib(e){return Td({value:e},"value")}function ci(e){return Td({value:e},"value")}function tW(e){return Td({value:e},"answer")}function nW(e){return Td({value:e},"value")}const Q_=y.createContext({}),Ms=30,Qh=50;function Fy(e){const t=y.useContext(Q_),n=e.item,r=e.response;function a(g){var b,S,j,C;let v;Array.isArray(g)?v=g:e.index>=(((S=(b=e.response)==null?void 0:b.answer)==null?void 0:S.length)??0)?v=(((j=e.response)==null?void 0:j.answer)??[]).concat([g]):v=(((C=e.response)==null?void 0:C.answer)??[]).map((D,E)=>E===e.index?g:D)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:v})}const o=n.type;if(!o)return null;const c=n.linkId;if(!c)return null;const u=n.initial&&n.initial.length>0?n.initial[0]:void 0,f=zb(r,e.index)??Ib(u),p=Ji(r,`${Ed}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(o){case At.display:m=s.jsx("p",{children:e.item.text},e.item.linkId);break;case At.boolean:m=s.jsx(b_,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Fn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:f==null?void 0:f.value,onChange:g=>a({valueBoolean:g.currentTarget.checked})})},e.item.linkId);break;case At.decimal:m=s.jsx(ze,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueDecimal:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber})});break;case At.integer:m=s.jsx(ze,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueInteger:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber})});break;case At.date:m=s.jsx(ze,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueDate:g.currentTarget.value})});break;case At.dateTime:m=s.jsx(ii,{name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueDateTime:g})});break;case At.time:m=s.jsx(ze,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueTime:g.currentTarget.value})});break;case At.string:case At.url:m=s.jsx(ze,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const v=g.currentTarget.value;a({valueString:v===""?void 0:v})}});break;case At.text:m=s.jsx(Zs,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const v=g.currentTarget.value;a({valueString:v===""?void 0:v})}});break;case At.attachment:m=s.jsx(je,{py:4,children:s.jsx(a_,{path:"",name:c,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueAttachment:g})})});break;case At.reference:m=s.jsx(Nd,{name:c,required:e.required??n.required,targetTypes:H_(n),searchCriteria:KQ(n,t.subject,t.encounter),defaultValue:f==null?void 0:f.value,onChange:g=>a({valueReference:g})});break;case At.quantity:m=s.jsx(Hs,{path:"",name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueQuantity:g}),disableWheel:!0});break;case At.choice:case At.openChoice:cW(n)?m=s.jsx(oW,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>a(g)}):lW(n)||n.answerValueSet&&!uW(n)?m=s.jsx(rW,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>a(g)}):m=s.jsx(iW,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>a(g)});break;default:return null}return s.jsxs(s.Fragment,{children:[m,(p==null?void 0:p.valueString)&&s.jsx(De,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function rW(e){var m;const{name:t,item:n,initial:r,onChangeAnswer:a,response:o}=e;if(!((m=n.answerOption)!=null&&m.length)&&!n.answerValueSet)return s.jsx(Lb,{});const c=Ib(r),u=zb(o)??c,f=K_(o),p=n.repeats||dW(n);if(n.answerValueSet)return s.jsx(Jp,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:p?void 0:1,onChange:g=>{p?g.length===0?a({}):a(g.map(v=>({valueCoding:v}))):a({valueCoding:g[0]})},defaultValue:u==null?void 0:u.value});if(p){const{propertyName:g,data:v}=fW(n);return s.jsx(Pp,{data:v,placeholder:"Select items",searchable:!0,defaultValue:f||[vc(c)],onChange:b=>{if(b.length===0)a({});else{const S=V_(b,g,n);a(S)}}})}else{const g=[""];if(n.answerOption)for(const v of n.answerOption){const b=ci(v);g.push(vc(b))}return s.jsx(ln,{id:t,name:t,onChange:v=>{const b=v.currentTarget.selectedIndex;if(b===0){a({});return}const S=n.answerOption[b-1],j=ci(S),C="value"+Hn(j.type);a({[C]:j.value})},defaultValue:Rd(u==null?void 0:u.value)||(u==null?void 0:u.value),data:g})}}function aW(e,t){return e?t.valueSetExpand({url:e,count:Ms+1}).then(n=>{var r;return((r=n.expansion)==null?void 0:r.contains)??[]}):Promise.resolve([])}function W_(e){const t=_e(),[n,r]=y.useState([]),[a,o]=y.useState(!1);return y.useEffect(()=>{async function c(){if(e){o(!0);try{const u=await aW(e,t);r(u)}catch(u){console.error("Error loading value set:",u)}finally{o(!1)}}}c().catch(console.error)},[e,t]),[n,a]}function Y_(e,t){return e.map((n,r)=>{const a=`${t}-valueset-${r}`,o={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[a,o]})}function iW(e){const{name:t,item:n,initial:r,onChangeAnswer:a,response:o}=e,c=Wo("QuestionnaireItemAnswerOption","value[x]"),u=Ib(r),[f,p]=W_(n.answerValueSet),m=[];let g;if(n.answerValueSet)m.push(...Y_(f,t));else if(n.answerOption){const j=n.answerOption.slice(0,Qh).map((C,R)=>{const D=`${t}-option-${R}`,E=ci(C);return E!=null&&E.value?(u&&Ia(E)===Ia(u)&&(g=D),[D,E]):null}).filter(C=>C!==null);m.push(...j)}const v=zb(o),b=sW(m,v);if(p)return s.jsx(De,{children:"Loading options..."});if(m.length===0)return s.jsx(Lb,{});const S=m.slice(0,Ms);return s.jsxs(s.Fragment,{children:[s.jsx($s.Group,{name:t,value:b??g,onChange:j=>{const C=m.find(R=>R[0]===j);if(C){const R=C[1],D="value"+Hn(R.type);a({[D]:R.value})}},children:S.map(([j,C])=>s.jsx($s,{id:j,value:j,py:4,label:s.jsx(La,{property:c,propertyType:C.type,value:C.value})},j))}),(n.answerValueSet&&m.length>Ms||n.answerOption&&m.length>Qh)&&s.jsxs(De,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",Ms," options"]})]})}function oW(e){var S;const{name:t,item:n,onChangeAnswer:r,response:a}=e,o=Wo("QuestionnaireItemAnswerOption","value[x]"),[c,u]=W_(n.answerValueSet),f=n.answerValueSet?(((S=a.answer)==null?void 0:S.map(j=>j.valueCoding))||[]).filter(j=>j!==void 0):K_(a),[p,m]=y.useState(f),g=[];if(n.answerValueSet)g.push(...Y_(c,t));else if(n.answerOption){const j=n.answerOption.slice(0,Qh).map((C,R)=>{const D=`${t}-option-${R}`,E=ci(C);return E!=null&&E.value?[D,E]:null}).filter(C=>C!==null);g.push(...j)}if(u)return s.jsx(De,{children:"Loading options..."});if(g.length===0)return s.jsx(Lb,{});const v=g.slice(0,Ms),b=(j,C)=>{if(n.answerValueSet){const R=p;let D;C?D=[...R,j.value]:D=R.filter(E=>!si(E,j.value)),m(D),D.length===0?r({}):r(D.map(E=>({valueCoding:E})))}else{const R=p,D=vc(j);let E;if(C?E=[...R,D]:E=R.filter(T=>T!==D),m(E),E.length===0)r({});else{const T=V_(E,"value"+Hn(j.type),n);r(T)}}};return s.jsxs(je,{style:{flexDirection:"column",alignItems:"flex-start"},children:[v.map(([j,C])=>{const R=vc(C),D=n.answerValueSet?p.some(E=>si(E,C.value)):p.includes(R);return s.jsx(Fn,{id:j,label:s.jsx(La,{property:o,propertyType:C.type,value:C.value}),checked:D,onChange:E=>b(C,E.currentTarget.checked)},j)}),(n.answerValueSet&&g.length>Ms||n.answerOption&&g.length>Qh)&&s.jsxs(De,{size:"sm",c:"dimmed",children:["Showing first ",Ms," options"]})]})}function Lb(){return s.jsx(ze,{disabled:!0,placeholder:"No Answers Defined"})}function zb(e,t=0){const n=e.answer;return ci((n==null?void 0:n[t])??{})}function K_(e){const t=e.answer;return t?t.map(r=>ci(r)).map(r=>Rd(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function sW(e,t){var n;return(n=e.find(r=>si(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function sm(e,t){var n;return!!((n=e.extension)!=null&&n.some(r=>{var a,o,c;return r.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((c=(o=(a=r.valueCodeableConcept)==null?void 0:a.coding)==null?void 0:o[0])==null?void 0:c.code)===t}))}function lW(e){return sm(e,"drop-down")}function cW(e){return sm(e,"check-box")}function uW(e){return sm(e,"radio-button")}function dW(e){return sm(e,"multi-select")}function fW(e){var o;if(((o=e.answerOption)==null?void 0:o.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=ci(t),r="value"+Hn(n.type),a=(e.answerOption??[]).map(c=>{const u=ci(c),f=vc(u);return{value:f,label:f}});return{propertyName:r,data:a}}const hW="_section_my8o4_1",pW="_hovering_my8o4_10",mW="_editing_my8o4_14",gW="_questionBody_my8o4_20",vW="_topActions_my8o4_24",yW="_bottomActions_my8o4_33",xW="_movementActions_my8o4_44",bW="_movementIcons_my8o4_56",SW="_columnAlignment_my8o4_60",wW="_linkIdInput_my8o4_65",jW="_typeSelect_my8o4_70",CW="_preserveBreaks_my8o4_74",Fr={section:hW,hovering:pW,editing:mW,questionBody:gW,topActions:vW,bottomActions:yW,movementActions:xW,movementIcons:bW,columnAlignment:SW,linkIdInput:wW,typeSelect:jW,preserveBreaks:CW};function EW(e){const t=_e(),n=Qt(e.questionnaire),[r,a]=y.useState(!1),[o,c]=y.useState(),[u,f]=y.useState(),[p,m]=y.useState();function g(){m(void 0)}function v(){f(void 0)}y.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>a(!0)).catch(console.log)},[t]),y.useEffect(()=>(c(AW(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",v)}),[n]);const b=(S,j)=>{c(S),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(S)};return!r||!o?null:s.jsx("div",{children:s.jsxs(pt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(o),children:[s.jsx(X_,{item:o,selectedKey:u,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),s.jsx(Or,{children:"Save"})]})})}function X_(e){var E;const t=e.item,n=e.item,r=fi(e.item),a=r||n.type===At.group,o=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,f=y.useRef(e.item);f.current=e.item;function p(T){pn(T),e.setSelectedKey(e.item.id)}function m(T){pn(T),e.setHoverKey(e.item.id)}function g(T){var k;const A=f.current;e.onChange({...A,item:(k=A.item)==null?void 0:k.map(M=>M.id===T.id?T:M)})}function v(T,A){e.onChange({...e.item,item:[...e.item.item??[],T]},A)}function b(T){var A;e.onChange({...e.item,item:(A=e.item.item)==null?void 0:A.filter(k=>k!==T)})}function S(T,A){e.onChange({...f.current,[T]:A})}function j(T){e.onChange({...e.item,...T})}function C(T){var A;e.onChange({...e.item,item:(A=e.item.item)==null?void 0:A.map(k=>k===T?{...k,repeats:!k.repeats}:k)})}function R(T,A){const k=PW(e.item.item,T,A);e.onChange({...e.item,item:k})}const D=Ut(Fr.section,{[Fr.editing]:c,[Fr.hovering]:u&&!c});return s.jsxs("div",{"data-testid":n.linkId,className:D,onClick:p,onMouseOver:m,onFocus:m,children:[s.jsx("div",{className:Fr.questionBody,children:c?s.jsxs(s.Fragment,{children:[r&&s.jsx(ze,{size:"xl",defaultValue:t.title,onBlur:T=>S("title",T.currentTarget.value)}),!r&&s.jsx(Zs,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:T=>S("text",T.currentTarget.value)}),n.type==="reference"&&s.jsx(DW,{item:n,onChange:j}),HQ(n)&&s.jsx(TW,{item:n,onChange:T=>j(T)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(Le,{children:t.title}),n.text&&s.jsx("div",{className:Fr.preserveBreaks,children:n.text}),!a&&s.jsx(Fy,{item:n,index:0,required:!1,onChange:()=>{},response:{linkId:n.linkId}})]})}),(E=n.item)==null?void 0:E.map((T,A)=>s.jsx("div",{children:s.jsx(X_,{item:T,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:A===0,isLast:A===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(T),onRepeatable:C,onMoveUp:()=>R(A,-1),onMoveDown:()=>R(A,1)})},T.id)),!a&&s.jsx("div",{className:Fr.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx(ze,{size:"xs",className:Fr.linkIdInput,defaultValue:n.linkId,onBlur:T=>S("linkId",T.currentTarget.value)}),!a&&s.jsx(ln,{size:"xs",className:Fr.typeSelect,defaultValue:n.type,onChange:T=>S("type",T.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:o})}),!r&&s.jsx(ce,{className:Fr.movementActions,children:s.jsxs(ce,{className:Fr.columnAlignment,children:[!e.isFirst&&s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(AV,{"data-testid":"up-button",size:15,className:Fr.movementIcons})}),!e.isLast&&s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(DV,{"data-testid":"down-button",size:15,className:Fr.movementIcons})})]})}),s.jsxs("div",{className:Fr.bottomActions,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),v({id:Qs(),linkId:Gy("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),v({id:Qs(),linkId:Gy("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),v(kW(),!0)},children:"Add Page"}),c&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function TW(e){const t=Wo("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(ze,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(RW,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(ce,{display:"flex",children:[s.jsx(Pt,{href:"#",onClick:r=>{pn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Qs()}]})},children:"Add choice"}),s.jsx(Vp,{w:"lg"}),s.jsx(Pt,{href:"#",onClick:r=>{pn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function RW(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=em({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(Od,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(a,o)=>{const c=[...e.options],u=c.findIndex(f=>f.id===t.id);c[u]={id:t.id,[o]:a},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Pt,{href:"#",onClick:a=>{pn(a),e.onChange({...e.item,answerOption:e.options.filter(o=>o.id!==t.id)})},children:"Remove"})})]},t.id)})})}function DW(e){const t=H_(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(je,{children:[s.jsx(xb,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:a=>{e.onChange(Xv(e.item,t.map(o=>o===n?a:o)))}}),s.jsx(Pt,{href:"#",onClick:a=>{pn(a),e.onChange(Xv(e.item,t.filter(o=>o!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Pt,{href:"#",onClick:n=>{pn(n),e.onChange(Xv(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Hy=1,qy=1;function Gy(e){return e+Hy++}function Qs(){return"id-"+qy++}function AW(e){return{...e,id:e.id||Qs(),item:Z_(e.item)}}function Z_(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(qy=Math.max(qy,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Hy=Math.max(Hy,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Qs(),item:Z_(t.item),answerOption:_W(t.answerOption)}))}function _W(e){if(e)return e.map(t=>({...t,id:t.id||Qs()}))}function kW(){return{id:Qs(),linkId:Gy("s"),type:"group",text:"New Page",extension:[{url:"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function PW(e,t,n){const r=e??[],a=t+n;if(a<0||a>=r.length)return r;const o=[...r];return[o[t],o[a]]=[o[a],o[t]],o}function J_(e){const{item:t,response:n,onChange:r}=e,[a,o]=y.useState(NW(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===At.display)return s.jsx("p",{children:t.text},t.linkId);const c=(t==null?void 0:t.repeats)&&t.type!==At.choice&&t.type!==At.openChoice;return t.type===At.boolean?s.jsx(Fy,{item:t,response:n,onChange:u=>r([u]),index:0},t.linkId):s.jsxs($t,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(a)].map((u,f)=>s.jsx(Fy,{item:t,response:n,onChange:p=>r([p]),index:f},`${t.linkId}-${f}`)),c&&s.jsx(Pt,{onClick:()=>o(u=>u+1),children:"Add Item"})]},e.item.linkId)}function NW(e,t){if(e.type===At.choice||e.type===At.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function ek(e){const[t,n]=y.useState(e.response);if(y.useEffect(()=>{n(e.response)},[e.response]),t.length===0)return null;function r(o,c){const u=t.map((f,p)=>p===c?o[0]:f);n(u),e.onChange(u)}function a(){const o=G_(e.item,void 0);n([...t,o])}return s.jsxs(s.Fragment,{children:[t.map((o,c)=>s.jsx(tk,{item:e.item,response:o,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:u=>r(u,c)},o.id)),e.item.repeats&&s.jsx(Pt,{onClick:a,children:`Add Group: ${e.item.text}`})]})}function tk(e){var o;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function a(c){var m;const u=(m=t.item)==null?void 0:m.map(g=>c.find(b=>b.id===g.id)??g),f=u==null?void 0:u.concat(c.slice(1)),p={...t,item:f};r([p])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(Le,{order:3,mb:"md",children:e.item.text}),s.jsx(We,{children:(o=e.item.item)==null?void 0:o.map(c=>{var u,f,p;return c.type===At.group?c.repeats?s.jsx(ek,{item:c,response:((u=t.item)==null?void 0:u.filter(m=>m.linkId===c.linkId))??[],checkForQuestionEnabled:n,onChange:a},c.linkId):s.jsx(tk,{item:c,checkForQuestionEnabled:n,response:((f=t.item)==null?void 0:f.find(m=>m.linkId===c.linkId))??{linkId:c.linkId},onChange:a},c.linkId):s.jsx(J_,{item:c,response:(p=t.item)==null?void 0:p.find(m=>m.linkId===c.linkId),onChange:a,checkForQuestionEnabled:n},c.linkId)})})]},e.item.linkId):null}function OW(e){const{items:t,response:n,activePage:r,onChange:a,nextStep:o,prevStep:c,numberOfPages:u,renderPages:f,submitButtonText:p,excludeButtons:m,checkForQuestionEnabled:g}=e,v=t.map(b=>{var C;const S=((C=n==null?void 0:n.item)==null?void 0:C.filter(R=>R.linkId===b.linkId))??[],j=b.type===At.group?s.jsx(ek,{item:b,response:S,onChange:a,checkForQuestionEnabled:g},b.linkId):s.jsx(J_,{item:b,response:S==null?void 0:S[0],onChange:a,checkForQuestionEnabled:g},b.linkId);return f?s.jsx(mc.Step,{label:b.text,children:j},b.linkId):j});return s.jsxs(s.Fragment,{children:[f&&s.jsx(mc,{active:r??0,allowNextStepsSelect:!1,p:6,children:v}),!f&&s.jsx(We,{children:v}),!m&&s.jsx(MW,{activePage:r??0,numberOfPages:u,nextStep:f?o:void 0,prevStep:f?c:void 0,renderPages:f,submitButtonText:p})]})}function MW(e){const t=e.renderPages&&e.activePage>0,n=e.renderPages&&e.activePage<e.numberOfPages-1,r=!e.renderPages||e.activePage===e.numberOfPages-1;return s.jsxs(je,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&s.jsx(Oe,{onClick:e.prevStep,children:"Back"}),n&&s.jsx(Oe,{onClick:a=>{const o=a.currentTarget.closest("form");e.nextStep&&o.reportValidity()&&e.nextStep()},children:"Next"}),r&&s.jsx(Or,{children:e.submitButtonText??"Submit"})]})}function nk(e){const t=_e(),{subject:n,source:r}=e,a=Qt(e.questionnaire),o=vV(a),c=Qt(e.questionnaireResponse),[u,f]=y.useState(c),[p,m]=y.useState(0),g=y.useRef(e.onChange);g.current=e.onChange;const v=y.useRef(e.onSubmit);v.current=e.onSubmit,y.useEffect(()=>{if(c!=null&&c.item&&a){const E=tT(a,c),T=ak(E,a);f(T)}else{if(a&&nT(o)===nT(a))return;f(a?tT(a):void 0)}},[c,a,o]),y.useEffect(()=>{if(u&&g.current)try{g.current(u)}catch(E){console.error("Error invoking QuestionnaireForm.onChange callback",E)}},[u]);const b=y.useCallback(E=>{f(T=>LW(T,E,a))},[a]),S=y.useCallback(()=>{const E=v.current;if(E&&a&&u){let T=r;if(!T){const A=t.getProfile();A&&(T=on(A))}E({...u,questionnaire:a.url??zt(a),subject:n,source:T,authored:new Date().toISOString(),status:"completed"})}},[t,a,u,n,r]);function j(E){return qQ(E,u)}if(!a||!u)return null;const C=eW(a),R=()=>m(E=>E+1),D=()=>m(E=>E-1);return s.jsx(Q_.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(pt,{testid:"questionnaire-form",onSubmit:S,children:[a.title&&s.jsx(Le,{children:a.title}),s.jsx(OW,{items:a.item??[],response:u,onChange:b,renderPages:!e.disablePagination&&C>1,activePage:p,numberOfPages:C,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:j,nextStep:R,prevStep:D})]})})}function IW(e,t){const n=rk(e.item??[],t.item??[]);return{...t,item:n.length>0?n:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function rk(e,t){const n=[],r=new Set;for(const a of e){const o=a.id,c=t.find(u=>u.id===o);c?(n.push(IW(a,c)),r.add(c.id)):n.push(a)}for(const a of t)r.has(a.id)||n.push(a);return n}function nT(e){return(e==null?void 0:e.id)||e}function LW(e,t,n){if(!t)return{resourceType:"QuestionnaireResponse",status:"in-progress"};const r=(e==null?void 0:e.item)??[],a=rk(r,Array.isArray(t)?t:[t]),o={resourceType:"QuestionnaireResponse",status:"in-progress",item:a},c=Ob((n==null?void 0:n.item)??[],o);return o.item=Mb(a,c),ak(o,n)}function ak(e,t){const n=Ob((t==null?void 0:t.item)??[],e);return{resourceType:"QuestionnaireResponse",status:"in-progress",item:Mb(e.item??[],n)}}const zW="_section_4m5it_1",$W={section:zW},UW=["gender","age","gestationalAge","context","appliesTo","category"],BW={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function VW(e){e=Object.assign(BW,e);const t=e.definition,[n,r]=y.useState([]),[a,o]=y.useState(1),[c,u]=y.useState(1);return y.useEffect(()=>{const S=qW(t,u);r(GW(S.qualifiedInterval||[],o))},[t]),s.jsxs(pt,{testid:"reference-range-editor",onSubmit:f,children:[s.jsx(We,{children:n.map(S=>{var j;return s.jsx(FW,{unit:WW((j=t.quantitativeDetails)==null?void 0:j.unit),onChange:g,onAdd:v,onRemove:b,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`)})}),s.jsx(_n,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{pn(S),p({id:`group-id-${a}`,filters:{},intervals:[]}),o(j=>j+1)},children:s.jsx(Hh,{})}),s.jsx(je,{justify:"flex-end",children:s.jsx(Or,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!YW(j));e.onSubmit({...t,qualifiedInterval:S})}function p(S){r(j=>[...j,S])}function m(S){r(j=>j.filter(C=>C.id!==S.id))}function g(S,j){r(C=>{C=[...C];const R=C.find(E=>E.id===S),D=R==null?void 0:R.intervals.findIndex(E=>E.id===j.id);return D!==void 0&&(R!=null&&R.intervals[D])&&(R.intervals[D]=j),C})}function v(S,j){j.id===void 0&&(j.id=`id-${c}`,u(C=>C+1)),r(C=>{C=[...C];const R=C.findIndex(D=>D.id===S);if(R!==-1){const D={...C[R]};j={...j,...D.filters},D.intervals=[...D.intervals,j],C[R]=D}return C})}function b(S,j){r(C=>{C=[...C];const R=C.find(D=>D.id===S);return R&&(R.intervals=R.intervals.filter(D=>D.id!==j.id)),C})}}function FW(e){const{intervalGroup:t,unit:n}=e;return s.jsx(kd,{"data-testid":t.id,className:$W.section,children:s.jsxs(We,{gap:"lg",children:[s.jsx(je,{justify:"flex-end",children:s.jsx(_n,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{pn(r),e.onRemoveGroup(t)},children:s.jsx(Fh,{})},`remove-group-button-${t.id}`)}),s.jsx(HW,{intervalGroup:t,onChange:e.onChange}),s.jsx(jn,{}),t.intervals.map(r=>s.jsxs(We,{gap:"xs",children:[s.jsxs(je,{children:[s.jsx(ze,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:a=>{pn(a),e.onChange(t.id,{...r,condition:a.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(_n,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:a=>{pn(a),e.onRemove(t.id,r)},children:s.jsx(Fh,{})},`remove-interval-${r.id}`)]}),s.jsx(Eb,{path:"",onChange:a=>{e.onChange(t.id,{...r,range:a})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(_n,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{pn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(Hh,{})})]})})}function HW(e){var r,a;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const o of["low","high"])(r=t.filters.age[o])!=null&&r.unit||(t.filters.age[o]={...t.filters.age[o],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(We,{style:{maxWidth:"50%"},children:[s.jsx(je,{children:s.jsx(ln,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""&&(u=void 0),n(t.id,{...c,gender:u})}}})}),s.jsxs(je,{gap:"xs",children:[s.jsx(De,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Eb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:o=>{for(const c of t.intervals)n(t.id,{...c,age:o})}},`age-${t.id}`)})]}),s.jsx(ln,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((a=t.filters.context)==null?void 0:a.text)||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""?(u=void 0,n(t.id,{...c,context:void 0})):n(t.id,{...c,context:{text:u,coding:[{code:u,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(ln,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:o=>{for(const c of t.intervals){const u=o.currentTarget.value;u===""?n(t.id,{...c,category:void 0}):n(t.id,{...c,category:u})}}})]})}function qW(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(a=>{var c;const o=parseInt(((c=a.id)==null?void 0:c.substring(3))||"",10);return isNaN(o)?Number.NEGATIVE_INFINITY:o}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(a=>({...a,id:a.id||`id-${r++}`}))},t(r),e}function GW(e,t){let n=1;const r={};for(const a of e){const o=QW(a);o in r||(r[o]={id:`group-id-${n++}`,filters:Object.fromEntries(UW.map(c=>[c,a[c]])),intervals:[]}),r[o].intervals.push(a)}return t(n),Object.values(r)}function QW(e){var n,r;return[`gender=${e.gender}`,`age=${ad(e.age)}`,`gestationalAge=${ad(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(a=>a.text).join("+")}`,`category=${e.category}`].join(":")}function WW(e){return e&&(U$(e,"http://unitsofmeasure.org")||e.text)}function YW(e){var t,n,r,a;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((a=(r=e.range)==null?void 0:r.high)==null?void 0:a.value)===void 0}function KW(e){var p;const t=_e(),n=Qt(e.value),[r,a]=y.useState(!1),[o,c]=y.useState();if(y.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(c).catch(console.log),a(!0))},[t,n,r]),!n||!o)return null;return s.jsx(or,{children:(p=n.action)==null?void 0:p.map((m,g)=>{var j,C,R,D,E,T;const v=m.resource&&f(m.resource),b=(C=(j=v==null?void 0:v.input)==null?void 0:j[0])==null?void 0:C.valueReference,S=(D=(R=v==null?void 0:v.output)==null?void 0:R[0])==null?void 0:D.valueReference;return s.jsxs(y.Fragment,{children:[s.jsx(or.Col,{span:1,p:"md",children:(v==null?void 0:v.status)==="completed"?s.jsx(zV,{}):s.jsx(uF,{color:"gray"})}),s.jsxs(or.Col,{span:9,p:"xs",children:[s.jsx(De,{fw:500,children:m.title}),m.description&&s.jsx("div",{children:m.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Ic,{value:(E=v==null?void 0:v.meta)==null?void 0:E.author})," on ",gr((T=v==null?void 0:v.meta)==null?void 0:T.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(nm,{status:(v==null?void 0:v.status)||"unknown"})]})]}),s.jsxs(or.Col,{span:2,p:"md",children:[b&&!S&&s.jsx(Oe,{onClick:()=>e.onStart(v,b),children:"Start"}),b&&S&&s.jsx(Oe,{onClick:()=>e.onEdit(v,b,S),children:"Edit"})]})]},`action-${g}`)})});function u(m){var v;const g=[];if(m.action)for(const b of m.action)(v=b.resource)!=null&&v.reference&&g.push({request:{method:"GET",url:b.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:g}}function f(m){for(const g of(o==null?void 0:o.entry)??[])if(g.resource&&m.reference===zt(g.resource))return g.resource}}function ik(e,t){const n=XW(e,t);return ZW(n,e,t)}function XW(e,t){const n=e.length,r=t.length,a=n+r+1,o=1+2*a,c=o/2|0,u=new Array(o);u[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<a;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,v=m-1,b=u[g],S=u[v];let j,C=0;p===-f||p!==f&&S.i<b.i?(C=b.i,j=b):(C=S.i+1,j=S),u[v]=void 0;let R=C-p,D={i:C,j:R,prev:JW(j),snake:!1};for(;C<n&&R<r&&e[C]===t[R];)C++,R++;if(C>D.i&&(D={i:C,j:R,prev:D,snake:!0}),u[m]=D,C>=n&&R>=r)return u[m]}u[c+f-1]=void 0}}function ZW(e,t,n){const r=[];let a=e;for(a.snake&&(a=a.prev);a!=null&&a.prev&&a.prev.j>=0;){const o=a.i,c=a.j;a=a.prev;const u=a.i,f=a.j,p={position:u,lines:t.slice(u,o)},m={position:f,lines:n.slice(f,c)};let g;p.lines.length===0&&m.lines.length>0?g="insert":p.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:p,revised:m,type:g}),a.snake&&(a=a.prev)}return r}function JW(e){return e&&!e.snake&&e.prev?e.prev:e}function eY(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>{var a;return{meta:(a=r.resource)==null?void 0:a.meta,lines:Ia(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,a)=>r.meta.lastUpdated.localeCompare(a.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 tY(n,t),nY(n),n}function tY(e,t){for(let n=1;n<t.length;n++){const r=ik(t[n-1].lines,t[n].lines);for(const a of r){const o=a.original.position,c=a.original.lines,u=a.revised.lines;if((a.type==="delete"||a.type==="change")&&e.splice(o,c.length),a.type==="insert"||a.type==="change")for(let f=0;f<a.revised.lines.length;f++)e.splice(o+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:u[f],span:1})}}}function nY(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 rY="_container_1oj0p_1",aY="_root_1oj0p_5",iY="_startRow_1oj0p_20",oY="_normalRow_1oj0p_24",sY="_author_1oj0p_28",lY="_dateTime_1oj0p_32",cY="_lineNumber_1oj0p_37",uY="_line_1oj0p_37",dY="_pre_1oj0p_52",Oi={container:rY,root:aY,startRow:iY,normalRow:oY,author:sY,dateTime:lY,lineNumber:cY,line:uY,pre:dY};function fY(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function hY(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Xl(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Xl(r,"month");const a=Math.floor(t/86400);if(a>0)return Xl(a,"day");const o=Math.floor(t/3600);if(o>0)return Xl(o,"hour");const c=Math.floor(t/60);return c>0?Xl(c,"minute"):Xl(t,"second")}function Xl(e,t){return`${e} ${e===1?t:t+"s"} ago`}function pY(e){var c,u;const t=_e(),[n,r]=y.useState(e.history);if(y.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const a=(u=(c=n.entry)==null?void 0:c[0])==null?void 0:u.resource;if(!a)return null;const o=eY(n);return s.jsx("div",{className:Oi.container,children:s.jsx("table",{className:Oi.root,children:s.jsx("tbody",{children:o.map((f,p)=>s.jsxs("tr",{className:f.span>0?Oi.startRow:Oi.normalRow,children:[f.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:Oi.author,rowSpan:f.span,children:s.jsx(oc,{value:f.meta.author,link:!0})}),s.jsx("td",{className:Oi.dateTime,rowSpan:f.span,children:s.jsx(bt,{to:fY(a,f.meta.versionId),children:hY(f.meta.lastUpdated)})})]}),s.jsx("td",{className:Oi.lineNumber,children:p+1}),s.jsx("td",{className:Oi.line,children:s.jsx("pre",{className:Oi.pre,children:f.value})})]},"row-"+p))})})})}const mY="_removed_el5zk_1",gY="_added_el5zk_6",rT={removed:mY,added:gY};function vY(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Ia(t,!0).match(/[^\r\n]+/g),a=Ia(n,!0).match(/[^\r\n]+/g),o=ik(r,a);return s.jsx("pre",{style:{color:"gray"},children:o.map((c,u)=>s.jsx(yY,{delta:c},"delta"+u))})}function yY(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:rT.removed,children:e.delta.original.lines.join(`
532
- `)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:rT.added,children:e.delta.revised.lines.join(`
533
- `)}),"...",s.jsx("br",{})]})}const xY="_splitButton_1i0gi_1",bY="_menuControl_1i0gi_6",aT={splitButton:xY,menuControl:bY};function Wh(e){const{outcome:t}=e,n=_e(),r=Qt(e.defaultValue),a=r==null?void 0:r.resourceType,[o,c]=y.useState(!1),[u,f]=y.useState(),p=n.getAccessPolicy(),m=Sn();y.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=Pc(b);if(S){c(!0);const j=lV(r,S);f(j)}else console.error(`Schema not found for ${b}`)}).catch(S=>{console.error("Error in requestProfileSchema",S)})}else n.requestSchema(a).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,a,e.profileUrl]);const g=y.useMemo(()=>r&&kA(r,Ps.READ,p),[p,r]),v=y.useMemo(()=>n.isSuperAdmin()||!p||!En(u==null?void 0:u.resourceType)?!0:uB(p,u==null?void 0:u.resourceType),[n,p,u==null?void 0:u.resourceType]);return!o||!u?s.jsx("div",{children:"Loading..."}):v?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[s.jsxs(We,{mb:"xl",children:[s.jsx($t,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(ze,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),s.jsx($t,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(ze,{name:"id",defaultValue:u.id,disabled:!0})})]}),s.jsx(Db,{path:u.resourceType,valuePath:u.resourceType,typeName:a,defaultValue:u,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),s.jsxs(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[s.jsx(Oe,{type:"submit",className:Ut((e.onPatch||e.onDelete)&&aT.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&s.jsxs(we,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[s.jsx(we.Target,{children:s.jsx(_n,{variant:"filled",color:m.primaryColor,size:36,className:aT.menuControl,"aria-label":"More actions",children:s.jsx(db,{size:14,stroke:1.5})})}),s.jsxs(we.Dropdown,{children:[e.onPatch&&s.jsx(we.Item,{leftSection:s.jsx(YA,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&s.jsx(we.Item,{color:"red",leftSection:s.jsx(mb,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):s.jsxs(Yi,{color:"red",title:"Permission denied",icon:s.jsx(nl,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function SY(e){var a;const t=_e(),[n,r]=y.useState(e.history);return y.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?s.jsxs(Me,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(Me.Thead,{children:s.jsxs(Me.Tr,{children:[s.jsx(Me.Th,{children:"Author"}),s.jsx(Me.Th,{children:"Date"}),s.jsx(Me.Th,{children:"Version"})]})}),s.jsx(Me.Tbody,{children:(a=n.entry)==null?void 0:a.map((o,c)=>s.jsx(wY,{entry:o},"entry-"+c))})]}):s.jsx("div",{children:"Loading..."})}function wY(e){var r,a,o;const{response:t,resource:n}=e.entry;return n?s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:s.jsx(oc,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(Me.Td,{children:gr((a=n.meta)==null?void 0:a.lastUpdated)}),s.jsx(Me.Td,{children:s.jsx(bt,{to:jY(n),children:(o=n.meta)==null?void 0:o.versionId})})]}):s.jsx(Me.Tr,{children:s.jsx(Me.Td,{colSpan:3,children:Xe(t==null?void 0:t.outcome)})})}function jY(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function CY(e){const{serviceRequest:t,...n}=e;return s.jsx(rm,{value:t,loadTimelineResources:async(r,a,o)=>{const c=`${a}/${o}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",o),r.search("Communication",{"based-on":c,_count:u}),r.search("DiagnosticReport",{"based-on":c,_count:u}),r.search("Media",{"based-on":c,_count:u}),r.search("DocumentReference",{related:c,_count:u}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:u})])},createCommunication:(r,a,o)=>({resourceType:"Communication",status:"completed",basedOn:[on(r)],subject:r.subject,sender:on(a),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,a,o)=>({resourceType:"Media",status:"completed",basedOn:[on(r)],subject:r.subject,operator:on(a),issued:new Date().toISOString(),content:o}),...n})}function EY(e){const t=_e(),{client:n,patient:r,encounter:a,children:o,...c}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:a}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",X0(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),window.location.assign(p.toString())}).catch(f=>Pe({color:"red",message:Xe(f),autoClose:!1}))}return s.jsx(Pt,{onClick:()=>u(),...c,children:o})}var Zv={exports:{}},Lu={},Jv={exports:{}},ey={};/**
534
- * @license React
535
- * scheduler.production.js
536
- *
537
- * Copyright (c) Meta Platforms, Inc. and affiliates.
538
- *
539
- * This source code is licensed under the MIT license found in the
540
- * LICENSE file in the root directory of this source tree.
541
- */var iT;function TY(){return iT||(iT=1,function(e){function t(P,I){var z=P.length;P.push(I);e:for(;0<z;){var H=z-1>>>1,O=P[H];if(0<a(O,I))P[H]=I,P[z]=O,z=H;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var I=P[0],z=P.pop();if(z!==I){P[0]=z;e:for(var H=0,O=P.length,U=O>>>1;H<U;){var K=2*(H+1)-1,ee=P[K],be=K+1,xe=P[be];if(0>a(ee,z))be<O&&0>a(xe,ee)?(P[H]=xe,P[be]=z,H=be):(P[H]=ee,P[K]=z,H=K);else if(be<O&&0>a(xe,z))P[H]=xe,P[be]=z,H=be;else break e}}return I}function a(P,I){var z=P.sortIndex-I.sortIndex;return z!==0?z:P.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],p=[],m=1,g=null,v=3,b=!1,S=!1,j=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function T(P){for(var I=n(p);I!==null;){if(I.callback===null)r(p);else if(I.startTime<=P)r(p),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(p)}}function A(P){if(j=!1,T(P),!S)if(n(f)!==null)S=!0,k||(k=!0,Q());else{var I=n(p);I!==null&&Z(A,I.startTime-P)}}var k=!1,M=-1,L=5,$=-1;function V(){return C?!0:!(e.unstable_now()-$<L)}function Y(){if(C=!1,k){var P=e.unstable_now();$=P;var I=!0;try{e:{S=!1,j&&(j=!1,D(M),M=-1),b=!0;var z=v;try{t:{for(T(P),g=n(f);g!==null&&!(g.expirationTime>P&&V());){var H=g.callback;if(typeof H=="function"){g.callback=null,v=g.priorityLevel;var O=H(g.expirationTime<=P);if(P=e.unstable_now(),typeof O=="function"){g.callback=O,T(P),I=!0;break t}g===n(f)&&r(f),T(P)}else r(f);g=n(f)}if(g!==null)I=!0;else{var U=n(p);U!==null&&Z(A,U.startTime-P),I=!1}}break e}finally{g=null,v=z,b=!1}I=void 0}}finally{I?Q():k=!1}}}var Q;if(typeof E=="function")Q=function(){E(Y)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,G=J.port2;J.port1.onmessage=Y,Q=function(){G.postMessage(null)}}else Q=function(){R(Y,0)};function Z(P,I){M=R(function(){P(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(P){switch(v){case 1:case 2:case 3:var I=3;break;default:I=v}var z=v;v=I;try{return P()}finally{v=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(P,I){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var z=v;v=P;try{return I()}finally{v=z}},e.unstable_scheduleCallback=function(P,I,z){var H=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?H+z:H):z=H,P){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=z+O,P={id:m++,callback:I,priorityLevel:P,startTime:z,expirationTime:O,sortIndex:-1},z>H?(P.sortIndex=z,t(p,P),n(f)===null&&P===n(p)&&(j?(D(M),M=-1):j=!0,Z(A,z-H))):(P.sortIndex=O,t(f,P),S||b||(S=!0,k||(k=!0,Q()))),P},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(P){var I=v;return function(){var z=v;v=I;try{return P.apply(this,arguments)}finally{v=z}}}}(ey)),ey}var oT;function RY(){return oT||(oT=1,Jv.exports=TY()),Jv.exports}/**
542
- * @license React
543
- * react-dom-client.production.js
544
- *
545
- * Copyright (c) Meta Platforms, Inc. and affiliates.
546
- *
547
- * This source code is licensed under the MIT license found in the
548
- * LICENSE file in the root directory of this source tree.
549
- */var sT;function DY(){if(sT)return Lu;sT=1;var e=RY(),t=ix(),n=RR();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 a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(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(o(i)!==i)throw Error(r(188))}function f(i){var l=i.alternate;if(!l){if(l=o(i),l===null)throw Error(r(188));return l!==i?null:i}for(var d=i,h=l;;){var x=d.return;if(x===null)break;var w=x.alternate;if(w===null){if(h=x.return,h!==null){d=h;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===d)return u(x),i;if(w===h)return u(x),l;w=w.sibling}throw Error(r(188))}if(d.return!==h.return)d=x,h=w;else{for(var _=!1,N=x.child;N;){if(N===d){_=!0,d=x,h=w;break}if(N===h){_=!0,h=x,d=w;break}N=N.sibling}if(!_){for(N=w.child;N;){if(N===d){_=!0,d=w,h=x;break}if(N===h){_=!0,h=w,d=x;break}N=N.sibling}if(!_)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?i:l}function p(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=p(i),l!==null)return l;i=i.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),D=Symbol.for("react.consumer"),E=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function Q(i){return i===null||typeof i!="object"?null:(i=Y&&i[Y]||i["@@iterator"],typeof i=="function"?i:null)}var J=Symbol.for("react.client.reference");function G(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===J?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case C:return"Profiler";case j:return"StrictMode";case A:return"Suspense";case k:return"SuspenseList";case $:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case E:return(i.displayName||"Context")+".Provider";case D:return(i._context.displayName||"Context")+".Consumer";case T:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case M:return l=i.displayName||null,l!==null?l:G(i.type)||"Memo";case L:l=i._payload,i=i._init;try{return G(i(l))}catch{}}return null}var Z=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},H=[],O=-1;function U(i){return{current:i}}function K(i){0>O||(i.current=H[O],H[O]=null,O--)}function ee(i,l){O++,H[O]=i.current,i.current=l}var be=U(null),xe=U(null),ye=U(null),qe=U(null);function Ne(i,l){switch(ee(ye,l),ee(xe,i),ee(be,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?sj(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=sj(l),i=lj(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}K(be),ee(be,i)}function tt(){K(be),K(xe),K(ye)}function Ae(i){i.memoizedState!==null&&ee(qe,i);var l=be.current,d=lj(l,i.type);l!==d&&(ee(xe,i),ee(be,d))}function gt(i){xe.current===i&&(K(be),K(xe)),qe.current===i&&(K(qe),Tu._currentValue=z)}var Mt=Object.prototype.hasOwnProperty,It=e.unstable_scheduleCallback,mt=e.unstable_cancelCallback,Dt=e.unstable_shouldYield,nn=e.unstable_requestPaint,Ce=e.unstable_now,Re=e.unstable_getCurrentPriorityLevel,Ge=e.unstable_ImmediatePriority,Te=e.unstable_UserBlockingPriority,me=e.unstable_NormalPriority,ge=e.unstable_LowPriority,ke=e.unstable_IdlePriority,Se=e.log,$e=e.unstable_setDisableYieldValue,vt=null,ft=null;function Gt(i){if(typeof Se=="function"&&$e(i),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(vt,i)}catch{}}var _t=Math.clz32?Math.clz32:Va,un=Math.log,wt=Math.LN2;function Va(i){return i>>>=0,i===0?32:31-(un(i)/wt|0)|0}var Sa=256,pi=4194304;function Un(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:case 262144:case 524288:case 1048576:case 2097152:return i&4194048;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 wa(i,l,d){var h=i.pendingLanes;if(h===0)return 0;var x=0,w=i.suspendedLanes,_=i.pingedLanes;i=i.warmLanes;var N=h&134217727;return N!==0?(h=N&~w,h!==0?x=Un(h):(_&=N,_!==0?x=Un(_):d||(d=N&~i,d!==0&&(x=Un(d))))):(N=h&~w,N!==0?x=Un(N):_!==0?x=Un(_):d||(d=h&~i,d!==0&&(x=Un(d)))),x===0?0:l!==0&&l!==x&&(l&w)===0&&(w=x&-x,d=l&-l,w>=d||w===32&&(d&4194048)!==0)?l:x}function Kr(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function sl(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 mi(){var i=Sa;return Sa<<=1,(Sa&4194048)===0&&(Sa=256),i}function no(){var i=pi;return pi<<=1,(pi&62914560)===0&&(pi=4194304),i}function Fa(i){for(var l=[],d=0;31>d;d++)l.push(i);return l}function xr(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function qn(i,l,d,h,x,w){var _=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,B=i.expirationTimes,ne=i.hiddenUpdates;for(d=_&~d;0<d;){var ue=31-_t(d),pe=1<<ue;N[ue]=0,B[ue]=-1;var ae=ne[ue];if(ae!==null)for(ne[ue]=null,ue=0;ue<ae.length;ue++){var ie=ae[ue];ie!==null&&(ie.lane&=-536870913)}d&=~pe}h!==0&&gi(i,h,0),w!==0&&x===0&&i.tag!==0&&(i.suspendedLanes|=w&~(_&~l))}function gi(i,l,d){i.pendingLanes|=l,i.suspendedLanes&=~l;var h=31-_t(l);i.entangledLanes|=l,i.entanglements[h]=i.entanglements[h]|1073741824|d&4194090}function ro(i,l){var d=i.entangledLanes|=l;for(i=i.entanglements;d;){var h=31-_t(d),x=1<<h;x&l|i[h]&l&&(i[h]|=l),d&=~x}}function Jo(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 es(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function F(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:Rj(i.type))}function X(i,l){var d=I.p;try{return I.p=i,l()}finally{I.p=d}}var re=Math.random().toString(36).slice(2),he="__reactFiber$"+re,Ee="__reactProps$"+re,Be="__reactContainer$"+re,nt="__reactEvents$"+re,Ue="__reactListeners$"+re,Ze="__reactHandles$"+re,Je="__reactResources$"+re,at="__reactMarker$"+re;function Ye(i){delete i[he],delete i[Ee],delete i[nt],delete i[Ue],delete i[Ze]}function st(i){var l=i[he];if(l)return l;for(var d=i.parentNode;d;){if(l=d[Be]||d[he]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(i=fj(i);i!==null;){if(d=i[he])return d;i=fj(i)}return l}i=d,d=i.parentNode}return null}function Ke(i){if(i=i[he]||i[Be]){var l=i.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return i}return null}function Wt(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function dn(i){var l=i[Je];return l||(l=i[Je]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function kt(i){i[at]=!0}var Et=new Set,ao={};function cr(i,l){Xr(i,l),Xr(i+"Capture",l)}function Xr(i,l){for(ao[i]=l,i=0;i<l.length;i++)Et.add(l[i])}var br=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),io={},oo={};function Lc(i){return Mt.call(oo,i)?!0:Mt.call(io,i)?!1:br.test(i)?oo[i]=!0:(io[i]=!0,!1)}function Zr(i,l,d){if(Lc(l))if(d===null)i.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+d)}}function vi(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 jt(i,l,d,h){if(h===null)i.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(d);return}i.setAttributeNS(l,d,""+h)}}var nr,ja;function Ca(i){if(nr===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);nr=l&&l[1]||"",ja=-1<d.stack.indexOf(`
550
- at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
551
- `+nr+i+ja}var ts=!1;function xn(i,l){if(!i||ts)return"";ts=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ie){var ae=ie}Reflect.construct(i,[],pe)}else{try{pe.call()}catch(ie){ae=ie}i.call(pe.prototype)}}else{try{throw Error()}catch(ie){ae=ie}(pe=i())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ie){if(ie&&ae&&typeof ie.stack=="string")return[ie.stack,ae.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),_=w[0],N=w[1];if(_&&N){var B=_.split(`
552
- `),ne=N.split(`
553
- `);for(x=h=0;h<B.length&&!B[h].includes("DetermineComponentFrameRoot");)h++;for(;x<ne.length&&!ne[x].includes("DetermineComponentFrameRoot");)x++;if(h===B.length||x===ne.length)for(h=B.length-1,x=ne.length-1;1<=h&&0<=x&&B[h]!==ne[x];)x--;for(;1<=h&&0<=x;h--,x--)if(B[h]!==ne[x]){if(h!==1||x!==1)do if(h--,x--,0>x||B[h]!==ne[x]){var ue=`
554
- `+B[h].replace(" at new "," at ");return i.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",i.displayName)),ue}while(1<=h&&0<=x);break}}}finally{ts=!1,Error.prepareStackTrace=d}return(d=i?i.displayName||i.name:"")?Ca(d):""}function so(i){switch(i.tag){case 26:case 27:case 5:return Ca(i.type);case 16:return Ca("Lazy");case 13:return Ca("Suspense");case 19:return Ca("SuspenseList");case 0:case 15:return xn(i.type,!1);case 11:return xn(i.type.render,!1);case 1:return xn(i.type,!0);case 31:return Ca("Activity");default:return""}}function zc(i){try{var l="";do l+=so(i),i=i.return;while(i);return l}catch(d){return`
555
- Error generating stack: `+d.message+`
556
- `+d.stack}}function Sr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function n1(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Xk(i){var l=n1(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),h=""+i[l];if(!i.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,w=d.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return x.call(this)},set:function(_){h=""+_,w.call(this,_)}}),Object.defineProperty(i,l,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(_){h=""+_},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Vd(i){i._valueTracker||(i._valueTracker=Xk(i))}function r1(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var d=l.getValue(),h="";return i&&(h=n1(i)?i.checked?"true":"false":i.value),i=h,i!==d?(l.setValue(i),!0):!1}function Fd(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 Zk=/[\n"\\]/g;function Jr(i){return i.replace(Zk,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function dm(i,l,d,h,x,w,_,N){i.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?i.type=_:i.removeAttribute("type"),l!=null?_==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+Sr(l)):i.value!==""+Sr(l)&&(i.value=""+Sr(l)):_!=="submit"&&_!=="reset"||i.removeAttribute("value"),l!=null?fm(i,_,Sr(l)):d!=null?fm(i,_,Sr(d)):h!=null&&i.removeAttribute("value"),x==null&&w!=null&&(i.defaultChecked=!!w),x!=null&&(i.checked=x&&typeof x!="function"&&typeof x!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+Sr(N):i.removeAttribute("name")}function a1(i,l,d,h,x,w,_,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))return;d=d!=null?""+Sr(d):"",l=l!=null?""+Sr(l):d,N||l===i.value||(i.value=l),i.defaultValue=l}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=N?i.checked:!!h,i.defaultChecked=!!h,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(i.name=_)}function fm(i,l,d){l==="number"&&Fd(i.ownerDocument)===i||i.defaultValue===""+d||(i.defaultValue=""+d)}function ll(i,l,d,h){if(i=i.options,l){l={};for(var x=0;x<d.length;x++)l["$"+d[x]]=!0;for(d=0;d<i.length;d++)x=l.hasOwnProperty("$"+i[d].value),i[d].selected!==x&&(i[d].selected=x),x&&h&&(i[d].defaultSelected=!0)}else{for(d=""+Sr(d),l=null,x=0;x<i.length;x++){if(i[x].value===d){i[x].selected=!0,h&&(i[x].defaultSelected=!0);return}l!==null||i[x].disabled||(l=i[x])}l!==null&&(l.selected=!0)}}function i1(i,l,d){if(l!=null&&(l=""+Sr(l),l!==i.value&&(i.value=l),d==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=d!=null?""+Sr(d):""}function o1(i,l,d,h){if(l==null){if(h!=null){if(d!=null)throw Error(r(92));if(Z(h)){if(1<h.length)throw Error(r(93));h=h[0]}d=h}d==null&&(d=""),l=d}d=Sr(l),i.defaultValue=d,h=i.textContent,h===d&&h!==""&&h!==null&&(i.value=h)}function cl(i,l){if(l){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=l;return}}i.textContent=l}var Jk=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 s1(i,l,d){var h=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?h?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":h?i.setProperty(l,d):typeof d!="number"||d===0||Jk.has(l)?l==="float"?i.cssFloat=d:i[l]=(""+d).trim():i[l]=d+"px"}function l1(i,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,d!=null){for(var h in d)!d.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var x in l)h=l[x],l.hasOwnProperty(x)&&d[x]!==h&&s1(i,x,h)}else for(var w in l)l.hasOwnProperty(w)&&s1(i,w,l[w])}function hm(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 e4=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"]]),t4=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hd(i){return t4.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var pm=null;function mm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ul=null,dl=null;function c1(i){var l=Ke(i);if(l&&(i=l.stateNode)){var d=i[Ee]||null;e:switch(i=l.stateNode,l.type){case"input":if(dm(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="'+Jr(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var h=d[l];if(h!==i&&h.form===i.form){var x=h[Ee]||null;if(!x)throw Error(r(90));dm(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<d.length;l++)h=d[l],h.form===i.form&&r1(h)}break e;case"textarea":i1(i,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&ll(i,!!d.multiple,l,!1)}}}var gm=!1;function u1(i,l,d){if(gm)return i(l,d);gm=!0;try{var h=i(l);return h}finally{if(gm=!1,(ul!==null||dl!==null)&&(_f(),ul&&(l=ul,i=dl,dl=ul=null,c1(l),i)))for(l=0;l<i.length;l++)c1(i[l])}}function $c(i,l){var d=i.stateNode;if(d===null)return null;var h=d[Ee]||null;if(h===null)return null;d=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var yi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vm=!1;if(yi)try{var Uc={};Object.defineProperty(Uc,"passive",{get:function(){vm=!0}}),window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{vm=!1}var lo=null,ym=null,qd=null;function d1(){if(qd)return qd;var i,l=ym,d=l.length,h,x="value"in lo?lo.value:lo.textContent,w=x.length;for(i=0;i<d&&l[i]===x[i];i++);var _=d-i;for(h=1;h<=_&&l[d-h]===x[w-h];h++);return qd=x.slice(i,1<h?1-h:void 0)}function Gd(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 Qd(){return!0}function f1(){return!1}function wr(i){function l(d,h,x,w,_){this._reactName=d,this._targetInst=x,this.type=h,this.nativeEvent=w,this.target=_,this.currentTarget=null;for(var N in 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)?Qd:f1,this.isPropagationStopped=f1,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Qd)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Qd)},persist:function(){},isPersistent:Qd}),l}var ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wd=wr(ns),Bc=m({},ns,{view:0,detail:0}),n4=wr(Bc),xm,bm,Vc,Yd=m({},Bc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wm,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!==Vc&&(Vc&&i.type==="mousemove"?(xm=i.screenX-Vc.screenX,bm=i.screenY-Vc.screenY):bm=xm=0,Vc=i),xm)},movementY:function(i){return"movementY"in i?i.movementY:bm}}),h1=wr(Yd),r4=m({},Yd,{dataTransfer:0}),a4=wr(r4),i4=m({},Bc,{relatedTarget:0}),Sm=wr(i4),o4=m({},ns,{animationName:0,elapsedTime:0,pseudoElement:0}),s4=wr(o4),l4=m({},ns,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),c4=wr(l4),u4=m({},ns,{data:0}),p1=wr(u4),d4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f4={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"},h4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p4(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=h4[i])?!!l[i]:!1}function wm(){return p4}var m4=m({},Bc,{key:function(i){if(i.key){var l=d4[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Gd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?f4[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wm,charCode:function(i){return i.type==="keypress"?Gd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Gd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),g4=wr(m4),v4=m({},Yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),m1=wr(v4),y4=m({},Bc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wm}),x4=wr(y4),b4=m({},ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),S4=wr(b4),w4=m({},Yd,{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}),j4=wr(w4),C4=m({},ns,{newState:0,oldState:0}),E4=wr(C4),T4=[9,13,27,32],jm=yi&&"CompositionEvent"in window,Fc=null;yi&&"documentMode"in document&&(Fc=document.documentMode);var R4=yi&&"TextEvent"in window&&!Fc,g1=yi&&(!jm||Fc&&8<Fc&&11>=Fc),v1=" ",y1=!1;function x1(i,l){switch(i){case"keyup":return T4.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var fl=!1;function D4(i,l){switch(i){case"compositionend":return b1(l);case"keypress":return l.which!==32?null:(y1=!0,v1);case"textInput":return i=l.data,i===v1&&y1?null:i;default:return null}}function A4(i,l){if(fl)return i==="compositionend"||!jm&&x1(i,l)?(i=d1(),qd=ym=lo=null,fl=!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 g1&&l.locale!=="ko"?null:l.data;default:return null}}var _4={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 S1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!_4[i.type]:l==="textarea"}function w1(i,l,d,h){ul?dl?dl.push(h):dl=[h]:ul=h,l=If(l,"onChange"),0<l.length&&(d=new Wd("onChange","change",null,d,h),i.push({event:d,listeners:l}))}var Hc=null,qc=null;function k4(i){nj(i,0)}function Kd(i){var l=Wt(i);if(r1(l))return i}function j1(i,l){if(i==="change")return l}var C1=!1;if(yi){var Cm;if(yi){var Em="oninput"in document;if(!Em){var E1=document.createElement("div");E1.setAttribute("oninput","return;"),Em=typeof E1.oninput=="function"}Cm=Em}else Cm=!1;C1=Cm&&(!document.documentMode||9<document.documentMode)}function T1(){Hc&&(Hc.detachEvent("onpropertychange",R1),qc=Hc=null)}function R1(i){if(i.propertyName==="value"&&Kd(qc)){var l=[];w1(l,qc,i,mm(i)),u1(k4,l)}}function P4(i,l,d){i==="focusin"?(T1(),Hc=l,qc=d,Hc.attachEvent("onpropertychange",R1)):i==="focusout"&&T1()}function N4(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Kd(qc)}function O4(i,l){if(i==="click")return Kd(l)}function M4(i,l){if(i==="input"||i==="change")return Kd(l)}function I4(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var Ir=typeof Object.is=="function"?Object.is:I4;function Gc(i,l){if(Ir(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var d=Object.keys(i),h=Object.keys(l);if(d.length!==h.length)return!1;for(h=0;h<d.length;h++){var x=d[h];if(!Mt.call(l,x)||!Ir(i[x],l[x]))return!1}return!0}function D1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function A1(i,l){var d=D1(i);i=0;for(var h;d;){if(d.nodeType===3){if(h=i+d.textContent.length,i<=l&&h>=l)return{node:d,offset:l-i};i=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=D1(d)}}function _1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?_1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function k1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=Fd(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=Fd(i.document)}return l}function Tm(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 L4=yi&&"documentMode"in document&&11>=document.documentMode,hl=null,Rm=null,Qc=null,Dm=!1;function P1(i,l,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Dm||hl==null||hl!==Fd(h)||(h=hl,"selectionStart"in h&&Tm(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Qc&&Gc(Qc,h)||(Qc=h,h=If(Rm,"onSelect"),0<h.length&&(l=new Wd("onSelect","select",null,l,d),i.push({event:l,listeners:h}),l.target=hl)))}function rs(i,l){var d={};return d[i.toLowerCase()]=l.toLowerCase(),d["Webkit"+i]="webkit"+l,d["Moz"+i]="moz"+l,d}var pl={animationend:rs("Animation","AnimationEnd"),animationiteration:rs("Animation","AnimationIteration"),animationstart:rs("Animation","AnimationStart"),transitionrun:rs("Transition","TransitionRun"),transitionstart:rs("Transition","TransitionStart"),transitioncancel:rs("Transition","TransitionCancel"),transitionend:rs("Transition","TransitionEnd")},Am={},N1={};yi&&(N1=document.createElement("div").style,"AnimationEvent"in window||(delete pl.animationend.animation,delete pl.animationiteration.animation,delete pl.animationstart.animation),"TransitionEvent"in window||delete pl.transitionend.transition);function as(i){if(Am[i])return Am[i];if(!pl[i])return i;var l=pl[i],d;for(d in l)if(l.hasOwnProperty(d)&&d in N1)return Am[i]=l[d];return i}var O1=as("animationend"),M1=as("animationiteration"),I1=as("animationstart"),z4=as("transitionrun"),$4=as("transitionstart"),U4=as("transitioncancel"),L1=as("transitionend"),z1=new Map,_m="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");_m.push("scrollEnd");function Ea(i,l){z1.set(i,l),cr(l,[i])}var $1=new WeakMap;function ea(i,l){if(typeof i=="object"&&i!==null){var d=$1.get(i);return d!==void 0?d:(l={value:i,source:l,stack:zc(l)},$1.set(i,l),l)}return{value:i,source:l,stack:zc(l)}}var ta=[],ml=0,km=0;function Xd(){for(var i=ml,l=km=ml=0;l<i;){var d=ta[l];ta[l++]=null;var h=ta[l];ta[l++]=null;var x=ta[l];ta[l++]=null;var w=ta[l];if(ta[l++]=null,h!==null&&x!==null){var _=h.pending;_===null?x.next=x:(x.next=_.next,_.next=x),h.pending=x}w!==0&&U1(d,x,w)}}function Zd(i,l,d,h){ta[ml++]=i,ta[ml++]=l,ta[ml++]=d,ta[ml++]=h,km|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function Pm(i,l,d,h){return Zd(i,l,d,h),Jd(i)}function gl(i,l){return Zd(i,null,null,l),Jd(i)}function U1(i,l,d){i.lanes|=d;var h=i.alternate;h!==null&&(h.lanes|=d);for(var x=!1,w=i.return;w!==null;)w.childLanes|=d,h=w.alternate,h!==null&&(h.childLanes|=d),w.tag===22&&(i=w.stateNode,i===null||i._visibility&1||(x=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,x&&l!==null&&(x=31-_t(d),i=w.hiddenUpdates,h=i[x],h===null?i[x]=[l]:h.push(l),l.lane=d|536870912),w):null}function Jd(i){if(50<yu)throw yu=0,zg=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var vl={};function B4(i,l,d,h){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=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(i,l,d,h){return new B4(i,l,d,h)}function Nm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function xi(i,l){var d=i.alternate;return d===null?(d=Lr(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 B1(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 ef(i,l,d,h,x,w){var _=0;if(h=i,typeof i=="function")Nm(i)&&(_=1);else if(typeof i=="string")_=FP(i,d,be.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case $:return i=Lr(31,d,l,x),i.elementType=$,i.lanes=w,i;case S:return is(d.children,x,w,l);case j:_=8,x|=24;break;case C:return i=Lr(12,d,l,x|2),i.elementType=C,i.lanes=w,i;case A:return i=Lr(13,d,l,x),i.elementType=A,i.lanes=w,i;case k:return i=Lr(19,d,l,x),i.elementType=k,i.lanes=w,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:case E:_=10;break e;case D:_=9;break e;case T:_=11;break e;case M:_=14;break e;case L:_=16,h=null;break e}_=29,d=Error(r(130,i===null?"null":typeof i,"")),h=null}return l=Lr(_,d,l,x),l.elementType=i,l.type=h,l.lanes=w,l}function is(i,l,d,h){return i=Lr(7,i,h,l),i.lanes=d,i}function Om(i,l,d){return i=Lr(6,i,null,l),i.lanes=d,i}function Mm(i,l,d){return l=Lr(4,i.children!==null?i.children:[],i.key,l),l.lanes=d,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var yl=[],xl=0,tf=null,nf=0,na=[],ra=0,os=null,bi=1,Si="";function ss(i,l){yl[xl++]=nf,yl[xl++]=tf,tf=i,nf=l}function V1(i,l,d){na[ra++]=bi,na[ra++]=Si,na[ra++]=os,os=i;var h=bi;i=Si;var x=32-_t(h)-1;h&=~(1<<x),d+=1;var w=32-_t(l)+x;if(30<w){var _=x-x%5;w=(h&(1<<_)-1).toString(32),h>>=_,x-=_,bi=1<<32-_t(l)+x|d<<x|h,Si=w+i}else bi=1<<w|d<<x|h,Si=i}function Im(i){i.return!==null&&(ss(i,1),V1(i,1,0))}function Lm(i){for(;i===tf;)tf=yl[--xl],yl[xl]=null,nf=yl[--xl],yl[xl]=null;for(;i===os;)os=na[--ra],na[ra]=null,Si=na[--ra],na[ra]=null,bi=na[--ra],na[ra]=null}var ur=null,Dn=null,Ft=!1,ls=null,Ha=!1,zm=Error(r(519));function cs(i){var l=Error(r(418,""));throw Kc(ea(l,i)),zm}function F1(i){var l=i.stateNode,d=i.type,h=i.memoizedProps;switch(l[he]=i,l[Ee]=h,d){case"dialog":Rt("cancel",l),Rt("close",l);break;case"iframe":case"object":case"embed":Rt("load",l);break;case"video":case"audio":for(d=0;d<bu.length;d++)Rt(bu[d],l);break;case"source":Rt("error",l);break;case"img":case"image":case"link":Rt("error",l),Rt("load",l);break;case"details":Rt("toggle",l);break;case"input":Rt("invalid",l),a1(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),Vd(l);break;case"select":Rt("invalid",l);break;case"textarea":Rt("invalid",l),o1(l,h.value,h.defaultValue,h.children),Vd(l)}d=h.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||h.suppressHydrationWarning===!0||oj(l.textContent,d)?(h.popover!=null&&(Rt("beforetoggle",l),Rt("toggle",l)),h.onScroll!=null&&Rt("scroll",l),h.onScrollEnd!=null&&Rt("scrollend",l),h.onClick!=null&&(l.onclick=Lf),l=!0):l=!1,l||cs(i)}function H1(i){for(ur=i.return;ur;)switch(ur.tag){case 5:case 13:Ha=!1;return;case 27:case 3:Ha=!0;return;default:ur=ur.return}}function Wc(i){if(i!==ur)return!1;if(!Ft)return H1(i),Ft=!0,!1;var l=i.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=i.type,d=!(d!=="form"&&d!=="button")||ev(i.type,i.memoizedProps)),d=!d),d&&Dn&&cs(i),H1(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8)if(d=i.data,d==="/$"){if(l===0){Dn=Ra(i.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++;i=i.nextSibling}Dn=null}}else l===27?(l=Dn,Eo(i.type)?(i=av,av=null,Dn=i):Dn=l):Dn=ur?Ra(i.stateNode.nextSibling):null;return!0}function Yc(){Dn=ur=null,Ft=!1}function q1(){var i=ls;return i!==null&&(Er===null?Er=i:Er.push.apply(Er,i),ls=null),i}function Kc(i){ls===null?ls=[i]:ls.push(i)}var $m=U(null),us=null,wi=null;function co(i,l,d){ee($m,l._currentValue),l._currentValue=d}function ji(i){i._currentValue=$m.current,K($m)}function Um(i,l,d){for(;i!==null;){var h=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),i===d)break;i=i.return}}function Bm(i,l,d,h){var x=i.child;for(x!==null&&(x.return=i);x!==null;){var w=x.dependencies;if(w!==null){var _=x.child;w=w.firstContext;e:for(;w!==null;){var N=w;w=x;for(var B=0;B<l.length;B++)if(N.context===l[B]){w.lanes|=d,N=w.alternate,N!==null&&(N.lanes|=d),Um(w.return,d,i),h||(_=null);break e}w=N.next}}else if(x.tag===18){if(_=x.return,_===null)throw Error(r(341));_.lanes|=d,w=_.alternate,w!==null&&(w.lanes|=d),Um(_,d,i),_=null}else _=x.child;if(_!==null)_.return=x;else for(_=x;_!==null;){if(_===i){_=null;break}if(x=_.sibling,x!==null){x.return=_.return,_=x;break}_=_.return}x=_}}function Xc(i,l,d,h){i=null;for(var x=l,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var _=x.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var N=x.type;Ir(x.pendingProps.value,_.value)||(i!==null?i.push(N):i=[N])}}else if(x===qe.current){if(_=x.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(i!==null?i.push(Tu):i=[Tu])}x=x.return}i!==null&&Bm(l,i,d,h),l.flags|=262144}function rf(i){for(i=i.firstContext;i!==null;){if(!Ir(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function ds(i){us=i,wi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function rr(i){return G1(us,i)}function af(i,l){return us===null&&ds(i),G1(i,l)}function G1(i,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},wi===null){if(i===null)throw Error(r(308));wi=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else wi=wi.next=l;return d}var V4=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(d,h){i.push(h)}};this.abort=function(){l.aborted=!0,i.forEach(function(d){return d()})}},F4=e.unstable_scheduleCallback,H4=e.unstable_NormalPriority,Bn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vm(){return{controller:new V4,data:new Map,refCount:0}}function Zc(i){i.refCount--,i.refCount===0&&F4(H4,function(){i.controller.abort()})}var Jc=null,Fm=0,bl=0,Sl=null;function q4(i,l){if(Jc===null){var d=Jc=[];Fm=0,bl=qg(),Sl={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Fm++,l.then(Q1,Q1),l}function Q1(){if(--Fm===0&&Jc!==null){Sl!==null&&(Sl.status="fulfilled");var i=Jc;Jc=null,bl=0,Sl=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function G4(i,l){var d=[],h={status:"pending",value:null,reason:null,then:function(x){d.push(x)}};return i.then(function(){h.status="fulfilled",h.value=l;for(var x=0;x<d.length;x++)(0,d[x])(l)},function(x){for(h.status="rejected",h.reason=x,x=0;x<d.length;x++)(0,d[x])(void 0)}),h}var W1=P.S;P.S=function(i,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&q4(i,l),W1!==null&&W1(i,l)};var fs=U(null);function Hm(){var i=fs.current;return i!==null?i:fn.pooledCache}function of(i,l){l===null?ee(fs,fs.current):ee(fs,l.pool)}function Y1(){var i=Hm();return i===null?null:{parent:Bn._currentValue,pool:i}}var eu=Error(r(460)),K1=Error(r(474)),sf=Error(r(542)),qm={then:function(){}};function X1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function lf(){}function Z1(i,l,d){switch(d=i[d],d===void 0?i.push(l):d!==l&&(l.then(lf,lf),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,eS(i),i;default:if(typeof l.status=="string")l.then(lf,lf);else{if(i=fn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(h){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=h}},function(h){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,eS(i),i}throw tu=l,eu}}var tu=null;function J1(){if(tu===null)throw Error(r(459));var i=tu;return tu=null,i}function eS(i){if(i===eu||i===sf)throw Error(r(483))}var uo=!1;function Gm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qm(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 fo(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ho(i,l,d){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(Yt&2)!==0){var x=h.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),h.pending=l,l=Jd(i),U1(i,null,d),l}return Zd(i,h,l,d),Jd(i)}function nu(i,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var h=l.lanes;h&=i.pendingLanes,d|=h,l.lanes=d,ro(i,d)}}function Wm(i,l){var d=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,d===h)){var x=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var _={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?x=w=_:w=w.next=_,d=d.next}while(d!==null);w===null?x=w=l:w=w.next=l}else x=w=l;d={baseState:h.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=l:i.next=l,d.lastBaseUpdate=l}var Ym=!1;function ru(){if(Ym){var i=Sl;if(i!==null)throw i}}function au(i,l,d,h){Ym=!1;var x=i.updateQueue;uo=!1;var w=x.firstBaseUpdate,_=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var B=N,ne=B.next;B.next=null,_===null?w=ne:_.next=ne,_=B;var ue=i.alternate;ue!==null&&(ue=ue.updateQueue,N=ue.lastBaseUpdate,N!==_&&(N===null?ue.firstBaseUpdate=ne:N.next=ne,ue.lastBaseUpdate=B))}if(w!==null){var pe=x.baseState;_=0,ue=ne=B=null,N=w;do{var ae=N.lane&-536870913,ie=ae!==N.lane;if(ie?(Ot&ae)===ae:(h&ae)===ae){ae!==0&&ae===bl&&(Ym=!0),ue!==null&&(ue=ue.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ut=i,it=N;ae=l;var tn=d;switch(it.tag){case 1:if(ut=it.payload,typeof ut=="function"){pe=ut.call(tn,pe,ae);break e}pe=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=it.payload,ae=typeof ut=="function"?ut.call(tn,pe,ae):ut,ae==null)break e;pe=m({},pe,ae);break e;case 2:uo=!0}}ae=N.callback,ae!==null&&(i.flags|=64,ie&&(i.flags|=8192),ie=x.callbacks,ie===null?x.callbacks=[ae]:ie.push(ae))}else ie={lane:ae,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ue===null?(ne=ue=ie,B=pe):ue=ue.next=ie,_|=ae;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;ie=N,N=ie.next,ie.next=null,x.lastBaseUpdate=ie,x.shared.pending=null}}while(!0);ue===null&&(B=pe),x.baseState=B,x.firstBaseUpdate=ne,x.lastBaseUpdate=ue,w===null&&(x.shared.lanes=0),So|=_,i.lanes=_,i.memoizedState=pe}}function tS(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function nS(i,l){var d=i.callbacks;if(d!==null)for(i.callbacks=null,i=0;i<d.length;i++)tS(d[i],l)}var wl=U(null),cf=U(0);function rS(i,l){i=_i,ee(cf,i),ee(wl,l),_i=i|l.baseLanes}function Km(){ee(cf,_i),ee(wl,wl.current)}function Xm(){_i=cf.current,K(wl),K(cf)}var po=0,St=null,Jt=null,In=null,uf=!1,jl=!1,hs=!1,df=0,iu=0,Cl=null,Q4=0;function kn(){throw Error(r(321))}function Zm(i,l){if(l===null)return!1;for(var d=0;d<l.length&&d<i.length;d++)if(!Ir(i[d],l[d]))return!1;return!0}function Jm(i,l,d,h,x,w){return po=w,St=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=i===null||i.memoizedState===null?US:BS,hs=!1,w=d(h,x),hs=!1,jl&&(w=iS(l,d,h,x)),aS(i),w}function aS(i){P.H=vf;var l=Jt!==null&&Jt.next!==null;if(po=0,In=Jt=St=null,uf=!1,iu=0,Cl=null,l)throw Error(r(300));i===null||Gn||(i=i.dependencies,i!==null&&rf(i)&&(Gn=!0))}function iS(i,l,d,h){St=i;var x=0;do{if(jl&&(Cl=null),iu=0,jl=!1,25<=x)throw Error(r(301));if(x+=1,In=Jt=null,i.updateQueue!=null){var w=i.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}P.H=eP,w=l(d,h)}while(jl);return w}function W4(){var i=P.H,l=i.useState()[0];return l=typeof l.then=="function"?ou(l):l,i=i.useState()[0],(Jt!==null?Jt.memoizedState:null)!==i&&(St.flags|=1024),l}function eg(){var i=df!==0;return df=0,i}function tg(i,l,d){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~d}function ng(i){if(uf){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}uf=!1}po=0,In=Jt=St=null,jl=!1,iu=df=0,Cl=null}function jr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return In===null?St.memoizedState=In=i:In=In.next=i,In}function Ln(){if(Jt===null){var i=St.alternate;i=i!==null?i.memoizedState:null}else i=Jt.next;var l=In===null?St.memoizedState:In.next;if(l!==null)In=l,Jt=i;else{if(i===null)throw St.alternate===null?Error(r(467)):Error(r(310));Jt=i,i={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},In===null?St.memoizedState=In=i:In=In.next=i}return In}function rg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ou(i){var l=iu;return iu+=1,Cl===null&&(Cl=[]),i=Z1(Cl,i,l),l=St,(In===null?l.memoizedState:In.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?US:BS),i}function ff(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return ou(i);if(i.$$typeof===E)return rr(i)}throw Error(r(438,String(i)))}function ag(i){var l=null,d=St.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var h=St.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=rg(),St.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(i),h=0;h<i;h++)d[h]=V;return l.index++,d}function Ci(i,l){return typeof l=="function"?l(i):l}function hf(i){var l=Ln();return ig(l,Jt,i)}function ig(i,l,d){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=d;var x=i.baseQueue,w=h.pending;if(w!==null){if(x!==null){var _=x.next;x.next=w.next,w.next=_}l.baseQueue=x=w,h.pending=null}if(w=i.baseState,x===null)i.memoizedState=w;else{l=x.next;var N=_=null,B=null,ne=l,ue=!1;do{var pe=ne.lane&-536870913;if(pe!==ne.lane?(Ot&pe)===pe:(po&pe)===pe){var ae=ne.revertLane;if(ae===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),pe===bl&&(ue=!0);else if((po&ae)===ae){ne=ne.next,ae===bl&&(ue=!0);continue}else pe={lane:0,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=pe,_=w):B=B.next=pe,St.lanes|=ae,So|=ae;pe=ne.action,hs&&d(w,pe),w=ne.hasEagerState?ne.eagerState:d(w,pe)}else ae={lane:pe,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=ae,_=w):B=B.next=ae,St.lanes|=pe,So|=pe;ne=ne.next}while(ne!==null&&ne!==l);if(B===null?_=w:B.next=N,!Ir(w,i.memoizedState)&&(Gn=!0,ue&&(d=Sl,d!==null)))throw d;i.memoizedState=w,i.baseState=_,i.baseQueue=B,h.lastRenderedState=w}return x===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function og(i){var l=Ln(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=i;var h=d.dispatch,x=d.pending,w=l.memoizedState;if(x!==null){d.pending=null;var _=x=x.next;do w=i(w,_.action),_=_.next;while(_!==x);Ir(w,l.memoizedState)||(Gn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,h]}function oS(i,l,d){var h=St,x=Ln(),w=Ft;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var _=!Ir((Jt||x).memoizedState,d);_&&(x.memoizedState=d,Gn=!0),x=x.queue;var N=cS.bind(null,h,x,i);if(su(2048,8,N,[i]),x.getSnapshot!==l||_||In!==null&&In.memoizedState.tag&1){if(h.flags|=2048,El(9,pf(),lS.bind(null,h,x,d,l),null),fn===null)throw Error(r(349));w||(po&124)!==0||sS(h,l,d)}return d}function sS(i,l,d){i.flags|=16384,i={getSnapshot:l,value:d},l=St.updateQueue,l===null?(l=rg(),St.updateQueue=l,l.stores=[i]):(d=l.stores,d===null?l.stores=[i]:d.push(i))}function lS(i,l,d,h){l.value=d,l.getSnapshot=h,uS(l)&&dS(i)}function cS(i,l,d){return d(function(){uS(l)&&dS(i)})}function uS(i){var l=i.getSnapshot;i=i.value;try{var d=l();return!Ir(i,d)}catch{return!0}}function dS(i){var l=gl(i,2);l!==null&&Vr(l,i,2)}function sg(i){var l=jr();if(typeof i=="function"){var d=i;if(i=d(),hs){Gt(!0);try{d()}finally{Gt(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:i},l}function fS(i,l,d,h){return i.baseState=d,ig(i,Jt,typeof h=="function"?h:Ci)}function Y4(i,l,d,h,x){if(gf(i))throw Error(r(485));if(i=l.action,i!==null){var w={payload:x,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){w.listeners.push(_)}};P.T!==null?d(!0):w.isTransition=!1,h(w),d=l.pending,d===null?(w.next=l.pending=w,hS(l,w)):(w.next=d.next,l.pending=d.next=w)}}function hS(i,l){var d=l.action,h=l.payload,x=i.state;if(l.isTransition){var w=P.T,_={};P.T=_;try{var N=d(x,h),B=P.S;B!==null&&B(_,N),pS(i,l,N)}catch(ne){lg(i,l,ne)}finally{P.T=w}}else try{w=d(x,h),pS(i,l,w)}catch(ne){lg(i,l,ne)}}function pS(i,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(h){mS(i,l,h)},function(h){return lg(i,l,h)}):mS(i,l,d)}function mS(i,l,d){l.status="fulfilled",l.value=d,gS(l),i.state=d,l=i.pending,l!==null&&(d=l.next,d===l?i.pending=null:(d=d.next,l.next=d,hS(i,d)))}function lg(i,l,d){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=d,gS(l),l=l.next;while(l!==h)}i.action=null}function gS(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function vS(i,l){return l}function yS(i,l){if(Ft){var d=fn.formState;if(d!==null){e:{var h=St;if(Ft){if(Dn){t:{for(var x=Dn,w=Ha;x.nodeType!==8;){if(!w){x=null;break t}if(x=Ra(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){Dn=Ra(x.nextSibling),h=x.data==="F!";break e}}cs(h)}h=!1}h&&(l=d[0])}}return d=jr(),d.memoizedState=d.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vS,lastRenderedState:l},d.queue=h,d=LS.bind(null,St,h),h.dispatch=d,h=sg(!1),w=hg.bind(null,St,!1,h.queue),h=jr(),x={state:l,dispatch:null,action:i,pending:null},h.queue=x,d=Y4.bind(null,St,x,w,d),x.dispatch=d,h.memoizedState=i,[l,d,!1]}function xS(i){var l=Ln();return bS(l,Jt,i)}function bS(i,l,d){if(l=ig(i,l,vS)[0],i=hf(Ci)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=ou(l)}catch(_){throw _===eu?sf:_}else h=l;l=Ln();var x=l.queue,w=x.dispatch;return d!==l.memoizedState&&(St.flags|=2048,El(9,pf(),K4.bind(null,x,d),null)),[h,w,i]}function K4(i,l){i.action=l}function SS(i){var l=Ln(),d=Jt;if(d!==null)return bS(l,d,i);Ln(),l=l.memoizedState,d=Ln();var h=d.queue.dispatch;return d.memoizedState=i,[l,h,!1]}function El(i,l,d,h){return i={tag:i,create:d,deps:h,inst:l,next:null},l=St.updateQueue,l===null&&(l=rg(),St.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=i.next=i:(h=d.next,d.next=i,i.next=h,l.lastEffect=i),i}function pf(){return{destroy:void 0,resource:void 0}}function wS(){return Ln().memoizedState}function mf(i,l,d,h){var x=jr();h=h===void 0?null:h,St.flags|=i,x.memoizedState=El(1|l,pf(),d,h)}function su(i,l,d,h){var x=Ln();h=h===void 0?null:h;var w=x.memoizedState.inst;Jt!==null&&h!==null&&Zm(h,Jt.memoizedState.deps)?x.memoizedState=El(l,w,d,h):(St.flags|=i,x.memoizedState=El(1|l,w,d,h))}function jS(i,l){mf(8390656,8,i,l)}function CS(i,l){su(2048,8,i,l)}function ES(i,l){return su(4,2,i,l)}function TS(i,l){return su(4,4,i,l)}function RS(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 DS(i,l,d){d=d!=null?d.concat([i]):null,su(4,4,RS.bind(null,l,i),d)}function cg(){}function AS(i,l){var d=Ln();l=l===void 0?null:l;var h=d.memoizedState;return l!==null&&Zm(l,h[1])?h[0]:(d.memoizedState=[i,l],i)}function _S(i,l){var d=Ln();l=l===void 0?null:l;var h=d.memoizedState;if(l!==null&&Zm(l,h[1]))return h[0];if(h=i(),hs){Gt(!0);try{i()}finally{Gt(!1)}}return d.memoizedState=[h,l],h}function ug(i,l,d){return d===void 0||(po&1073741824)!==0?i.memoizedState=l:(i.memoizedState=d,i=Nw(),St.lanes|=i,So|=i,d)}function kS(i,l,d,h){return Ir(d,l)?d:wl.current!==null?(i=ug(i,d,h),Ir(i,l)||(Gn=!0),i):(po&42)===0?(Gn=!0,i.memoizedState=d):(i=Nw(),St.lanes|=i,So|=i,l)}function PS(i,l,d,h,x){var w=I.p;I.p=w!==0&&8>w?w:8;var _=P.T,N={};P.T=N,hg(i,!1,l,d);try{var B=x(),ne=P.S;if(ne!==null&&ne(N,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ue=G4(B,h);lu(i,l,ue,Br(i))}else lu(i,l,h,Br(i))}catch(pe){lu(i,l,{then:function(){},status:"rejected",reason:pe},Br())}finally{I.p=w,P.T=_}}function X4(){}function dg(i,l,d,h){if(i.tag!==5)throw Error(r(476));var x=NS(i).queue;PS(i,x,l,z,d===null?X4:function(){return OS(i),d(h)})}function NS(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:Ci,lastRenderedState:z},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:d},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function OS(i){var l=NS(i).next.queue;lu(i,l,{},Br())}function fg(){return rr(Tu)}function MS(){return Ln().memoizedState}function IS(){return Ln().memoizedState}function Z4(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var d=Br();i=fo(d);var h=ho(l,i,d);h!==null&&(Vr(h,l,d),nu(h,l,d)),l={cache:Vm()},i.payload=l;return}l=l.return}}function J4(i,l,d){var h=Br();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},gf(i)?zS(l,d):(d=Pm(i,l,d,h),d!==null&&(Vr(d,i,h),$S(d,l,h)))}function LS(i,l,d){var h=Br();lu(i,l,d,h)}function lu(i,l,d,h){var x={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(gf(i))zS(l,x);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var _=l.lastRenderedState,N=w(_,d);if(x.hasEagerState=!0,x.eagerState=N,Ir(N,_))return Zd(i,l,x,0),fn===null&&Xd(),!1}catch{}finally{}if(d=Pm(i,l,x,h),d!==null)return Vr(d,i,h),$S(d,l,h),!0}return!1}function hg(i,l,d,h){if(h={lane:2,revertLane:qg(),action:h,hasEagerState:!1,eagerState:null,next:null},gf(i)){if(l)throw Error(r(479))}else l=Pm(i,d,h,2),l!==null&&Vr(l,i,2)}function gf(i){var l=i.alternate;return i===St||l!==null&&l===St}function zS(i,l){jl=uf=!0;var d=i.pending;d===null?l.next=l:(l.next=d.next,d.next=l),i.pending=l}function $S(i,l,d){if((d&4194048)!==0){var h=l.lanes;h&=i.pendingLanes,d|=h,l.lanes=d,ro(i,d)}}var vf={readContext:rr,use:ff,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useLayoutEffect:kn,useInsertionEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useSyncExternalStore:kn,useId:kn,useHostTransitionStatus:kn,useFormState:kn,useActionState:kn,useOptimistic:kn,useMemoCache:kn,useCacheRefresh:kn},US={readContext:rr,use:ff,useCallback:function(i,l){return jr().memoizedState=[i,l===void 0?null:l],i},useContext:rr,useEffect:jS,useImperativeHandle:function(i,l,d){d=d!=null?d.concat([i]):null,mf(4194308,4,RS.bind(null,l,i),d)},useLayoutEffect:function(i,l){return mf(4194308,4,i,l)},useInsertionEffect:function(i,l){mf(4,2,i,l)},useMemo:function(i,l){var d=jr();l=l===void 0?null:l;var h=i();if(hs){Gt(!0);try{i()}finally{Gt(!1)}}return d.memoizedState=[h,l],h},useReducer:function(i,l,d){var h=jr();if(d!==void 0){var x=d(l);if(hs){Gt(!0);try{d(l)}finally{Gt(!1)}}}else x=l;return h.memoizedState=h.baseState=x,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:x},h.queue=i,i=i.dispatch=J4.bind(null,St,i),[h.memoizedState,i]},useRef:function(i){var l=jr();return i={current:i},l.memoizedState=i},useState:function(i){i=sg(i);var l=i.queue,d=LS.bind(null,St,l);return l.dispatch=d,[i.memoizedState,d]},useDebugValue:cg,useDeferredValue:function(i,l){var d=jr();return ug(d,i,l)},useTransition:function(){var i=sg(!1);return i=PS.bind(null,St,i.queue,!0,!1),jr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,d){var h=St,x=jr();if(Ft){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),fn===null)throw Error(r(349));(Ot&124)!==0||sS(h,l,d)}x.memoizedState=d;var w={value:d,getSnapshot:l};return x.queue=w,jS(cS.bind(null,h,w,i),[i]),h.flags|=2048,El(9,pf(),lS.bind(null,h,w,d,l),null),d},useId:function(){var i=jr(),l=fn.identifierPrefix;if(Ft){var d=Si,h=bi;d=(h&~(1<<32-_t(h)-1)).toString(32)+d,l="«"+l+"R"+d,d=df++,0<d&&(l+="H"+d.toString(32)),l+="»"}else d=Q4++,l="«"+l+"r"+d.toString(32)+"»";return i.memoizedState=l},useHostTransitionStatus:fg,useFormState:yS,useActionState:yS,useOptimistic:function(i){var l=jr();l.memoizedState=l.baseState=i;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=hg.bind(null,St,!0,d),d.dispatch=l,[i,l]},useMemoCache:ag,useCacheRefresh:function(){return jr().memoizedState=Z4.bind(null,St)}},BS={readContext:rr,use:ff,useCallback:AS,useContext:rr,useEffect:CS,useImperativeHandle:DS,useInsertionEffect:ES,useLayoutEffect:TS,useMemo:_S,useReducer:hf,useRef:wS,useState:function(){return hf(Ci)},useDebugValue:cg,useDeferredValue:function(i,l){var d=Ln();return kS(d,Jt.memoizedState,i,l)},useTransition:function(){var i=hf(Ci)[0],l=Ln().memoizedState;return[typeof i=="boolean"?i:ou(i),l]},useSyncExternalStore:oS,useId:MS,useHostTransitionStatus:fg,useFormState:xS,useActionState:xS,useOptimistic:function(i,l){var d=Ln();return fS(d,Jt,i,l)},useMemoCache:ag,useCacheRefresh:IS},eP={readContext:rr,use:ff,useCallback:AS,useContext:rr,useEffect:CS,useImperativeHandle:DS,useInsertionEffect:ES,useLayoutEffect:TS,useMemo:_S,useReducer:og,useRef:wS,useState:function(){return og(Ci)},useDebugValue:cg,useDeferredValue:function(i,l){var d=Ln();return Jt===null?ug(d,i,l):kS(d,Jt.memoizedState,i,l)},useTransition:function(){var i=og(Ci)[0],l=Ln().memoizedState;return[typeof i=="boolean"?i:ou(i),l]},useSyncExternalStore:oS,useId:MS,useHostTransitionStatus:fg,useFormState:SS,useActionState:SS,useOptimistic:function(i,l){var d=Ln();return Jt!==null?fS(d,Jt,i,l):(d.baseState=i,[i,d.queue.dispatch])},useMemoCache:ag,useCacheRefresh:IS},Tl=null,cu=0;function yf(i){var l=cu;return cu+=1,Tl===null&&(Tl=[]),Z1(Tl,i,l)}function uu(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function xf(i,l){throw l.$$typeof===g?Error(r(525)):(i=Object.prototype.toString.call(l),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function VS(i){var l=i._init;return l(i._payload)}function FS(i){function l(W,q){if(i){var te=W.deletions;te===null?(W.deletions=[q],W.flags|=16):te.push(q)}}function d(W,q){if(!i)return null;for(;q!==null;)l(W,q),q=q.sibling;return null}function h(W){for(var q=new Map;W!==null;)W.key!==null?q.set(W.key,W):q.set(W.index,W),W=W.sibling;return q}function x(W,q){return W=xi(W,q),W.index=0,W.sibling=null,W}function w(W,q,te){return W.index=te,i?(te=W.alternate,te!==null?(te=te.index,te<q?(W.flags|=67108866,q):te):(W.flags|=67108866,q)):(W.flags|=1048576,q)}function _(W){return i&&W.alternate===null&&(W.flags|=67108866),W}function N(W,q,te,fe){return q===null||q.tag!==6?(q=Om(te,W.mode,fe),q.return=W,q):(q=x(q,te),q.return=W,q)}function B(W,q,te,fe){var Fe=te.type;return Fe===S?ue(W,q,te.props.children,fe,te.key):q!==null&&(q.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===L&&VS(Fe)===q.type)?(q=x(q,te.props),uu(q,te),q.return=W,q):(q=ef(te.type,te.key,te.props,null,W.mode,fe),uu(q,te),q.return=W,q)}function ne(W,q,te,fe){return q===null||q.tag!==4||q.stateNode.containerInfo!==te.containerInfo||q.stateNode.implementation!==te.implementation?(q=Mm(te,W.mode,fe),q.return=W,q):(q=x(q,te.children||[]),q.return=W,q)}function ue(W,q,te,fe,Fe){return q===null||q.tag!==7?(q=is(te,W.mode,fe,Fe),q.return=W,q):(q=x(q,te),q.return=W,q)}function pe(W,q,te){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Om(""+q,W.mode,te),q.return=W,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return te=ef(q.type,q.key,q.props,null,W.mode,te),uu(te,q),te.return=W,te;case b:return q=Mm(q,W.mode,te),q.return=W,q;case L:var fe=q._init;return q=fe(q._payload),pe(W,q,te)}if(Z(q)||Q(q))return q=is(q,W.mode,te,null),q.return=W,q;if(typeof q.then=="function")return pe(W,yf(q),te);if(q.$$typeof===E)return pe(W,af(W,q),te);xf(W,q)}return null}function ae(W,q,te,fe){var Fe=q!==null?q.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Fe!==null?null:N(W,q,""+te,fe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return te.key===Fe?B(W,q,te,fe):null;case b:return te.key===Fe?ne(W,q,te,fe):null;case L:return Fe=te._init,te=Fe(te._payload),ae(W,q,te,fe)}if(Z(te)||Q(te))return Fe!==null?null:ue(W,q,te,fe,null);if(typeof te.then=="function")return ae(W,q,yf(te),fe);if(te.$$typeof===E)return ae(W,q,af(W,te),fe);xf(W,te)}return null}function ie(W,q,te,fe,Fe){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return W=W.get(te)||null,N(q,W,""+fe,Fe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case v:return W=W.get(fe.key===null?te:fe.key)||null,B(q,W,fe,Fe);case b:return W=W.get(fe.key===null?te:fe.key)||null,ne(q,W,fe,Fe);case L:var Ct=fe._init;return fe=Ct(fe._payload),ie(W,q,te,fe,Fe)}if(Z(fe)||Q(fe))return W=W.get(te)||null,ue(q,W,fe,Fe,null);if(typeof fe.then=="function")return ie(W,q,te,yf(fe),Fe);if(fe.$$typeof===E)return ie(W,q,te,af(q,fe),Fe);xf(q,fe)}return null}function ut(W,q,te,fe){for(var Fe=null,Ct=null,et=q,lt=q=0,Wn=null;et!==null&&lt<te.length;lt++){et.index>lt?(Wn=et,et=null):Wn=et.sibling;var Bt=ae(W,et,te[lt],fe);if(Bt===null){et===null&&(et=Wn);break}i&&et&&Bt.alternate===null&&l(W,et),q=w(Bt,q,lt),Ct===null?Fe=Bt:Ct.sibling=Bt,Ct=Bt,et=Wn}if(lt===te.length)return d(W,et),Ft&&ss(W,lt),Fe;if(et===null){for(;lt<te.length;lt++)et=pe(W,te[lt],fe),et!==null&&(q=w(et,q,lt),Ct===null?Fe=et:Ct.sibling=et,Ct=et);return Ft&&ss(W,lt),Fe}for(et=h(et);lt<te.length;lt++)Wn=ie(et,W,lt,te[lt],fe),Wn!==null&&(i&&Wn.alternate!==null&&et.delete(Wn.key===null?lt:Wn.key),q=w(Wn,q,lt),Ct===null?Fe=Wn:Ct.sibling=Wn,Ct=Wn);return i&&et.forEach(function(_o){return l(W,_o)}),Ft&&ss(W,lt),Fe}function it(W,q,te,fe){if(te==null)throw Error(r(151));for(var Fe=null,Ct=null,et=q,lt=q=0,Wn=null,Bt=te.next();et!==null&&!Bt.done;lt++,Bt=te.next()){et.index>lt?(Wn=et,et=null):Wn=et.sibling;var _o=ae(W,et,Bt.value,fe);if(_o===null){et===null&&(et=Wn);break}i&&et&&_o.alternate===null&&l(W,et),q=w(_o,q,lt),Ct===null?Fe=_o:Ct.sibling=_o,Ct=_o,et=Wn}if(Bt.done)return d(W,et),Ft&&ss(W,lt),Fe;if(et===null){for(;!Bt.done;lt++,Bt=te.next())Bt=pe(W,Bt.value,fe),Bt!==null&&(q=w(Bt,q,lt),Ct===null?Fe=Bt:Ct.sibling=Bt,Ct=Bt);return Ft&&ss(W,lt),Fe}for(et=h(et);!Bt.done;lt++,Bt=te.next())Bt=ie(et,W,lt,Bt.value,fe),Bt!==null&&(i&&Bt.alternate!==null&&et.delete(Bt.key===null?lt:Bt.key),q=w(Bt,q,lt),Ct===null?Fe=Bt:Ct.sibling=Bt,Ct=Bt);return i&&et.forEach(function(t3){return l(W,t3)}),Ft&&ss(W,lt),Fe}function tn(W,q,te,fe){if(typeof te=="object"&&te!==null&&te.type===S&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case v:e:{for(var Fe=te.key;q!==null;){if(q.key===Fe){if(Fe=te.type,Fe===S){if(q.tag===7){d(W,q.sibling),fe=x(q,te.props.children),fe.return=W,W=fe;break e}}else if(q.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===L&&VS(Fe)===q.type){d(W,q.sibling),fe=x(q,te.props),uu(fe,te),fe.return=W,W=fe;break e}d(W,q);break}else l(W,q);q=q.sibling}te.type===S?(fe=is(te.props.children,W.mode,fe,te.key),fe.return=W,W=fe):(fe=ef(te.type,te.key,te.props,null,W.mode,fe),uu(fe,te),fe.return=W,W=fe)}return _(W);case b:e:{for(Fe=te.key;q!==null;){if(q.key===Fe)if(q.tag===4&&q.stateNode.containerInfo===te.containerInfo&&q.stateNode.implementation===te.implementation){d(W,q.sibling),fe=x(q,te.children||[]),fe.return=W,W=fe;break e}else{d(W,q);break}else l(W,q);q=q.sibling}fe=Mm(te,W.mode,fe),fe.return=W,W=fe}return _(W);case L:return Fe=te._init,te=Fe(te._payload),tn(W,q,te,fe)}if(Z(te))return ut(W,q,te,fe);if(Q(te)){if(Fe=Q(te),typeof Fe!="function")throw Error(r(150));return te=Fe.call(te),it(W,q,te,fe)}if(typeof te.then=="function")return tn(W,q,yf(te),fe);if(te.$$typeof===E)return tn(W,q,af(W,te),fe);xf(W,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,q!==null&&q.tag===6?(d(W,q.sibling),fe=x(q,te),fe.return=W,W=fe):(d(W,q),fe=Om(te,W.mode,fe),fe.return=W,W=fe),_(W)):d(W,q)}return function(W,q,te,fe){try{cu=0;var Fe=tn(W,q,te,fe);return Tl=null,Fe}catch(et){if(et===eu||et===sf)throw et;var Ct=Lr(29,et,null,W.mode);return Ct.lanes=fe,Ct.return=W,Ct}finally{}}}var Rl=FS(!0),HS=FS(!1),aa=U(null),qa=null;function mo(i){var l=i.alternate;ee(Vn,Vn.current&1),ee(aa,i),qa===null&&(l===null||wl.current!==null||l.memoizedState!==null)&&(qa=i)}function qS(i){if(i.tag===22){if(ee(Vn,Vn.current),ee(aa,i),qa===null){var l=i.alternate;l!==null&&l.memoizedState!==null&&(qa=i)}}else go()}function go(){ee(Vn,Vn.current),ee(aa,aa.current)}function Ei(i){K(aa),qa===i&&(qa=null),K(Vn)}var Vn=U(0);function bf(i){for(var l=i;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||rv(d)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===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}function pg(i,l,d,h){l=i.memoizedState,d=d(h,l),d=d==null?l:m({},l,d),i.memoizedState=d,i.lanes===0&&(i.updateQueue.baseState=d)}var mg={enqueueSetState:function(i,l,d){i=i._reactInternals;var h=Br(),x=fo(h);x.payload=l,d!=null&&(x.callback=d),l=ho(i,x,h),l!==null&&(Vr(l,i,h),nu(l,i,h))},enqueueReplaceState:function(i,l,d){i=i._reactInternals;var h=Br(),x=fo(h);x.tag=1,x.payload=l,d!=null&&(x.callback=d),l=ho(i,x,h),l!==null&&(Vr(l,i,h),nu(l,i,h))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var d=Br(),h=fo(d);h.tag=2,l!=null&&(h.callback=l),l=ho(i,h,d),l!==null&&(Vr(l,i,d),nu(l,i,d))}};function GS(i,l,d,h,x,w,_){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,w,_):l.prototype&&l.prototype.isPureReactComponent?!Gc(d,h)||!Gc(x,w):!0}function QS(i,l,d,h){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,h),l.state!==i&&mg.enqueueReplaceState(l,l.state,null)}function ps(i,l){var d=l;if("ref"in l){d={};for(var h in l)h!=="ref"&&(d[h]=l[h])}if(i=i.defaultProps){d===l&&(d=m({},d));for(var x in i)d[x]===void 0&&(d[x]=i[x])}return d}var Sf=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)};function WS(i){Sf(i)}function YS(i){console.error(i)}function KS(i){Sf(i)}function wf(i,l){try{var d=i.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function XS(i,l,d){try{var h=i.onCaughtError;h(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function gg(i,l,d){return d=fo(d),d.tag=3,d.payload={element:null},d.callback=function(){wf(i,l)},d}function ZS(i){return i=fo(i),i.tag=3,i}function JS(i,l,d,h){var x=d.type.getDerivedStateFromError;if(typeof x=="function"){var w=h.value;i.payload=function(){return x(w)},i.callback=function(){XS(l,d,h)}}var _=d.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(i.callback=function(){XS(l,d,h),typeof x!="function"&&(wo===null?wo=new Set([this]):wo.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})})}function tP(i,l,d,h,x){if(d.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=d.alternate,l!==null&&Xc(l,d,x,!0),d=aa.current,d!==null){switch(d.tag){case 13:return qa===null?Ug():d.alternate===null&&An===0&&(An=3),d.flags&=-257,d.flags|=65536,d.lanes=x,h===qm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([h]):l.add(h),Vg(i,h,x)),!1;case 22:return d.flags|=65536,h===qm?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([h]):d.add(h)),Vg(i,h,x)),!1}throw Error(r(435,d.tag))}return Vg(i,h,x),Ug(),!1}if(Ft)return l=aa.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,h!==zm&&(i=Error(r(422),{cause:h}),Kc(ea(i,d)))):(h!==zm&&(l=Error(r(423),{cause:h}),Kc(ea(l,d))),i=i.current.alternate,i.flags|=65536,x&=-x,i.lanes|=x,h=ea(h,d),x=gg(i.stateNode,h,x),Wm(i,x),An!==4&&(An=2)),!1;var w=Error(r(520),{cause:h});if(w=ea(w,d),vu===null?vu=[w]:vu.push(w),An!==4&&(An=2),l===null)return!0;h=ea(h,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,i=x&-x,d.lanes|=i,i=gg(d.stateNode,h,i),Wm(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"&&(wo===null||!wo.has(w))))return d.flags|=65536,x&=-x,d.lanes|=x,x=ZS(x),JS(x,i,d,h),Wm(d,x),!1}d=d.return}while(d!==null);return!1}var ew=Error(r(461)),Gn=!1;function Kn(i,l,d,h){l.child=i===null?HS(l,null,d,h):Rl(l,i.child,d,h)}function tw(i,l,d,h,x){d=d.render;var w=l.ref;if("ref"in h){var _={};for(var N in h)N!=="ref"&&(_[N]=h[N])}else _=h;return ds(l),h=Jm(i,l,d,_,w,x),N=eg(),i!==null&&!Gn?(tg(i,l,x),Ti(i,l,x)):(Ft&&N&&Im(l),l.flags|=1,Kn(i,l,h,x),l.child)}function nw(i,l,d,h,x){if(i===null){var w=d.type;return typeof w=="function"&&!Nm(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,rw(i,l,w,h,x)):(i=ef(d.type,null,h,l,l.mode,x),i.ref=l.ref,i.return=l,l.child=i)}if(w=i.child,!Cg(i,x)){var _=w.memoizedProps;if(d=d.compare,d=d!==null?d:Gc,d(_,h)&&i.ref===l.ref)return Ti(i,l,x)}return l.flags|=1,i=xi(w,h),i.ref=l.ref,i.return=l,l.child=i}function rw(i,l,d,h,x){if(i!==null){var w=i.memoizedProps;if(Gc(w,h)&&i.ref===l.ref)if(Gn=!1,l.pendingProps=h=w,Cg(i,x))(i.flags&131072)!==0&&(Gn=!0);else return l.lanes=i.lanes,Ti(i,l,x)}return vg(i,l,d,h,x)}function aw(i,l,d){var h=l.pendingProps,x=h.children,w=i!==null?i.memoizedState:null;if(h.mode==="hidden"){if((l.flags&128)!==0){if(h=w!==null?w.baseLanes|d:d,i!==null){for(x=l.child=i.child,w=0;x!==null;)w=w|x.lanes|x.childLanes,x=x.sibling;l.childLanes=w&~h}else l.childLanes=0,l.child=null;return iw(i,l,h,d)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&of(l,w!==null?w.cachePool:null),w!==null?rS(l,w):Km(),qS(l);else return l.lanes=l.childLanes=536870912,iw(i,l,w!==null?w.baseLanes|d:d,d)}else w!==null?(of(l,w.cachePool),rS(l,w),go(),l.memoizedState=null):(i!==null&&of(l,null),Km(),go());return Kn(i,l,x,d),l.child}function iw(i,l,d,h){var x=Hm();return x=x===null?null:{parent:Bn._currentValue,pool:x},l.memoizedState={baseLanes:d,cachePool:x},i!==null&&of(l,null),Km(),qS(l),i!==null&&Xc(i,l,h,!0),null}function jf(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 vg(i,l,d,h,x){return ds(l),d=Jm(i,l,d,h,void 0,x),h=eg(),i!==null&&!Gn?(tg(i,l,x),Ti(i,l,x)):(Ft&&h&&Im(l),l.flags|=1,Kn(i,l,d,x),l.child)}function ow(i,l,d,h,x,w){return ds(l),l.updateQueue=null,d=iS(l,h,d,x),aS(i),h=eg(),i!==null&&!Gn?(tg(i,l,w),Ti(i,l,w)):(Ft&&h&&Im(l),l.flags|=1,Kn(i,l,d,w),l.child)}function sw(i,l,d,h,x){if(ds(l),l.stateNode===null){var w=vl,_=d.contextType;typeof _=="object"&&_!==null&&(w=rr(_)),w=new d(h,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=mg,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=h,w.state=l.memoizedState,w.refs={},Gm(l),_=d.contextType,w.context=typeof _=="object"&&_!==null?rr(_):vl,w.state=l.memoizedState,_=d.getDerivedStateFromProps,typeof _=="function"&&(pg(l,d,_,h),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(_=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),_!==w.state&&mg.enqueueReplaceState(w,w.state,null),au(l,h,w,x),ru(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(i===null){w=l.stateNode;var N=l.memoizedProps,B=ps(d,N);w.props=B;var ne=w.context,ue=d.contextType;_=vl,typeof ue=="object"&&ue!==null&&(_=rr(ue));var pe=d.getDerivedStateFromProps;ue=typeof pe=="function"||typeof w.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N||ne!==_)&&QS(l,w,h,_),uo=!1;var ae=l.memoizedState;w.state=ae,au(l,h,w,x),ru(),ne=l.memoizedState,N||ae!==ne||uo?(typeof pe=="function"&&(pg(l,d,pe,h),ne=l.memoizedState),(B=uo||GS(l,d,B,h,ae,ne,_))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=ne),w.props=h,w.state=ne,w.context=_,h=B):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{w=l.stateNode,Qm(i,l),_=l.memoizedProps,ue=ps(d,_),w.props=ue,pe=l.pendingProps,ae=w.context,ne=d.contextType,B=vl,typeof ne=="object"&&ne!==null&&(B=rr(ne)),N=d.getDerivedStateFromProps,(ne=typeof N=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==pe||ae!==B)&&QS(l,w,h,B),uo=!1,ae=l.memoizedState,w.state=ae,au(l,h,w,x),ru();var ie=l.memoizedState;_!==pe||ae!==ie||uo||i!==null&&i.dependencies!==null&&rf(i.dependencies)?(typeof N=="function"&&(pg(l,d,N,h),ie=l.memoizedState),(ue=uo||GS(l,d,ue,h,ae,ie,B)||i!==null&&i.dependencies!==null&&rf(i.dependencies))?(ne||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,ie,B),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,ie,B)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||_===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ie),w.props=h,w.state=ie,w.context=B,h=ue):(typeof w.componentDidUpdate!="function"||_===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),h=!1)}return w=h,jf(i,l),h=(l.flags&128)!==0,w||h?(w=l.stateNode,d=h&&typeof d.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,i!==null&&h?(l.child=Rl(l,i.child,null,x),l.child=Rl(l,null,d,x)):Kn(i,l,d,x),l.memoizedState=w.state,i=l.child):i=Ti(i,l,x),i}function lw(i,l,d,h){return Yc(),l.flags|=256,Kn(i,l,d,h),l.child}var yg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xg(i){return{baseLanes:i,cachePool:Y1()}}function bg(i,l,d){return i=i!==null?i.childLanes&~d:0,l&&(i|=ia),i}function cw(i,l,d){var h=l.pendingProps,x=!1,w=(l.flags&128)!==0,_;if((_=w)||(_=i!==null&&i.memoizedState===null?!1:(Vn.current&2)!==0),_&&(x=!0,l.flags&=-129),_=(l.flags&32)!==0,l.flags&=-33,i===null){if(Ft){if(x?mo(l):go(),Ft){var N=Dn,B;if(B=N){e:{for(B=N,N=Ha;B.nodeType!==8;){if(!N){N=null;break e}if(B=Ra(B.nextSibling),B===null){N=null;break e}}N=B}N!==null?(l.memoizedState={dehydrated:N,treeContext:os!==null?{id:bi,overflow:Si}:null,retryLane:536870912,hydrationErrors:null},B=Lr(18,null,null,0),B.stateNode=N,B.return=l,l.child=B,ur=l,Dn=null,B=!0):B=!1}B||cs(l)}if(N=l.memoizedState,N!==null&&(N=N.dehydrated,N!==null))return rv(N)?l.lanes=32:l.lanes=536870912,null;Ei(l)}return N=h.children,h=h.fallback,x?(go(),x=l.mode,N=Cf({mode:"hidden",children:N},x),h=is(h,x,d,null),N.return=l,h.return=l,N.sibling=h,l.child=N,x=l.child,x.memoizedState=xg(d),x.childLanes=bg(i,_,d),l.memoizedState=yg,h):(mo(l),Sg(l,N))}if(B=i.memoizedState,B!==null&&(N=B.dehydrated,N!==null)){if(w)l.flags&256?(mo(l),l.flags&=-257,l=wg(i,l,d)):l.memoizedState!==null?(go(),l.child=i.child,l.flags|=128,l=null):(go(),x=h.fallback,N=l.mode,h=Cf({mode:"visible",children:h.children},N),x=is(x,N,d,null),x.flags|=2,h.return=l,x.return=l,h.sibling=x,l.child=h,Rl(l,i.child,null,d),h=l.child,h.memoizedState=xg(d),h.childLanes=bg(i,_,d),l.memoizedState=yg,l=x);else if(mo(l),rv(N)){if(_=N.nextSibling&&N.nextSibling.dataset,_)var ne=_.dgst;_=ne,h=Error(r(419)),h.stack="",h.digest=_,Kc({value:h,source:null,stack:null}),l=wg(i,l,d)}else if(Gn||Xc(i,l,d,!1),_=(d&i.childLanes)!==0,Gn||_){if(_=fn,_!==null&&(h=d&-d,h=(h&42)!==0?1:Jo(h),h=(h&(_.suspendedLanes|d))!==0?0:h,h!==0&&h!==B.retryLane))throw B.retryLane=h,gl(i,h),Vr(_,i,h),ew;N.data==="$?"||Ug(),l=wg(i,l,d)}else N.data==="$?"?(l.flags|=192,l.child=i.child,l=null):(i=B.treeContext,Dn=Ra(N.nextSibling),ur=l,Ft=!0,ls=null,Ha=!1,i!==null&&(na[ra++]=bi,na[ra++]=Si,na[ra++]=os,bi=i.id,Si=i.overflow,os=l),l=Sg(l,h.children),l.flags|=4096);return l}return x?(go(),x=h.fallback,N=l.mode,B=i.child,ne=B.sibling,h=xi(B,{mode:"hidden",children:h.children}),h.subtreeFlags=B.subtreeFlags&65011712,ne!==null?x=xi(ne,x):(x=is(x,N,d,null),x.flags|=2),x.return=l,h.return=l,h.sibling=x,l.child=h,h=x,x=l.child,N=i.child.memoizedState,N===null?N=xg(d):(B=N.cachePool,B!==null?(ne=Bn._currentValue,B=B.parent!==ne?{parent:ne,pool:ne}:B):B=Y1(),N={baseLanes:N.baseLanes|d,cachePool:B}),x.memoizedState=N,x.childLanes=bg(i,_,d),l.memoizedState=yg,h):(mo(l),d=i.child,i=d.sibling,d=xi(d,{mode:"visible",children:h.children}),d.return=l,d.sibling=null,i!==null&&(_=l.deletions,_===null?(l.deletions=[i],l.flags|=16):_.push(i)),l.child=d,l.memoizedState=null,d)}function Sg(i,l){return l=Cf({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function Cf(i,l){return i=Lr(22,i,null,l),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function wg(i,l,d){return Rl(l,i.child,null,d),i=Sg(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function uw(i,l,d){i.lanes|=l;var h=i.alternate;h!==null&&(h.lanes|=l),Um(i.return,l,d)}function jg(i,l,d,h,x){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:d,tailMode:x}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=d,w.tailMode=x)}function dw(i,l,d){var h=l.pendingProps,x=h.revealOrder,w=h.tail;if(Kn(i,l,h.children,d),h=Vn.current,(h&2)!==0)h=h&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&uw(i,d,l);else if(i.tag===19)uw(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}h&=1}switch(ee(Vn,h),x){case"forwards":for(d=l.child,x=null;d!==null;)i=d.alternate,i!==null&&bf(i)===null&&(x=d),d=d.sibling;d=x,d===null?(x=l.child,l.child=null):(x=d.sibling,d.sibling=null),jg(l,!1,x,d,w);break;case"backwards":for(d=null,x=l.child,l.child=null;x!==null;){if(i=x.alternate,i!==null&&bf(i)===null){l.child=x;break}i=x.sibling,x.sibling=d,d=x,x=i}jg(l,!0,d,null,w);break;case"together":jg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ti(i,l,d){if(i!==null&&(l.dependencies=i.dependencies),So|=l.lanes,(d&l.childLanes)===0)if(i!==null){if(Xc(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=xi(i,i.pendingProps),l.child=d,d.return=l;i.sibling!==null;)i=i.sibling,d=d.sibling=xi(i,i.pendingProps),d.return=l;d.sibling=null}return l.child}function Cg(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&rf(i)))}function nP(i,l,d){switch(l.tag){case 3:Ne(l,l.stateNode.containerInfo),co(l,Bn,i.memoizedState.cache),Yc();break;case 27:case 5:Ae(l);break;case 4:Ne(l,l.stateNode.containerInfo);break;case 10:co(l,l.type,l.memoizedProps.value);break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(mo(l),l.flags|=128,null):(d&l.child.childLanes)!==0?cw(i,l,d):(mo(l),i=Ti(i,l,d),i!==null?i.sibling:null);mo(l);break;case 19:var x=(i.flags&128)!==0;if(h=(d&l.childLanes)!==0,h||(Xc(i,l,d,!1),h=(d&l.childLanes)!==0),x){if(h)return dw(i,l,d);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ee(Vn,Vn.current),h)break;return null;case 22:case 23:return l.lanes=0,aw(i,l,d);case 24:co(l,Bn,i.memoizedState.cache)}return Ti(i,l,d)}function fw(i,l,d){if(i!==null)if(i.memoizedProps!==l.pendingProps)Gn=!0;else{if(!Cg(i,d)&&(l.flags&128)===0)return Gn=!1,nP(i,l,d);Gn=(i.flags&131072)!==0}else Gn=!1,Ft&&(l.flags&1048576)!==0&&V1(l,nf,l.index);switch(l.lanes=0,l.tag){case 16:e:{i=l.pendingProps;var h=l.elementType,x=h._init;if(h=x(h._payload),l.type=h,typeof h=="function")Nm(h)?(i=ps(h,i),l.tag=1,l=sw(null,l,h,i,d)):(l.tag=0,l=vg(null,l,h,i,d));else{if(h!=null){if(x=h.$$typeof,x===T){l.tag=11,l=tw(null,l,h,i,d);break e}else if(x===M){l.tag=14,l=nw(null,l,h,i,d);break e}}throw l=G(h)||h,Error(r(306,l,""))}}return l;case 0:return vg(i,l,l.type,l.pendingProps,d);case 1:return h=l.type,x=ps(h,l.pendingProps),sw(i,l,h,x,d);case 3:e:{if(Ne(l,l.stateNode.containerInfo),i===null)throw Error(r(387));h=l.pendingProps;var w=l.memoizedState;x=w.element,Qm(i,l),au(l,h,null,d);var _=l.memoizedState;if(h=_.cache,co(l,Bn,h),h!==w.cache&&Bm(l,[Bn],d,!0),ru(),h=_.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:_.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=lw(i,l,h,d);break e}else if(h!==x){x=ea(Error(r(424)),l),Kc(x),l=lw(i,l,h,d);break e}else{switch(i=l.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Dn=Ra(i.firstChild),ur=l,Ft=!0,ls=null,Ha=!0,d=HS(l,null,h,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Yc(),h===x){l=Ti(i,l,d);break e}Kn(i,l,h,d)}l=l.child}return l;case 26:return jf(i,l),i===null?(d=gj(l.type,null,l.pendingProps,null))?l.memoizedState=d:Ft||(d=l.type,i=l.pendingProps,h=zf(ye.current).createElement(d),h[he]=l,h[Ee]=i,Zn(h,d,i),kt(h),l.stateNode=h):l.memoizedState=gj(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return Ae(l),i===null&&Ft&&(h=l.stateNode=hj(l.type,l.pendingProps,ye.current),ur=l,Ha=!0,x=Dn,Eo(l.type)?(av=x,Dn=Ra(h.firstChild)):Dn=x),Kn(i,l,l.pendingProps.children,d),jf(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&Ft&&((x=h=Dn)&&(h=_P(h,l.type,l.pendingProps,Ha),h!==null?(l.stateNode=h,ur=l,Dn=Ra(h.firstChild),Ha=!1,x=!0):x=!1),x||cs(l)),Ae(l),x=l.type,w=l.pendingProps,_=i!==null?i.memoizedProps:null,h=w.children,ev(x,w)?h=null:_!==null&&ev(x,_)&&(l.flags|=32),l.memoizedState!==null&&(x=Jm(i,l,W4,null,null,d),Tu._currentValue=x),jf(i,l),Kn(i,l,h,d),l.child;case 6:return i===null&&Ft&&((i=d=Dn)&&(d=kP(d,l.pendingProps,Ha),d!==null?(l.stateNode=d,ur=l,Dn=null,i=!0):i=!1),i||cs(l)),null;case 13:return cw(i,l,d);case 4:return Ne(l,l.stateNode.containerInfo),h=l.pendingProps,i===null?l.child=Rl(l,null,h,d):Kn(i,l,h,d),l.child;case 11:return tw(i,l,l.type,l.pendingProps,d);case 7:return Kn(i,l,l.pendingProps,d),l.child;case 8:return Kn(i,l,l.pendingProps.children,d),l.child;case 12:return Kn(i,l,l.pendingProps.children,d),l.child;case 10:return h=l.pendingProps,co(l,l.type,h.value),Kn(i,l,h.children,d),l.child;case 9:return x=l.type._context,h=l.pendingProps.children,ds(l),x=rr(x),h=h(x),l.flags|=1,Kn(i,l,h,d),l.child;case 14:return nw(i,l,l.type,l.pendingProps,d);case 15:return rw(i,l,l.type,l.pendingProps,d);case 19:return dw(i,l,d);case 31:return h=l.pendingProps,d=l.mode,h={mode:h.mode,children:h.children},i===null?(d=Cf(h,d),d.ref=l.ref,l.child=d,d.return=l,l=d):(d=xi(i.child,h),d.ref=l.ref,l.child=d,d.return=l,l=d),l;case 22:return aw(i,l,d);case 24:return ds(l),h=rr(Bn),i===null?(x=Hm(),x===null&&(x=fn,w=Vm(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=d),x=w),l.memoizedState={parent:h,cache:x},Gm(l),co(l,Bn,x)):((i.lanes&d)!==0&&(Qm(i,l),au(l,null,null,d),ru()),x=i.memoizedState,w=l.memoizedState,x.parent!==h?(x={parent:h,cache:h},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),co(l,Bn,h)):(h=w.cache,co(l,Bn,h),h!==x.cache&&Bm(l,[Bn],d,!0))),Kn(i,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Ri(i){i.flags|=4}function hw(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Sj(l)){if(l=aa.current,l!==null&&((Ot&4194048)===Ot?qa!==null:(Ot&62914560)!==Ot&&(Ot&536870912)===0||l!==qa))throw tu=qm,K1;i.flags|=8192}}function Ef(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?no():536870912,i.lanes|=l,kl|=l)}function du(i,l){if(!Ft)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 h=null;d!==null;)d.alternate!==null&&(h=d),d=d.sibling;h===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function wn(i){var l=i.alternate!==null&&i.alternate.child===i.child,d=0,h=0;if(l)for(var x=i.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=h,i.childLanes=d,l}function rP(i,l,d){var h=l.pendingProps;switch(Lm(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wn(l),null;case 1:return wn(l),null;case 3:return d=l.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),ji(Bn),tt(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Wc(l)?Ri(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,q1())),wn(l),null;case 26:return d=l.memoizedState,i===null?(Ri(l),d!==null?(wn(l),hw(l,d)):(wn(l),l.flags&=-16777217)):d?d!==i.memoizedState?(Ri(l),wn(l),hw(l,d)):(wn(l),l.flags&=-16777217):(i.memoizedProps!==h&&Ri(l),wn(l),l.flags&=-16777217),null;case 27:gt(l),d=ye.current;var x=l.type;if(i!==null&&l.stateNode!=null)i.memoizedProps!==h&&Ri(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return wn(l),null}i=be.current,Wc(l)?F1(l):(i=hj(x,h,d),l.stateNode=i,Ri(l))}return wn(l),null;case 5:if(gt(l),d=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&Ri(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return wn(l),null}if(i=be.current,Wc(l))F1(l);else{switch(x=zf(ye.current),i){case 1:i=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:i=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":i=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":i=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":i=x.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof h.is=="string"?x.createElement("select",{is:h.is}):x.createElement("select"),h.multiple?i.multiple=!0:h.size&&(i.size=h.size);break;default:i=typeof h.is=="string"?x.createElement(d,{is:h.is}):x.createElement(d)}}i[he]=l,i[Ee]=h;e:for(x=l.child;x!==null;){if(x.tag===5||x.tag===6)i.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===l)break e;for(;x.sibling===null;){if(x.return===null||x.return===l)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}l.stateNode=i;e:switch(Zn(i,d,h),d){case"button":case"input":case"select":case"textarea":i=!!h.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ri(l)}}return wn(l),l.flags&=-16777217,null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==h&&Ri(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(i=ye.current,Wc(l)){if(i=l.stateNode,d=l.memoizedProps,h=null,x=ur,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}i[he]=l,i=!!(i.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||oj(i.nodeValue,d)),i||cs(l)}else i=zf(i).createTextNode(h),i[he]=l,l.stateNode=i}return wn(l),null;case 13:if(h=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(x=Wc(l),h!==null&&h.dehydrated!==null){if(i===null){if(!x)throw Error(r(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[he]=l}else Yc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;wn(l),x=!1}else x=q1(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(Ei(l),l):(Ei(l),null)}if(Ei(l),(l.flags&128)!==0)return l.lanes=d,l;if(d=h!==null,i=i!==null&&i.memoizedState!==null,d){h=l.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool);var w=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==x&&(h.flags|=2048)}return d!==i&&d&&(l.child.flags|=8192),Ef(l,l.updateQueue),wn(l),null;case 4:return tt(),i===null&&Yg(l.stateNode.containerInfo),wn(l),null;case 10:return ji(l.type),wn(l),null;case 19:if(K(Vn),x=l.memoizedState,x===null)return wn(l),null;if(h=(l.flags&128)!==0,w=x.rendering,w===null)if(h)du(x,!1);else{if(An!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(w=bf(i),w!==null){for(l.flags|=128,du(x,!1),i=w.updateQueue,l.updateQueue=i,Ef(l,i),l.subtreeFlags=0,i=d,d=l.child;d!==null;)B1(d,i),d=d.sibling;return ee(Vn,Vn.current&1|2),l.child}i=i.sibling}x.tail!==null&&Ce()>Df&&(l.flags|=128,h=!0,du(x,!1),l.lanes=4194304)}else{if(!h)if(i=bf(w),i!==null){if(l.flags|=128,h=!0,i=i.updateQueue,l.updateQueue=i,Ef(l,i),du(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!Ft)return wn(l),null}else 2*Ce()-x.renderingStartTime>Df&&d!==536870912&&(l.flags|=128,h=!0,du(x,!1),l.lanes=4194304);x.isBackwards?(w.sibling=l.child,l.child=w):(i=x.last,i!==null?i.sibling=w:l.child=w,x.last=w)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=Ce(),l.sibling=null,i=Vn.current,ee(Vn,h?i&1|2:i&1),l):(wn(l),null);case 22:case 23:return Ei(l),Xm(),h=l.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(d&536870912)!==0&&(l.flags&128)===0&&(wn(l),l.subtreeFlags&6&&(l.flags|=8192)):wn(l),d=l.updateQueue,d!==null&&Ef(l,d.retryQueue),d=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048),i!==null&&K(fs),null;case 24:return d=null,i!==null&&(d=i.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),ji(Bn),wn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function aP(i,l){switch(Lm(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return ji(Bn),tt(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return gt(l),null;case 13:if(Ei(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Yc()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return K(Vn),null;case 4:return tt(),null;case 10:return ji(l.type),null;case 22:case 23:return Ei(l),Xm(),i!==null&&K(fs),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return ji(Bn),null;case 25:return null;default:return null}}function pw(i,l){switch(Lm(l),l.tag){case 3:ji(Bn),tt();break;case 26:case 27:case 5:gt(l);break;case 4:tt();break;case 13:Ei(l);break;case 19:K(Vn);break;case 10:ji(l.type);break;case 22:case 23:Ei(l),Xm(),i!==null&&K(fs);break;case 24:ji(Bn)}}function fu(i,l){try{var d=l.updateQueue,h=d!==null?d.lastEffect:null;if(h!==null){var x=h.next;d=x;do{if((d.tag&i)===i){h=void 0;var w=d.create,_=d.inst;h=w(),_.destroy=h}d=d.next}while(d!==x)}}catch(N){rn(l,l.return,N)}}function vo(i,l,d){try{var h=l.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var w=x.next;h=w;do{if((h.tag&i)===i){var _=h.inst,N=_.destroy;if(N!==void 0){_.destroy=void 0,x=l;var B=d,ne=N;try{ne()}catch(ue){rn(x,B,ue)}}}h=h.next}while(h!==w)}}catch(ue){rn(l,l.return,ue)}}function mw(i){var l=i.updateQueue;if(l!==null){var d=i.stateNode;try{nS(l,d)}catch(h){rn(i,i.return,h)}}}function gw(i,l,d){d.props=ps(i.type,i.memoizedProps),d.state=i.memoizedState;try{d.componentWillUnmount()}catch(h){rn(i,l,h)}}function hu(i,l){try{var d=i.ref;if(d!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof d=="function"?i.refCleanup=d(h):d.current=h}}catch(x){rn(i,l,x)}}function Ga(i,l){var d=i.ref,h=i.refCleanup;if(d!==null)if(typeof h=="function")try{h()}catch(x){rn(i,l,x)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(x){rn(i,l,x)}else d.current=null}function vw(i){var l=i.type,d=i.memoizedProps,h=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&h.focus();break e;case"img":d.src?h.src=d.src:d.srcSet&&(h.srcset=d.srcSet)}}catch(x){rn(i,i.return,x)}}function Eg(i,l,d){try{var h=i.stateNode;EP(h,i.type,d,l),h[Ee]=l}catch(x){rn(i,i.return,x)}}function yw(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Eo(i.type)||i.tag===4}function Tg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||yw(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&&Eo(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 Rg(i,l,d){var h=i.tag;if(h===5||h===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=Lf));else if(h!==4&&(h===27&&Eo(i.type)&&(d=i.stateNode,l=null),i=i.child,i!==null))for(Rg(i,l,d),i=i.sibling;i!==null;)Rg(i,l,d),i=i.sibling}function Tf(i,l,d){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?d.insertBefore(i,l):d.appendChild(i);else if(h!==4&&(h===27&&Eo(i.type)&&(d=i.stateNode),i=i.child,i!==null))for(Tf(i,l,d),i=i.sibling;i!==null;)Tf(i,l,d),i=i.sibling}function xw(i){var l=i.stateNode,d=i.memoizedProps;try{for(var h=i.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);Zn(l,h,d),l[he]=i,l[Ee]=d}catch(w){rn(i,i.return,w)}}var Di=!1,Pn=!1,Dg=!1,bw=typeof WeakSet=="function"?WeakSet:Set,Qn=null;function iP(i,l){if(i=i.containerInfo,Zg=Hf,i=k1(i),Tm(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var h=d.getSelection&&d.getSelection();if(h&&h.rangeCount!==0){d=h.anchorNode;var x=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var _=0,N=-1,B=-1,ne=0,ue=0,pe=i,ae=null;t:for(;;){for(var ie;pe!==d||x!==0&&pe.nodeType!==3||(N=_+x),pe!==w||h!==0&&pe.nodeType!==3||(B=_+h),pe.nodeType===3&&(_+=pe.nodeValue.length),(ie=pe.firstChild)!==null;)ae=pe,pe=ie;for(;;){if(pe===i)break t;if(ae===d&&++ne===x&&(N=_),ae===w&&++ue===h&&(B=_),(ie=pe.nextSibling)!==null)break;pe=ae,ae=pe.parentNode}pe=ie}d=N===-1||B===-1?null:{start:N,end:B}}else d=null}d=d||{start:0,end:0}}else d=null;for(Jg={focusedElem:i,selectionRange:d},Hf=!1,Qn=l;Qn!==null;)if(l=Qn,i=l.child,(l.subtreeFlags&1024)!==0&&i!==null)i.return=l,Qn=i;else for(;Qn!==null;){switch(l=Qn,w=l.alternate,i=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&w!==null){i=void 0,d=l,x=w.memoizedProps,w=w.memoizedState,h=d.stateNode;try{var ut=ps(d.type,x,d.elementType===d.type);i=h.getSnapshotBeforeUpdate(ut,w),h.__reactInternalSnapshotBeforeUpdate=i}catch(it){rn(d,d.return,it)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,d=i.nodeType,d===9)nv(i);else if(d===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":nv(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,Qn=i;break}Qn=l.return}}function Sw(i,l,d){var h=d.flags;switch(d.tag){case 0:case 11:case 15:yo(i,d),h&4&&fu(5,d);break;case 1:if(yo(i,d),h&4)if(i=d.stateNode,l===null)try{i.componentDidMount()}catch(_){rn(d,d.return,_)}else{var x=ps(d.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(x,l,i.__reactInternalSnapshotBeforeUpdate)}catch(_){rn(d,d.return,_)}}h&64&&mw(d),h&512&&hu(d,d.return);break;case 3:if(yo(i,d),h&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{nS(i,l)}catch(_){rn(d,d.return,_)}}break;case 27:l===null&&h&4&&xw(d);case 26:case 5:yo(i,d),l===null&&h&4&&vw(d),h&512&&hu(d,d.return);break;case 12:yo(i,d);break;case 13:yo(i,d),h&4&&Cw(i,d),h&64&&(i=d.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(d=pP.bind(null,d),PP(i,d))));break;case 22:if(h=d.memoizedState!==null||Di,!h){l=l!==null&&l.memoizedState!==null||Pn,x=Di;var w=Pn;Di=h,(Pn=l)&&!w?xo(i,d,(d.subtreeFlags&8772)!==0):yo(i,d),Di=x,Pn=w}break;case 30:break;default:yo(i,d)}}function ww(i){var l=i.alternate;l!==null&&(i.alternate=null,ww(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&Ye(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 bn=null,Cr=!1;function Ai(i,l,d){for(d=d.child;d!==null;)jw(i,l,d),d=d.sibling}function jw(i,l,d){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(vt,d)}catch{}switch(d.tag){case 26:Pn||Ga(d,l),Ai(i,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Pn||Ga(d,l);var h=bn,x=Cr;Eo(d.type)&&(bn=d.stateNode,Cr=!1),Ai(i,l,d),wu(d.stateNode),bn=h,Cr=x;break;case 5:Pn||Ga(d,l);case 6:if(h=bn,x=Cr,bn=null,Ai(i,l,d),bn=h,Cr=x,bn!==null)if(Cr)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(d.stateNode)}catch(w){rn(d,l,w)}else try{bn.removeChild(d.stateNode)}catch(w){rn(d,l,w)}break;case 18:bn!==null&&(Cr?(i=bn,dj(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,d.stateNode),_u(i)):dj(bn,d.stateNode));break;case 4:h=bn,x=Cr,bn=d.stateNode.containerInfo,Cr=!0,Ai(i,l,d),bn=h,Cr=x;break;case 0:case 11:case 14:case 15:Pn||vo(2,d,l),Pn||vo(4,d,l),Ai(i,l,d);break;case 1:Pn||(Ga(d,l),h=d.stateNode,typeof h.componentWillUnmount=="function"&&gw(d,l,h)),Ai(i,l,d);break;case 21:Ai(i,l,d);break;case 22:Pn=(h=Pn)||d.memoizedState!==null,Ai(i,l,d),Pn=h;break;default:Ai(i,l,d)}}function Cw(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{_u(i)}catch(d){rn(l,l.return,d)}}function oP(i){switch(i.tag){case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new bw),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new bw),l;default:throw Error(r(435,i.tag))}}function Ag(i,l){var d=oP(i);l.forEach(function(h){var x=mP.bind(null,i,h);d.has(h)||(d.add(h),h.then(x,x))})}function zr(i,l){var d=l.deletions;if(d!==null)for(var h=0;h<d.length;h++){var x=d[h],w=i,_=l,N=_;e:for(;N!==null;){switch(N.tag){case 27:if(Eo(N.type)){bn=N.stateNode,Cr=!1;break e}break;case 5:bn=N.stateNode,Cr=!1;break e;case 3:case 4:bn=N.stateNode.containerInfo,Cr=!0;break e}N=N.return}if(bn===null)throw Error(r(160));jw(w,_,x),bn=null,Cr=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)Ew(l,i),l=l.sibling}var Ta=null;function Ew(i,l){var d=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:zr(l,i),$r(i),h&4&&(vo(3,i,i.return),fu(3,i),vo(5,i,i.return));break;case 1:zr(l,i),$r(i),h&512&&(Pn||d===null||Ga(d,d.return)),h&64&&Di&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(d=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=d===null?h:d.concat(h))));break;case 26:var x=Ta;if(zr(l,i),$r(i),h&512&&(Pn||d===null||Ga(d,d.return)),h&4){var w=d!==null?d.memoizedState:null;if(h=i.memoizedState,d===null)if(h===null)if(i.stateNode===null){e:{h=i.type,d=i.memoizedProps,x=x.ownerDocument||x;t:switch(h){case"title":w=x.getElementsByTagName("title")[0],(!w||w[at]||w[he]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(h),x.head.insertBefore(w,x.querySelector("head > title"))),Zn(w,h,d),w[he]=i,kt(w),h=w;break e;case"link":var _=xj("link","href",x).get(h+(d.href||""));if(_){for(var N=0;N<_.length;N++)if(w=_[N],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){_.splice(N,1);break t}}w=x.createElement(h),Zn(w,h,d),x.head.appendChild(w);break;case"meta":if(_=xj("meta","content",x).get(h+(d.content||""))){for(N=0;N<_.length;N++)if(w=_[N],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){_.splice(N,1);break t}}w=x.createElement(h),Zn(w,h,d),x.head.appendChild(w);break;default:throw Error(r(468,h))}w[he]=i,kt(w),h=w}i.stateNode=h}else bj(x,i.type,i.stateNode);else i.stateNode=yj(x,h,i.memoizedProps);else w!==h?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,h===null?bj(x,i.type,i.stateNode):yj(x,h,i.memoizedProps)):h===null&&i.stateNode!==null&&Eg(i,i.memoizedProps,d.memoizedProps)}break;case 27:zr(l,i),$r(i),h&512&&(Pn||d===null||Ga(d,d.return)),d!==null&&h&4&&Eg(i,i.memoizedProps,d.memoizedProps);break;case 5:if(zr(l,i),$r(i),h&512&&(Pn||d===null||Ga(d,d.return)),i.flags&32){x=i.stateNode;try{cl(x,"")}catch(ie){rn(i,i.return,ie)}}h&4&&i.stateNode!=null&&(x=i.memoizedProps,Eg(i,x,d!==null?d.memoizedProps:x)),h&1024&&(Dg=!0);break;case 6:if(zr(l,i),$r(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,d=i.stateNode;try{d.nodeValue=h}catch(ie){rn(i,i.return,ie)}}break;case 3:if(Bf=null,x=Ta,Ta=$f(l.containerInfo),zr(l,i),Ta=x,$r(i),h&4&&d!==null&&d.memoizedState.isDehydrated)try{_u(l.containerInfo)}catch(ie){rn(i,i.return,ie)}Dg&&(Dg=!1,Tw(i));break;case 4:h=Ta,Ta=$f(i.stateNode.containerInfo),zr(l,i),$r(i),Ta=h;break;case 12:zr(l,i),$r(i);break;case 13:zr(l,i),$r(i),i.child.flags&8192&&i.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Mg=Ce()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Ag(i,h)));break;case 22:x=i.memoizedState!==null;var B=d!==null&&d.memoizedState!==null,ne=Di,ue=Pn;if(Di=ne||x,Pn=ue||B,zr(l,i),Pn=ue,Di=ne,$r(i),h&8192)e:for(l=i.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(d===null||B||Di||Pn||ms(i)),d=null,l=i;;){if(l.tag===5||l.tag===26){if(d===null){B=d=l;try{if(w=B.stateNode,x)_=w.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{N=B.stateNode;var pe=B.memoizedProps.style,ae=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;N.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(ie){rn(B,B.return,ie)}}}else if(l.tag===6){if(d===null){B=l;try{B.stateNode.nodeValue=x?"":B.memoizedProps}catch(ie){rn(B,B.return,ie)}}}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}h&4&&(h=i.updateQueue,h!==null&&(d=h.retryQueue,d!==null&&(h.retryQueue=null,Ag(i,d))));break;case 19:zr(l,i),$r(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Ag(i,h)));break;case 30:break;case 21:break;default:zr(l,i),$r(i)}}function $r(i){var l=i.flags;if(l&2){try{for(var d,h=i.return;h!==null;){if(yw(h)){d=h;break}h=h.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var x=d.stateNode,w=Tg(i);Tf(i,w,x);break;case 5:var _=d.stateNode;d.flags&32&&(cl(_,""),d.flags&=-33);var N=Tg(i);Tf(i,N,_);break;case 3:case 4:var B=d.stateNode.containerInfo,ne=Tg(i);Rg(i,ne,B);break;default:throw Error(r(161))}}catch(ue){rn(i,i.return,ue)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function Tw(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;Tw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function yo(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Sw(i,l.alternate,l),l=l.sibling}function ms(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:vo(4,l,l.return),ms(l);break;case 1:Ga(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&gw(l,l.return,d),ms(l);break;case 27:wu(l.stateNode);case 26:case 5:Ga(l,l.return),ms(l);break;case 22:l.memoizedState===null&&ms(l);break;case 30:ms(l);break;default:ms(l)}i=i.sibling}}function xo(i,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,x=i,w=l,_=w.flags;switch(w.tag){case 0:case 11:case 15:xo(x,w,d),fu(4,w);break;case 1:if(xo(x,w,d),h=w,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ne){rn(h,h.return,ne)}if(h=w,x=h.updateQueue,x!==null){var N=h.stateNode;try{var B=x.shared.hiddenCallbacks;if(B!==null)for(x.shared.hiddenCallbacks=null,x=0;x<B.length;x++)tS(B[x],N)}catch(ne){rn(h,h.return,ne)}}d&&_&64&&mw(w),hu(w,w.return);break;case 27:xw(w);case 26:case 5:xo(x,w,d),d&&h===null&&_&4&&vw(w),hu(w,w.return);break;case 12:xo(x,w,d);break;case 13:xo(x,w,d),d&&_&4&&Cw(x,w);break;case 22:w.memoizedState===null&&xo(x,w,d),hu(w,w.return);break;case 30:break;default:xo(x,w,d)}l=l.sibling}}function _g(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&&Zc(d))}function kg(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Zc(i))}function Qa(i,l,d,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Rw(i,l,d,h),l=l.sibling}function Rw(i,l,d,h){var x=l.flags;switch(l.tag){case 0:case 11:case 15:Qa(i,l,d,h),x&2048&&fu(9,l);break;case 1:Qa(i,l,d,h);break;case 3:Qa(i,l,d,h),x&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Zc(i)));break;case 12:if(x&2048){Qa(i,l,d,h),i=l.stateNode;try{var w=l.memoizedProps,_=w.id,N=w.onPostCommit;typeof N=="function"&&N(_,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(B){rn(l,l.return,B)}}else Qa(i,l,d,h);break;case 13:Qa(i,l,d,h);break;case 23:break;case 22:w=l.stateNode,_=l.alternate,l.memoizedState!==null?w._visibility&2?Qa(i,l,d,h):pu(i,l):w._visibility&2?Qa(i,l,d,h):(w._visibility|=2,Dl(i,l,d,h,(l.subtreeFlags&10256)!==0)),x&2048&&_g(_,l);break;case 24:Qa(i,l,d,h),x&2048&&kg(l.alternate,l);break;default:Qa(i,l,d,h)}}function Dl(i,l,d,h,x){for(x=x&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var w=i,_=l,N=d,B=h,ne=_.flags;switch(_.tag){case 0:case 11:case 15:Dl(w,_,N,B,x),fu(8,_);break;case 23:break;case 22:var ue=_.stateNode;_.memoizedState!==null?ue._visibility&2?Dl(w,_,N,B,x):pu(w,_):(ue._visibility|=2,Dl(w,_,N,B,x)),x&&ne&2048&&_g(_.alternate,_);break;case 24:Dl(w,_,N,B,x),x&&ne&2048&&kg(_.alternate,_);break;default:Dl(w,_,N,B,x)}l=l.sibling}}function pu(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=i,h=l,x=h.flags;switch(h.tag){case 22:pu(d,h),x&2048&&_g(h.alternate,h);break;case 24:pu(d,h),x&2048&&kg(h.alternate,h);break;default:pu(d,h)}l=l.sibling}}var mu=8192;function Al(i){if(i.subtreeFlags&mu)for(i=i.child;i!==null;)Dw(i),i=i.sibling}function Dw(i){switch(i.tag){case 26:Al(i),i.flags&mu&&i.memoizedState!==null&&qP(Ta,i.memoizedState,i.memoizedProps);break;case 5:Al(i);break;case 3:case 4:var l=Ta;Ta=$f(i.stateNode.containerInfo),Al(i),Ta=l;break;case 22:i.memoizedState===null&&(l=i.alternate,l!==null&&l.memoizedState!==null?(l=mu,mu=16777216,Al(i),mu=l):Al(i));break;default:Al(i)}}function Aw(i){var l=i.alternate;if(l!==null&&(i=l.child,i!==null)){l.child=null;do l=i.sibling,i.sibling=null,i=l;while(i!==null)}}function gu(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var h=l[d];Qn=h,kw(h,i)}Aw(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)_w(i),i=i.sibling}function _w(i){switch(i.tag){case 0:case 11:case 15:gu(i),i.flags&2048&&vo(9,i,i.return);break;case 3:gu(i);break;case 12:gu(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,Rf(i)):gu(i);break;default:gu(i)}}function Rf(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var h=l[d];Qn=h,kw(h,i)}Aw(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:vo(8,l,l.return),Rf(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Rf(l));break;default:Rf(l)}i=i.sibling}}function kw(i,l){for(;Qn!==null;){var d=Qn;switch(d.tag){case 0:case 11:case 15:vo(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var h=d.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Zc(d.memoizedState.cache)}if(h=d.child,h!==null)h.return=d,Qn=h;else e:for(d=i;Qn!==null;){h=Qn;var x=h.sibling,w=h.return;if(ww(h),h===d){Qn=null;break e}if(x!==null){x.return=w,Qn=x;break e}Qn=w}}}var sP={getCacheForType:function(i){var l=rr(Bn),d=l.data.get(i);return d===void 0&&(d=i(),l.data.set(i,d)),d}},lP=typeof WeakMap=="function"?WeakMap:Map,Yt=0,fn=null,Tt=null,Ot=0,Kt=0,Ur=null,bo=!1,_l=!1,Pg=!1,_i=0,An=0,So=0,gs=0,Ng=0,ia=0,kl=0,vu=null,Er=null,Og=!1,Mg=0,Df=1/0,Af=null,wo=null,Xn=0,jo=null,Pl=null,Nl=0,Ig=0,Lg=null,Pw=null,yu=0,zg=null;function Br(){if((Yt&2)!==0&&Ot!==0)return Ot&-Ot;if(P.T!==null){var i=bl;return i!==0?i:qg()}return F()}function Nw(){ia===0&&(ia=(Ot&536870912)===0||Ft?mi():536870912);var i=aa.current;return i!==null&&(i.flags|=32),ia}function Vr(i,l,d){(i===fn&&(Kt===2||Kt===9)||i.cancelPendingCommit!==null)&&(Ol(i,0),Co(i,Ot,ia,!1)),xr(i,d),((Yt&2)===0||i!==fn)&&(i===fn&&((Yt&2)===0&&(gs|=d),An===4&&Co(i,Ot,ia,!1)),Wa(i))}function Ow(i,l,d){if((Yt&6)!==0)throw Error(r(327));var h=!d&&(l&124)===0&&(l&i.expiredLanes)===0||Kr(i,l),x=h?dP(i,l):Bg(i,l,!0),w=h;do{if(x===0){_l&&!h&&Co(i,l,0,!1);break}else{if(d=i.current.alternate,w&&!cP(d)){x=Bg(i,l,!1),w=!1;continue}if(x===2){if(w=l,i.errorRecoveryDisabledLanes&w)var _=0;else _=i.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){l=_;e:{var N=i;x=vu;var B=N.current.memoizedState.isDehydrated;if(B&&(Ol(N,_).flags|=256),_=Bg(N,_,!1),_!==2){if(Pg&&!B){N.errorRecoveryDisabledLanes|=w,gs|=w,x=4;break e}w=Er,Er=x,w!==null&&(Er===null?Er=w:Er.push.apply(Er,w))}x=_}if(w=!1,x!==2)continue}}if(x===1){Ol(i,0),Co(i,l,0,!0);break}e:{switch(h=i,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Co(h,l,ia,!bo);break e;case 2:Er=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=Mg+300-Ce(),10<x)){if(Co(h,l,ia,!bo),wa(h,0,!0)!==0)break e;h.timeoutHandle=cj(Mw.bind(null,h,d,Er,Af,Og,l,ia,gs,kl,bo,w,2,-0,0),x);break e}Mw(h,d,Er,Af,Og,l,ia,gs,kl,bo,w,0,-0,0)}}break}while(!0);Wa(i)}function Mw(i,l,d,h,x,w,_,N,B,ne,ue,pe,ae,ie){if(i.timeoutHandle=-1,pe=l.subtreeFlags,(pe&8192||(pe&16785408)===16785408)&&(Eu={stylesheets:null,count:0,unsuspend:HP},Dw(l),pe=GP(),pe!==null)){i.cancelPendingCommit=pe(Vw.bind(null,i,l,w,d,h,x,_,N,B,ue,1,ae,ie)),Co(i,w,_,!ne);return}Vw(i,l,w,d,h,x,_,N,B)}function cP(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 h=0;h<d.length;h++){var x=d[h],w=x.getSnapshot;x=x.value;try{if(!Ir(w(),x))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===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 Co(i,l,d,h){l&=~Ng,l&=~gs,i.suspendedLanes|=l,i.pingedLanes&=~l,h&&(i.warmLanes|=l),h=i.expirationTimes;for(var x=l;0<x;){var w=31-_t(x),_=1<<w;h[w]=-1,x&=~_}d!==0&&gi(i,d,l)}function _f(){return(Yt&6)===0?(xu(0),!1):!0}function $g(){if(Tt!==null){if(Kt===0)var i=Tt.return;else i=Tt,wi=us=null,ng(i),Tl=null,cu=0,i=Tt;for(;i!==null;)pw(i.alternate,i),i=i.return;Tt=null}}function Ol(i,l){var d=i.timeoutHandle;d!==-1&&(i.timeoutHandle=-1,RP(d)),d=i.cancelPendingCommit,d!==null&&(i.cancelPendingCommit=null,d()),$g(),fn=i,Tt=d=xi(i.current,null),Ot=l,Kt=0,Ur=null,bo=!1,_l=Kr(i,l),Pg=!1,kl=ia=Ng=gs=So=An=0,Er=vu=null,Og=!1,(l&8)!==0&&(l|=l&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=l;0<h;){var x=31-_t(h),w=1<<x;l|=i[x],h&=~w}return _i=l,Xd(),d}function Iw(i,l){St=null,P.H=vf,l===eu||l===sf?(l=J1(),Kt=3):l===K1?(l=J1(),Kt=4):Kt=l===ew?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ur=l,Tt===null&&(An=1,wf(i,ea(l,i.current)))}function Lw(){var i=P.H;return P.H=vf,i===null?vf:i}function zw(){var i=P.A;return P.A=sP,i}function Ug(){An=4,bo||(Ot&4194048)!==Ot&&aa.current!==null||(_l=!0),(So&134217727)===0&&(gs&134217727)===0||fn===null||Co(fn,Ot,ia,!1)}function Bg(i,l,d){var h=Yt;Yt|=2;var x=Lw(),w=zw();(fn!==i||Ot!==l)&&(Af=null,Ol(i,l)),l=!1;var _=An;e:do try{if(Kt!==0&&Tt!==null){var N=Tt,B=Ur;switch(Kt){case 8:$g(),_=6;break e;case 3:case 2:case 9:case 6:aa.current===null&&(l=!0);var ne=Kt;if(Kt=0,Ur=null,Ml(i,N,B,ne),d&&_l){_=0;break e}break;default:ne=Kt,Kt=0,Ur=null,Ml(i,N,B,ne)}}uP(),_=An;break}catch(ue){Iw(i,ue)}while(!0);return l&&i.shellSuspendCounter++,wi=us=null,Yt=h,P.H=x,P.A=w,Tt===null&&(fn=null,Ot=0,Xd()),_}function uP(){for(;Tt!==null;)$w(Tt)}function dP(i,l){var d=Yt;Yt|=2;var h=Lw(),x=zw();fn!==i||Ot!==l?(Af=null,Df=Ce()+500,Ol(i,l)):_l=Kr(i,l);e:do try{if(Kt!==0&&Tt!==null){l=Tt;var w=Ur;t:switch(Kt){case 1:Kt=0,Ur=null,Ml(i,l,w,1);break;case 2:case 9:if(X1(w)){Kt=0,Ur=null,Uw(l);break}l=function(){Kt!==2&&Kt!==9||fn!==i||(Kt=7),Wa(i)},w.then(l,l);break e;case 3:Kt=7;break e;case 4:Kt=5;break e;case 7:X1(w)?(Kt=0,Ur=null,Uw(l)):(Kt=0,Ur=null,Ml(i,l,w,7));break;case 5:var _=null;switch(Tt.tag){case 26:_=Tt.memoizedState;case 5:case 27:var N=Tt;if(!_||Sj(_)){Kt=0,Ur=null;var B=N.sibling;if(B!==null)Tt=B;else{var ne=N.return;ne!==null?(Tt=ne,kf(ne)):Tt=null}break t}}Kt=0,Ur=null,Ml(i,l,w,5);break;case 6:Kt=0,Ur=null,Ml(i,l,w,6);break;case 8:$g(),An=6;break e;default:throw Error(r(462))}}fP();break}catch(ue){Iw(i,ue)}while(!0);return wi=us=null,P.H=h,P.A=x,Yt=d,Tt!==null?0:(fn=null,Ot=0,Xd(),An)}function fP(){for(;Tt!==null&&!Dt();)$w(Tt)}function $w(i){var l=fw(i.alternate,i,_i);i.memoizedProps=i.pendingProps,l===null?kf(i):Tt=l}function Uw(i){var l=i,d=l.alternate;switch(l.tag){case 15:case 0:l=ow(d,l,l.pendingProps,l.type,void 0,Ot);break;case 11:l=ow(d,l,l.pendingProps,l.type.render,l.ref,Ot);break;case 5:ng(l);default:pw(d,l),l=Tt=B1(l,_i),l=fw(d,l,_i)}i.memoizedProps=i.pendingProps,l===null?kf(i):Tt=l}function Ml(i,l,d,h){wi=us=null,ng(l),Tl=null,cu=0;var x=l.return;try{if(tP(i,x,l,d,Ot)){An=1,wf(i,ea(d,i.current)),Tt=null;return}}catch(w){if(x!==null)throw Tt=x,w;An=1,wf(i,ea(d,i.current)),Tt=null;return}l.flags&32768?(Ft||h===1?i=!0:_l||(Ot&536870912)!==0?i=!1:(bo=i=!0,(h===2||h===9||h===3||h===6)&&(h=aa.current,h!==null&&h.tag===13&&(h.flags|=16384))),Bw(l,i)):kf(l)}function kf(i){var l=i;do{if((l.flags&32768)!==0){Bw(l,bo);return}i=l.return;var d=rP(l.alternate,l,_i);if(d!==null){Tt=d;return}if(l=l.sibling,l!==null){Tt=l;return}Tt=l=i}while(l!==null);An===0&&(An=5)}function Bw(i,l){do{var d=aP(i.alternate,i);if(d!==null){d.flags&=32767,Tt=d;return}if(d=i.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(i=i.sibling,i!==null)){Tt=i;return}Tt=i=d}while(i!==null);An=6,Tt=null}function Vw(i,l,d,h,x,w,_,N,B){i.cancelPendingCommit=null;do Pf();while(Xn!==0);if((Yt&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=km,qn(i,d,w,_,N,B),i===fn&&(Tt=fn=null,Ot=0),Pl=l,jo=i,Nl=d,Ig=w,Lg=x,Pw=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,gP(me,function(){return Qw(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=P.T,P.T=null,x=I.p,I.p=2,_=Yt,Yt|=4;try{iP(i,l,d)}finally{Yt=_,I.p=x,P.T=h}}Xn=1,Fw(),Hw(),qw()}}function Fw(){if(Xn===1){Xn=0;var i=jo,l=Pl,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=P.T,P.T=null;var h=I.p;I.p=2;var x=Yt;Yt|=4;try{Ew(l,i);var w=Jg,_=k1(i.containerInfo),N=w.focusedElem,B=w.selectionRange;if(_!==N&&N&&N.ownerDocument&&_1(N.ownerDocument.documentElement,N)){if(B!==null&&Tm(N)){var ne=B.start,ue=B.end;if(ue===void 0&&(ue=ne),"selectionStart"in N)N.selectionStart=ne,N.selectionEnd=Math.min(ue,N.value.length);else{var pe=N.ownerDocument||document,ae=pe&&pe.defaultView||window;if(ae.getSelection){var ie=ae.getSelection(),ut=N.textContent.length,it=Math.min(B.start,ut),tn=B.end===void 0?it:Math.min(B.end,ut);!ie.extend&&it>tn&&(_=tn,tn=it,it=_);var W=A1(N,it),q=A1(N,tn);if(W&&q&&(ie.rangeCount!==1||ie.anchorNode!==W.node||ie.anchorOffset!==W.offset||ie.focusNode!==q.node||ie.focusOffset!==q.offset)){var te=pe.createRange();te.setStart(W.node,W.offset),ie.removeAllRanges(),it>tn?(ie.addRange(te),ie.extend(q.node,q.offset)):(te.setEnd(q.node,q.offset),ie.addRange(te))}}}}for(pe=[],ie=N;ie=ie.parentNode;)ie.nodeType===1&&pe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<pe.length;N++){var fe=pe[N];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Hf=!!Zg,Jg=Zg=null}finally{Yt=x,I.p=h,P.T=d}}i.current=l,Xn=2}}function Hw(){if(Xn===2){Xn=0;var i=jo,l=Pl,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=P.T,P.T=null;var h=I.p;I.p=2;var x=Yt;Yt|=4;try{Sw(i,l.alternate,l)}finally{Yt=x,I.p=h,P.T=d}}Xn=3}}function qw(){if(Xn===4||Xn===3){Xn=0,nn();var i=jo,l=Pl,d=Nl,h=Pw;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Xn=5:(Xn=0,Pl=jo=null,Gw(i,i.pendingLanes));var x=i.pendingLanes;if(x===0&&(wo=null),es(d),l=l.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(vt,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=P.T,x=I.p,I.p=2,P.T=null;try{for(var w=i.onRecoverableError,_=0;_<h.length;_++){var N=h[_];w(N.value,{componentStack:N.stack})}}finally{P.T=l,I.p=x}}(Nl&3)!==0&&Pf(),Wa(i),x=i.pendingLanes,(d&4194090)!==0&&(x&42)!==0?i===zg?yu++:(yu=0,zg=i):yu=0,xu(0)}}function Gw(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Zc(l)))}function Pf(i){return Fw(),Hw(),qw(),Qw()}function Qw(){if(Xn!==5)return!1;var i=jo,l=Ig;Ig=0;var d=es(Nl),h=P.T,x=I.p;try{I.p=32>d?32:d,P.T=null,d=Lg,Lg=null;var w=jo,_=Nl;if(Xn=0,Pl=jo=null,Nl=0,(Yt&6)!==0)throw Error(r(331));var N=Yt;if(Yt|=4,_w(w.current),Rw(w,w.current,_,d),Yt=N,xu(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(vt,w)}catch{}return!0}finally{I.p=x,P.T=h,Gw(i,l)}}function Ww(i,l,d){l=ea(d,l),l=gg(i.stateNode,l,2),i=ho(i,l,2),i!==null&&(xr(i,2),Wa(i))}function rn(i,l,d){if(i.tag===3)Ww(i,i,d);else for(;l!==null;){if(l.tag===3){Ww(l,i,d);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(wo===null||!wo.has(h))){i=ea(d,i),d=ZS(2),h=ho(l,d,2),h!==null&&(JS(d,h,l,i),xr(h,2),Wa(h));break}}l=l.return}}function Vg(i,l,d){var h=i.pingCache;if(h===null){h=i.pingCache=new lP;var x=new Set;h.set(l,x)}else x=h.get(l),x===void 0&&(x=new Set,h.set(l,x));x.has(d)||(Pg=!0,x.add(d),i=hP.bind(null,i,l,d),l.then(i,i))}function hP(i,l,d){var h=i.pingCache;h!==null&&h.delete(l),i.pingedLanes|=i.suspendedLanes&d,i.warmLanes&=~d,fn===i&&(Ot&d)===d&&(An===4||An===3&&(Ot&62914560)===Ot&&300>Ce()-Mg?(Yt&2)===0&&Ol(i,0):Ng|=d,kl===Ot&&(kl=0)),Wa(i)}function Yw(i,l){l===0&&(l=no()),i=gl(i,l),i!==null&&(xr(i,l),Wa(i))}function pP(i){var l=i.memoizedState,d=0;l!==null&&(d=l.retryLane),Yw(i,d)}function mP(i,l){var d=0;switch(i.tag){case 13:var h=i.stateNode,x=i.memoizedState;x!==null&&(d=x.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),Yw(i,d)}function gP(i,l){return It(i,l)}var Nf=null,Il=null,Fg=!1,Of=!1,Hg=!1,vs=0;function Wa(i){i!==Il&&i.next===null&&(Il===null?Nf=Il=i:Il=Il.next=i),Of=!0,Fg||(Fg=!0,yP())}function xu(i,l){if(!Hg&&Of){Hg=!0;do for(var d=!1,h=Nf;h!==null;){if(i!==0){var x=h.pendingLanes;if(x===0)var w=0;else{var _=h.suspendedLanes,N=h.pingedLanes;w=(1<<31-_t(42|i)+1)-1,w&=x&~(_&~N),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,Jw(h,w))}else w=Ot,w=wa(h,h===fn?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||Kr(h,w)||(d=!0,Jw(h,w));h=h.next}while(d);Hg=!1}}function vP(){Kw()}function Kw(){Of=Fg=!1;var i=0;vs!==0&&(TP()&&(i=vs),vs=0);for(var l=Ce(),d=null,h=Nf;h!==null;){var x=h.next,w=Xw(h,l);w===0?(h.next=null,d===null?Nf=x:d.next=x,x===null&&(Il=d)):(d=h,(i!==0||(w&3)!==0)&&(Of=!0)),h=x}xu(i)}function Xw(i,l){for(var d=i.suspendedLanes,h=i.pingedLanes,x=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var _=31-_t(w),N=1<<_,B=x[_];B===-1?((N&d)===0||(N&h)!==0)&&(x[_]=sl(N,l)):B<=l&&(i.expiredLanes|=N),w&=~N}if(l=fn,d=Ot,d=wa(i,i===l?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,d===0||i===l&&(Kt===2||Kt===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&mt(h),i.callbackNode=null,i.callbackPriority=0;if((d&3)===0||Kr(i,d)){if(l=d&-d,l===i.callbackPriority)return l;switch(h!==null&&mt(h),es(d)){case 2:case 8:d=Te;break;case 32:d=me;break;case 268435456:d=ke;break;default:d=me}return h=Zw.bind(null,i),d=It(d,h),i.callbackPriority=l,i.callbackNode=d,l}return h!==null&&h!==null&&mt(h),i.callbackPriority=2,i.callbackNode=null,2}function Zw(i,l){if(Xn!==0&&Xn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var d=i.callbackNode;if(Pf()&&i.callbackNode!==d)return null;var h=Ot;return h=wa(i,i===fn?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(Ow(i,h,l),Xw(i,Ce()),i.callbackNode!=null&&i.callbackNode===d?Zw.bind(null,i):null)}function Jw(i,l){if(Pf())return null;Ow(i,l,!0)}function yP(){DP(function(){(Yt&6)!==0?It(Ge,vP):Kw()})}function qg(){return vs===0&&(vs=mi()),vs}function ej(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Hd(""+i)}function tj(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 xP(i,l,d,h,x){if(l==="submit"&&d&&d.stateNode===x){var w=ej((x[Ee]||null).action),_=h.submitter;_&&(l=(l=_[Ee]||null)?ej(l.formAction):_.getAttribute("formAction"),l!==null&&(w=l,_=null));var N=new Wd("action","action",null,h,x);i.push({event:N,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(vs!==0){var B=_?tj(x,_):new FormData(x);dg(d,{pending:!0,data:B,method:x.method,action:w},null,B)}}else typeof w=="function"&&(N.preventDefault(),B=_?tj(x,_):new FormData(x),dg(d,{pending:!0,data:B,method:x.method,action:w},w,B))},currentTarget:x}]})}}for(var Gg=0;Gg<_m.length;Gg++){var Qg=_m[Gg],bP=Qg.toLowerCase(),SP=Qg[0].toUpperCase()+Qg.slice(1);Ea(bP,"on"+SP)}Ea(O1,"onAnimationEnd"),Ea(M1,"onAnimationIteration"),Ea(I1,"onAnimationStart"),Ea("dblclick","onDoubleClick"),Ea("focusin","onFocus"),Ea("focusout","onBlur"),Ea(z4,"onTransitionRun"),Ea($4,"onTransitionStart"),Ea(U4,"onTransitionCancel"),Ea(L1,"onTransitionEnd"),Xr("onMouseEnter",["mouseout","mouseover"]),Xr("onMouseLeave",["mouseout","mouseover"]),Xr("onPointerEnter",["pointerout","pointerover"]),Xr("onPointerLeave",["pointerout","pointerover"]),cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bu));function nj(i,l){l=(l&4)!==0;for(var d=0;d<i.length;d++){var h=i[d],x=h.event;h=h.listeners;e:{var w=void 0;if(l)for(var _=h.length-1;0<=_;_--){var N=h[_],B=N.instance,ne=N.currentTarget;if(N=N.listener,B!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=ne;try{w(x)}catch(ue){Sf(ue)}x.currentTarget=null,w=B}else for(_=0;_<h.length;_++){if(N=h[_],B=N.instance,ne=N.currentTarget,N=N.listener,B!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=ne;try{w(x)}catch(ue){Sf(ue)}x.currentTarget=null,w=B}}}}function Rt(i,l){var d=l[nt];d===void 0&&(d=l[nt]=new Set);var h=i+"__bubble";d.has(h)||(rj(l,i,2,!1),d.add(h))}function Wg(i,l,d){var h=0;l&&(h|=4),rj(d,i,h,l)}var Mf="_reactListening"+Math.random().toString(36).slice(2);function Yg(i){if(!i[Mf]){i[Mf]=!0,Et.forEach(function(d){d!=="selectionchange"&&(wP.has(d)||Wg(d,!1,i),Wg(d,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Mf]||(l[Mf]=!0,Wg("selectionchange",!1,l))}}function rj(i,l,d,h){switch(Rj(l)){case 2:var x=YP;break;case 8:x=KP;break;default:x=cv}d=x.bind(null,l,d,i),x=void 0,!vm||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),h?x!==void 0?i.addEventListener(l,d,{capture:!0,passive:x}):i.addEventListener(l,d,!0):x!==void 0?i.addEventListener(l,d,{passive:x}):i.addEventListener(l,d,!1)}function Kg(i,l,d,h,x){var w=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var _=h.tag;if(_===3||_===4){var N=h.stateNode.containerInfo;if(N===x)break;if(_===4)for(_=h.return;_!==null;){var B=_.tag;if((B===3||B===4)&&_.stateNode.containerInfo===x)return;_=_.return}for(;N!==null;){if(_=st(N),_===null)return;if(B=_.tag,B===5||B===6||B===26||B===27){h=w=_;continue e}N=N.parentNode}}h=h.return}u1(function(){var ne=w,ue=mm(d),pe=[];e:{var ae=z1.get(i);if(ae!==void 0){var ie=Wd,ut=i;switch(i){case"keypress":if(Gd(d)===0)break e;case"keydown":case"keyup":ie=g4;break;case"focusin":ut="focus",ie=Sm;break;case"focusout":ut="blur",ie=Sm;break;case"beforeblur":case"afterblur":ie=Sm;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":ie=h1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=a4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=x4;break;case O1:case M1:case I1:ie=s4;break;case L1:ie=S4;break;case"scroll":case"scrollend":ie=n4;break;case"wheel":ie=j4;break;case"copy":case"cut":case"paste":ie=c4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=m1;break;case"toggle":case"beforetoggle":ie=E4}var it=(l&4)!==0,tn=!it&&(i==="scroll"||i==="scrollend"),W=it?ae!==null?ae+"Capture":null:ae;it=[];for(var q=ne,te;q!==null;){var fe=q;if(te=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||te===null||W===null||(fe=$c(q,W),fe!=null&&it.push(Su(q,fe,te))),tn)break;q=q.return}0<it.length&&(ae=new ie(ae,ut,null,d,ue),pe.push({event:ae,listeners:it}))}}if((l&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ie=i==="mouseout"||i==="pointerout",ae&&d!==pm&&(ut=d.relatedTarget||d.fromElement)&&(st(ut)||ut[Be]))break e;if((ie||ae)&&(ae=ue.window===ue?ue:(ae=ue.ownerDocument)?ae.defaultView||ae.parentWindow:window,ie?(ut=d.relatedTarget||d.toElement,ie=ne,ut=ut?st(ut):null,ut!==null&&(tn=o(ut),it=ut.tag,ut!==tn||it!==5&&it!==27&&it!==6)&&(ut=null)):(ie=null,ut=ne),ie!==ut)){if(it=h1,fe="onMouseLeave",W="onMouseEnter",q="mouse",(i==="pointerout"||i==="pointerover")&&(it=m1,fe="onPointerLeave",W="onPointerEnter",q="pointer"),tn=ie==null?ae:Wt(ie),te=ut==null?ae:Wt(ut),ae=new it(fe,q+"leave",ie,d,ue),ae.target=tn,ae.relatedTarget=te,fe=null,st(ue)===ne&&(it=new it(W,q+"enter",ut,d,ue),it.target=te,it.relatedTarget=tn,fe=it),tn=fe,ie&&ut)t:{for(it=ie,W=ut,q=0,te=it;te;te=Ll(te))q++;for(te=0,fe=W;fe;fe=Ll(fe))te++;for(;0<q-te;)it=Ll(it),q--;for(;0<te-q;)W=Ll(W),te--;for(;q--;){if(it===W||W!==null&&it===W.alternate)break t;it=Ll(it),W=Ll(W)}it=null}else it=null;ie!==null&&aj(pe,ae,ie,it,!1),ut!==null&&tn!==null&&aj(pe,tn,ut,it,!0)}}e:{if(ae=ne?Wt(ne):window,ie=ae.nodeName&&ae.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ae.type==="file")var Fe=j1;else if(S1(ae))if(C1)Fe=M4;else{Fe=N4;var Ct=P4}else ie=ae.nodeName,!ie||ie.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&hm(ne.elementType)&&(Fe=j1):Fe=O4;if(Fe&&(Fe=Fe(i,ne))){w1(pe,Fe,d,ue);break e}Ct&&Ct(i,ae,ne),i==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&fm(ae,"number",ae.value)}switch(Ct=ne?Wt(ne):window,i){case"focusin":(S1(Ct)||Ct.contentEditable==="true")&&(hl=Ct,Rm=ne,Qc=null);break;case"focusout":Qc=Rm=hl=null;break;case"mousedown":Dm=!0;break;case"contextmenu":case"mouseup":case"dragend":Dm=!1,P1(pe,d,ue);break;case"selectionchange":if(L4)break;case"keydown":case"keyup":P1(pe,d,ue)}var et;if(jm)e:{switch(i){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else fl?x1(i,d)&&(lt="onCompositionEnd"):i==="keydown"&&d.keyCode===229&&(lt="onCompositionStart");lt&&(g1&&d.locale!=="ko"&&(fl||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&fl&&(et=d1()):(lo=ue,ym="value"in lo?lo.value:lo.textContent,fl=!0)),Ct=If(ne,lt),0<Ct.length&&(lt=new p1(lt,i,null,d,ue),pe.push({event:lt,listeners:Ct}),et?lt.data=et:(et=b1(d),et!==null&&(lt.data=et)))),(et=R4?D4(i,d):A4(i,d))&&(lt=If(ne,"onBeforeInput"),0<lt.length&&(Ct=new p1("onBeforeInput","beforeinput",null,d,ue),pe.push({event:Ct,listeners:lt}),Ct.data=et)),xP(pe,i,ne,d,ue)}nj(pe,l)})}function Su(i,l,d){return{instance:i,listener:l,currentTarget:d}}function If(i,l){for(var d=l+"Capture",h=[];i!==null;){var x=i,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=$c(i,d),x!=null&&h.unshift(Su(i,x,w)),x=$c(i,l),x!=null&&h.push(Su(i,x,w))),i.tag===3)return h;i=i.return}return[]}function Ll(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function aj(i,l,d,h,x){for(var w=l._reactName,_=[];d!==null&&d!==h;){var N=d,B=N.alternate,ne=N.stateNode;if(N=N.tag,B!==null&&B===h)break;N!==5&&N!==26&&N!==27||ne===null||(B=ne,x?(ne=$c(d,w),ne!=null&&_.unshift(Su(d,ne,B))):x||(ne=$c(d,w),ne!=null&&_.push(Su(d,ne,B)))),d=d.return}_.length!==0&&i.push({event:l,listeners:_})}var jP=/\r\n?/g,CP=/\u0000|\uFFFD/g;function ij(i){return(typeof i=="string"?i:""+i).replace(jP,`
557
- `).replace(CP,"")}function oj(i,l){return l=ij(l),ij(i)===l}function Lf(){}function en(i,l,d,h,x,w){switch(d){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||cl(i,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&cl(i,""+h);break;case"className":vi(i,"class",h);break;case"tabIndex":vi(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":vi(i,d,h);break;case"style":l1(i,h,w);break;case"data":if(l!=="object"){vi(i,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||d!=="href")){i.removeAttribute(d);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(d);break}h=Hd(""+h),i.setAttribute(d,h);break;case"action":case"formAction":if(typeof h=="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"&&en(i,l,"name",x.name,x,null),en(i,l,"formEncType",x.formEncType,x,null),en(i,l,"formMethod",x.formMethod,x,null),en(i,l,"formTarget",x.formTarget,x,null)):(en(i,l,"encType",x.encType,x,null),en(i,l,"method",x.method,x,null),en(i,l,"target",x.target,x,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(d);break}h=Hd(""+h),i.setAttribute(d,h);break;case"onClick":h!=null&&(i.onclick=Lf);break;case"onScroll":h!=null&&Rt("scroll",i);break;case"onScrollEnd":h!=null&&Rt("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=d}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}d=Hd(""+h),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":h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(d,""+h):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":h&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(d,""):i.removeAttribute(d);break;case"capture":case"download":h===!0?i.setAttribute(d,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(d,h):i.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(d,h):i.removeAttribute(d);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(d):i.setAttribute(d,h);break;case"popover":Rt("beforetoggle",i),Rt("toggle",i),Zr(i,"popover",h);break;case"xlinkActuate":jt(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":jt(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":jt(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":jt(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":jt(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":jt(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":jt(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":jt(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":jt(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Zr(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=e4.get(d)||d,Zr(i,d,h))}}function Xg(i,l,d,h,x,w){switch(d){case"style":l1(i,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=d}}break;case"children":typeof h=="string"?cl(i,h):(typeof h=="number"||typeof h=="bigint")&&cl(i,""+h);break;case"onScroll":h!=null&&Rt("scroll",i);break;case"onScrollEnd":h!=null&&Rt("scrollend",i);break;case"onClick":h!=null&&(i.onclick=Lf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ao.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(x=d.endsWith("Capture"),l=d.slice(2,x?d.length-7:void 0),w=i[Ee]||null,w=w!=null?w[d]:null,typeof w=="function"&&i.removeEventListener(l,w,x),typeof h=="function")){typeof w!="function"&&w!==null&&(d in i?i[d]=null:i.hasAttribute(d)&&i.removeAttribute(d)),i.addEventListener(l,h,x);break e}d in i?i[d]=h:h===!0?i.setAttribute(d,""):Zr(i,d,h)}}}function Zn(i,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",i),Rt("load",i);var h=!1,x=!1,w;for(w in d)if(d.hasOwnProperty(w)){var _=d[w];if(_!=null)switch(w){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:en(i,l,w,_,d,null)}}x&&en(i,l,"srcSet",d.srcSet,d,null),h&&en(i,l,"src",d.src,d,null);return;case"input":Rt("invalid",i);var N=w=_=x=null,B=null,ne=null;for(h in d)if(d.hasOwnProperty(h)){var ue=d[h];if(ue!=null)switch(h){case"name":x=ue;break;case"type":_=ue;break;case"checked":B=ue;break;case"defaultChecked":ne=ue;break;case"value":w=ue;break;case"defaultValue":N=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,l));break;default:en(i,l,h,ue,d,null)}}a1(i,w,N,B,ne,_,x,!1),Vd(i);return;case"select":Rt("invalid",i),h=_=w=null;for(x in d)if(d.hasOwnProperty(x)&&(N=d[x],N!=null))switch(x){case"value":w=N;break;case"defaultValue":_=N;break;case"multiple":h=N;default:en(i,l,x,N,d,null)}l=w,d=_,i.multiple=!!h,l!=null?ll(i,!!h,l,!1):d!=null&&ll(i,!!h,d,!0);return;case"textarea":Rt("invalid",i),w=x=h=null;for(_ in d)if(d.hasOwnProperty(_)&&(N=d[_],N!=null))switch(_){case"value":h=N;break;case"defaultValue":x=N;break;case"children":w=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:en(i,l,_,N,d,null)}o1(i,h,x,w),Vd(i);return;case"option":for(B in d)if(d.hasOwnProperty(B)&&(h=d[B],h!=null))switch(B){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:en(i,l,B,h,d,null)}return;case"dialog":Rt("beforetoggle",i),Rt("toggle",i),Rt("cancel",i),Rt("close",i);break;case"iframe":case"object":Rt("load",i);break;case"video":case"audio":for(h=0;h<bu.length;h++)Rt(bu[h],i);break;case"image":Rt("error",i),Rt("load",i);break;case"details":Rt("toggle",i);break;case"embed":case"source":case"link":Rt("error",i),Rt("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(ne in d)if(d.hasOwnProperty(ne)&&(h=d[ne],h!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:en(i,l,ne,h,d,null)}return;default:if(hm(l)){for(ue in d)d.hasOwnProperty(ue)&&(h=d[ue],h!==void 0&&Xg(i,l,ue,h,d,void 0));return}}for(N in d)d.hasOwnProperty(N)&&(h=d[N],h!=null&&en(i,l,N,h,d,null))}function EP(i,l,d,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,w=null,_=null,N=null,B=null,ne=null,ue=null;for(ie in d){var pe=d[ie];if(d.hasOwnProperty(ie)&&pe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":B=pe;default:h.hasOwnProperty(ie)||en(i,l,ie,null,h,pe)}}for(var ae in h){var ie=h[ae];if(pe=d[ae],h.hasOwnProperty(ae)&&(ie!=null||pe!=null))switch(ae){case"type":w=ie;break;case"name":x=ie;break;case"checked":ne=ie;break;case"defaultChecked":ue=ie;break;case"value":_=ie;break;case"defaultValue":N=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,l));break;default:ie!==pe&&en(i,l,ae,ie,h,pe)}}dm(i,_,N,B,ne,ue,w,x);return;case"select":ie=_=N=ae=null;for(w in d)if(B=d[w],d.hasOwnProperty(w)&&B!=null)switch(w){case"value":break;case"multiple":ie=B;default:h.hasOwnProperty(w)||en(i,l,w,null,h,B)}for(x in h)if(w=h[x],B=d[x],h.hasOwnProperty(x)&&(w!=null||B!=null))switch(x){case"value":ae=w;break;case"defaultValue":N=w;break;case"multiple":_=w;default:w!==B&&en(i,l,x,w,h,B)}l=N,d=_,h=ie,ae!=null?ll(i,!!d,ae,!1):!!h!=!!d&&(l!=null?ll(i,!!d,l,!0):ll(i,!!d,d?[]:"",!1));return;case"textarea":ie=ae=null;for(N in d)if(x=d[N],d.hasOwnProperty(N)&&x!=null&&!h.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:en(i,l,N,null,h,x)}for(_ in h)if(x=h[_],w=d[_],h.hasOwnProperty(_)&&(x!=null||w!=null))switch(_){case"value":ae=x;break;case"defaultValue":ie=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&en(i,l,_,x,h,w)}i1(i,ae,ie);return;case"option":for(var ut in d)if(ae=d[ut],d.hasOwnProperty(ut)&&ae!=null&&!h.hasOwnProperty(ut))switch(ut){case"selected":i.selected=!1;break;default:en(i,l,ut,null,h,ae)}for(B in h)if(ae=h[B],ie=d[B],h.hasOwnProperty(B)&&ae!==ie&&(ae!=null||ie!=null))switch(B){case"selected":i.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:en(i,l,B,ae,h,ie)}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 it in d)ae=d[it],d.hasOwnProperty(it)&&ae!=null&&!h.hasOwnProperty(it)&&en(i,l,it,null,h,ae);for(ne in h)if(ae=h[ne],ie=d[ne],h.hasOwnProperty(ne)&&ae!==ie&&(ae!=null||ie!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,l));break;default:en(i,l,ne,ae,h,ie)}return;default:if(hm(l)){for(var tn in d)ae=d[tn],d.hasOwnProperty(tn)&&ae!==void 0&&!h.hasOwnProperty(tn)&&Xg(i,l,tn,void 0,h,ae);for(ue in h)ae=h[ue],ie=d[ue],!h.hasOwnProperty(ue)||ae===ie||ae===void 0&&ie===void 0||Xg(i,l,ue,ae,h,ie);return}}for(var W in d)ae=d[W],d.hasOwnProperty(W)&&ae!=null&&!h.hasOwnProperty(W)&&en(i,l,W,null,h,ae);for(pe in h)ae=h[pe],ie=d[pe],!h.hasOwnProperty(pe)||ae===ie||ae==null&&ie==null||en(i,l,pe,ae,h,ie)}var Zg=null,Jg=null;function zf(i){return i.nodeType===9?i:i.ownerDocument}function sj(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 lj(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 ev(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 tv=null;function TP(){var i=window.event;return i&&i.type==="popstate"?i===tv?!1:(tv=i,!0):(tv=null,!1)}var cj=typeof setTimeout=="function"?setTimeout:void 0,RP=typeof clearTimeout=="function"?clearTimeout:void 0,uj=typeof Promise=="function"?Promise:void 0,DP=typeof queueMicrotask=="function"?queueMicrotask:typeof uj<"u"?function(i){return uj.resolve(null).then(i).catch(AP)}:cj;function AP(i){setTimeout(function(){throw i})}function Eo(i){return i==="head"}function dj(i,l){var d=l,h=0,x=0;do{var w=d.nextSibling;if(i.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(0<h&&8>h){d=h;var _=i.ownerDocument;if(d&1&&wu(_.documentElement),d&2&&wu(_.body),d&4)for(d=_.head,wu(d),_=d.firstChild;_;){var N=_.nextSibling,B=_.nodeName;_[at]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&_.rel.toLowerCase()==="stylesheet"||d.removeChild(_),_=N}}if(x===0){i.removeChild(w),_u(l);return}x--}else d==="$"||d==="$?"||d==="$!"?x++:h=d.charCodeAt(0)-48;else h=0;d=w}while(d);_u(l)}function nv(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":nv(d),Ye(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}i.removeChild(d)}}function _P(i,l,d,h){for(;i.nodeType===1;){var x=d;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[at])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(w=i.getAttribute("rel"),w==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(w!==x.rel||i.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||i.getAttribute("title")!==(x.title==null?null:x.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(x.src==null?null:x.src)||i.getAttribute("type")!==(x.type==null?null:x.type)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=Ra(i.nextSibling),i===null)break}return null}function kP(i,l,d){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!d||(i=Ra(i.nextSibling),i===null))return null;return i}function rv(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function PP(i,l){var d=i.ownerDocument;if(i.data!=="$?"||d.readyState==="complete")l();else{var h=function(){l(),d.removeEventListener("DOMContentLoaded",h)};d.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function Ra(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==="F!"||l==="F")break;if(l==="/$")return null}}return i}var av=null;function fj(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var d=i.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return i;l--}else d==="/$"&&l++}i=i.previousSibling}return null}function hj(i,l,d){switch(l=zf(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 wu(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);Ye(i)}var oa=new Map,pj=new Set;function $f(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var ki=I.d;I.d={f:NP,r:OP,D:MP,C:IP,L:LP,m:zP,X:UP,S:$P,M:BP};function NP(){var i=ki.f(),l=_f();return i||l}function OP(i){var l=Ke(i);l!==null&&l.tag===5&&l.type==="form"?OS(l):ki.r(i)}var zl=typeof document>"u"?null:document;function mj(i,l,d){var h=zl;if(h&&typeof l=="string"&&l){var x=Jr(l);x='link[rel="'+i+'"][href="'+x+'"]',typeof d=="string"&&(x+='[crossorigin="'+d+'"]'),pj.has(x)||(pj.add(x),i={rel:i,crossOrigin:d,href:l},h.querySelector(x)===null&&(l=h.createElement("link"),Zn(l,"link",i),kt(l),h.head.appendChild(l)))}}function MP(i){ki.D(i),mj("dns-prefetch",i,null)}function IP(i,l){ki.C(i,l),mj("preconnect",i,l)}function LP(i,l,d){ki.L(i,l,d);var h=zl;if(h&&i&&l){var x='link[rel="preload"][as="'+Jr(l)+'"]';l==="image"&&d&&d.imageSrcSet?(x+='[imagesrcset="'+Jr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(x+='[imagesizes="'+Jr(d.imageSizes)+'"]')):x+='[href="'+Jr(i)+'"]';var w=x;switch(l){case"style":w=$l(i);break;case"script":w=Ul(i)}oa.has(w)||(i=m({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:i,as:l},d),oa.set(w,i),h.querySelector(x)!==null||l==="style"&&h.querySelector(ju(w))||l==="script"&&h.querySelector(Cu(w))||(l=h.createElement("link"),Zn(l,"link",i),kt(l),h.head.appendChild(l)))}}function zP(i,l){ki.m(i,l);var d=zl;if(d&&i){var h=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+Jr(h)+'"][href="'+Jr(i)+'"]',w=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Ul(i)}if(!oa.has(w)&&(i=m({rel:"modulepreload",href:i},l),oa.set(w,i),d.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Cu(w)))return}h=d.createElement("link"),Zn(h,"link",i),kt(h),d.head.appendChild(h)}}}function $P(i,l,d){ki.S(i,l,d);var h=zl;if(h&&i){var x=dn(h).hoistableStyles,w=$l(i);l=l||"default";var _=x.get(w);if(!_){var N={loading:0,preload:null};if(_=h.querySelector(ju(w)))N.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":l},d),(d=oa.get(w))&&iv(i,d);var B=_=h.createElement("link");kt(B),Zn(B,"link",i),B._p=new Promise(function(ne,ue){B.onload=ne,B.onerror=ue}),B.addEventListener("load",function(){N.loading|=1}),B.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Uf(_,l,h)}_={type:"stylesheet",instance:_,count:1,state:N},x.set(w,_)}}}function UP(i,l){ki.X(i,l);var d=zl;if(d&&i){var h=dn(d).hoistableScripts,x=Ul(i),w=h.get(x);w||(w=d.querySelector(Cu(x)),w||(i=m({src:i,async:!0},l),(l=oa.get(x))&&ov(i,l),w=d.createElement("script"),kt(w),Zn(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function BP(i,l){ki.M(i,l);var d=zl;if(d&&i){var h=dn(d).hoistableScripts,x=Ul(i),w=h.get(x);w||(w=d.querySelector(Cu(x)),w||(i=m({src:i,async:!0,type:"module"},l),(l=oa.get(x))&&ov(i,l),w=d.createElement("script"),kt(w),Zn(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function gj(i,l,d,h){var x=(x=ye.current)?$f(x):null;if(!x)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=$l(d.href),d=dn(x).hoistableStyles,h=d.get(l),h||(h={type:"style",instance:null,count:0,state:null},d.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){i=$l(d.href);var w=dn(x).hoistableStyles,_=w.get(i);if(_||(x=x.ownerDocument||x,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,_),(w=x.querySelector(ju(i)))&&!w._p&&(_.instance=w,_.state.loading=5),oa.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},oa.set(i,d),w||VP(x,i,d,_.state))),l&&h===null)throw Error(r(528,""));return _}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ul(d),d=dn(x).hoistableScripts,h=d.get(l),h||(h={type:"script",instance:null,count:0,state:null},d.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function $l(i){return'href="'+Jr(i)+'"'}function ju(i){return'link[rel="stylesheet"]['+i+"]"}function vj(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function VP(i,l,d,h){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=i.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),Zn(l,"link",d),kt(l),i.head.appendChild(l))}function Ul(i){return'[src="'+Jr(i)+'"]'}function Cu(i){return"script[async]"+i}function yj(i,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var h=i.querySelector('style[data-href~="'+Jr(d.href)+'"]');if(h)return l.instance=h,kt(h),h;var x=m({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),kt(h),Zn(h,"style",x),Uf(h,d.precedence,i),l.instance=h;case"stylesheet":x=$l(d.href);var w=i.querySelector(ju(x));if(w)return l.state.loading|=4,l.instance=w,kt(w),w;h=vj(d),(x=oa.get(x))&&iv(h,x),w=(i.ownerDocument||i).createElement("link"),kt(w);var _=w;return _._p=new Promise(function(N,B){_.onload=N,_.onerror=B}),Zn(w,"link",h),l.state.loading|=4,Uf(w,d.precedence,i),l.instance=w;case"script":return w=Ul(d.src),(x=i.querySelector(Cu(w)))?(l.instance=x,kt(x),x):(h=d,(x=oa.get(w))&&(h=m({},d),ov(h,x)),i=i.ownerDocument||i,x=i.createElement("script"),kt(x),Zn(x,"link",h),i.head.appendChild(x),l.instance=x);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,Uf(h,d.precedence,i));return l.instance}function Uf(i,l,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,w=x,_=0;_<h.length;_++){var N=h[_];if(N.dataset.precedence===l)w=N;else if(w!==x)break}w?w.parentNode.insertBefore(i,w.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(i,l.firstChild))}function iv(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function ov(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Bf=null;function xj(i,l,d){if(Bf===null){var h=new Map,x=Bf=new Map;x.set(d,h)}else x=Bf,h=x.get(d),h||(h=new Map,x.set(d,h));if(h.has(i))return h;for(h.set(i,null),d=d.getElementsByTagName(i),x=0;x<d.length;x++){var w=d[x];if(!(w[at]||w[he]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var _=w.getAttribute(l)||"";_=i+_;var N=h.get(_);N?N.push(w):h.set(_,[w])}}return h}function bj(i,l,d){i=i.ownerDocument||i,i.head.insertBefore(d,l==="title"?i.querySelector("head > title"):null)}function FP(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;switch(l.rel){case"stylesheet":return i=l.disabled,typeof l.precedence=="string"&&i==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Sj(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Eu=null;function HP(){}function qP(i,l,d){if(Eu===null)throw Error(r(475));var h=Eu;if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var x=$l(d.href),w=i.querySelector(ju(x));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(h.count++,h=Vf.bind(h),i.then(h,h)),l.state.loading|=4,l.instance=w,kt(w);return}w=i.ownerDocument||i,d=vj(d),(x=oa.get(x))&&iv(d,x),w=w.createElement("link"),kt(w);var _=w;_._p=new Promise(function(N,B){_.onload=N,_.onerror=B}),Zn(w,"link",d),l.instance=w}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(h.count++,l=Vf.bind(h),i.addEventListener("load",l),i.addEventListener("error",l))}}function GP(){if(Eu===null)throw Error(r(475));var i=Eu;return i.stylesheets&&i.count===0&&sv(i,i.stylesheets),0<i.count?function(l){var d=setTimeout(function(){if(i.stylesheets&&sv(i,i.stylesheets),i.unsuspend){var h=i.unsuspend;i.unsuspend=null,h()}},6e4);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(d)}}:null}function Vf(){if(this.count--,this.count===0){if(this.stylesheets)sv(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Ff=null;function sv(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Ff=new Map,l.forEach(QP,i),Ff=null,Vf.call(i))}function QP(i,l){if(!(l.state.loading&4)){var d=Ff.get(i);if(d)var h=d.get(null);else{d=new Map,Ff.set(i,d);for(var x=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var _=x[w];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(d.set(_.dataset.precedence,_),h=_)}h&&d.set(null,h)}x=l.instance,_=x.getAttribute("data-precedence"),w=d.get(_)||h,w===h&&d.set(null,x),d.set(_,x),this.count++,h=Vf.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),w?w.parentNode.insertBefore(x,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(x,i.firstChild)),l.state.loading|=4}}var Tu={$$typeof:E,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function WP(i,l,d,h,x,w,_,N){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=Fa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fa(0),this.hiddenUpdates=Fa(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function wj(i,l,d,h,x,w,_,N,B,ne,ue,pe){return i=new WP(i,l,d,_,N,B,ne,pe),l=1,w===!0&&(l|=24),w=Lr(3,null,null,l),i.current=w,w.stateNode=i,l=Vm(),l.refCount++,i.pooledCache=l,l.refCount++,w.memoizedState={element:h,isDehydrated:d,cache:l},Gm(w),i}function jj(i){return i?(i=vl,i):vl}function Cj(i,l,d,h,x,w){x=jj(x),h.context===null?h.context=x:h.pendingContext=x,h=fo(l),h.payload={element:d},w=w===void 0?null:w,w!==null&&(h.callback=w),d=ho(i,h,l),d!==null&&(Vr(d,i,l),nu(d,i,l))}function Ej(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var d=i.retryLane;i.retryLane=d!==0&&d<l?d:l}}function lv(i,l){Ej(i,l),(i=i.alternate)&&Ej(i,l)}function Tj(i){if(i.tag===13){var l=gl(i,67108864);l!==null&&Vr(l,i,67108864),lv(i,67108864)}}var Hf=!0;function YP(i,l,d,h){var x=P.T;P.T=null;var w=I.p;try{I.p=2,cv(i,l,d,h)}finally{I.p=w,P.T=x}}function KP(i,l,d,h){var x=P.T;P.T=null;var w=I.p;try{I.p=8,cv(i,l,d,h)}finally{I.p=w,P.T=x}}function cv(i,l,d,h){if(Hf){var x=uv(h);if(x===null)Kg(i,l,h,qf,d),Dj(i,h);else if(ZP(x,i,l,d,h))h.stopPropagation();else if(Dj(i,h),l&4&&-1<XP.indexOf(i)){for(;x!==null;){var w=Ke(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var _=Un(w.pendingLanes);if(_!==0){var N=w;for(N.pendingLanes|=2,N.entangledLanes|=2;_;){var B=1<<31-_t(_);N.entanglements[1]|=B,_&=~B}Wa(w),(Yt&6)===0&&(Df=Ce()+500,xu(0))}}break;case 13:N=gl(w,2),N!==null&&Vr(N,w,2),_f(),lv(w,2)}if(w=uv(h),w===null&&Kg(i,l,h,qf,d),w===x)break;x=w}x!==null&&h.stopPropagation()}else Kg(i,l,h,null,d)}}function uv(i){return i=mm(i),dv(i)}var qf=null;function dv(i){if(qf=null,i=st(i),i!==null){var l=o(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===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return qf=i,null}function Rj(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(Re()){case Ge:return 2;case Te:return 8;case me:case ge:return 32;case ke:return 268435456;default:return 32}default:return 32}}var fv=!1,To=null,Ro=null,Do=null,Ru=new Map,Du=new Map,Ao=[],XP="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 Dj(i,l){switch(i){case"focusin":case"focusout":To=null;break;case"dragenter":case"dragleave":Ro=null;break;case"mouseover":case"mouseout":Do=null;break;case"pointerover":case"pointerout":Ru.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Du.delete(l.pointerId)}}function Au(i,l,d,h,x,w){return i===null||i.nativeEvent!==w?(i={blockedOn:l,domEventName:d,eventSystemFlags:h,nativeEvent:w,targetContainers:[x]},l!==null&&(l=Ke(l),l!==null&&Tj(l)),i):(i.eventSystemFlags|=h,l=i.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),i)}function ZP(i,l,d,h,x){switch(l){case"focusin":return To=Au(To,i,l,d,h,x),!0;case"dragenter":return Ro=Au(Ro,i,l,d,h,x),!0;case"mouseover":return Do=Au(Do,i,l,d,h,x),!0;case"pointerover":var w=x.pointerId;return Ru.set(w,Au(Ru.get(w)||null,i,l,d,h,x)),!0;case"gotpointercapture":return w=x.pointerId,Du.set(w,Au(Du.get(w)||null,i,l,d,h,x)),!0}return!1}function Aj(i){var l=st(i.target);if(l!==null){var d=o(l);if(d!==null){if(l=d.tag,l===13){if(l=c(d),l!==null){i.blockedOn=l,X(i.priority,function(){if(d.tag===13){var h=Br();h=Jo(h);var x=gl(d,h);x!==null&&Vr(x,d,h),lv(d,h)}});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){i.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Gf(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var d=uv(i.nativeEvent);if(d===null){d=i.nativeEvent;var h=new d.constructor(d.type,d);pm=h,d.target.dispatchEvent(h),pm=null}else return l=Ke(d),l!==null&&Tj(l),i.blockedOn=d,!1;l.shift()}return!0}function _j(i,l,d){Gf(i)&&d.delete(l)}function JP(){fv=!1,To!==null&&Gf(To)&&(To=null),Ro!==null&&Gf(Ro)&&(Ro=null),Do!==null&&Gf(Do)&&(Do=null),Ru.forEach(_j),Du.forEach(_j)}function Qf(i,l){i.blockedOn===l&&(i.blockedOn=null,fv||(fv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,JP)))}var Wf=null;function kj(i){Wf!==i&&(Wf=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wf===i&&(Wf=null);for(var l=0;l<i.length;l+=3){var d=i[l],h=i[l+1],x=i[l+2];if(typeof h!="function"){if(dv(h||d)===null)continue;break}var w=Ke(d);w!==null&&(i.splice(l,3),l-=3,dg(w,{pending:!0,data:x,method:d.method,action:h},h,x))}}))}function _u(i){function l(B){return Qf(B,i)}To!==null&&Qf(To,i),Ro!==null&&Qf(Ro,i),Do!==null&&Qf(Do,i),Ru.forEach(l),Du.forEach(l);for(var d=0;d<Ao.length;d++){var h=Ao[d];h.blockedOn===i&&(h.blockedOn=null)}for(;0<Ao.length&&(d=Ao[0],d.blockedOn===null);)Aj(d),d.blockedOn===null&&Ao.shift();if(d=(i.ownerDocument||i).$$reactFormReplay,d!=null)for(h=0;h<d.length;h+=3){var x=d[h],w=d[h+1],_=x[Ee]||null;if(typeof w=="function")_||kj(d);else if(_){var N=null;if(w&&w.hasAttribute("formAction")){if(x=w,_=w[Ee]||null)N=_.formAction;else if(dv(x)!==null)continue}else N=_.action;typeof N=="function"?d[h+1]=N:(d.splice(h,3),h-=3),kj(d)}}}function hv(i){this._internalRoot=i}Yf.prototype.render=hv.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,h=Br();Cj(d,h,i,l,null,null)},Yf.prototype.unmount=hv.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Cj(i.current,2,null,i,null,null),_f(),l[Be]=null}};function Yf(i){this._internalRoot=i}Yf.prototype.unstable_scheduleHydration=function(i){if(i){var l=F();i={blockedOn:null,target:i,priority:l};for(var d=0;d<Ao.length&&l!==0&&l<Ao[d].priority;d++);Ao.splice(d,0,i),d===0&&Aj(i)}};var Pj=t.version;if(Pj!=="19.1.0")throw Error(r(527,Pj,"19.1.0"));I.findDOMNode=function(i){var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(l),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var e3={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kf.isDisabled&&Kf.supportsFiber)try{vt=Kf.inject(e3),ft=Kf}catch{}}return Lu.createRoot=function(i,l){if(!a(i))throw Error(r(299));var d=!1,h="",x=WS,w=YS,_=KS,N=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(_=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(N=l.unstable_transitionCallbacks)),l=wj(i,1,!1,null,null,d,h,x,w,_,N,null),i[Be]=l.current,Yg(i),new hv(l)},Lu.hydrateRoot=function(i,l,d){if(!a(i))throw Error(r(299));var h=!1,x="",w=WS,_=YS,N=KS,B=null,ne=null;return d!=null&&(d.unstable_strictMode===!0&&(h=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(_=d.onCaughtError),d.onRecoverableError!==void 0&&(N=d.onRecoverableError),d.unstable_transitionCallbacks!==void 0&&(B=d.unstable_transitionCallbacks),d.formState!==void 0&&(ne=d.formState)),l=wj(i,1,!0,l,d??null,h,x,w,_,N,B,ne),l.context=jj(null),d=l.current,h=Br(),h=Jo(h),x=fo(h),x.callback=null,ho(d,x,h),d=h,l.current.lanes=d,xr(l,d),Wa(l),i[Be]=l.current,Yg(i),new Yf(l)},Lu.version="19.1.0",Lu}var lT;function AY(){if(lT)return Zv.exports;lT=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(),Zv.exports=DY(),Zv.exports}var _Y=AY(),zu={},cT;function kY(){if(cT)return zu;cT=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.parse=c,zu.serialize=p;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,o=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function c(v,b){const S=new o,j=v.length;if(j<2)return S;const C=(b==null?void 0:b.decode)||m;let R=0;do{const D=v.indexOf("=",R);if(D===-1)break;const E=v.indexOf(";",R),T=E===-1?j:E;if(D>T){R=v.lastIndexOf(";",D-1)+1;continue}const A=u(v,R,D),k=f(v,D,A),M=v.slice(A,k);if(S[M]===void 0){let L=u(v,D+1,T),$=f(v,T,L);const V=C(v.slice(L,$));S[M]=V}R=T+1}while(R<j);return S}function u(v,b,S){do{const j=v.charCodeAt(b);if(j!==32&&j!==9)return b}while(++b<S);return S}function f(v,b,S){for(;b>S;){const j=v.charCodeAt(--b);if(j!==32&&j!==9)return b+1}return S}function p(v,b,S){const j=(S==null?void 0:S.encode)||encodeURIComponent;if(!e.test(v))throw new TypeError(`argument name is invalid: ${v}`);const C=j(b);if(!t.test(C))throw new TypeError(`argument val is invalid: ${b}`);let R=v+"="+C;if(!S)return R;if(S.maxAge!==void 0){if(!Number.isInteger(S.maxAge))throw new TypeError(`option maxAge is invalid: ${S.maxAge}`);R+="; Max-Age="+S.maxAge}if(S.domain){if(!n.test(S.domain))throw new TypeError(`option domain is invalid: ${S.domain}`);R+="; Domain="+S.domain}if(S.path){if(!r.test(S.path))throw new TypeError(`option path is invalid: ${S.path}`);R+="; Path="+S.path}if(S.expires){if(!g(S.expires)||!Number.isFinite(S.expires.valueOf()))throw new TypeError(`option expires is invalid: ${S.expires}`);R+="; Expires="+S.expires.toUTCString()}if(S.httpOnly&&(R+="; HttpOnly"),S.secure&&(R+="; Secure"),S.partitioned&&(R+="; Partitioned"),S.priority)switch(typeof S.priority=="string"?S.priority.toLowerCase():void 0){case"low":R+="; Priority=Low";break;case"medium":R+="; Priority=Medium";break;case"high":R+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${S.priority}`)}if(S.sameSite)switch(typeof S.sameSite=="string"?S.sameSite.toLowerCase():S.sameSite){case!0:case"strict":R+="; SameSite=Strict";break;case"lax":R+="; SameSite=Lax";break;case"none":R+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${S.sameSite}`)}return R}function m(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function g(v){return a.call(v)==="[object Date]"}return zu}kY();/**
558
- * react-router v7.6.2
559
- *
560
- * Copyright (c) Remix Software Inc.
561
- *
562
- * This source code is licensed under the MIT license found in the
563
- * LICENSE.md file in the root directory of this source tree.
564
- *
565
- * @license MIT
566
- */var ok=e=>{throw TypeError(e)},PY=(e,t,n)=>t.has(e)||ok("Cannot "+n),ty=(e,t,n)=>(PY(e,t,"read from private field"),n?n.call(e):t.get(e)),NY=(e,t,n)=>t.has(e)?ok("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),uT="popstate";function OY(e={}){function t(r,a){let{pathname:o,search:c,hash:u}=r.location;return sd("",{pathname:o,search:c,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Fo(a)}return IY(t,n,null,e)}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Mn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function MY(){return Math.random().toString(36).substring(2,10)}function dT(e,t){return{usr:e.state,key:e.key,idx:t}}function sd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?to(t):t,state:n,key:t&&t.key||r||MY()}}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 to(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function IY(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,c=a.history,u="POP",f=null,p=m();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function m(){return(c.state||{idx:null}).idx}function g(){u="POP";let C=m(),R=C==null?null:C-p;p=C,f&&f({action:u,location:j.location,delta:R})}function v(C,R){u="PUSH";let D=sd(j.location,C,R);p=m()+1;let E=dT(D,p),T=j.createHref(D);try{c.pushState(E,"",T)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(T)}o&&f&&f({action:u,location:j.location,delta:1})}function b(C,R){u="REPLACE";let D=sd(j.location,C,R);p=m();let E=dT(D,p),T=j.createHref(D);c.replaceState(E,"",T),o&&f&&f({action:u,location:j.location,delta:0})}function S(C){return sk(C)}let j={get action(){return u},get location(){return e(a,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(uT,g),f=C,()=>{a.removeEventListener(uT,g),f=null}},createHref(C){return t(a,C)},createURL:S,encodeLocation(C){let R=S(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:v,replace:b,go(C){return c.go(C)}};return j}function sk(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xt(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 Hu,fT=class{constructor(e){if(NY(this,Hu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(ty(this,Hu).has(e))return ty(this,Hu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){ty(this,Hu).set(e,t)}};Hu=new WeakMap;var LY=new Set(["lazy","caseSensitive","path","id","index","children"]);function zY(e){return LY.has(e)}var $Y=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function UY(e){return $Y.has(e)}function BY(e){return e.index===!0}function Yh(e,t,n=[],r={}){return e.map((a,o)=>{let c=[...n,String(o)],u=typeof a.id=="string"?a.id:c.join("-");if(xt(a.index!==!0||!a.children,"Cannot specify children on an index route"),xt(!r[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),BY(a)){let f={...a,...t(a),id:u};return r[u]=f,f}else{let f={...a,...t(a),id:u,children:void 0};return r[u]=f,a.children&&(f.children=Yh(a.children,t,c,r)),f}})}function zo(e,t,n="/"){return bh(e,t,n,!1)}function bh(e,t,n,r){let a=typeof t=="string"?to(t):t,o=ga(a.pathname||"/",n);if(o==null)return null;let c=lk(e);FY(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let p=eK(o);u=ZY(c[f],p,r)}return u}function VY(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],handle:n.handle}}function lk(e,t=[],n=[],r=""){let a=(o,c,u)=>{let f={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};f.relativePath.startsWith("/")&&(xt(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length));let p=oi([r,f.relativePath]),m=n.concat(f);o.children&&o.children.length>0&&(xt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),lk(o.children,t,m,p)),!(o.path==null&&!o.index)&&t.push({path:p,score:KY(p,o.index),routesMeta:m})};return e.forEach((o,c)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,c);else for(let f of ck(o.path))a(o,c,f)}),t}function ck(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let c=ck(r.join("/")),u=[];return u.push(...c.map(f=>f===""?o:[o,f].join("/"))),a&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function FY(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:XY(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var HY=/^:[\w-]+$/,qY=3,GY=2,QY=1,WY=10,YY=-2,hT=e=>e==="*";function KY(e,t){let n=e.split("/"),r=n.length;return n.some(hT)&&(r+=YY),t&&(r+=GY),n.filter(a=>!hT(a)).reduce((a,o)=>a+(HY.test(o)?qY:o===""?QY:WY),r)}function XY(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function ZY(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],p=u===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",g=Kh({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),v=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=Kh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(a,g.params),c.push({params:a,pathname:oi([o,g.pathname]),pathnameBase:rK(oi([o,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(o=oi([o,g.pathnameBase]))}return c}function Kh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=JY(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],c=o.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},v)=>{if(m==="*"){let S=u[v]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const b=u[v];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:o,pathnameBase:c,pattern:e}}function JY(e,t=!1,n=!0){Mn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function eK(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Mn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ga(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 tK(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?to(e):e;return{pathname:n?n.startsWith("/")?n:nK(n,t):t,search:aK(r),hash:iK(a)}}function nK(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function ny(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 uk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function $b(e){let t=uk(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Ub(e,t,n,r=!1){let a;typeof e=="string"?a=to(e):(a={...e},xt(!a.pathname||!a.pathname.includes("?"),ny("?","pathname","search",a)),xt(!a.pathname||!a.pathname.includes("#"),ny("#","pathname","hash",a)),xt(!a.search||!a.search.includes("#"),ny("#","search","hash",a)));let o=e===""||a.pathname==="",c=o?"/":a.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),g-=1;a.pathname=v.join("/")}u=g>=0?t[g]:"/"}let f=tK(a,u),p=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var oi=e=>e.join("/").replace(/\/\/+/g,"/"),rK=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),aK=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iK=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Xh=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ld(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var dk=["POST","PUT","PATCH","DELETE"],oK=new Set(dk),sK=["GET",...dk],lK=new Set(sK),cK=new Set([301,302,303,307,308]),uK=new Set([307,308]),ry={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},dK={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$u={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Bb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fK=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),fk="remix-router-transitions",hk=Symbol("ResetLoaderData");function hK(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";xt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||fK,o={},c=Yh(e.routes,a,void 0,o),u,f=e.basename||"/",p=e.dataStrategy||yK,m={unstable_middleware:!1,...e.future},g=null,v=new Set,b=null,S=null,j=null,C=e.hydrationData!=null,R=zo(c,e.history.location,f),D=!1,E=null,T;if(R==null&&!e.patchRoutesOnNavigation){let F=ca(404,{pathname:e.history.location.pathname}),{matches:X,route:re}=ET(c);T=!0,R=X,E={[re.id]:F}}else if(R&&!e.hydrationData&&gi(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(F=>F.route.lazy))T=!1;else if(!R.some(F=>F.route.loader))T=!0;else{let F=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let re=R.findIndex(he=>X[he.route.id]!==void 0);T=R.slice(0,re+1).every(he=>!Wy(he.route,F,X))}else T=R.every(re=>!Wy(re.route,F,X))}else{T=!1,R=[];let F=gi(null,c,e.history.location.pathname);F.active&&F.matches&&(D=!0,R=F.matches)}let A,k={historyAction:e.history.action,location:e.history.location,matches:R,initialized:T,navigation:ry,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},M="POP",L=!1,$,V=!1,Y=new Map,Q=null,J=!1,G=!1,Z=new Set,P=new Map,I=0,z=-1,H=new Map,O=new Set,U=new Map,K=new Map,ee=new Set,be=new Map,xe,ye=null;function qe(){if(g=e.history.listen(({action:F,location:X,delta:re})=>{if(xe){xe(),xe=void 0;return}Mn(be.size===0||re!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let he=sl({currentLocation:k.location,nextLocation:X,historyAction:F});if(he&&re!=null){let Ee=new Promise(Be=>{xe=Be});e.history.go(re*-1),Kr(he,{state:"blocked",location:X,proceed(){Kr(he,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),Ee.then(()=>e.history.go(re))},reset(){let Be=new Map(k.blockers);Be.set(he,$u),Ae({blockers:Be})}});return}return mt(F,X)}),n){AK(t,Y);let F=()=>_K(t,Y);t.addEventListener("pagehide",F),Q=()=>t.removeEventListener("pagehide",F)}return k.initialized||mt("POP",k.location,{initialHydration:!0}),A}function Ne(){g&&g(),Q&&Q(),v.clear(),$&&$.abort(),k.fetchers.forEach((F,X)=>_t(X)),k.blockers.forEach((F,X)=>wa(X))}function tt(F){return v.add(F),()=>v.delete(F)}function Ae(F,X={}){k={...k,...F};let re=[],he=[];k.fetchers.forEach((Ee,Be)=>{Ee.state==="idle"&&(ee.has(Be)?re.push(Be):he.push(Be))}),ee.forEach(Ee=>{!k.fetchers.has(Ee)&&!P.has(Ee)&&re.push(Ee)}),[...v].forEach(Ee=>Ee(k,{deletedFetchers:re,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),re.forEach(Ee=>_t(Ee)),he.forEach(Ee=>k.fetchers.delete(Ee))}function gt(F,X,{flushSync:re}={}){var Je,at;let he=k.actionData!=null&&k.navigation.formMethod!=null&&qr(k.navigation.formMethod)&&k.navigation.state==="loading"&&((Je=F.state)==null?void 0:Je._isRedirect)!==!0,Ee;X.actionData?Object.keys(X.actionData).length>0?Ee=X.actionData:Ee=null:he?Ee=k.actionData:Ee=null;let Be=X.loaderData?jT(k.loaderData,X.loaderData,X.matches||[],X.errors):k.loaderData,nt=k.blockers;nt.size>0&&(nt=new Map(nt),nt.forEach((Ye,st)=>nt.set(st,$u)));let Ue=L===!0||k.navigation.formMethod!=null&&qr(k.navigation.formMethod)&&((at=F.state)==null?void 0:at._isRedirect)!==!0;u&&(c=u,u=void 0),J||M==="POP"||(M==="PUSH"?e.history.push(F,F.state):M==="REPLACE"&&e.history.replace(F,F.state));let Ze;if(M==="POP"){let Ye=Y.get(k.location.pathname);Ye&&Ye.has(F.pathname)?Ze={currentLocation:k.location,nextLocation:F}:Y.has(F.pathname)&&(Ze={currentLocation:F,nextLocation:k.location})}else if(V){let Ye=Y.get(k.location.pathname);Ye?Ye.add(F.pathname):(Ye=new Set([F.pathname]),Y.set(k.location.pathname,Ye)),Ze={currentLocation:k.location,nextLocation:F}}Ae({...X,actionData:Ee,loaderData:Be,historyAction:M,location:F,initialized:!0,navigation:ry,revalidation:"idle",restoreScrollPosition:qn(F,X.matches||k.matches),preventScrollReset:Ue,blockers:nt},{viewTransitionOpts:Ze,flushSync:re===!0}),M="POP",L=!1,V=!1,J=!1,G=!1,ye==null||ye.resolve(),ye=null}async function Mt(F,X){if(typeof F=="number"){e.history.go(F);return}let re=Qy(k.location,k.matches,f,F,X==null?void 0:X.fromRouteId,X==null?void 0:X.relative),{path:he,submission:Ee,error:Be}=pT(!1,re,X),nt=k.location,Ue=sd(k.location,he,X&&X.state);Ue={...Ue,...e.history.encodeLocation(Ue)};let Ze=X&&X.replace!=null?X.replace:void 0,Je="PUSH";Ze===!0?Je="REPLACE":Ze===!1||Ee!=null&&qr(Ee.formMethod)&&Ee.formAction===k.location.pathname+k.location.search&&(Je="REPLACE");let at=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,Ye=(X&&X.flushSync)===!0,st=sl({currentLocation:nt,nextLocation:Ue,historyAction:Je});if(st){Kr(st,{state:"blocked",location:Ue,proceed(){Kr(st,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),Mt(F,X)},reset(){let Ke=new Map(k.blockers);Ke.set(st,$u),Ae({blockers:Ke})}});return}await mt(Je,Ue,{submission:Ee,pendingError:Be,preventScrollReset:at,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:Ye})}function It(){ye||(ye=kK()),$e(),Ae({revalidation:"loading"});let F=ye.promise;return k.navigation.state==="submitting"?F:k.navigation.state==="idle"?(mt(k.historyAction,k.location,{startUninterruptedRevalidation:!0}),F):(mt(M||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:V===!0}),F)}async function mt(F,X,re){$&&$.abort(),$=null,M=F,J=(re&&re.startUninterruptedRevalidation)===!0,xr(k.location,k.matches),L=(re&&re.preventScrollReset)===!0,V=(re&&re.enableViewTransition)===!0;let he=u||c,Ee=re&&re.overrideNavigation,Be=re!=null&&re.initialHydration&&k.matches&&k.matches.length>0&&!D?k.matches:zo(he,X,f),nt=(re&&re.flushSync)===!0;if(Be&&k.initialized&&!G&&CK(k.location,X)&&!(re&&re.submission&&qr(re.submission.formMethod))){gt(X,{matches:Be},{flushSync:nt});return}let Ue=gi(Be,he,X.pathname);if(Ue.active&&Ue.matches&&(Be=Ue.matches),!Be){let{error:dn,notFoundMatches:kt,route:Et}=mi(X.pathname);gt(X,{matches:kt,loaderData:{},errors:{[Et.id]:dn}},{flushSync:nt});return}$=new AbortController;let Ze=ec(e.history,X,$.signal,re&&re.submission),Je=new fT(e.unstable_getContext?await e.unstable_getContext():void 0),at;if(re&&re.pendingError)at=[Es(Be).route.id,{type:"error",error:re.pendingError}];else if(re&&re.submission&&qr(re.submission.formMethod)){let dn=await Dt(Ze,X,re.submission,Be,Je,Ue.active,re&&re.initialHydration===!0,{replace:re.replace,flushSync:nt});if(dn.shortCircuited)return;if(dn.pendingActionResult){let[kt,Et]=dn.pendingActionResult;if(Hr(Et)&&ld(Et.error)&&Et.error.status===404){$=null,gt(X,{matches:dn.matches,loaderData:{},errors:{[kt]:Et.error}});return}}Be=dn.matches||Be,at=dn.pendingActionResult,Ee=ay(X,re.submission),nt=!1,Ue.active=!1,Ze=ec(e.history,Ze.url,Ze.signal)}let{shortCircuited:Ye,matches:st,loaderData:Ke,errors:Wt}=await nn(Ze,X,Be,Je,Ue.active,Ee,re&&re.submission,re&&re.fetcherSubmission,re&&re.replace,re&&re.initialHydration===!0,nt,at);Ye||($=null,gt(X,{matches:st||Be,...CT(at),loaderData:Ke,errors:Wt}))}async function Dt(F,X,re,he,Ee,Be,nt,Ue={}){$e();let Ze=RK(X,re);if(Ae({navigation:Ze},{flushSync:Ue.flushSync===!0}),Be){let Ye=await ro(he,X.pathname,F.signal);if(Ye.type==="aborted")return{shortCircuited:!0};if(Ye.type==="error"){let st=Es(Ye.partialMatches).route.id;return{matches:Ye.partialMatches,pendingActionResult:[st,{type:"error",error:Ye.error}]}}else if(Ye.matches)he=Ye.matches;else{let{notFoundMatches:st,error:Ke,route:Wt}=mi(X.pathname);return{matches:st,pendingActionResult:[Wt.id,{type:"error",error:Ke}]}}}let Je,at=qu(he,X);if(!at.route.action&&!at.route.lazy)Je={type:"error",error:ca(405,{method:F.method,pathname:X.pathname,routeId:at.route.id})};else{let Ye=sc(a,o,F,he,at,nt?[]:r,Ee),st=await ke(F,Ye,Ee,null);if(Je=st[at.route.id],!Je){for(let Ke of he)if(st[Ke.route.id]){Je=st[Ke.route.id];break}}if(F.signal.aborted)return{shortCircuited:!0}}if(Ns(Je)){let Ye;return Ue&&Ue.replace!=null?Ye=Ue.replace:Ye=bT(Je.response.headers.get("Location"),new URL(F.url),f)===k.location.pathname+k.location.search,await ge(F,Je,!0,{submission:re,replace:Ye}),{shortCircuited:!0}}if(Hr(Je)){let Ye=Es(he,at.route.id);return(Ue&&Ue.replace)!==!0&&(M="PUSH"),{matches:he,pendingActionResult:[Ye.route.id,Je,at.route.id]}}return{matches:he,pendingActionResult:[at.route.id,Je]}}async function nn(F,X,re,he,Ee,Be,nt,Ue,Ze,Je,at,Ye){let st=Be||ay(X,nt),Ke=nt||Ue||RT(st),Wt=!J&&!Je;if(Ee){if(Wt){let nr=Ce(Ye);Ae({navigation:st,...nr!==void 0?{actionData:nr}:{}},{flushSync:at})}let jt=await ro(re,X.pathname,F.signal);if(jt.type==="aborted")return{shortCircuited:!0};if(jt.type==="error"){let nr=Es(jt.partialMatches).route.id;return{matches:jt.partialMatches,loaderData:{},errors:{[nr]:jt.error}}}else if(jt.matches)re=jt.matches;else{let{error:nr,notFoundMatches:ja,route:Ca}=mi(X.pathname);return{matches:ja,loaderData:{},errors:{[Ca.id]:nr}}}}let dn=u||c,{dsMatches:kt,revalidatingFetchers:Et}=mT(F,he,a,o,e.history,k,re,Ke,X,Je?[]:r,Je===!0,G,Z,ee,U,O,dn,f,e.patchRoutesOnNavigation!=null,Ye);if(z=++I,!e.dataStrategy&&!kt.some(jt=>jt.shouldLoad)&&Et.length===0){let jt=Sa();return gt(X,{matches:re,loaderData:{},errors:Ye&&Hr(Ye[1])?{[Ye[0]]:Ye[1].error}:null,...CT(Ye),...jt?{fetchers:new Map(k.fetchers)}:{}},{flushSync:at}),{shortCircuited:!0}}if(Wt){let jt={};if(!Ee){jt.navigation=st;let nr=Ce(Ye);nr!==void 0&&(jt.actionData=nr)}Et.length>0&&(jt.fetchers=Re(Et)),Ae(jt,{flushSync:at})}Et.forEach(jt=>{wt(jt.key),jt.controller&&P.set(jt.key,jt.controller)});let ao=()=>Et.forEach(jt=>wt(jt.key));$&&$.signal.addEventListener("abort",ao);let{loaderResults:cr,fetcherResults:Xr}=await Se(kt,Et,F,he);if(F.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",ao),Et.forEach(jt=>P.delete(jt.key));let br=lh(cr);if(br)return await ge(F,br.result,!0,{replace:Ze}),{shortCircuited:!0};if(br=lh(Xr),br)return O.add(br.key),await ge(F,br.result,!0,{replace:Ze}),{shortCircuited:!0};let{loaderData:io,errors:oo}=wT(k,re,cr,Ye,Et,Xr);Je&&k.errors&&(oo={...k.errors,...oo});let Lc=Sa(),Zr=pi(z),vi=Lc||Zr||Et.length>0;return{matches:re,loaderData:io,errors:oo,...vi?{fetchers:new Map(k.fetchers)}:{}}}function Ce(F){if(F&&!Hr(F[1]))return{[F[0]]:F[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function Re(F){return F.forEach(X=>{let re=k.fetchers.get(X.key),he=Uu(void 0,re?re.data:void 0);k.fetchers.set(X.key,he)}),new Map(k.fetchers)}async function Ge(F,X,re,he){wt(F);let Ee=(he&&he.flushSync)===!0,Be=u||c,nt=Qy(k.location,k.matches,f,re,X,he==null?void 0:he.relative),Ue=zo(Be,nt,f),Ze=gi(Ue,Be,nt);if(Ze.active&&Ze.matches&&(Ue=Ze.matches),!Ue){ft(F,X,ca(404,{pathname:nt}),{flushSync:Ee});return}let{path:Je,submission:at,error:Ye}=pT(!0,nt,he);if(Ye){ft(F,X,Ye,{flushSync:Ee});return}let st=qu(Ue,Je),Ke=new fT(e.unstable_getContext?await e.unstable_getContext():void 0),Wt=(he&&he.preventScrollReset)===!0;if(at&&qr(at.formMethod)){await Te(F,X,Je,st,Ue,Ke,Ze.active,Ee,Wt,at);return}U.set(F,{routeId:X,path:Je}),await me(F,X,Je,st,Ue,Ke,Ze.active,Ee,Wt,at)}async function Te(F,X,re,he,Ee,Be,nt,Ue,Ze,Je){$e(),U.delete(F);function at(xn){if(!xn.route.action&&!xn.route.lazy){let so=ca(405,{method:Je.formMethod,pathname:re,routeId:X});return ft(F,X,so,{flushSync:Ue}),!0}return!1}if(!nt&&at(he))return;let Ye=k.fetchers.get(F);vt(F,DK(Je,Ye),{flushSync:Ue});let st=new AbortController,Ke=ec(e.history,re,st.signal,Je);if(nt){let xn=await ro(Ee,re,Ke.signal,F);if(xn.type==="aborted")return;if(xn.type==="error"){ft(F,X,xn.error,{flushSync:Ue});return}else if(xn.matches){if(Ee=xn.matches,he=qu(Ee,re),at(he))return}else{ft(F,X,ca(404,{pathname:re}),{flushSync:Ue});return}}P.set(F,st);let Wt=I,dn=sc(a,o,Ke,Ee,he,r,Be),Et=(await ke(Ke,dn,Be,F))[he.route.id];if(Ke.signal.aborted){P.get(F)===st&&P.delete(F);return}if(ee.has(F)){if(Ns(Et)||Hr(Et)){vt(F,No(void 0));return}}else{if(Ns(Et))if(P.delete(F),z>Wt){vt(F,No(void 0));return}else return O.add(F),vt(F,Uu(Je)),ge(Ke,Et,!1,{fetcherSubmission:Je,preventScrollReset:Ze});if(Hr(Et)){ft(F,X,Et.error);return}}let ao=k.navigation.location||k.location,cr=ec(e.history,ao,st.signal),Xr=u||c,br=k.navigation.state!=="idle"?zo(Xr,k.navigation.location,f):k.matches;xt(br,"Didn't find any matches after fetcher action");let io=++I;H.set(F,io);let oo=Uu(Je,Et.data);k.fetchers.set(F,oo);let{dsMatches:Lc,revalidatingFetchers:Zr}=mT(cr,Be,a,o,e.history,k,br,Je,ao,r,!1,G,Z,ee,U,O,Xr,f,e.patchRoutesOnNavigation!=null,[he.route.id,Et]);Zr.filter(xn=>xn.key!==F).forEach(xn=>{let so=xn.key,zc=k.fetchers.get(so),Sr=Uu(void 0,zc?zc.data:void 0);k.fetchers.set(so,Sr),wt(so),xn.controller&&P.set(so,xn.controller)}),Ae({fetchers:new Map(k.fetchers)});let vi=()=>Zr.forEach(xn=>wt(xn.key));st.signal.addEventListener("abort",vi);let{loaderResults:jt,fetcherResults:nr}=await Se(Lc,Zr,cr,Be);if(st.signal.aborted)return;if(st.signal.removeEventListener("abort",vi),H.delete(F),P.delete(F),Zr.forEach(xn=>P.delete(xn.key)),k.fetchers.has(F)){let xn=No(Et.data);k.fetchers.set(F,xn)}let ja=lh(jt);if(ja)return ge(cr,ja.result,!1,{preventScrollReset:Ze});if(ja=lh(nr),ja)return O.add(ja.key),ge(cr,ja.result,!1,{preventScrollReset:Ze});let{loaderData:Ca,errors:ts}=wT(k,br,jt,void 0,Zr,nr);pi(io),k.navigation.state==="loading"&&io>z?(xt(M,"Expected pending action"),$&&$.abort(),gt(k.navigation.location,{matches:br,loaderData:Ca,errors:ts,fetchers:new Map(k.fetchers)})):(Ae({errors:ts,loaderData:jT(k.loaderData,Ca,br,ts),fetchers:new Map(k.fetchers)}),G=!1)}async function me(F,X,re,he,Ee,Be,nt,Ue,Ze,Je){let at=k.fetchers.get(F);vt(F,Uu(Je,at?at.data:void 0),{flushSync:Ue});let Ye=new AbortController,st=ec(e.history,re,Ye.signal);if(nt){let Et=await ro(Ee,re,st.signal,F);if(Et.type==="aborted")return;if(Et.type==="error"){ft(F,X,Et.error,{flushSync:Ue});return}else if(Et.matches)Ee=Et.matches,he=qu(Ee,re);else{ft(F,X,ca(404,{pathname:re}),{flushSync:Ue});return}}P.set(F,Ye);let Ke=I,Wt=sc(a,o,st,Ee,he,r,Be),kt=(await ke(st,Wt,Be,F))[he.route.id];if(P.get(F)===Ye&&P.delete(F),!st.signal.aborted){if(ee.has(F)){vt(F,No(void 0));return}if(Ns(kt))if(z>Ke){vt(F,No(void 0));return}else{O.add(F),await ge(st,kt,!1,{preventScrollReset:Ze});return}if(Hr(kt)){ft(F,X,kt.error);return}vt(F,No(kt.data))}}async function ge(F,X,re,{submission:he,fetcherSubmission:Ee,preventScrollReset:Be,replace:nt}={}){X.response.headers.has("X-Remix-Revalidate")&&(G=!0);let Ue=X.response.headers.get("Location");xt(Ue,"Expected a Location header on the redirect Response"),Ue=bT(Ue,new URL(F.url),f);let Ze=sd(k.location,Ue,{_isRedirect:!0});if(n){let Wt=!1;if(X.response.headers.has("X-Remix-Reload-Document"))Wt=!0;else if(Bb.test(Ue)){const dn=sk(Ue,!0);Wt=dn.origin!==t.location.origin||ga(dn.pathname,f)==null}if(Wt){nt?t.location.replace(Ue):t.location.assign(Ue);return}}$=null;let Je=nt===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:at,formAction:Ye,formEncType:st}=k.navigation;!he&&!Ee&&at&&Ye&&st&&(he=RT(k.navigation));let Ke=he||Ee;if(uK.has(X.response.status)&&Ke&&qr(Ke.formMethod))await mt(Je,Ze,{submission:{...Ke,formAction:Ue},preventScrollReset:Be||L,enableViewTransition:re?V:void 0});else{let Wt=ay(Ze,he);await mt(Je,Ze,{overrideNavigation:Wt,fetcherSubmission:Ee,preventScrollReset:Be||L,enableViewTransition:re?V:void 0})}}async function ke(F,X,re,he){let Ee,Be={};try{Ee=await xK(p,F,X,he,re,!1)}catch(nt){return X.filter(Ue=>Ue.shouldLoad).forEach(Ue=>{Be[Ue.route.id]={type:"error",error:nt}}),Be}if(F.signal.aborted)return Be;for(let[nt,Ue]of Object.entries(Ee))if(EK(Ue)){let Ze=Ue.result;Be[nt]={type:"redirect",response:wK(Ze,F,nt,X,f)}}else Be[nt]=await SK(Ue);return Be}async function Se(F,X,re,he){let Ee=ke(re,F,he,null),Be=Promise.all(X.map(async Ze=>{if(Ze.matches&&Ze.match&&Ze.request&&Ze.controller){let at=(await ke(Ze.request,Ze.matches,he,Ze.key))[Ze.match.route.id];return{[Ze.key]:at}}else return Promise.resolve({[Ze.key]:{type:"error",error:ca(404,{pathname:Ze.path})}})})),nt=await Ee,Ue=(await Be).reduce((Ze,Je)=>Object.assign(Ze,Je),{});return{loaderResults:nt,fetcherResults:Ue}}function $e(){G=!0,U.forEach((F,X)=>{P.has(X)&&Z.add(X),wt(X)})}function vt(F,X,re={}){k.fetchers.set(F,X),Ae({fetchers:new Map(k.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function ft(F,X,re,he={}){let Ee=Es(k.matches,X);_t(F),Ae({errors:{[Ee.route.id]:re},fetchers:new Map(k.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function Gt(F){return K.set(F,(K.get(F)||0)+1),ee.has(F)&&ee.delete(F),k.fetchers.get(F)||dK}function _t(F){let X=k.fetchers.get(F);P.has(F)&&!(X&&X.state==="loading"&&H.has(F))&&wt(F),U.delete(F),H.delete(F),O.delete(F),ee.delete(F),Z.delete(F),k.fetchers.delete(F)}function un(F){let X=(K.get(F)||0)-1;X<=0?(K.delete(F),ee.add(F)):K.set(F,X),Ae({fetchers:new Map(k.fetchers)})}function wt(F){let X=P.get(F);X&&(X.abort(),P.delete(F))}function Va(F){for(let X of F){let re=Gt(X),he=No(re.data);k.fetchers.set(X,he)}}function Sa(){let F=[],X=!1;for(let re of O){let he=k.fetchers.get(re);xt(he,`Expected fetcher: ${re}`),he.state==="loading"&&(O.delete(re),F.push(re),X=!0)}return Va(F),X}function pi(F){let X=[];for(let[re,he]of H)if(he<F){let Ee=k.fetchers.get(re);xt(Ee,`Expected fetcher: ${re}`),Ee.state==="loading"&&(wt(re),H.delete(re),X.push(re))}return Va(X),X.length>0}function Un(F,X){let re=k.blockers.get(F)||$u;return be.get(F)!==X&&be.set(F,X),re}function wa(F){k.blockers.delete(F),be.delete(F)}function Kr(F,X){let re=k.blockers.get(F)||$u;xt(re.state==="unblocked"&&X.state==="blocked"||re.state==="blocked"&&X.state==="blocked"||re.state==="blocked"&&X.state==="proceeding"||re.state==="blocked"&&X.state==="unblocked"||re.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${re.state} -> ${X.state}`);let he=new Map(k.blockers);he.set(F,X),Ae({blockers:he})}function sl({currentLocation:F,nextLocation:X,historyAction:re}){if(be.size===0)return;be.size>1&&Mn(!1,"A router only supports one blocker at a time");let he=Array.from(be.entries()),[Ee,Be]=he[he.length-1],nt=k.blockers.get(Ee);if(!(nt&&nt.state==="proceeding")&&Be({currentLocation:F,nextLocation:X,historyAction:re}))return Ee}function mi(F){let X=ca(404,{pathname:F}),re=u||c,{matches:he,route:Ee}=ET(re);return{notFoundMatches:he,route:Ee,error:X}}function no(F,X,re){if(b=F,j=X,S=re||null,!C&&k.navigation===ry){C=!0;let he=qn(k.location,k.matches);he!=null&&Ae({restoreScrollPosition:he})}return()=>{b=null,j=null,S=null}}function Fa(F,X){return S&&S(F,X.map(he=>VY(he,k.loaderData)))||F.key}function xr(F,X){if(b&&j){let re=Fa(F,X);b[re]=j()}}function qn(F,X){if(b){let re=Fa(F,X),he=b[re];if(typeof he=="number")return he}return null}function gi(F,X,re){if(e.patchRoutesOnNavigation)if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:bh(X,re,f,!0)}}else return{active:!0,matches:bh(X,re,f,!0)||[]};return{active:!1,matches:null}}async function ro(F,X,re,he){if(!e.patchRoutesOnNavigation)return{type:"success",matches:F};let Ee=F;for(;;){let Be=u==null,nt=u||c,Ue=o;try{await e.patchRoutesOnNavigation({signal:re,path:X,matches:Ee,fetcherKey:he,patch:(at,Ye)=>{re.aborted||gT(at,Ye,nt,Ue,a)}})}catch(at){return{type:"error",error:at,partialMatches:Ee}}finally{Be&&!re.aborted&&(c=[...c])}if(re.aborted)return{type:"aborted"};let Ze=zo(nt,X,f);if(Ze)return{type:"success",matches:Ze};let Je=bh(nt,X,f,!0);if(!Je||Ee.length===Je.length&&Ee.every((at,Ye)=>at.route.id===Je[Ye].route.id))return{type:"success",matches:null};Ee=Je}}function Jo(F){o={},u=Yh(F,a,void 0,o)}function es(F,X){let re=u==null;gT(F,X,u||c,o,a),re&&(c=[...c],Ae({}))}return A={get basename(){return f},get future(){return m},get state(){return k},get routes(){return c},get window(){return t},initialize:qe,subscribe:tt,enableScrollRestoration:no,navigate:Mt,fetch:Ge,revalidate:It,createHref:F=>e.history.createHref(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:Gt,deleteFetcher:un,dispose:Ne,getBlocker:Un,deleteBlocker:wa,patchRoutes:es,_internalFetchControllers:P,_internalSetRoutes:Jo},A}function pK(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Qy(e,t,n,r,a,o){let c,u;if(a){c=[];for(let p of t)if(c.push(p),p.route.id===a){u=p;break}}else c=t,u=t[t.length-1];let f=Ub(r||".",$b(c),ga(e.pathname,n)||e.pathname,o==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let p=Vb(f.search);if(u.route.index&&!p)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&p){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let v=m.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=f.pathname==="/"?n:oi([n,f.pathname])),Fo(f)}function pT(e,t,n){if(!n||!pK(n))return{path:t};if(n.formMethod&&!TK(n.formMethod))return{path:t,error:ca(405,{method:n.formMethod})};let r=()=>({path:t,error:ca(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),c=xk(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!qr(o))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[b,S])=>`${v}${b}=${S}
567
- `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!qr(o))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}xt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=Ky(n.formData),f=n.formData;else if(n.body instanceof FormData)u=Ky(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=ST(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=ST(u)}catch{return r()}let p={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(qr(p.formMethod))return{path:t,submission:p};let m=to(t);return e&&m.search&&Vb(m.search)&&u.append("index",""),m.search=`?${u}`,{path:Fo(m),submission:p}}function mT(e,t,n,r,a,o,c,u,f,p,m,g,v,b,S,j,C,R,D,E){var J;let T=E?Hr(E[1])?E[1].error:E[1].data:void 0,A=a.createURL(o.location),k=a.createURL(f),M;if(m&&o.errors){let G=Object.keys(o.errors)[0];M=c.findIndex(Z=>Z.route.id===G)}else if(E&&Hr(E[1])){let G=E[0];M=c.findIndex(Z=>Z.route.id===G)-1}let L=E?E[1].statusCode:void 0,$=L&&L>=400,V={currentUrl:A,currentParams:((J=o.matches[0])==null?void 0:J.params)||{},nextUrl:k,nextParams:c[0].params,...u,actionResult:T,actionStatus:L},Y=c.map((G,Z)=>{let{route:P}=G,I=null;if(M!=null&&Z>M?I=!1:P.lazy?I=!0:P.loader==null?I=!1:m?I=Wy(P,o.loaderData,o.errors):mK(o.loaderData,o.matches[Z],G)&&(I=!0),I!==null)return Yy(n,r,e,G,p,t,I);let z=$?!1:g||A.pathname+A.search===k.pathname+k.search||A.search!==k.search||gK(o.matches[Z],G),H={...V,defaultShouldRevalidate:z},O=Zh(G,H);return Yy(n,r,e,G,p,t,O,H)}),Q=[];return S.forEach((G,Z)=>{if(m||!c.some(ee=>ee.route.id===G.routeId)||b.has(Z))return;let P=o.fetchers.get(Z),I=P&&P.state!=="idle"&&P.data===void 0,z=zo(C,G.path,R);if(!z){if(D&&I)return;Q.push({key:Z,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(j.has(Z))return;let H=qu(z,G.path),O=new AbortController,U=ec(a,G.path,O.signal),K=null;if(v.has(Z))v.delete(Z),K=sc(n,r,U,z,H,p,t);else if(I)g&&(K=sc(n,r,U,z,H,p,t));else{let ee={...V,defaultShouldRevalidate:$?!1:g};Zh(H,ee)&&(K=sc(n,r,U,z,H,p,t,ee))}K&&Q.push({key:Z,routeId:G.routeId,path:G.path,matches:K,match:H,request:U,controller:O})}),{dsMatches:Y,revalidatingFetchers:Q}}function Wy(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;return!r&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!a}function mK(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function gK(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Zh(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function gT(e,t,n,r,a){let o;if(e){let f=r[e];xt(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),o=f.children}else o=n;let c=t.filter(f=>!o.some(p=>pk(f,p))),u=Yh(c,a,[e||"_","patch",String((o==null?void 0:o.length)||"0")],r);o.push(...u)}function pk(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var a;return(a=t.children)==null?void 0:a.some(o=>pk(n,o))}):!1}var vT=new WeakMap,mk=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(xt(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let c=vT.get(a);c||(c={},vT.set(a,c));let u=c[e];if(u)return u;let f=(async()=>{let p=zY(e),g=a[e]!==void 0&&e!=="hasErrorBoundary";if(p)Mn(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Mn(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await o();v!=null&&(Object.assign(a,{[e]:v}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(v=>v===void 0)&&(a.lazy=void 0))})();return c[e]=f,f},yT=new WeakMap;function vK(e,t,n,r,a){let o=n[e.id];if(xt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=yT.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{xt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let S in v){let j=v[S];if(j===void 0)continue;let C=UY(S),D=o[S]!==void 0&&S!=="hasErrorBoundary";C?Mn(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):D?Mn(!D,`Route "${o.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):b[S]=j}Object.assign(o,b),Object.assign(o,{...r(o),lazy:void 0})})();return yT.set(o,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let m of c){if(a&&a.includes(m))continue;let g=mk({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),m===t&&(f=g))}let p=u.length>0?Promise.all(u).then(()=>{}):void 0;return p==null||p.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:f}}async function xT(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{n[t[o].route.id]=a}),n}async function yK(e){return e.matches.some(t=>t.route.unstable_middleware)?gk(e,!1,()=>xT(e),(t,n)=>({[n]:{type:"error",result:t}})):xT(e)}async function gk(e,t,n,r){let{matches:a,request:o,params:c,context:u}=e,f={handlerResult:void 0};try{let p=a.flatMap(g=>g.route.unstable_middleware?g.route.unstable_middleware.map(v=>[g.route.id,v]):[]),m=await vk({request:o,params:c,context:u},p,t,f,n);return t?m:f.handlerResult}catch(p){if(!f.middlewareError)throw p;let m=await r(f.middlewareError.error,f.middlewareError.routeId);return f.handlerResult?Object.assign(f.handlerResult,m):m}}async function vk(e,t,n,r,a,o=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason?c.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${c.method} ${c.url}`);let u=t[o];if(!u)return r.handlerResult=await a(),r.handlerResult;let[f,p]=u,m=!1,g,v=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");m=!0,await vk(e,t,n,r,a,o+1)};try{let b=await p({request:e.request,params:e.params,context:e.context},v);return m?b===void 0?g:b:v()}catch(b){throw r.middlewareError?r.middlewareError.error!==b&&(r.middlewareError={routeId:f,error:b}):r.middlewareError={routeId:f,error:b},b}}function yk(e,t,n,r,a){let o=mk({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=vK(r.route,qr(n.method)?"action":"loader",t,e,a);return{middleware:o,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Yy(e,t,n,r,a,o,c,u=null){let f=!1,p=yk(e,t,n,r,a);return{...r,_lazyPromises:p,shouldLoad:c,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler(m){return f=!0,u?typeof m=="boolean"?Zh(r,{...u,defaultShouldRevalidate:m}):Zh(r,u):c},resolve(m){return f||c||m&&n.method==="GET"&&(r.route.lazy||r.route.loader)?bK({request:n,match:r,lazyHandlerPromise:p==null?void 0:p.handler,lazyRoutePromise:p==null?void 0:p.route,handlerOverride:m,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function sc(e,t,n,r,a,o,c,u=null){return r.map(f=>f.route.id!==a.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:yk(e,t,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Yy(e,t,n,f,o,c,!0,u))}async function xK(e,t,n,r,a,o){n.some(p=>{var m;return(m=p._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(p=>{var m;return(m=p._lazyPromises)==null?void 0:m.middleware}));let c={request:t,params:n[0].params,context:a,matches:n},f=await e({...c,fetcherKey:r,unstable_runClientMiddleware:p=>{let m=c;return gk(m,!1,()=>p({...m,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(g,v)=>({[v]:{type:"error",result:g}}))}});try{await Promise.all(n.flatMap(p=>{var m,g;return[(m=p._lazyPromises)==null?void 0:m.handler,(g=p._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function bK({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:a,scopedContext:o}){let c,u,f=qr(e.method),p=f?"action":"loader",m=g=>{let v,b=new Promise((C,R)=>v=R);u=()=>v(),e.signal.addEventListener("abort",u);let S=C=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${p}" [routeId: ${t.route.id}]`)):g({request:e,params:t.params,context:o},...C!==void 0?[C]:[]),j=(async()=>{try{return{type:"data",result:await(a?a(R=>S(R)):S())}}catch(C){return{type:"error",result:C}}})();return Promise.race([j,b])};try{let g=f?t.route.action:t.route.loader;if(n||r)if(g){let v,[b]=await Promise.all([m(g).catch(S=>{v=S}),n,r]);if(v!==void 0)throw v;c=b}else{await n;let v=f?t.route.action:t.route.loader;if(v)[c]=await Promise.all([m(v),r]);else if(p==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw ca(405,{method:e.method,pathname:S,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(g)c=await m(g);else{let v=new URL(e.url),b=v.pathname+v.search;throw ca(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{u&&e.signal.removeEventListener("abort",u)}return c}async function SK(e){var r,a,o,c,u,f;let{result:t,type:n}=e;if(bk(t)){let p;try{let m=t.headers.get("Content-Type");m&&/\bapplication\/json\b/.test(m)?t.body==null?p=null:p=await t.json():p=await t.text()}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new Xh(t.status,t.statusText,p),statusCode:t.status,headers:t.headers}:{type:"data",data:p,statusCode:t.status,headers:t.headers}}return n==="error"?TT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Xh(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:ld(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ld(t)?t.status:void 0}:TT(t)?{type:"data",data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function wK(e,t,n,r,a){let o=e.headers.get("Location");if(xt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Bb.test(o)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);o=Qy(new URL(t.url),c,a,o),e.headers.set("Location",o)}return e}function bT(e,t,n){if(Bb.test(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=ga(a.pathname,n)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function ec(e,t,n,r){let a=e.createURL(xk(t)).toString(),o={signal:n};if(r&&qr(r.formMethod)){let{formMethod:c,formEncType:u}=r;o.method=c.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(r.json)):u==="text/plain"?o.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?o.body=Ky(r.formData):o.body=r.formData}return new Request(a,o)}function Ky(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function ST(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function jK(e,t,n,r=!1,a=!1){let o={},c=null,u,f=!1,p={},m=n&&Hr(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let v=g.route.id,b=t[v];if(xt(!Ns(b),"Cannot handle redirect results in processLoaderData"),Hr(b)){let S=b.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},a)c[v]=S;else{let j=Es(e,v);c[j.route.id]==null&&(c[j.route.id]=S)}r||(o[v]=hk),f||(f=!0,u=ld(b.error)?b.error.status:500),b.headers&&(p[v]=b.headers)}else o[v]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(u=b.statusCode),b.headers&&(p[v]=b.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:c,statusCode:u||200,loaderHeaders:p}}function wT(e,t,n,r,a,o){let{loaderData:c,errors:u}=jK(t,n,r);return a.filter(f=>!f.matches||f.matches.some(p=>p.shouldLoad)).forEach(f=>{let{key:p,match:m,controller:g}=f,v=o[p];if(xt(v,"Did not find corresponding fetcher result"),!(g&&g.signal.aborted))if(Hr(v)){let b=Es(e.matches,m==null?void 0:m.route.id);u&&u[b.route.id]||(u={...u,[b.route.id]:v.error}),e.fetchers.delete(p)}else if(Ns(v))xt(!1,"Unhandled fetcher revalidation redirect");else{let b=No(v.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:u}}function jT(e,t,n,r){let a=Object.entries(t).filter(([,o])=>o!==hk).reduce((o,[c,u])=>(o[c]=u,o),{});for(let o of n){let c=o.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&o.route.loader&&(a[c]=e[c]),r&&r.hasOwnProperty(c))break}return a}function CT(e){return e?Hr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Es(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 ET(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 ca(e,{pathname:t,routeId:n,method:r,type:a,message:o}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="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 Xh(e||500,c,new Error(u),!0)}function lh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(Ns(a))return{key:r,result:a}}}function xk(e){let t=typeof e=="string"?to(e):e;return Fo({...t,hash:""})}function CK(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function EK(e){return bk(e.result)&&cK.has(e.result.status)}function Hr(e){return e.type==="error"}function Ns(e){return(e&&e.type)==="redirect"}function TT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function bk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function TK(e){return lK.has(e.toUpperCase())}function qr(e){return oK.has(e.toUpperCase())}function Vb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function qu(e,t){let n=typeof t=="string"?to(t).search:t.search;if(e[e.length-1].route.index&&Vb(n||""))return e[e.length-1];let r=uk(e);return r[r.length-1]}function RT(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:c}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function ay(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 RK(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 Uu(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 DK(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function No(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function AK(e,t){try{let n=e.sessionStorage.getItem(fk);if(n){let r=JSON.parse(n);for(let[a,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function _K(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(fk,JSON.stringify(n))}catch(r){Mn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function kK(){let e,t,n=new Promise((r,a)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{a(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var al=y.createContext(null);al.displayName="DataRouter";var Ld=y.createContext(null);Ld.displayName="DataRouterState";var Fb=y.createContext({isTransitioning:!1});Fb.displayName="ViewTransition";var Sk=y.createContext(new Map);Sk.displayName="Fetchers";var PK=y.createContext(null);PK.displayName="Await";var hi=y.createContext(null);hi.displayName="Navigation";var zd=y.createContext(null);zd.displayName="Location";var Ba=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ba.displayName="Route";var Hb=y.createContext(null);Hb.displayName="RouteError";function NK(e,{relative:t}={}){xt($d(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(hi),{hash:a,pathname:o,search:c}=Ud(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:oi([n,o])),r.createHref({pathname:u,search:c,hash:a})}function $d(){return y.useContext(zd)!=null}function Mr(){return xt($d(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(zd).location}var wk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function jk(e){y.useContext(hi).static||y.useLayoutEffect(e)}function Rn(){let{isDataRoute:e}=y.useContext(Ba);return e?WK():OK()}function OK(){xt($d(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(al),{basename:t,navigator:n}=y.useContext(hi),{matches:r}=y.useContext(Ba),{pathname:a}=Mr(),o=JSON.stringify($b(r)),c=y.useRef(!1);return jk(()=>{c.current=!0}),y.useCallback((f,p={})=>{if(Mn(c.current,wk),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Ub(f,JSON.parse(o),a,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:oi([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,o,a,e])}var MK=y.createContext(null);function IK(e){let t=y.useContext(Ba).outlet;return t&&y.createElement(MK.Provider,{value:e},t)}function qt(){let{matches:e}=y.useContext(Ba),t=e[e.length-1];return t?t.params:{}}function Ud(e,{relative:t}={}){let{matches:n}=y.useContext(Ba),{pathname:r}=Mr(),a=JSON.stringify($b(n));return y.useMemo(()=>Ub(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function LK(e,t){return Ck(e,t)}function Ck(e,t,n,r){var R;xt($d(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=y.useContext(hi),{matches:o}=y.useContext(Ba),c=o[o.length-1],u=c?c.params:{},f=c?c.pathname:"/",p=c?c.pathnameBase:"/",m=c&&c.route;{let D=m&&m.path||"";Ek(f,!m||D.endsWith("*")||D.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${D}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
568
-
569
- Please change the parent <Route path="${D}"> to <Route path="${D==="/"?"*":`${D}/*`}">.`)}let g=Mr(),v;if(t){let D=typeof t=="string"?to(t):t;xt(p==="/"||((R=D.pathname)==null?void 0:R.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${D.pathname}" was given in the \`location\` prop.`),v=D}else v=g;let b=v.pathname||"/",S=b;if(p!=="/"){let D=p.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(D.length).join("/")}let j=zo(e,{pathname:S});Mn(m||j!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Mn(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=VK(j&&j.map(D=>Object.assign({},D,{params:Object.assign({},u,D.params),pathname:oi([p,a.encodeLocation?a.encodeLocation(D.pathname).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?p:oi([p,a.encodeLocation?a.encodeLocation(D.pathnameBase).pathname:D.pathnameBase])})),o,n,r);return t&&C?y.createElement(zd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},C):C}function zK(){let e=QK(),t=ld(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:o},"ErrorBoundary")," or"," ",y.createElement("code",{style:o},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:a},n):null,c)}var $K=y.createElement(zK,null),UK=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?y.createElement(Ba.Provider,{value:this.props.routeContext},y.createElement(Hb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function BK({routeContext:e,match:t,children:n}){let r=y.useContext(al);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Ba.Provider,{value:e},n)}function VK(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let f=a.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);xt(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,u=-1;if(n)for(let f=0;f<a.length;f++){let p=a[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=f),p.route.id){let{loaderData:m,errors:g}=n,v=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!g||g[p.route.id]===void 0);if(p.route.lazy||v){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((f,p,m)=>{let g,v=!1,b=null,S=null;n&&(g=o&&p.route.id?o[p.route.id]:void 0,b=p.route.errorElement||$K,c&&(u<0&&m===0?(Ek("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,S=null):u===m&&(v=!0,S=p.route.hydrateFallbackElement||null)));let j=t.concat(a.slice(0,m+1)),C=()=>{let R;return g?R=b:v?R=S:p.route.Component?R=y.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=f,y.createElement(BK,{match:p,routeContext:{outlet:f,matches:j,isDataRoute:n!=null},children:R})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?y.createElement(UK,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):C()},null)}function qb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FK(e){let t=y.useContext(al);return xt(t,qb(e)),t}function HK(e){let t=y.useContext(Ld);return xt(t,qb(e)),t}function qK(e){let t=y.useContext(Ba);return xt(t,qb(e)),t}function Gb(e){let t=qK(e),n=t.matches[t.matches.length-1];return xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function GK(){return Gb("useRouteId")}function QK(){var r;let e=y.useContext(Hb),t=HK("useRouteError"),n=Gb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function WK(){let{router:e}=FK("useNavigate"),t=Gb("useNavigate"),n=y.useRef(!1);return jk(()=>{n.current=!0}),y.useCallback(async(a,o={})=>{Mn(n.current,wk),n.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var DT={};function Ek(e,t,n){!t&&!DT[e]&&(DT[e]=!0,Mn(!1,n))}var AT={};function _T(e,t){!e&&!AT[t]&&(AT[t]=!0,console.warn(t))}function YK(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Mn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Mn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Mn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var KK=["HydrateFallback","hydrateFallbackElement"],XK=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 ZK({router:e,flushSync:t}){let[n,r]=y.useState(e.state),[a,o]=y.useState(),[c,u]=y.useState({isTransitioning:!1}),[f,p]=y.useState(),[m,g]=y.useState(),[v,b]=y.useState(),S=y.useRef(new Map),j=y.useCallback((E,{deletedFetchers:T,flushSync:A,viewTransitionOpts:k})=>{E.fetchers.forEach((L,$)=>{L.data!==void 0&&S.current.set($,L.data)}),T.forEach(L=>S.current.delete(L)),_T(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let M=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(_T(k==null||M,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!k||!M){t&&A?t(()=>r(E)):y.startTransition(()=>r(E));return}if(t&&A){t(()=>{m&&(f&&f.resolve(),m.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:k.currentLocation,nextLocation:k.nextLocation})});let L=e.window.document.startViewTransition(()=>{t(()=>r(E))});L.finished.finally(()=>{t(()=>{p(void 0),g(void 0),o(void 0),u({isTransitioning:!1})})}),t(()=>g(L));return}m?(f&&f.resolve(),m.skipTransition(),b({state:E,currentLocation:k.currentLocation,nextLocation:k.nextLocation})):(o(E),u({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}))},[e.window,t,m,f]);y.useLayoutEffect(()=>e.subscribe(j),[e,j]),y.useEffect(()=>{c.isTransitioning&&!c.flushSync&&p(new XK)},[c]),y.useEffect(()=>{if(f&&a&&e.window){let E=a,T=f.promise,A=e.window.document.startViewTransition(async()=>{y.startTransition(()=>r(E)),await T});A.finished.finally(()=>{p(void 0),g(void 0),o(void 0),u({isTransitioning:!1})}),g(A)}},[a,f,e.window]),y.useEffect(()=>{f&&a&&n.location.key===a.location.key&&f.resolve()},[f,m,n.location,a]),y.useEffect(()=>{!c.isTransitioning&&v&&(o(v.state),u({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[c.isTransitioning,v]);let C=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:E=>e.navigate(E),push:(E,T,A)=>e.navigate(E,{state:T,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(E,T,A)=>e.navigate(E,{replace:!0,state:T,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[e]),R=e.basename||"/",D=y.useMemo(()=>({router:e,navigator:C,static:!1,basename:R}),[e,C,R]);return y.createElement(y.Fragment,null,y.createElement(al.Provider,{value:D},y.createElement(Ld.Provider,{value:n},y.createElement(Sk.Provider,{value:S.current},y.createElement(Fb.Provider,{value:c},y.createElement(tX,{basename:R,location:n.location,navigationType:n.historyAction,navigator:C},y.createElement(JK,{routes:e.routes,future:e.future,state:n})))))),null)}var JK=y.memo(eX);function eX({routes:e,future:t,state:n}){return Ck(e,void 0,n,t)}function Qb(e){return IK(e.context)}function He(e){xt(!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 tX({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1}){xt(!$d(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:c,navigator:a,static:o,future:{}}),[c,a,o]);typeof n=="string"&&(n=to(n));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:v="default"}=n,b=y.useMemo(()=>{let S=ga(f,c);return S==null?null:{location:{pathname:S,search:p,hash:m,state:g,key:v},navigationType:r}},[c,f,p,m,g,v,r]);return Mn(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:y.createElement(hi.Provider,{value:u},y.createElement(zd.Provider,{children:t,value:b}))}function nX({children:e,location:t}){return LK(Xy(e),t)}function Xy(e,t=[]){let n=[];return y.Children.forEach(e,(r,a)=>{if(!y.isValidElement(r))return;let o=[...t,a];if(r.type===y.Fragment){n.push.apply(n,Xy(r.props.children,o));return}xt(r.type===He,`[${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>`),xt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=Xy(r.props.children,o)),n.push(c)}),n}var Sh="get",wh="application/x-www-form-urlencoded";function lm(e){return e!=null&&typeof e.tagName=="string"}function rX(e){return lm(e)&&e.tagName.toLowerCase()==="button"}function aX(e){return lm(e)&&e.tagName.toLowerCase()==="form"}function iX(e){return lm(e)&&e.tagName.toLowerCase()==="input"}function oX(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sX(e,t){return e.button===0&&(!t||t==="_self")&&!oX(e)}function Zy(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(a=>[n,a]):[[n,r]])},[]))}function lX(e,t){let n=Zy(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}var ch=null;function cX(){if(ch===null)try{new FormData(document.createElement("form"),0),ch=!1}catch{ch=!0}return ch}var uX=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function iy(e){return e!=null&&!uX.has(e)?(Mn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wh}"`),null):e}function dX(e,t){let n,r,a,o,c;if(aX(e)){let u=e.getAttribute("action");r=u?ga(u,t):null,n=e.getAttribute("method")||Sh,a=iy(e.getAttribute("enctype"))||wh,o=new FormData(e)}else if(rX(e)||iX(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?ga(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Sh,a=iy(e.getAttribute("formenctype"))||iy(u.getAttribute("enctype"))||wh,o=new FormData(u,e),!cX()){let{name:p,type:m,value:g}=e;if(m==="image"){let v=p?`${p}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else p&&o.append(p,g)}}else{if(lm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Sh,r=null,a=wh,c=e}return o&&a==="text/plain"&&(c=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:c}}function Wb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function fX(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 hX(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 pX(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let c=await fX(o,n);return c.links?c.links():[]}return[]}));return yX(r.flat(1).filter(hX).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function kT(e,t,n,r,a,o){let c=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,u=(f,p)=>{var m;return n[p].pathname!==f.pathname||((m=n[p].route.path)==null?void 0:m.endsWith("*"))&&n[p].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,p)=>c(f,p)||u(f,p)):o==="data"?t.filter((f,p)=>{var g;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,p)||u(f,p))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function mX(e,t,{includeHydrateFallback:n}={}){return gX(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function gX(e){return[...new Set(e)]}function vX(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function yX(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(vX(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var xX=new Set([100,101,204,205]);function bX(e,t){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&ga(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function Tk(){let e=y.useContext(al);return Wb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function SX(){let e=y.useContext(Ld);return Wb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yb=y.createContext(void 0);Yb.displayName="FrameworkContext";function Rk(){let e=y.useContext(Yb);return Wb(e,"You must render this element inside a <HydratedRouter> element"),e}function wX(e,t){let n=y.useContext(Yb),[r,a]=y.useState(!1),[o,c]=y.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,v=y.useRef(null);y.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=R=>{R.forEach(D=>{c(D.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[e]),y.useEffect(()=>{if(r){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[r]);let b=()=>{a(!0)},S=()=>{a(!1),c(!1)};return n?e!=="intent"?[o,v,{}]:[o,v,{onFocus:Bu(u,b),onBlur:Bu(f,S),onMouseEnter:Bu(p,b),onMouseLeave:Bu(m,S),onTouchStart:Bu(g,b)}]:[!1,v,{}]}function Bu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function jX({page:e,...t}){let{router:n}=Tk(),r=y.useMemo(()=>zo(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(EX,{page:e,matches:r,...t}):null}function CX(e){let{manifest:t,routeModules:n}=Rk(),[r,a]=y.useState([]);return y.useEffect(()=>{let o=!1;return pX(e,t,n).then(c=>{o||a(c)}),()=>{o=!0}},[e,t,n]),r}function EX({page:e,matches:t,...n}){let r=Mr(),{manifest:a,routeModules:o}=Rk(),{basename:c}=Tk(),{loaderData:u,matches:f}=SX(),p=y.useMemo(()=>kT(e,t,f,a,r,"data"),[e,t,f,a,r]),m=y.useMemo(()=>kT(e,t,f,a,r,"assets"),[e,t,f,a,r]),g=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,j=!1;if(t.forEach(R=>{var E;let D=a.routes[R.route.id];!D||!D.hasLoader||(!p.some(T=>T.route.id===R.route.id)&&R.route.id in u&&((E=o[R.route.id])!=null&&E.shouldRevalidate)||D.hasClientLoader?j=!0:S.add(R.route.id))}),S.size===0)return[];let C=bX(e,c);return j&&S.size>0&&C.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[c,u,r,a,p,t,e,o]),v=y.useMemo(()=>mX(m,a),[m,a]),b=CX(m);return y.createElement(y.Fragment,null,g.map(S=>y.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),v.map(S=>y.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),b.map(({key:S,link:j})=>y.createElement("link",{key:S,...j})))}function TX(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Dk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Dk&&(window.__reactRouterVersion="7.6.2")}catch{}function RX(e,t){return hK({basename:t==null?void 0:t.basename,unstable_getContext:t==null?void 0:t.unstable_getContext,future:t==null?void 0:t.future,history:OY({window:t==null?void 0:t.window}),hydrationData:DX(),routes:e,mapRouteProperties:YK,hydrationRouteProperties:KK,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function DX(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:AX(e.errors)}),e}function AX(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new Xh(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let c=new o(a.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}var Ak=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_k=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:c,state:u,target:f,to:p,preventScrollReset:m,viewTransition:g,...v},b){let{basename:S}=y.useContext(hi),j=typeof p=="string"&&Ak.test(p),C,R=!1;if(typeof p=="string"&&j&&(C=p,Dk))try{let $=new URL(window.location.href),V=p.startsWith("//")?new URL($.protocol+p):new URL(p),Y=ga(V.pathname,S);V.origin===$.origin&&Y!=null?p=Y+V.search+V.hash:R=!0}catch{Mn(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let D=NK(p,{relative:a}),[E,T,A]=wX(r,v),k=NX(p,{replace:c,state:u,target:f,preventScrollReset:m,relative:a,viewTransition:g});function M($){t&&t($),$.defaultPrevented||k($)}let L=y.createElement("a",{...v,...A,href:C||D,onClick:R||o?t:M,ref:TX(b,T),target:f,"data-discover":!j&&n==="render"?"true":void 0});return E&&!j?y.createElement(y.Fragment,null,L,y.createElement(jX,{page:D})):L});_k.displayName="Link";var _X=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:c,viewTransition:u,children:f,...p},m){let g=Ud(c,{relative:p.relative}),v=Mr(),b=y.useContext(Ld),{navigator:S,basename:j}=y.useContext(hi),C=b!=null&&zX(g)&&u===!0,R=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,D=v.pathname,E=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(D=D.toLowerCase(),E=E?E.toLowerCase():null,R=R.toLowerCase()),E&&j&&(E=ga(E,j)||E);const T=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=D===R||!a&&D.startsWith(R)&&D.charAt(T)==="/",k=E!=null&&(E===R||!a&&E.startsWith(R)&&E.charAt(R.length)==="/"),M={isActive:A,isPending:k,isTransitioning:C},L=A?t:void 0,$;typeof r=="function"?$=r(M):$=[r,A?"active":null,k?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let V=typeof o=="function"?o(M):o;return y.createElement(_k,{...p,"aria-current":L,className:$,ref:m,style:V,to:c,viewTransition:u},typeof f=="function"?f(M):f)});_X.displayName="NavLink";var kX=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:c=Sh,action:u,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...v},b)=>{let S=IX(),j=LX(u,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&Ak.test(u),D=E=>{if(f&&f(E),E.defaultPrevented)return;E.preventDefault();let T=E.nativeEvent.submitter,A=(T==null?void 0:T.getAttribute("formmethod"))||c;S(T||E.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:a,state:o,relative:p,preventScrollReset:m,viewTransition:g})};return y.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:D,...v,"data-discover":!R&&e==="render"?"true":void 0})});kX.displayName="Form";function PX(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kk(e){let t=y.useContext(al);return xt(t,PX(e)),t}function NX(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:o,viewTransition:c}={}){let u=Rn(),f=Mr(),p=Ud(e,{relative:o});return y.useCallback(m=>{if(sX(m,t)){m.preventDefault();let g=n!==void 0?n:Fo(f)===Fo(p);u(e,{replace:g,state:r,preventScrollReset:a,relative:o,viewTransition:c})}},[f,u,p,n,r,t,e,a,o,c])}function Kb(e){Mn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(Zy(e)),n=y.useRef(!1),r=Mr(),a=y.useMemo(()=>lX(r.search,n.current?null:t.current),[r.search]),o=Rn(),c=y.useCallback((u,f)=>{const p=Zy(typeof u=="function"?u(a):u);n.current=!0,o("?"+p,f)},[o,a]);return[a,c]}var OX=0,MX=()=>`__${String(++OX)}__`;function IX(){let{router:e}=kk("useSubmit"),{basename:t}=y.useContext(hi),n=GK();return y.useCallback(async(r,a={})=>{let{action:o,method:c,encType:u,formData:f,body:p}=dX(r,t);if(a.navigate===!1){let m=a.fetcherKey||MX();await e.fetch(m,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||c,formEncType:a.encType||u,flushSync:a.flushSync})}else await e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||c,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function LX(e,{relative:t}={}){let{basename:n}=y.useContext(hi),r=y.useContext(Ba);xt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...Ud(e||".",{relative:t})},c=Mr();if(e==null){o.search=c.search;let u=new URLSearchParams(o.search),f=u.getAll("index");if(f.some(m=>m==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let m=u.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:oi([n,o.pathname])),Fo(o)}function zX(e,t={}){let n=y.useContext(Fb);xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=kk("useViewTransitionState"),a=Ud(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=ga(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ga(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Kh(a.pathname,c)!=null||Kh(a.pathname,o)!=null}[...xX];const $X=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function bc(e,t,n){const r=UX(e),{webkitRelativePath:a}=e,o=typeof t=="string"?t:typeof a=="string"&&a.length>0?a:`./${e.name}`;return typeof r.path!="string"&&PT(r,"path",o),PT(r,"relativePath",o),r}function UX(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),a=$X.get(r);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}function PT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var il=(e,t,n)=>new Promise((r,a)=>{var o=f=>{try{u(n.next(f))}catch(p){a(p)}},c=f=>{try{u(n.throw(f))}catch(p){a(p)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,c);u((n=n.apply(e,t)).next())});const BX=[".DS_Store","Thumbs.db"];function VX(e){return il(this,null,function*(){return Jh(e)&&FX(e.dataTransfer)?QX(e.dataTransfer,e.type):HX(e)?qX(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?GX(e):[]})}function FX(e){return Jh(e)}function HX(e){return Jh(e)&&Jh(e.target)}function Jh(e){return typeof e=="object"&&e!==null}function qX(e){return Jy(e.target.files).map(t=>bc(t))}function GX(e){return il(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>bc(n))})}function QX(e,t){return il(this,null,function*(){if(e.items){const n=Jy(e.items).filter(a=>a.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(WX));return NT(Pk(r))}return NT(Jy(e.files).map(n=>bc(n)))})}function NT(e){return e.filter(t=>BX.indexOf(t.name)===-1)}function Jy(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 WX(e){if(typeof e.webkitGetAsEntry!="function")return OT(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Nk(t):OT(e,t)}function Pk(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?Pk(n):[n]],[])}function OT(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(o=>il(this,null,function*(){const c=yield o.getFile();return c.handle=o,bc(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const a=bc(r,(n=t==null?void 0:t.fullPath)!=null?n:void 0);return Promise.resolve(a)}function YX(e){return il(this,null,function*(){return e.isDirectory?Nk(e):KX(e)})}function Nk(e){const t=e.createReader();return new Promise((n,r)=>{const a=[];function o(){t.readEntries(c=>il(this,null,function*(){if(c.length){const u=Promise.all(c.map(YX));a.push(u),o()}else try{const u=yield Promise.all(a);n(u)}catch(u){r(u)}}),c=>{r(c)})}o()})}function KX(e){return il(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const a=bc(r,e.fullPath);t(a)},r=>{n(r)})})})}function oy(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",a=(e.type||"").toLowerCase(),o=a.replace(/\/.*$/,"");return n.some(c=>{const u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):a===u})}return!0}var XX=Object.defineProperty,ZX=Object.defineProperties,JX=Object.getOwnPropertyDescriptors,MT=Object.getOwnPropertySymbols,eZ=Object.prototype.hasOwnProperty,tZ=Object.prototype.propertyIsEnumerable,IT=(e,t,n)=>t in e?XX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nZ=(e,t)=>{for(var n in t||(t={}))eZ.call(t,n)&&IT(e,n,t[n]);if(MT)for(var n of MT(t))tZ.call(t,n)&&IT(e,n,t[n]);return e},rZ=(e,t)=>ZX(e,JX(t));const aZ=typeof oy=="function"?oy:oy.default,iZ="file-invalid-type",oZ="file-too-large",sZ="file-too-small",lZ="too-many-files",cZ=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:iZ,message:`File type must be ${n}`}},LT=e=>({code:oZ,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),zT=e=>({code:sZ,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),uZ={code:lZ,message:"Too many files"};function Ok(e,t){const n=e.type==="application/x-moz-file"||aZ(e,t);return[n,n?null:cZ(t)]}function Mk(e,t,n){if(Ts(e.size))if(Ts(t)&&Ts(n)){if(e.size>n)return[!1,LT(n)];if(e.size<t)return[!1,zT(t)]}else{if(Ts(t)&&e.size<t)return[!1,zT(t)];if(Ts(n)&&e.size>n)return[!1,LT(n)]}return[!0,null]}function Ts(e){return e!=null}function dZ({files:e,accept:t,minSize:n,maxSize:r,multiple:a,maxFiles:o,validator:c}){return!a&&e.length>1||a&&o>=1&&e.length>o?!1:e.every(u=>{const[f]=Ok(u,t),[p]=Mk(u,n,r),m=c?c(u):null;return f&&p&&!m})}function ep(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function uh(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,t=>t==="Files"||t==="application/x-moz-file"):!!e.target&&!!e.target.files}function $T(e){e.preventDefault()}function fZ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function hZ(e){return e.indexOf("Edge/")!==-1}function pZ(e=window.navigator.userAgent){return fZ(e)||hZ(e)}function Ka(...e){return(t,...n)=>e.some(r=>(!ep(t)&&r&&r(t,...n),ep(t)))}function mZ(){return"showOpenFilePicker"in window}function gZ(e){return Ts(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let a=!0;return Ik(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),a=!1),(!Array.isArray(r)||!r.every(Lk))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),a=!1),a}).reduce((n,[r,a])=>rZ(nZ({},n),{[r]:a}),{})}]:e}function vZ(e){if(Ts(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>Ik(t)||Lk(t)).join(",")}function yZ(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function xZ(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Ik(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function Lk(e){return/^.*\.[\w]+$/.test(e)}var bZ=Object.defineProperty,SZ=Object.defineProperties,wZ=Object.getOwnPropertyDescriptors,tp=Object.getOwnPropertySymbols,zk=Object.prototype.hasOwnProperty,$k=Object.prototype.propertyIsEnumerable,UT=(e,t,n)=>t in e?bZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t)=>{for(var n in t||(t={}))zk.call(t,n)&&UT(e,n,t[n]);if(tp)for(var n of tp(t))$k.call(t,n)&&UT(e,n,t[n]);return e},Io=(e,t)=>SZ(e,wZ(t)),np=(e,t)=>{var n={};for(var r in e)zk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tp)for(var r of tp(e))t.indexOf(r)<0&&$k.call(e,r)&&(n[r]=e[r]);return n};const Xb=y.forwardRef((e,t)=>{var n=e,{children:r}=n,a=np(n,["children"]);const o=Bk(a),{open:c}=o,u=np(o,["open"]);return y.useImperativeHandle(t,()=>({open:c}),[c]),Cn.createElement(y.Fragment,null,r(Io(hr({},u),{open:c})))});Xb.displayName="Dropzone";const Uk={disabled:!1,getFilesFromEvent:VX,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};Xb.defaultProps=Uk;Xb.propTypes={children:an.func,accept:an.objectOf(an.arrayOf(an.string)),multiple:an.bool,preventDropOnDocument:an.bool,noClick:an.bool,noKeyboard:an.bool,noDrag:an.bool,noDragEventsBubbling:an.bool,minSize:an.number,maxSize:an.number,maxFiles:an.number,disabled:an.bool,getFilesFromEvent:an.func,onFileDialogCancel:an.func,onFileDialogOpen:an.func,useFsAccessApi:an.bool,autoFocus:an.bool,onDragEnter:an.func,onDragLeave:an.func,onDragOver:an.func,onDrop:an.func,onDropAccepted:an.func,onDropRejected:an.func,onError:an.func,validator:an.func};const ex={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Bk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:a,minSize:o,multiple:c,maxFiles:u,onDragEnter:f,onDragLeave:p,onDragOver:m,onDrop:g,onDropAccepted:v,onDropRejected:b,onFileDialogCancel:S,onFileDialogOpen:j,useFsAccessApi:C,autoFocus:R,preventDropOnDocument:D,noClick:E,noKeyboard:T,noDrag:A,noDragEventsBubbling:k,onError:M,validator:L}=hr(hr({},Uk),e),$=y.useMemo(()=>vZ(t),[t]),V=y.useMemo(()=>gZ(t),[t]),Y=y.useMemo(()=>typeof j=="function"?j:BT,[j]),Q=y.useMemo(()=>typeof S=="function"?S:BT,[S]),J=y.useRef(null),G=y.useRef(null),[Z,P]=y.useReducer(jZ,ex),{isFocused:I,isFileDialogActive:z}=Z,H=y.useRef(typeof window<"u"&&window.isSecureContext&&C&&mZ()),O=()=>{!H.current&&z&&setTimeout(()=>{if(G.current){const{files:me}=G.current;me.length||(P({type:"closeDialog"}),Q())}},300)};y.useEffect(()=>(window.addEventListener("focus",O,!1),()=>{window.removeEventListener("focus",O,!1)}),[G,z,Q,H]);const U=y.useRef([]),K=me=>{J.current&&J.current.contains(me.target)||(me.preventDefault(),U.current=[])};y.useEffect(()=>(D&&(document.addEventListener("dragover",$T,!1),document.addEventListener("drop",K,!1)),()=>{D&&(document.removeEventListener("dragover",$T),document.removeEventListener("drop",K))}),[J,D]),y.useEffect(()=>(!n&&R&&J.current&&J.current.focus(),()=>{}),[J,R,n]);const ee=y.useCallback(me=>{M?M(me):console.error(me)},[M]),be=y.useCallback(me=>{me.preventDefault(),me.persist(),Ce(me),U.current=[...U.current,me.target],uh(me)&&Promise.resolve(r(me)).then(ge=>{if(ep(me)&&!k)return;const ke=ge.length,Se=ke>0&&dZ({files:ge,accept:$,minSize:o,maxSize:a,multiple:c,maxFiles:u,validator:L}),$e=ke>0&&!Se;P({isDragAccept:Se,isDragReject:$e,isDragActive:!0,type:"setDraggedFiles"}),f&&f(me)}).catch(ge=>ee(ge))},[r,f,ee,k,$,o,a,c,u,L]),xe=y.useCallback(me=>{me.preventDefault(),me.persist(),Ce(me);const ge=uh(me);if(ge&&me.dataTransfer)try{me.dataTransfer.dropEffect="copy"}catch{}return ge&&m&&m(me),!1},[m,k]),ye=y.useCallback(me=>{me.preventDefault(),me.persist(),Ce(me);const ge=U.current.filter(Se=>J.current&&J.current.contains(Se)),ke=ge.indexOf(me.target);ke!==-1&&ge.splice(ke,1),U.current=ge,!(ge.length>0)&&(P({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(me)&&p&&p(me))},[J,p,k]),qe=y.useCallback((me,ge)=>{const ke=[],Se=[];me.forEach($e=>{const[vt,ft]=Ok($e,$),[Gt,_t]=Mk($e,o,a),un=L?L($e):null;if(vt&&Gt&&!un)ke.push($e);else{let wt=[ft,_t];un&&(wt=wt.concat(un)),Se.push({file:$e,errors:wt.filter(Va=>Va)})}}),(!c&&ke.length>1||c&&u>=1&&ke.length>u)&&(ke.forEach($e=>{Se.push({file:$e,errors:[uZ]})}),ke.splice(0)),P({acceptedFiles:ke,fileRejections:Se,isDragReject:Se.length>0,type:"setFiles"}),g&&g(ke,Se,ge),Se.length>0&&b&&b(Se,ge),ke.length>0&&v&&v(ke,ge)},[P,c,$,o,a,u,g,v,b,L]),Ne=y.useCallback(me=>{me.preventDefault(),me.persist(),Ce(me),U.current=[],uh(me)&&Promise.resolve(r(me)).then(ge=>{ep(me)&&!k||qe(ge,me)}).catch(ge=>ee(ge)),P({type:"reset"})},[r,qe,ee,k]),tt=y.useCallback(()=>{if(H.current){P({type:"openDialog"}),Y();const me={multiple:c,types:V};window.showOpenFilePicker(me).then(ge=>r(ge)).then(ge=>{qe(ge,null),P({type:"closeDialog"})}).catch(ge=>{yZ(ge)?(Q(ge),P({type:"closeDialog"})):xZ(ge)?(H.current=!1,G.current?(G.current.value=null,G.current.click()):ee(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ee(ge)});return}G.current&&(P({type:"openDialog"}),Y(),G.current.value=null,G.current.click())},[P,Y,Q,C,qe,ee,V,c]),Ae=y.useCallback(me=>{!J.current||!J.current.isEqualNode(me.target)||(me.key===" "||me.key==="Enter"||me.keyCode===32||me.keyCode===13)&&(me.preventDefault(),tt())},[J,tt]),gt=y.useCallback(()=>{P({type:"focus"})},[]),Mt=y.useCallback(()=>{P({type:"blur"})},[]),It=y.useCallback(()=>{E||(pZ()?setTimeout(tt,0):tt())},[E,tt]),mt=me=>n?null:me,Dt=me=>T?null:mt(me),nn=me=>A?null:mt(me),Ce=me=>{k&&me.stopPropagation()},Re=y.useMemo(()=>(me={})=>{var ge=me,{refKey:ke="ref",role:Se,onKeyDown:$e,onFocus:vt,onBlur:ft,onClick:Gt,onDragEnter:_t,onDragOver:un,onDragLeave:wt,onDrop:Va}=ge,Sa=np(ge,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return hr(hr({onKeyDown:Dt(Ka($e,Ae)),onFocus:Dt(Ka(vt,gt)),onBlur:Dt(Ka(ft,Mt)),onClick:mt(Ka(Gt,It)),onDragEnter:nn(Ka(_t,be)),onDragOver:nn(Ka(un,xe)),onDragLeave:nn(Ka(wt,ye)),onDrop:nn(Ka(Va,Ne)),role:typeof Se=="string"&&Se!==""?Se:"presentation",[ke]:J},!n&&!T?{tabIndex:0}:{}),Sa)},[J,Ae,gt,Mt,It,be,xe,ye,Ne,T,A,n]),Ge=y.useCallback(me=>{me.stopPropagation()},[]),Te=y.useMemo(()=>(me={})=>{var ge=me,{refKey:ke="ref",onChange:Se,onClick:$e}=ge,vt=np(ge,["refKey","onChange","onClick"]);const ft={accept:$,multiple:c,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:mt(Ka(Se,Ne)),onClick:mt(Ka($e,Ge)),tabIndex:-1,[ke]:G};return hr(hr({},ft),vt)},[G,t,c,Ne,n]);return Io(hr({},Z),{isFocused:I&&!n,getRootProps:Re,getInputProps:Te,rootRef:J,inputRef:G,open:mt(tt)})}function jZ(e,t){switch(t.type){case"focus":return Io(hr({},e),{isFocused:!0});case"blur":return Io(hr({},e),{isFocused:!1});case"openDialog":return Io(hr({},ex),{isFileDialogActive:!0});case"closeDialog":return Io(hr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Io(hr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Io(hr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return hr({},ex);default:return e}}function BT(){}const[CZ,EZ]=vr("Dropzone component was not found in tree");function Zb(e){const t=n=>{const{children:r,...a}=se(`Dropzone${Fj(e)}`,{},n),o=EZ(),c=Fi(r)?r:s.jsx("span",{children:r});return o[e]?y.cloneElement(c,a):null};return t.displayName=`@mantine/dropzone/${Fj(e)}`,t}const TZ=Zb("accept"),RZ=Zb("reject"),DZ=Zb("idle");var cd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const AZ={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},_Z=(e,{radius:t,variant:n,acceptColor:r,rejectColor:a})=>{const o=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:a||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Vt(t),"--dropzone-accept-color":o.color,"--dropzone-accept-bg":o.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},Xo=ve((e,t)=>{const n=se("Dropzone",AZ,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,radius:p,disabled:m,loading:g,multiple:v,maxSize:b,accept:S,children:j,onDropAny:C,onDrop:R,onReject:D,openRef:E,name:T,maxFiles:A,autoFocus:k,activateOnClick:M,activateOnDrag:L,dragEventsBubbling:$,activateOnKeyboard:V,onDragEnter:Y,onDragLeave:Q,onDragOver:J,onFileDialogCancel:G,onFileDialogOpen:Z,preventDropOnDocument:P,useFsAccessApi:I,getFilesFromEvent:z,validator:H,rejectColor:O,acceptColor:U,enablePointerEvents:K,loaderProps:ee,inputProps:be,mod:xe,...ye}=n,qe=Ie({name:"Dropzone",classes:cd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:_Z}),{getRootProps:Ne,getInputProps:tt,isDragAccept:Ae,isDragReject:gt,isDragActive:Mt,open:It}=Bk({onDrop:C,onDropAccepted:R,onDropRejected:D,disabled:m||g,accept:Array.isArray(S)?S.reduce((Ce,Re)=>({...Ce,[Re]:[]}),{}):S,multiple:v,maxSize:b,maxFiles:A,autoFocus:k,noClick:!M,noDrag:!L,noDragEventsBubbling:!$,noKeyboard:!V,onDragEnter:Y,onDragLeave:Q,onDragOver:J,onFileDialogCancel:G,onFileDialogOpen:Z,preventDropOnDocument:P,useFsAccessApi:I,validator:H,...z?{getFilesFromEvent:z}:null});Ku(E,It);const mt=Mt&&Ae,Dt=Mt&&gt,nn=!mt&&!Dt;return s.jsx(CZ,{value:{accept:mt,reject:Dt,idle:nn},children:s.jsxs(ce,{...Ne(),...qe("root",{focusable:!0}),...ye,mod:[{accept:mt,reject:Dt,idle:nn,disabled:m,loading:g,"activate-on-click":M},xe],children:[s.jsx(g0,{visible:g,overlayProps:{radius:p},unstyled:u,loaderProps:ee}),s.jsx("input",{...tt(be),name:T}),s.jsx("div",{...qe("inner"),ref:t,"data-enable-pointer-events":K||void 0,children:j})]})})});Xo.classes=cd;Xo.displayName="@mantine/dropzone/Dropzone";Xo.Accept=TZ;Xo.Idle=DZ;Xo.Reject=RZ;const kZ={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Wr("max"),withinPortal:!0},Jb=ve((e,t)=>{const n=se("DropzoneFullScreen",kZ,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,active:p,onDrop:m,onReject:g,zIndex:v,withinPortal:b,portalProps:S,...j}=n,C=Ie({name:"DropzoneFullScreen",classes:cd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"fullScreen"}),{resolvedClassNames:R,resolvedStyles:D}=Ws({classNames:r,styles:c,props:n}),[E,T]=y.useState(0),[A,{open:k,close:M}]=ip(!1),L=V=>{var Y;(Y=V.dataTransfer)!=null&&Y.types.includes("Files")&&(T(Q=>Q+1),k())},$=()=>{T(V=>V-1)};return y.useEffect(()=>{E===0&&M()},[E]),y.useEffect(()=>{if(p)return document.addEventListener("dragenter",L,!1),document.addEventListener("dragleave",$,!1),()=>{document.removeEventListener("dragenter",L,!1),document.removeEventListener("dragleave",$,!1)}},[p]),s.jsx(qo,{...S,withinPortal:b,children:s.jsx(ce,{...C("fullScreen",{style:{opacity:A?1:0,pointerEvents:A?"all":"none",zIndex:v}}),ref:t,children:s.jsx(Xo,{...j,classNames:R,styles:D,unstyled:u,className:cd.dropzone,onDrop:V=>{m==null||m(V),M(),T(0)},onReject:V=>{g==null||g(V),M(),T(0)}})})})});Jb.classes=cd;Jb.displayName="@mantine/dropzone/DropzoneFullScreen";Xo.FullScreen=Jb;const dh=Xo,PZ='{"resourceType": "Bundle"}';function sy({id:e,title:t,message:n,color:r,icon:a,withCloseButton:o=!1,method:c="show",loading:u}){ua[c]({id:e,loading:u,title:t,message:n,color:r,icon:a,withCloseButton:o,autoClose:!1})}function NZ(){const e=Sn(),t=_e(),[n,r]=y.useState({}),a=y.useCallback(async(u,f)=>{const p="batch-upload";sy({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(u);m.type!=="batch"&&m.type!=="transaction"&&(m=OA(m));const g=await t.executeBatch(m);r(v=>({...v,[f]:g})),sy({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(eo,{size:"1rem"}),withCloseButton:!0})}catch(m){sy({id:p,title:"Batch Upload Failed",color:"red",message:Xe(m),method:"update",icon:s.jsx(Fs,{size:"1rem"}),withCloseButton:!0})}},[t]),o=y.useCallback(async u=>{for(const f of u){const p=new FileReader;p.onload=m=>{var g;return a((g=m.target)==null?void 0:g.result,f.name)},p.readAsText(f)}},[a]),c=y.useCallback(async u=>{await a(u.input,"JSON Data")},[a]);return s.jsxs(ot,{children:[s.jsx(Le,{children:"Batch Create"}),s.jsxs(De,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",s.jsx(Pt,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(Lt,{defaultValue:"upload",children:[s.jsxs(Lt.List,{children:[s.jsx(Lt.Tab,{value:"upload",children:"File Upload"}),s.jsx(Lt.Tab,{value:"json",children:"JSON"})]}),s.jsx(Lt.Panel,{value:"upload",pt:"xs",children:s.jsx(dh,{onDrop:o,accept:["application/json"],children:s.jsxs(je,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(dh.Accept,{children:s.jsx(PE,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(dh.Reject,{children:s.jsx(Fs,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(dh.Idle,{children:s.jsx(PE,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(De,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(De,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(Lt.Panel,{value:"json",pt:"xs",children:s.jsxs(pt,{onSubmit:c,children:[s.jsx(Dc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:PZ,deserialize:JSON.parse}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(Lt,{defaultValue:Object.keys(n)[0],children:[s.jsx(Lt.List,{children:Object.keys(n).map(u=>s.jsx(Lt.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>s.jsx(Lt.Panel,{value:u,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{onClick:()=>r({}),children:"Start over"})})]})]})}function OZ(){const{resourceType:e}=qt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(a=>!!a),[r]=xc("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(ot,{children:[s.jsxs(Le,{children:["No apps for ",e]}),s.jsx(bt,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(ot,{children:s.jsx("div",{children:r.map(a=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(bt,{to:`/forms/${a.id}?subject=`+n.map(o=>`${e}/${o}`).join(","),children:a.name})}),s.jsx("p",{children:a.description})]},a.id))})}):s.jsx(ma,{})}function MZ(){const e=_e(),[t,n]=y.useState(),[r,a]=y.useState(!1);return s.jsx(ot,{width:450,children:s.jsxs(pt,{onSubmit:o=>{n(void 0),e.post("auth/changepassword",o).then(()=>a(!0)).catch(c=>n(Zt(c)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Le,{children:"Change password"})]}),!r&&s.jsxs(We,{gap:"xl",mt:"xl",children:[s.jsx(Na,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Nt(t,"oldPassword")}),s.jsx(Na,{name:"newPassword",label:"New password",required:!0,error:Nt(t,"newPassword")}),s.jsx(Na,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Nt(t,"confirmPassword")}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const tx=["Form","JSON","Profiles"],IZ=["Profiles"],ly=tx[0].toLowerCase();function LZ(){const e=Rn(),t=Sn(),{resourceType:n}=qt(),[r,a]=y.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&tx.map(u=>u.toLowerCase()).includes(c)?c:ly});function o(c){var u;c||(c=ly),a(c),(u=e(`/${n}/new/${c}`))==null||u.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(mr,{children:[s.jsxs(De,{p:"md",fw:500,children:["New ",n]}),s.jsx(Yr,{children:s.jsx(Lt,{defaultValue:ly,value:r,onChange:o,children:s.jsx(Lt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:tx.map(c=>s.jsx(Lt.Tab,{value:c.toLowerCase(),px:"md",children:IZ.includes(c)?s.jsxs(je,{gap:"xs",wrap:"nowrap",children:[c,s.jsx(jp,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),s.jsx(Qb,{})]})}function zZ(){return s.jsx(ot,{children:s.jsxs(We,{children:[s.jsx(Le,{order:1,children:"Unexpected Error"}),s.jsx(De,{children:"We're sorry, something went wrong."}),s.jsxs(De,{children:["Please contact ",s.jsx(Pt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function Vk(e){const t=Qt(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(bt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,u){c&&u&&n.push({key:c,value:u})}function a(c){c&&r(c.system,c.value)}function o(c,u){Array.isArray(u)?u.forEach(f=>o(c,f)):typeof u=="string"?r(c,u):u&&(Array.isArray(u.coding)?r(c,u.coding.map(f=>f.display||f.code).join(", ")):r(c,u.text))}if("name"in t){const c=Vi(t);c!==zt(t)&&r("Name",c)}return"category"in t&&o("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&o("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(a):a(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),s.jsx(ht,{children:n.map((c,u)=>s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:c.key}),s.jsx(ht.Value,{children:c.value})]},`${c.key}-${u}`))})}function e1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function $Z(e){var t;if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return(t=e.specimen)==null?void 0:t[0]}function Zo(e){var t;return Us((t=e.getActiveLogin())==null?void 0:t.project)}function UZ(){const{id:e}=qt(),t=Mr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,a=_e(),[o,c]=y.useState(!0),[u,f]=y.useState(),[p,m]=y.useState(),[g,v]=y.useState(),[b,S]=y.useState(),[j,C]=y.useState();if(y.useEffect(()=>{const E={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const T=r.split(",").filter(A=>!!A);T.length===1&&E.entry.push({request:{method:"GET",url:T[0]}}),m(T)}a.executeBatch(E).then(T=>{var A,k,M,L,$,V,Y,Q;((M=(k=(A=T.entry)==null?void 0:A[0])==null?void 0:k.response)==null?void 0:M.status)!=="200"?S((V=($=(L=T.entry)==null?void 0:L[0])==null?void 0:$.response)==null?void 0:V.outcome):(f((Y=T.entry[0])==null?void 0:Y.resource),v((Q=T.entry[1])==null?void 0:Q.resource)),c(!1)}).catch(T=>{S(T),c(!1)})},[a,e,r]),b)return s.jsx(ot,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return s.jsxs(ot,{children:[s.jsx(Le,{children:u==null?void 0:u.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[j.length===1&&s.jsx("li",{children:s.jsx(bt,{to:j[0],children:"Review your answers"})}),j.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:j.map(E=>s.jsx("li",{children:s.jsx(bt,{to:E,children:zt(E)})},E.id))})]}),g&&s.jsx("li",{children:s.jsxs(bt,{to:g,children:["Back to ",Vi(g)]})}),s.jsx("li",{children:s.jsx(bt,{to:"/",children:"Go back home"})})]})]});if(o||!u)return s.jsx(ma,{});const R=g&&e1(g);return s.jsxs(s.Fragment,{children:[s.jsxs(mr,{shadow:"xs",radius:0,children:[R&&s.jsx($_,{patient:R}),g&&g.resourceType!=="Patient"&&s.jsx(Vk,{resource:g}),s.jsx(ce,{px:"xl",py:"md",children:s.jsxs(De,{children:[Vi(u),p&&p.length>1&&s.jsxs(s.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),s.jsx(ot,{children:s.jsx(nk,{questionnaire:u,subject:g&&on(g),onSubmit:D})})]});async function D(E){const T=[];if(!p||p.length===0)T.push(await a.createResource(E));else for(const A of p)T.push(await a.createResource({...E,subject:{reference:A}}));C(T)}}const BZ="_paper_unw9o_1",VZ={paper:BZ},FZ={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function Fk(e,t){const n=e.resourceType||HZ(t),r=e.fields??qZ(n),a=e.filters??(e.resourceType?void 0:GZ(n)),o=e.sortRules??QZ(n),c=e.offset??0,u=e.count??Qp;return{...e,resourceType:n,fields:r,filters:a,sortRules:o,offset:c,count:u}}function HZ(e){var t,n;return localStorage.getItem("defaultResourceType")??((n=(t=e==null?void 0:e.option)==null?void 0:t.find(r=>r.id==="defaultResourceType"))==null?void 0:n.valueString)??"Patient"}function qZ(e){const t=t1(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AsyncJob":n.push("status","dataVersion");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function GZ(e){var t;return(t=t1(e))==null?void 0:t.filters}function QZ(e){const t=t1(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function t1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function WZ(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function YZ(e,t){const n={...e,count:1e3,offset:0},r=Fk(n,t.getUserConfiguration()),a=await t.search(r.resourceType,tc({...r,total:"accurate",fields:void 0}));return OA(a)}function VT(){const e=_e(),t=Rn(),n=Mr(),[r,a]=y.useState();return y.useEffect(()=>{var u;const o=AA(n.pathname+n.search),c=Fk(o,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===tc(c)?(WZ(c),a(c)):(u=t(`/${c.resourceType}${tc(c)}`))==null||u.catch(console.error)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(ma,{}):s.jsx(mr,{shadow:"xs",m:"md",p:"xs",className:VZ.paper,children:s.jsx(Id,{checkboxesEnabled:!0,search:r,onClick:o=>{var c;return(c=t(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onAuxClick:o=>window.open(`/${o.resource.resourceType}/${o.resource.id}`,"_blank"),onChange:o=>{var c;(c=t(`/${r.resourceType}${tc(o.definition)}`))==null||c.catch(console.error)},onNew:()=>{var o;(o=t(FZ[r.resourceType]??`/${r.resourceType}/new`))==null||o.catch(console.error)},onExportCsv:()=>{const o=e.fhirUrl(r.resourceType,"$csv")+tc(r);e.download(o).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Pe({color:"red",message:Xe(c),autoClose:!1}))},onExportTransactionBundle:async()=>{YZ(r,e).then(o=>t_(JSON.stringify(o,void 0,2))).catch(o=>Pe({color:"red",message:Xe(o),autoClose:!1}))},onDelete:o=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:o.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>a({...r})).catch(c=>Pe({color:"red",message:Xe(c),autoClose:!1})))},onBulk:o=>{var c;(c=t(`/bulk/${r.resourceType}?ids=${o.join(",")}`))==null||c.catch(console.error)}})})}function KZ(){const e=_e(),[t,n]=y.useState(),[r,a]=y.useState(void 0),[o,c]=y.useState(!1),u=y.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),a(m.enrolled)}).catch(m=>Pe({color:"red",message:Xe(m),autoClose:!1}))},[e]);y.useEffect(()=>{u()},[u]);const f=y.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{a(!0),Pe({color:"green",message:"Success"})}).catch(g=>Pe({color:"red",message:Xe(g),autoClose:!1}))},[e]),p=y.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?s.jsxs(ot,{children:[s.jsx($n,{title:"Disable MFA",opened:o,onClose:()=>c(!1),children:s.jsx(f_,{onSubmit:async m=>{await p(m),c(!1),a(!1),Pe({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:s.jsx($V,{})}),u()}})}),s.jsxs(je,{children:[s.jsx(Le,{children:"MFA is enabled"}),s.jsx(Oe,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):s.jsx(ot,{width:400,children:s.jsxs(pt,{onSubmit:f,children:[s.jsx(Le,{children:"Multi Factor Auth Setup"}),s.jsx(er,{children:s.jsx("img",{src:t,alt:"Multi Factor Auth QR Code"})}),s.jsx(ze,{name:"token",label:"Code"}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Oe,{type:"submit",children:"Enroll"})})]})})}const cy={},nx={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:cy==null?void 0:cy.MEDPLUM_AWS_TEXTRACT_ENABLED};function Bd(){return nx}function Hk(){return qk("registerEnabled")}function XZ(){return qk("awsTextractEnabled")}function qk(e){try{return nx[e]!==!1&&nx[e]!=="false"}catch{return!0}}function ZZ(){var g,v;const e=Rn(),[t]=Kb(),n=_e(),r=t.get("scope")||"openid",[a,o]=y.useState(),[c,u]=y.useState(!0),f=t.get("client_id"),p=t.get("login");if(y.useEffect(()=>{if(!f||f==="medplum-cli")return;async function b(){try{const S=await n.get(`/auth/clientinfo/${f}`);o(S)}catch(S){Pe({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Xe(S),withCloseButton:!0})}finally{u(!1)}}b().catch(console.error)},[n,f]),!f)return null;function m(b){const S=new URL(t.get("redirect_uri"));for(const j of["scope","state","nonce"])t.has(j)&&S.searchParams.set(j,t.get(j));S.searchParams.set("code",b),window.location.assign(S.toString())}return s.jsx(h_,{onCode:m,onForgotPassword:()=>{var b;return(b=e("/resetpassword"))==null?void 0:b.catch(console.error)},onRegister:()=>{var b;return(b=e("/register"))==null?void 0:b.catch(console.error)},googleClientId:Bd().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:p||void 0,children:!c&&s.jsxs(s.Fragment,{children:[(g=a==null?void 0:a.logo)!=null&&g.url?s.jsx("img",{src:(v=a==null?void 0:a.logo)==null?void 0:v.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):s.jsx(Ua,{size:32}),s.jsx(Le,{children:(a==null?void 0:a.welcomeString)??"Sign in to Medplum"})]})})}function JZ(){const e=_e(),t=Rn(),n=Bd();return y.useEffect(()=>{var r;e.getProfile()&&((r=t("/signin?project=new"))==null||r.catch(console.error))},[e,t]),Hk()?s.jsxs(wH,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(Ua,{size:32}),s.jsx(Le,{children:"Create a new account"})]}):s.jsx(ot,{width:450,children:s.jsx(Yi,{icon:s.jsx(nl,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function eJ(){const e=Rn(),t=_e(),[n,r]=y.useState(),[a,o]=y.useState(!1),c=Bd().recaptchaSiteKey;return y.useEffect(()=>{u_(c)},[c]),s.jsx(ot,{width:450,children:s.jsxs(pt,{onSubmit:async u=>{let f="";f=await d_(c),t.post("auth/resetpassword",{...u,recaptchaToken:f}).then(()=>o(!0)).catch(p=>r(Zt(p)))},children:[s.jsxs(We,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(Ua,{size:32}),s.jsx(Le,{children:"Medplum Password Reset"})]}),s.jsxs(We,{gap:"xl",children:[s.jsx(ba,{issues:Pd(n,void 0)}),!a&&s.jsxs(s.Fragment,{children:[s.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Nt(n,"email")}),s.jsxs(je,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Pt,{component:"button",type:"button",color:"dimmed",onClick:()=>{var u;return(u=e("/register"))==null?void 0:u.catch(console.error)},size:"xs",children:"Register"}),s.jsx(Oe,{type:"submit",children:"Reset password"})]})]}),a&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function tJ(){var o;const e=Rn(),t=_e(),[n,r]=y.useState();y.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(c=>Pe({color:"red",message:Xe(c),autoClose:!1}))},[t]);function a(c){t.post("auth/revoke",{loginId:c}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Pe({color:"green",message:"Login revoked"})).catch(u=>Pe({color:"red",message:Xe(u),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(ot,{children:[s.jsx(Le,{children:"Security"}),s.jsxs(bb,{children:[s.jsx(Li,{term:"ID",children:s.jsx(Pt,{href:`/${zt(n.profile)}`,children:n.profile.id})}),s.jsx(Li,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(Li,{term:"Name",children:Nc((o=n.profile.name)==null?void 0:o[0])})]})]}),s.jsxs(ot,{children:[s.jsx(Le,{children:"Sessions"}),s.jsxs(Me,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:n.security.sessions.map(c=>s.jsxs("tr",{children:[s.jsx("td",{children:c.os}),s.jsx("td",{children:c.browser}),s.jsx("td",{children:c.remoteAddress}),s.jsx("td",{children:c.authMethod}),s.jsx("td",{children:gr(c.lastUpdated)}),s.jsx("td",{children:s.jsx(Pt,{href:"#",onClick:()=>a(c.id),children:"Revoke"})})]},c.id))})]})]}),s.jsxs(ot,{children:[s.jsx(Le,{children:"Password"}),s.jsx(Oe,{onClick:()=>{var c;return(c=e("/changepassword"))==null?void 0:c.catch(console.error)},children:"Change password"})]}),s.jsxs(ot,{children:[s.jsx(Le,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(Oe,{onClick:()=>{var c;return(c=e("/mfa"))==null?void 0:c.catch(console.error)},children:"Enroll"})]})]}):null}function nJ(){const{id:e,secret:t}=qt(),n=_e(),[r,a]=y.useState(),[o,c]=y.useState(!1),u=Pd(r,void 0);return s.jsxs(ot,{width:450,children:[s.jsx(ba,{issues:u}),s.jsxs(pt,{onSubmit:f=>{if(f.password!==f.confirmPassword){a(ri("Passwords do not match","confirmPassword"));return}a(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>a(Zt(m)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Le,{children:"Set password"})]}),!o&&s.jsxs(We,{children:[s.jsx(Na,{name:"password",label:"New password",required:!0,error:Nt(r,"password")}),s.jsx(Na,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Nt(r,"confirmPassword")}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Oe,{type:"submit",children:"Set password"})})]}),o&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(bt,{to:"/signin",children:"sign in"}),"."]})]})]})}function rJ(){const e=Zp(),t=Rn(),[n]=Kb(),r=Bd(),a=y.useCallback(()=>{var c;const o=n.get("next");(c=t(o!=null&&o.startsWith("/")?o:"/"))==null||c.catch(console.error)},[n,t]);return y.useEffect(()=>{e&&n.has("next")&&a()},[e,n,a]),s.jsxs(h_,{onSuccess:()=>a(),onForgotPassword:()=>{var o;return(o=t("/resetpassword"))==null?void 0:o.catch(console.error)},onRegister:Hk()?()=>{var o;return(o=t("/register"))==null?void 0:o.catch(console.error)}:void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(Ua,{size:32}),s.jsx(Le,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function aJ(){const e=Rn(),t=Mr(),[n,r]=y.useState(),[a,o]=y.useState(),[c,u]=y.useState();return y.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),o(f.query),u(JSON.parse(f.fields))},[t]),!n||!a||!c?null:s.jsx(bQ,{resourceType:n,checkboxesEnabled:!0,query:a,fields:c,onClick:f=>{var p;return(p=e(`/${n}/${f.resource.id}`))==null?void 0:p.catch(console.error)},onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{var p;(p=e(`/bulk/${n}?ids=${f.join(",")}`))==null||p.catch(console.error)}})}function cm(e){const t=_e(),n=Zo(t),r=Rn(),[a,o]=y.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:de.EQUALS,value:"Project/"+n},{code:"profile-type",operator:de.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(Id,{search:a,onClick:c=>{var u;return(u=r(`/admin/members/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})}function iJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Bots"}),s.jsx(cm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function oJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Clients"}),s.jsx(cm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/clients/new",children:"Create new client"})})]})}function um(e){return s.jsx(rl,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{fi(t)?e.onChange(on(t)):e.onChange(void 0)}})}function sJ(){const e=_e(),t=Zo(e),[n,r]=y.useState(""),[a,o]=y.useState(""),[c,u]=y.useState(),[f,p]=y.useState(),[m,g]=y.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Create new Bot"}),s.jsxs(pt,{onSubmit:()=>{const v={name:n,description:a,accessPolicy:c};e.post("admin/projects/"+t+"/bot",v).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),Pe({color:"green",message:"Bot created"})}).catch(b=>{Pe({color:"red",message:Xe(b),autoClose:!1}),p(Zt(b))})},children:[!m&&s.jsxs(We,{children:[s.jsx($t,{title:"Name",htmlFor:"name",outcome:f,children:s.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:v=>r(v.currentTarget.value),error:Nt(f,"name")})}),s.jsx($t,{title:"Description",htmlFor:"description",outcome:f,children:s.jsx(ze,{id:"description",name:"description",onChange:v=>o(v.currentTarget.value),error:Nt(f,"description")})}),s.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(um,{name:"accessPolicy",onChange:u})}),s.jsx(je,{justify:"flex-end",children:s.jsx(Oe,{type:"submit",children:"Create Bot"})})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(De,{children:"Bot created"}),s.jsxs(pr,{children:[s.jsx(pr.Item,{children:s.jsx(bt,{to:m,children:"Go to new bot"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function lJ(){const e=_e(),t=Zo(e),[n,r]=y.useState(""),[a,o]=y.useState(""),[c,u]=y.useState(""),[f,p]=y.useState(),[m,g]=y.useState(),[v,b]=y.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Create new Client"}),s.jsxs(pt,{onSubmit:()=>{const S={name:n,description:a,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",S).then(j=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),b(j),Pe({color:"green",message:"Client created"})}).catch(j=>{Pe({color:"red",message:Xe(j),autoClose:!1}),g(Zt(j))})},children:[!v&&s.jsxs(We,{children:[s.jsx($t,{title:"Name",htmlFor:"name",outcome:m,children:s.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:S=>r(S.currentTarget.value),error:Nt(m,"name")})}),s.jsx($t,{title:"Description",htmlFor:"description",outcome:m,children:s.jsx(ze,{id:"description",name:"description",onChange:S=>o(S.currentTarget.value),error:Nt(m,"description")})}),s.jsx($t,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:s.jsx(ze,{id:"redirectUri",name:"redirectUri",onChange:S=>u(S.currentTarget.value),error:Nt(m,"redirectUri")})}),s.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:s.jsx(um,{name:"accessPolicy",onChange:p})}),s.jsx(je,{justify:"flex-end",children:s.jsx(Oe,{type:"submit",children:"Create Client"})})]}),v&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(De,{children:"Client created"}),s.jsxs(pr,{children:[s.jsx(pr.Item,{children:s.jsx(bt,{to:v,children:"Go to new client"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function cJ(e){return s.jsx(rl,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{fi(t)?e.onChange(on(t)):e.onChange(void 0)}})}function uJ(){const{membershipId:e}=qt(),t=_e(),n=Zo(t),r=Rn(),a=t.get(`admin/projects/${n}/members/${e}`).read(),[o,c]=y.useState(a.accessPolicy),[u,f]=y.useState(a.userConfiguration),[p,m]=y.useState(a.admin),[g,v]=y.useState(),[b,S]=y.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=>v(Zt(C)))}return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(oc,{value:a.profile,link:!0})}),s.jsxs(pt,{onSubmit:()=>{const C={...a,accessPolicy:o,userConfiguration:u,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(R=>v(Zt(R)))},children:[!b&&s.jsxs(We,{children:[s.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:s.jsx(um,{name:"accessPolicy",defaultValue:o,onChange:c})}),s.jsx($t,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:s.jsx(cJ,{name:"userConfiguration",defaultValue:u,onChange:f})}),s.jsx($t,{title:"Admin",htmlFor:"admin",outcome:g,children:s.jsx(Fn,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),s.jsxs(je,{justify:"flex-end",mt:"xl",children:[s.jsx(Oe,{type:"submit",children:"Save"}),s.jsx(Oe,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(bt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function dJ(){const e=_e(),[t,n]=y.useState(e.getProject()),[r,a]=y.useState(),[o,c]=y.useState(),[u,f]=y.useState(!1),[p,m]=y.useState(void 0),g=y.useCallback(v=>{const b={resourceType:v.resourceType,firstName:v.firstName,lastName:v.lastName,email:v.email,sendEmail:v.sendEmail==="on",accessPolicy:r,admin:v.isAdmin==="on",scope:v.isProjectScoped==="on"?"project":"server"};return e.invite(t==null?void 0:t.id,b).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Fp(S)?c(S):m(S),f(b.sendEmail??!1),Pe({color:"green",message:"Invite success"})}).catch(S=>{Pe({color:"red",message:Xe(S),autoClose:!1}),c(Zt(S))})},[e,t,r]);return s.jsxs(pt,{onSubmit:g,children:[!p&&!o&&s.jsxs(We,{children:[s.jsx(Le,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx($t,{title:"Project",htmlFor:"project",outcome:o,children:s.jsx(rl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(ln,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Nt(o,"resourceType")}),s.jsx(ze,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Nt(o,"firstName")}),s.jsx(ze,{name:"lastName",label:"Last Name",required:!0,error:Nt(o,"lastName")}),s.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,error:Nt(o,"email")}),s.jsx($t,{title:"Access Policy",htmlFor:"accessPolicy",outcome:o,children:s.jsx(um,{name:"accessPolicy",onChange:a})}),s.jsx(Fn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Fn,{name:"isAdmin",label:"Admin"}),s.jsx(Fn,{name:"isProjectScoped",label:"Project scoped"}),s.jsx(je,{justify:"flex-end",children:s.jsx(Or,{children:"Invite"})})]}),o&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx(bt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(De,{children:"User created"}),u&&s.jsx(De,{children:"Email sent"}),s.jsxs(pr,{children:[s.jsx(pr.Item,{children:s.jsx(bt,{to:p,children:"Go to new membership"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:p.profile,children:"Go to new profile"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function fJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Patients"}),s.jsx(cm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/invite",children:"Invite new patient"})})]})}function hJ(){const e=_e();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(ba,{outcome:JD});function t(n){e.post("admin/projects/setpassword",n).then(()=>Pe({color:"green",message:"Done"})).catch(r=>Pe({color:"red",message:Xe(r),autoClose:!1}))}return s.jsxs(ot,{width:600,children:[s.jsx(Le,{order:1,children:"Project Admin"}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Force Set Password"}),s.jsx(De,{children:"Sets the password for the specified user in this project."}),s.jsx(De,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),s.jsx(pt,{onSubmit:t,children:s.jsxs(We,{children:[s.jsx(ze,{name:"email",label:"Email",required:!0}),s.jsx(Na,{name:"password",label:"Password",required:!0}),s.jsx(Oe,{type:"submit",children:"Force Set Password"})]})})]})}function FT(){const e=_e(),t=Zo(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Details"}),s.jsxs(bb,{children:[s.jsx(Li,{term:"ID",children:n.project.id}),s.jsx(Li,{term:"Name",children:n.project.name})]})]})}const HT=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function pJ(){const e=Rn(),n=Mr().pathname.replace("/admin/","")||HT[0],r=_e(),a=Zo(r),o=y.useMemo(()=>r.get("admin/projects/"+a).read(),[r,a]);function c(u){var f;(f=e(`/admin/${u}`))==null||f.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(mr,{children:[s.jsx(ht,{children:s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Project"}),s.jsx(ht.Value,{children:o.project.name})]})}),s.jsx(Yr,{children:s.jsx(Lt,{value:n.toLowerCase(),onChange:c,children:s.jsx(Lt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:HT.map(u=>s.jsx(Lt.Tab,{value:u.toLowerCase(),children:u},u))})})})]}),s.jsx(ot,{children:s.jsx(Qb,{})})]})}function mJ(){const e=_e(),t=Zo(e),n=e.get(`admin/projects/${t}`).read(),[r,a]=y.useState(!1),[o,c]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>a(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&c(Qr(n.project.secret||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Pe({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(Le,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(Od,{property:Wo("Project","secret"),name:"secret",path:"Project.secret",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Oe,{type:"submit",children:"Save"})]})}function gJ(){const e=_e(),t=Zo(e),n=e.get(`admin/projects/${t}`).read(),[r,a]=y.useState(!1),[o,c]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>a(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&c(Qr(n.project.site||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Pe({color:"green",message:"Saved"})).catch(f=>{var m,g,v,b;const p=Zt(f);Pe({color:"red",message:`Error ${(g=(m=p.issue)==null?void 0:m[0].details)==null?void 0:g.text} ${(b=(v=p.issue)==null?void 0:v[0].expression)==null?void 0:b[0]}`,autoClose:!1})})},children:[s.jsx(Le,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(Od,{property:Wo("Project","site"),name:"site",path:"Project.site",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Oe,{type:"submit",children:"Save"})]})}function vJ(){const e=_e(),[t,{open:n,close:r}]=ip(!1),[a,o]=y.useState(""),[c,u]=y.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(ba,{outcome:JD});function f(){bs(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){bs(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){bs(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(A){bs(e,"Reindexing Resources","admin/super/reindex",A)}function v(){bs(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){bs(e,"Run Pending Data Migration","admin/super/migrate")}function S(A){e.post("admin/super/removebotidjobsfromqueue",A).then(()=>Pe({color:"green",message:"Done"})).catch(k=>Pe({color:"red",message:Xe(k),autoClose:!1}))}function j(A){e.post("admin/super/purge",{...A,before:Cb(A.before)}).then(()=>Pe({color:"green",message:"Done"})).catch(k=>Pe({color:"red",message:Xe(k),autoClose:!1}))}function C(A){e.post("admin/super/setpassword",A).then(()=>Pe({color:"green",message:"Done"})).catch(k=>Pe({color:"red",message:Xe(k),autoClose:!1}))}function R(A){e.post("fhir/R4/$db-stats",A.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:A.tableNames}]}:void 0).then(k=>{var M,L;o("Database Stats"),u(s.jsx("pre",{children:(L=(M=k.parameter)==null?void 0:M.find($=>$.name==="tableString"))==null?void 0:L.valueString})),n()}).catch(k=>Pe({color:"red",message:Xe(k),autoClose:!1}))}function D(){e.post("fhir/R4/$db-invalid-indexes").then(A=>{var k;o("Database Invalid Indexes"),u(s.jsx("pre",{children:(k=A.parameter)==null?void 0:k.filter(M=>M.name==="invalidIndex").map(M=>M.valueString).join(`
570
- `)})),n()}).catch(A=>Pe({color:"red",message:Xe(A),autoClose:!1}))}function E(){e.post("fhir/R4/$db-schema-diff").then(A=>{var k,M;o("Schema Diff"),u(s.jsx("pre",{children:(M=(k=A.parameter)==null?void 0:k.find(L=>L.name==="migrationString"))==null?void 0:M.valueString})),n()}).catch(A=>Pe({color:"red",message:Xe(A),autoClose:!1}))}function T(){bs(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return s.jsxs(ot,{width:600,children:[s.jsx(Le,{order:1,children:"Super Admin"}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Structure Definitions"}),s.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),s.jsx(pt,{children:s.jsx(Oe,{onClick:f,children:"Rebuild StructureDefinitions"})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Search Parameters"}),s.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),s.jsx(pt,{children:s.jsx(Oe,{onClick:p,children:"Rebuild SearchParameters"})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Value Sets"}),s.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),s.jsx(pt,{children:s.jsx(Oe,{onClick:m,children:"Rebuild ValueSets"})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Run Pending Data Migration"}),s.jsx("p",{children:"When a Medplum version releases with data migrations to apply, you can run them here. Press this button to kick off the background data migration process."}),s.jsx(pt,{onSubmit:b,children:s.jsx(We,{children:s.jsx(Oe,{type:"submit",children:"Start Migration"})})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Reindex Resources"}),s.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),s.jsx(pt,{onSubmit:g,children:s.jsxs(We,{children:[s.jsx($t,{title:"Resource Type",htmlFor:"resourceType",children:s.jsx(ze,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx($t,{title:"Search Filter",htmlFor:"filter",children:s.jsx(ze,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),s.jsx($t,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:s.jsx(yJ,{})}),s.jsx(Oe,{type:"submit",children:"Reindex"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Purge Resources"}),s.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),s.jsx(pt,{onSubmit:j,children:s.jsxs(We,{children:[s.jsx($t,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(ln,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx($t,{title:"Purge Before",htmlFor:"before",children:s.jsx(ii,{name:"before",placeholder:"Before Date"})}),s.jsx(Oe,{type:"submit",children:"Purge"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(pt,{onSubmit:S,children:s.jsxs(We,{children:[s.jsx($t,{title:"Bot ID",children:s.jsx(ze,{name:"botId",placeholder:"Bot Id"})}),s.jsx(Oe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Force Set Password"}),s.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),s.jsx(pt,{onSubmit:C,children:s.jsxs(We,{children:[s.jsx(ze,{name:"email",label:"Email",required:!0}),s.jsx(Na,{name:"password",label:"Password",required:!0}),s.jsx(ze,{name:"projectId",label:"Project ID"}),s.jsx(Oe,{type:"submit",children:"Force Set Password"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(pt,{onSubmit:R,children:s.jsxs(We,{children:[s.jsx($t,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:s.jsx(ze,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),s.jsx(Oe,{type:"submit",children:"Get Database Stats"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Database Invalid Indexes"}),s.jsx("p",{children:"Query invalid indexes from the database."}),s.jsx(pt,{onSubmit:D,children:s.jsx(We,{children:s.jsx(Oe,{type:"submit",children:"Get Database Invalid Indexes"})})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Database Schema Drift"}),s.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),s.jsxs(or,{children:[s.jsx(or.Col,{span:6,children:s.jsx(pt,{onSubmit:E,children:s.jsx(We,{children:s.jsx(Oe,{type:"submit",children:"Get Schema Drift"})})})}),s.jsx(or.Col,{span:6,children:s.jsx(pt,{onSubmit:T,children:s.jsx(We,{children:s.jsx(Oe,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Reload Cron Resources"}),s.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),s.jsx(pt,{onSubmit:v,children:s.jsx(We,{children:s.jsx(Oe,{type:"submit",children:"Reload Cron Resources"})})}),s.jsx($n,{opened:t,onClose:r,title:a,centered:!0,size:"auto",children:c})]})}function yJ(){const[e,t]=y.useState("outdated");return s.jsxs(s.Fragment,{children:[s.jsx(ln,{id:"reindexType",name:"reindexType",value:e,onChange:n=>t(n.target.value),data:[{label:"Outdated resources",value:"outdated"},{label:"All resources",value:"all"},{label:"Less than or equal to a specific version",value:"specific"}]}),e==="specific"&&s.jsx(Op,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function bs(e,t,n,r){const a=Date.now().toString();Pe({id:a,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST",pollStatusOnAccepted:!0};r&&(o.body=JSON.stringify(r)),e.startAsyncRequest(n,o).then(c=>{var f,p,m;let u="Done";c.resourceType==="AsyncJob"?u=s.jsx(bt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&((m=(p=(f=c.issue)==null?void 0:f[0])==null?void 0:p.details)!=null&&m.text)&&(u=s.jsx(De,{children:c.issue[0].details.text})),ua.update({id:a,color:"green",title:t,message:u,icon:s.jsx(eo,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(c=>{ua.update({id:a,color:"red",title:t,message:Xe(c),icon:s.jsx(Fs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function xJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Le,{children:"Users"}),s.jsx(cm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(je,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/invite",children:"Invite new user"})})]})}function bJ(){const[e]=xc("ObservationDefinition","_count=100");return e?s.jsxs(Me,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var n,r,a,o;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ai,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(ai,{value:t.code})}),s.jsx("td",{children:s.jsx(ai,{value:t.method})}),s.jsx("td",{children:(a=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:a.text}),s.jsx("td",{children:(o=t.quantitativeDetails)==null?void 0:o.decimalPrecision}),s.jsx("td",{children:s.jsx(rx,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(ma,{})}function rx(e){const{ranges:t}=e;if(!t)return null;const n=qT(t.map(a=>a.gender));if(n.length>1)return rd(n),s.jsx(s.Fragment,{children:n.map(a=>{var o;return s.jsxs(y.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Hn(a)})}),s.jsx(rx,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>c.gender===a)})]},a)})});const r=qT(t.map(a=>a.age&&ad(a.age)));return r.length>1?(rd(r),s.jsx(s.Fragment,{children:r.map(a=>{var o;return s.jsxs(y.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Hn(a)})}),s.jsx(rx,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>ad(c.age)===a)})]},a)})})):s.jsx(s.Fragment,{children:t.map(a=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:a.condition}),s.jsx("td",{children:s.jsx(jb,{value:a.range})})]})})},`range-${a.condition}`))})}function qT(e){return[...new Set(e.filter(t=>!!t))]}function SJ(){const[e]=xc("ActivityDefinition","_count=100"),[t]=xc("ObservationDefinition","_count=100");return!e||!t?s.jsx(ma,{}):s.jsxs(Me,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(n=>s.jsx("th",{children:n.name},n.id))]})}),s.jsx("tbody",{children:t.map(n=>{var r;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ai,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(ai,{value:n.code})}),e.map(a=>{var o;return s.jsx("td",{children:(o=a.observationResultRequirement)!=null&&o.find(c=>{var u;return(u=c.reference)==null?void 0:u.includes(n.id)})?"✅":""},a.id)})]},n.id)})})]})}function wJ(e){var c;const t=_e(),[n,r]=y.useState(),[a,o]=y.useState();return a?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx(bt,{to:a,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(bt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(pt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(o).catch(console.log)},children:s.jsxs(We,{children:[s.jsxs(Le,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(De,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(De,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(c=e.planDefinition.action)==null?void 0:c.map((u,f)=>{var p;return s.jsxs("li",{children:[((p=u.definitionCanonical)==null?void 0:p.startsWith("Questionnaire/"))&&"Questionnaire request: ",u.title&&s.jsx(s.Fragment,{children:u.title}),u.code&&s.jsx(ai,{value:u.code[0]})]},`action-${f}`)})}),s.jsx($t,{title:"Subject",children:s.jsx(Nd,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Oe,{type:"submit",children:"Go"})})]})})}function jJ(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t});return n?s.jsx(ot,{children:s.jsx(wJ,{planDefinition:n})}):null}function CJ(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t}),[r,a]=xc("Questionnaire","subject-type="+e),[o,c]=xc("ClientApplication",{_count:1e3});if(!n||a||c)return s.jsx(ma,{});const u=o==null?void 0:o.filter(m=>EJ(e)&&!!m.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return s.jsxs(ot,{children:[s.jsx(Le,{children:"Apps"}),s.jsxs("p",{children:["No apps found. Contact your administrator or ",s.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,p;return n.resourceType==="Patient"?f=on(n):n.resourceType==="Encounter"&&(f=n.subject,p=on(n)),s.jsxs(ot,{children:[r==null?void 0:r.map(m=>s.jsxs("div",{children:[s.jsx(Le,{order:3,children:s.jsx(bt,{to:`/forms/${m.id}?subject=${zt(n)}`,children:m.title||m.name})}),s.jsx(De,{children:m.description})]},m.id)),u==null?void 0:u.map(m=>s.jsxs("div",{children:[s.jsx(Le,{order:3,children:s.jsx(EY,{client:m,patient:f,encounter:p,children:m.name})}),s.jsx(De,{children:m.description})]},m.id))]})}function EJ(e){return e==="Patient"||e==="Encounter"}function TJ(){const{resourceType:e,id:t}=qt(),n=Rn(),[r,a]=y.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:de.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(ot,{children:s.jsx(Id,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>a(o.definition),hideFilters:!0})})}function RJ(){const e=_e(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return s.jsx(ot,{children:s.jsx(pY,{history:r})})}const DJ="_hl7Input_k5xm3_1",AJ={hl7Input:DJ};function _J(e){return s.jsx("iframe",{title:"Bot Runner",frameBorder:"0",src:"https://codeeditor.medplum.com/bot-runner.html",className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function kJ(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),s.jsx("iframe",{title:"Code Editor",frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Qu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const PJ=`{
571
- "resourceType": "Patient",
572
- "name": [
573
- {
574
- "given": [
575
- "Alice"
576
- ],
577
- "family": "Smith"
578
- }
579
- ]
580
- }`,NJ="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 OJ(){const e=_e(),{id:t}=qt(),[n,r]=y.useState(),[a,o]=y.useState(),[c,u]=y.useState(PJ),[f,p]=y.useState(NJ),[m,g]=y.useState(hn.FHIR_JSON),v=y.useRef(null),b=y.useRef(null),[S,j]=y.useState(!1);y.useEffect(()=>{e.readResource("Bot",t).then(async k=>{r(k),o(await MJ(e,k))}).catch(k=>Pe({color:"red",message:Xe(k),autoClose:!1}))},[e,t]);const C=y.useCallback(async()=>Qu(v.current,{command:"getValue"}),[]),R=y.useCallback(async()=>Qu(v.current,{command:"getOutput"}),[]),D=y.useCallback(async()=>m===hn.FHIR_JSON?JSON.parse(c):f,[m,c,f]),E=y.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),j(!0);try{const M=await C(),L=await R(),$=await e.createAttachment({data:M,filename:"index.ts",contentType:"text/typescript"}),V=await e.createAttachment({data:L,filename:"index.js",contentType:"text/typescript"}),Y=[{op:"add",path:"/sourceCode",value:$},{op:"add",path:"/executableCode",value:V}];await e.patchResource("Bot",t,Y),Pe({color:"green",message:"Saved"})}catch(M){Pe({color:"red",message:Xe(M),autoClose:!1})}finally{j(!1)}},[e,t,C,R]),T=y.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),j(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Pe({color:"green",message:"Deployed"})}catch(M){Pe({color:"red",message:Xe(M),autoClose:!1})}finally{j(!1)}},[e,t]),A=y.useCallback(async k=>{k.preventDefault(),k.stopPropagation(),j(!0);try{const M=await D(),L=await e.post(e.fhirUrl("Bot",t,"$execute"),M,m);await Qu(b.current,{command:"setValue",value:L}),Pe({color:"green",message:"Success"})}catch(M){Pe({color:"red",message:Xe(M),autoClose:!1})}finally{j(!1)}},[e,t,D,m]);return!n||a===void 0?null:s.jsxs(or,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(or.Col,{span:8,children:s.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(kJ,{iframeRef:v,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:a,minHeight:"528px"}),s.jsxs(je,{justify:"flex-end",gap:"xs",children:[s.jsx(Oe,{type:"button",onClick:E,loading:S,leftSection:s.jsx(VV,{size:"1rem"}),children:"Save"}),s.jsx(Oe,{type:"button",onClick:T,loading:S,leftSection:s.jsx(fb,{size:"1rem"}),children:"Deploy"}),s.jsx(Oe,{type:"button",onClick:A,loading:S,leftSection:s.jsx(nF,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(or.Col,{span:4,children:[s.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(ln,{data:[{label:"FHIR",value:hn.FHIR_JSON},{label:"HL7",value:hn.HL7_V2}],onChange:k=>g(k.currentTarget.value)}),m===hn.FHIR_JSON?s.jsx(Dc,{value:c,onChange:k=>u(k),autosize:!0,minRows:15}):s.jsx("textarea",{className:AJ.hl7Input,value:f,onChange:k=>p(k.currentTarget.value),rows:15})]}),s.jsx(mr,{m:2,p:"xs",shadow:"md",children:s.jsx(_J,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function MJ(e,t){var n,r,a;if((n=t.sourceCode)!=null&&n.url){const o=(a=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:a.find(mA);return(await e.download(e.fhirUrl("Binary",o))).text()}return t.code??""}function ol(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function IJ(){const e=_e(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},a=y.useCallback(o=>{e.updateResource(ol(o)).then(()=>{Pe({color:"green",message:"Success"})}).catch(c=>{Pe({color:"red",message:Xe(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(ot,{children:s.jsx(zQ,{value:r,onSubmit:a})});case"Questionnaire":return s.jsx(ot,{children:s.jsx(EW,{questionnaire:r,onSubmit:a})});default:return null}}function LJ(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t}),r=Rn();return n?s.jsx(ot,{children:s.jsx(KW,{value:n,onStart:(a,o)=>{var c;return(c=r(`/forms/${Us(o)}`))==null?void 0:c.catch(console.error)},onEdit:(a,o,c)=>{var u;return(u=r(`/${c.reference}}`))==null?void 0:u.catch(console.error)}})}):null}function zJ(){const e=_e(),{resourceType:t,id:n}=qt(),r=Rn();return s.jsxs(ot,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(Oe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>{var a;return(a=r(`/${t}`))==null?void 0:a.catch(console.error)}).catch(a=>Pe({color:"red",message:Xe(a),autoClose:!1}))},children:"Delete"})]})}const $J="_selectProfileBtn_tbaz6_1",UJ="_chevron_tbaz6_13",GT={selectProfileBtn:$J,chevron:UJ};function BJ(){var f,p;const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t}),[r,a]=y.useState(),o=gd({onDropdownClose:()=>o.resetSelectedOption()}),c=y.useMemo(()=>{var m;if(En((m=n==null?void 0:n.meta)==null?void 0:m.profile))return[s.jsx(ct.Option,{value:"",children:"None"},""),...n.meta.profile.map(g=>s.jsx(ct.Option,{value:g,children:g},g))]},[(f=n==null?void 0:n.meta)==null?void 0:f.profile]);if(y.useEffect(()=>{var m,g;((g=(m=n==null?void 0:n.meta)==null?void 0:m.profile)==null?void 0:g.length)===1&&a(n.meta.profile[0])},[(p=n==null?void 0:n.meta)==null?void 0:p.profile]),!n)return null;let u;return En(c)&&(u=s.jsx(je,{justify:"flex-end",children:s.jsxs(We,{align:"flex-end",gap:"xs",children:[s.jsxs(ct,{store:o,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:m=>{a(m),o.closeDropdown()},children:[s.jsx(ct.Target,{children:s.jsx(tr,{onClick:()=>o.toggleDropdown(),children:s.jsxs(l0,{fw:"bold",fs:"sm",className:GT.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(db,{stroke:1.5,className:GT.chevron})]})})}),s.jsx(ct.Dropdown,{w:"max-content",children:s.jsx(ct.Options,{children:c})})]}),s.jsx(ce,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(De,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(De,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(De,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(ot,{children:s.jsxs(We,{gap:"xl",children:[u,s.jsx(_b,{value:n,profileUrl:r})]})})}function VJ(){const e=_e(),{resourceType:t,id:n}=qt(),[r,a]=y.useState(),[o,c]=y.useState(),u=Rn(),[f,p]=y.useState();y.useEffect(()=>{e.readResource(t,n).then(b=>{a(Qr(b)),c(Qr(b))}).catch(b=>{p(Zt(b)),Pe({color:"red",message:Xe(b),autoClose:!1})})},[e,t,n]);const m=y.useCallback(b=>{p(void 0),e.updateResource(ol(b)).then(()=>{var S;(S=u(`/${t}/${n}/details`))==null||S.catch(console.error),Pe({id:"succes",color:"green",message:"Success"})}).catch(S=>{p(Zt(S)),Pe({color:"red",message:Xe(S),autoClose:!1})})},[e,t,n,u]),g=y.useCallback(b=>{p(void 0);const S=__.createPatch(r,b);e.patchResource(t,n,S).then(()=>{var j;(j=u(`/${t}/${n}/details`))==null||j.catch(console.error),Pe({id:"succes",color:"green",message:"Success"})}).catch(j=>{p(Zt(j)),Pe({color:"red",message:Xe(j),autoClose:!1})})},[e,t,n,r,u]),v=y.useCallback(()=>{var b;return(b=u(`/${t}/${n}/delete`))==null?void 0:b.catch(console.error)},[u,t,n]);return o?s.jsx(ot,{children:s.jsx(Wh,{defaultValue:o,onSubmit:m,onPatch:g,onDelete:v,outcome:f})}):null}function FJ(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t});return n?s.jsx(ot,{maw:700,children:n.resourceType==="Patient"?s.jsx(PQ,{patient:n}):s.jsx(Yi,{icon:s.jsx(nl,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function Gk({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,a=_e(),[o,c]=y.useState();return y.useEffect(()=>{a.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(u=>{c(u.filter(JH))}).catch(console.error)},[a,n,r]),s.jsx(Lt,{value:t==null?void 0:t.url,onChange:u=>{const f=o==null?void 0:o.find(p=>p.url===u);f&&n(f)},children:s.jsx(Lt.List,{children:o==null?void 0:o.map(u=>{var m,g;const f=(g=(m=e.meta)==null?void 0:m.profile)==null?void 0:g.includes(u.url),p=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return s.jsx(Lt.Tab,{value:u.url,title:p,rightSection:f&&s.jsx(F0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(gF,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function Qk(e,t){const n=_e(),r=Rn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Zt(u)),Pe({color:"red",message:Xe(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function uy(){const{resourceType:e}=qt(),t=Mr(),[n,r]=y.useState(),{defaultValue:a,handleSubmit:o}=Qk(e,r),[c,u]=y.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=y.useCallback(m=>{const g=ol(m);c&&bA(g,c.url),o(g)},[c,o]);return f?s.jsx(ot,{children:s.jsxs(We,{children:[s.jsx(Gk,{resource:a,currentProfile:c,onChange:u}),c?s.jsx(Wh,{defaultValue:a,onSubmit:p,outcome:n,profileUrl:c.url},c.url):s.jsx(De,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(ot,{children:s.jsx(Wh,{defaultValue:a,onSubmit:o,outcome:n})})}function HJ(){const e=_e(),{resourceType:t,id:n}=qt(),r=e.readHistory(t,n).read();return s.jsx(ot,{children:s.jsx(SY,{history:r})})}function qJ(){const{resourceType:e}=qt(),[t,n]=y.useState(),{defaultValue:r,handleSubmit:a}=Qk(e,n),o=y.useCallback(c=>{a(JSON.parse(c["new-resource"]))},[a]);return s.jsxs(ot,{children:[t&&s.jsx(ba,{outcome:t}),s.jsxs(pt,{onSubmit:o,children:[s.jsx(Dc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Ia(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{type:"submit",children:"OK"})})]})]})}function GJ(){const e=_e(),{resourceType:t,id:n}=qt(),r=Qt({reference:t+"/"+n}),a=Rn(),[o,c]=y.useState(),u=y.useCallback(f=>{e.updateResource(ol(JSON.parse(f.resource))).then(()=>{var p;c(void 0),(p=a(`/${t}/${n}/details`))==null||p.catch(console.error),Pe({color:"green",message:"Success"})}).catch(p=>{Pe({color:"red",message:Xe(p),autoClose:!1})})},[e,t,n,a]);return r?s.jsxs(ot,{children:[o&&s.jsx(ba,{outcome:o}),s.jsxs(pt,{onSubmit:u,children:[s.jsx(Dc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Ia(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(je,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{type:"submit",children:"OK"})})]})]}):null}function QJ(){const{resourceType:e,id:t}=qt();return Qt({reference:e+"/"+t})?s.jsxs(ot,{children:[s.jsxs(Yi,{icon:s.jsx(nl,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Pt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(nk,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function WJ(){const e=_e(),{resourceType:t,id:n}=qt(),[r,a]=y.useState(),[o,c]=y.useState();return y.useEffect(()=>{e.readResource(t,n).then(u=>a(Qr(u))).catch(u=>{Pe({color:"red",message:Xe(u)})})},[e,t,n]),r?s.jsxs(ot,{children:[s.jsxs(Le,{order:2,children:["Available ",t," profiles"]}),s.jsx(We,{children:s.jsxs(s.Fragment,{children:[s.jsx(Gk,{resource:r,currentProfile:o,onChange:c}),o?s.jsx(YJ,{profile:o,resource:r,onResourceUpdated:u=>a(u)},o.url):s.jsx(De,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const YJ=({profile:e,resource:t,onResourceUpdated:n})=>{const r=_e(),[a,o]=y.useState(),[c,u]=y.useState(()=>{var p,m;return(m=(p=t.meta)==null?void 0:p.profile)==null?void 0:m.includes(e.url)}),f=y.useCallback(p=>{o(void 0);const m=ol(p);c?bA(m,e.url):G$(m,e.url),r.updateResource(m).then(g=>{n(g),Pe({color:"green",message:"Success"})}).catch(g=>{o(Zt(g)),Pe({color:"red",message:Xe(g),autoClose:!1})})},[r,e.url,n,c]);return s.jsxs(We,{children:[s.jsx(Sd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>u(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?s.jsx(Wh,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:a}):s.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:s.jsx(je,{justify:"flex-end",mt:"xl",children:s.jsx(Oe,{type:"submit",children:"OK"})})})]})},Wk={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},KJ=Object.keys(Wk);function XJ(){const e=_e(),{id:t}=qt(),n=Qt({reference:`Questionnaire/${t}`}),[r,a]=y.useState(),[o,c]=y.useState("create"),[u,f]=y.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>ZJ(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)},...o?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:o}]}:void 0}).then(()=>{a(void 0),f(Date.now()),e.invalidateSearches("Subscription"),Pe({color:"green",message:"Success"})}).catch(g=>Pe({color:"red",message:Xe(g),autoClose:!1}))}return s.jsxs(ot,{children:[s.jsx(Le,{children:"Bots"}),s.jsxs(We,{children:[p.length===0&&s.jsx("p",{children:"No bots found."}),p.map(g=>{var v;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Ic,{value:{reference:(v=g.channel)==null?void 0:v.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id)})]}),s.jsx(jn,{}),s.jsxs(We,{mt:10,children:[s.jsx(fd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),s.jsxs(je,{children:[s.jsx(rl,{name:"bot",resourceType:"Bot",onChange:g=>a(g)}),s.jsx(Oe,{onClick:m,children:"Connect"})]}),s.jsx(je,{children:s.jsx(ln,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:KJ,onChange:g=>c(Wk[g.target.value])})})]}),s.jsx("div",{style:{display:"none"},children:u})]})}function ZJ(e,t){var a;if(!t)return!1;const n=e.criteria||"",r=((a=e.channel)==null?void 0:a.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(zt(t))||(t.url?n.includes(t.url):!1))}function JJ(){const{id:e}=qt(),t=Rn(),r=_e().readReference({reference:`Questionnaire/${e}`}).read(),[a,o]=y.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:de.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return s.jsx(ot,{children:s.jsx(Id,{search:a,onClick:c=>{var u;return(u=t(`/${c.resource.resourceType}/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})})}function eee(){const e=_e(),{resourceType:t,id:n}=qt(),r=Qt({reference:t+"/"+n}),a=y.useCallback(o=>{e.updateResource(ol(o)).then(()=>{Pe({color:"green",message:"Success"})}).catch(c=>{Pe({color:"red",message:Xe(c),autoClose:!1})})},[e]);return r?s.jsx(ot,{children:s.jsx(VW,{onSubmit:a,definition:r})}):null}function tee(){const{resourceType:e,id:t}=qt(),n=Qt({reference:e+"/"+t});return n?s.jsx(ot,{children:e==="MeasureReport"?s.jsx(_Q,{measureReport:n}):s.jsx(Ab,{value:n})}):null}const nee="_container_1ue98_1",ree="_entry_1ue98_14",aee="_active_1ue98_21",dy={container:nee,entry:ree,active:aee};function iee(e){const t=_e(),n=Qt(e.value),[r,a]=y.useState();return y.useEffect(()=>{if(!n)return;const o=e1(n);if(!o)return;const c="reference"in o?o.reference:zt(o);t.search("ServiceRequest","subject="+c).then(u=>{const p=(u.entry??[]).map(m=>m.resource);k_(p),p.reverse(),a(p)}).catch(u=>Pe({color:"red",message:Xe(u),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:dy.container,children:r.map(o=>{var c,u,f,p,m,g,v;return s.jsxs("div",{className:Ut(dy.entry,{[dy.active]:o.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(bt,{to:o,children:oee(o)})}),((u=(c=o.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(f=o.category[0])==null?void 0:f.text}),((g=(m=(p=o.code)==null?void 0:p.coding)==null?void 0:m[0])==null?void 0:g.code)&&s.jsx("p",{children:(v=o.code.coding[0])==null?void 0:v.code}),s.jsx("p",{children:see(o)})]},o.id)})}):null}function oee(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function see(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const lee="_container_1l2dh_1",cee={container:lee};function uee(e){var a,o,c,u;const t=Qt(e.valueSet);if(!t)return null;const n=[""],r=(u=(c=(o=(a=t.compose)==null?void 0:a.include)==null?void 0:o[0])==null?void 0:c.concept)==null?void 0:u.map(f=>f.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:cee.container,children:s.jsx(ln,{defaultValue:e.defaultValue,onChange:f=>e.onChange(f.currentTarget.value),data:n})})}function dee(e){var n,r;const t=Qt(e.specimen);return t?s.jsxs(ht,{children:[s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Type"}),s.jsx(ht.Value,{children:"Specimen"})]}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Collected"}),s.jsx(ht.Value,{children:gr((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Specimen Age"}),s.jsx(ht.Value,{children:fee(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Specimen Stability"}),s.jsx(ht.Value,{children:hee(t)})]}):s.jsx(s.Fragment,{})]}):null}function fee(e){var a;const t=(a=e.collection)==null?void 0:a.collectedDateTime;if(!t)return;const n=new Date(t);return Yk(Kk(n,new Date))}function hee(e){var r;if(!((r=e.collection)!=null&&r.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return Yk(Kk(t,n))}function Yk(e){return e.toString().padStart(3,"0")+"D"}function Kk(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function pee(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),e==="Agent"&&t.push("Tools"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),e==="Patient"&&t.push("Export"),t}function mee(){var D,E,T,A,k,M,L;const e=_e(),{resourceType:t,id:n}=qt(),r={reference:t+"/"+n},a=Rn(),[o,c]=y.useState(),u=Qt(r,c),f=pee(t),[p,m]=y.useState(()=>{const $=window.location.pathname.split("/").pop();return $&&f.map(V=>V.toLowerCase()).includes($)?$:f[0].toLowerCase()});async function g(){var Y,Q;const V=(Q=(Y=(await e.readHistory(t,n)).entry)==null?void 0:Y.find(J=>!!J.resource))==null?void 0:Q.resource;V?v(V):Pe({color:"red",message:"No history to restore",autoClose:!1})}function v($){e.updateResource(ol($)).then(()=>{c(void 0),Pe({color:"green",message:"Success"})}).catch(V=>{Pe({color:"red",message:Xe(V),autoClose:!1})})}if(o)return e8(o)?s.jsxs(ot,{children:[s.jsx(Le,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(Oe,{color:"red",onClick:g,children:"Restore"})]}):s.jsx(ba,{outcome:o});function b($){var V;$||($=f[0].toLowerCase()),m($),(V=a(`/${t}/${n}/${$}`))==null||V.catch(console.error)}function S($){const V=u,Y=V.orderDetail||[];Y.length===0&&Y.push({}),Y[0].text!==$&&(Y[0].text=$,v({...V,orderDetail:Y}))}const j=u&&e1(u),C=u&&$Z(u),R=(T=(E=(D=e.getUserConfiguration())==null?void 0:D.option)==null?void 0:E.find($=>$.id==="statusValueSet"))==null?void 0:T.valueString;return s.jsxs(s.Fragment,{children:[(u==null?void 0:u.resourceType)==="ServiceRequest"&&R&&s.jsx(uee,{valueSet:{reference:R},defaultValue:(k=(A=u.orderDetail)==null?void 0:A[0])==null?void 0:k.text,onChange:S},zt(u)+"-"+((L=(M=u.orderDetail)==null?void 0:M[0])==null?void 0:L.text)),u&&s.jsx(iee,{value:u}),u&&s.jsxs(mr,{children:[j&&s.jsx($_,{patient:j}),C&&s.jsx(dee,{specimen:C}),t!=="Patient"&&s.jsx(Vk,{resource:r}),s.jsx(Yr,{children:s.jsx(Lt,{value:p.toLowerCase(),onChange:b,children:s.jsx(Lt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map($=>s.jsx(Lt.Tab,{value:$.toLowerCase(),children:$},$))})})})]}),s.jsx(Qb,{})]})}function QT(){var R,D,E,T;const e=Rn(),{resourceType:t,id:n,versionId:r,tab:a}=qt(),o=_e(),[c,u]=y.useState(!0),[f,p]=y.useState(),[m,g]=y.useState();if(y.useEffect(()=>{g(void 0),u(!0),o.readHistory(t,n).then(A=>p(A)).then(()=>u(!1)).catch(A=>{g(A),u(!1)})},[o,t,n]),c)return s.jsx(ma,{});if(!f)return s.jsxs(ot,{children:[s.jsx(Le,{children:"Resource not found"}),s.jsx(bt,{to:`/${t}`,children:"Return to search page"})]});const v=f.entry??[],b=v.findIndex(A=>{var k,M;return((M=(k=A.resource)==null?void 0:k.meta)==null?void 0:M.versionId)===r});if(b===-1)return s.jsxs(ot,{children:[s.jsx(Le,{children:"Version not found"}),s.jsx(bt,{to:`/${t}/${n}`,children:"Return to resource"})]});const S=v[b].resource,j=b<v.length-1?v[b+1].resource:void 0,C="diff";return s.jsxs(Lt,{value:a||C,onChange:A=>{var k;return(k=e(`/${t}/${n}/_history/${r}/${A||C}`))==null?void 0:k.catch(console.error)},children:[s.jsxs(mr,{children:[s.jsx(kd,{fluid:!0,p:"md",children:s.jsx(De,{children:`${t} ${n}`})}),s.jsxs(Lt.List,{children:[s.jsx(Lt.Tab,{value:"diff",children:"Diff"}),s.jsx(Lt.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(ot,{children:[m&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),s.jsx(Lt.Panel,{value:"diff",children:j?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(R=S.meta)==null?void 0:R.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(bt,{to:`/${t}/${n}/_history/${(D=j.meta)==null?void 0:D.versionId}`,children:(E=j.meta)==null?void 0:E.versionId})]})]}),s.jsx(vY,{original:j,revised:S})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(T=S.meta)==null?void 0:T.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(S,void 0,2)})]})}),s.jsx(Lt.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(S,void 0,2)})})]})]})}function gee(){const{resourceType:e,id:t}=qt(),n=Rn(),[r,a]=y.useState({resourceType:"Subscription",filters:[{code:"url",operator:de.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(ot,{children:s.jsx(pQ,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>a(o.definition),hideFilters:!0})})}function vee(e){const t=_e(),{resource:n,opened:r,onClose:a}=e,[o,c]=y.useState(!1),[u,f]=y.useState(),[p,m]=y.useState(!1),g=y.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:o&&u?zt(u):void 0,verbose:p}),Pe({color:"green",message:"Done"}),a()}catch(v){Pe({color:"red",message:Xe(v),autoClose:!1})}},[t,n,a,o,u,p]);return s.jsx($n,{opened:r,onClose:a,title:"Resend Subscriptions",children:s.jsx(pt,{onSubmit:g,children:s.jsxs(We,{children:[s.jsx(Fn,{label:"Choose subscription (all subscriptions by default)",onChange:v=>c(v.currentTarget.checked)}),o&&s.jsx(rl,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),s.jsx(Fn,{label:"Verbose mode",onChange:v=>m(v.currentTarget.checked)}),s.jsx(je,{justify:"flex-end",children:s.jsx(Oe,{type:"submit",children:"Resend"})})]})})})}function WT(){const e=_e(),t=Xp(),{resourceType:n,id:r}=qt(),a={reference:n+"/"+r},[o,c]=y.useState(),u=ip(!1);function f(D,E){return e.updateResource({...D,priority:E})}function p(D,E){f(D,"stat").then(E).catch(console.error)}function m(D,E){f(D,"routine").then(E).catch(console.error)}function g(D){t(`/${D.resourceType}/${D.id}`)}function v(D){t(`/${D.resourceType}/${D.id}/edit`)}function b(D){t(`/${D.resourceType}/${D.id}/delete`)}function S(D){c(D),u[1].open()}function j(D){var E;t(`/${D.resourceType}/${D.id}/_history/${(E=D.meta)==null?void 0:E.versionId}`)}function C(D,E){const T="aws-textract";Pe({id:T,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(D.resourceType,D.id,"$aws-textract"),{}).then(()=>{E(),Ds({id:T,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:s.jsx(eo,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(A=>Ds({id:T,title:"AWS Textract Error",color:"red",message:Xe(A),icon:s.jsx(Fs,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function R(D){var P;const{primaryResource:E,currentResource:T,reloadTimeline:A}=D,k=T.resourceType===E.resourceType&&T.id===E.id,M=T.resourceType==="Communication"&&T.priority!=="stat",L=T.resourceType==="Communication"&&T.priority==="stat",$=k,V=!k,Y=!k,Q=!k,J=(P=e.getProjectMembership())==null?void 0:P.admin,G=J,Z=XZ()&&(T.resourceType==="DocumentReference"||T.resourceType==="Media");return s.jsxs(we.Dropdown,{children:[s.jsx(we.Label,{children:"Resource"}),M&&s.jsx(we.Item,{leftSection:s.jsx(eF,{size:14}),onClick:()=>p(T,A),"aria-label":`Pin ${zt(T)}`,children:"Pin"}),L&&s.jsx(we.Item,{leftSection:s.jsx(tF,{size:14}),onClick:()=>m(T,A),"aria-label":`Unpin ${zt(T)}`,children:"Unpin"}),V&&s.jsx(we.Item,{leftSection:s.jsx(kE,{size:14}),onClick:()=>g(T),"aria-label":`Details ${zt(T)}`,children:"Details"}),$&&s.jsx(we.Item,{leftSection:s.jsx(kE,{size:14}),onClick:()=>j(T),"aria-label":`Details ${zt(T)}`,children:"Details"}),Y&&s.jsx(we.Item,{leftSection:s.jsx(YA,{size:14}),onClick:()=>v(T),"aria-label":`Edit ${zt(T)}`,children:"Edit"}),J&&s.jsxs(s.Fragment,{children:[s.jsx(we.Divider,{}),s.jsx(we.Label,{children:"Admin"}),G&&s.jsx(we.Item,{leftSection:s.jsx(oF,{size:14}),onClick:()=>S(T),"aria-label":`Resend Subscriptions ${zt(T)}`,children:"Resend Subscriptions"})]}),Z&&s.jsxs(s.Fragment,{children:[s.jsx(we.Divider,{}),s.jsx(we.Label,{children:"AWS AI"}),s.jsx(we.Item,{leftSection:s.jsx(pF,{size:14}),onClick:()=>C(T,A),"aria-label":`AWS Textract ${zt(T)}`,children:"AWS Textract"})]}),Q&&s.jsxs(s.Fragment,{children:[s.jsx(we.Divider,{}),s.jsx(we.Label,{children:"Danger zone"}),s.jsx(we.Item,{color:"red",leftSection:s.jsx(mb,{size:14}),onClick:()=>b(T),"aria-label":`Delete ${zt(T)}`,children:"Delete"})]})]})}return s.jsxs(s.Fragment,{children:[n==="Encounter"&&s.jsx(wG,{encounter:a,getMenu:R}),n==="Patient"&&s.jsx(MQ,{patient:a,getMenu:R}),n==="ServiceRequest"&&s.jsx(CY,{serviceRequest:a,getMenu:R}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&s.jsx(SG,{resource:a,getMenu:R}),s.jsx(vee,{resource:o,opened:u[0],onClose:u[1].close},`resend-subscriptions-${o==null?void 0:o.id}`)]})}function yee(e){const{opened:t,close:n,version:r,loadingStatus:a,handleStatus:o,handleUpgrade:c}=e,[u,f]=y.useState();return y.useEffect(()=>{t&&(u||pV("app-tools-page").then(f).catch(console.error),o())},[t,u,o]),u&&r&&!a?r==="unknown"?s.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(u)?s.jsxs("p",{children:["This agent is already on the latest version (",u,")."]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",u,"?"]}),s.jsx(Oe,{onClick:()=>{c(),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"})]}):s.jsx(ma,{})}function xee(){const e=_e(),{id:t}=qt(),n=y.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,a]=y.useState(!1),[o,c]=y.useState(!1),[u,f]=y.useState(!1),[p,m]=y.useState(),[g,v]=y.useState(),[b,S]=y.useState(),[j,C]=y.useState(),[R,D]=y.useState(!1),[E,T]=y.useState(!1),[A,{open:k,close:M}]=ip(!1);y.useEffect(()=>{if(r||o||u||R){T(!0);return}T(!1)},[r,o,u,R]);const L=y.useCallback(()=>{a(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(G=>{var Z,P,I,z,H,O;m((P=(Z=G.parameter)==null?void 0:Z.find(U=>U.name==="status"))==null?void 0:P.valueCode),v((z=(I=G.parameter)==null?void 0:I.find(U=>U.name==="version"))==null?void 0:z.valueString),S((O=(H=G.parameter)==null?void 0:H.find(U=>U.name==="lastUpdated"))==null?void 0:O.valueInstant)}).catch(G=>J(Xe(G))).finally(()=>a(!1))},[e,t]),$=y.useCallback(G=>{const Z=G.host,P=G.pingCount||1;Z&&(D(!0),e.pushToAgent(n,Z,`PING ${P}`,hn.PING,!0).then(I=>C(I)).catch(I=>J(Xe(I))).finally(()=>D(!1)))},[e,n]),V=y.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(G=>{Q("Agent config reloaded successfully.")}).catch(G=>J(Xe(G))).finally(()=>c(!1))},[e,t]),Y=y.useCallback(()=>{f(!0),e.get(e.fhirUrl("Agent",t,"$upgrade"),{cache:"reload"}).then(G=>{Q("Agent upgraded successfully.")}).catch(G=>J(Xe(G))).finally(()=>f(!1))},[e,t]);function Q(G){Pe({color:"green",title:"Success",icon:s.jsx(eo,{size:"1rem"}),message:G})}function J(G){Pe({color:"red",title:"Error",message:G,autoClose:!1})}return s.jsxs(ot,{children:[s.jsx($n,{opened:A,onClose:M,title:"Upgrade Agent",centered:!0,children:s.jsx(yee,{opened:A,close:M,version:g,loadingStatus:r,handleStatus:L,handleUpgrade:Y})}),s.jsx(Le,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(Ic,{value:n,link:!0})]}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Agent Status"}),s.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),s.jsx(Oe,{onClick:L,loading:r,disabled:E&&!r,children:"Get Status"}),!r&&p&&s.jsx(Me,{children:s.jsxs(Me.Tbody,{children:[s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:"Status"}),s.jsx(Me.Td,{children:s.jsx(nm,{status:p})})]}),s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:"Version"}),s.jsx(Me.Td,{children:g})]}),s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:"Last Updated"}),s.jsx(Me.Td,{children:gr(b,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Reload Config"}),s.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),s.jsx(Oe,{onClick:V,loading:o,disabled:E&&!o,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Upgrade Agent"}),s.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),s.jsx(Oe,{onClick:k,loading:u,disabled:E&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),s.jsx(jn,{my:"lg"}),s.jsx(Le,{order:2,children:"Ping from Agent"}),s.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),s.jsx(pt,{onSubmit:$,children:s.jsxs(je,{children:[s.jsx(ze,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(_n,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:R,disabled:E&&!R,children:s.jsx(lF,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(Op,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!R&&j&&s.jsxs(s.Fragment,{children:[s.jsx(Le,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:j})]})]})}function bee(){return s.jsx(nX,{children:s.jsxs(He,{errorElement:s.jsx(zZ,{}),children:[s.jsx(He,{path:"/signin",element:s.jsx(rJ,{})}),s.jsx(He,{path:"/oauth",element:s.jsx(ZZ,{})}),s.jsx(He,{path:"/resetpassword",element:s.jsx(eJ,{})}),s.jsx(He,{path:"/setpassword/:id/:secret",element:s.jsx(nJ,{})}),s.jsx(He,{path:"/register",element:s.jsx(JZ,{})}),s.jsx(He,{path:"/changepassword",element:s.jsx(MZ,{})}),s.jsx(He,{path:"/security",element:s.jsx(tJ,{})}),s.jsx(He,{path:"/mfa",element:s.jsx(KZ,{})}),s.jsx(He,{path:"/batch",element:s.jsx(NZ,{})}),s.jsx(He,{path:"/bulk/:resourceType",element:s.jsx(OZ,{})}),s.jsx(He,{path:"/smart",element:s.jsx(aJ,{})}),s.jsx(He,{path:"/forms/:id",element:s.jsx(UZ,{})}),s.jsx(He,{path:"/admin/super",element:s.jsx(vJ,{})}),s.jsx(He,{path:"/admin/config",element:s.jsx(hJ,{})}),s.jsxs(He,{path:"/admin",element:s.jsx(pJ,{}),children:[s.jsx(He,{path:"patients",element:s.jsx(fJ,{})}),s.jsx(He,{path:"bots/new",element:s.jsx(sJ,{})}),s.jsx(He,{path:"bots",element:s.jsx(iJ,{})}),s.jsx(He,{path:"clients/new",element:s.jsx(lJ,{})}),s.jsx(He,{path:"clients",element:s.jsx(oJ,{})}),s.jsx(He,{path:"details",element:s.jsx(FT,{})}),s.jsx(He,{path:"invite",element:s.jsx(dJ,{})}),s.jsx(He,{path:"users",element:s.jsx(xJ,{})}),s.jsx(He,{path:"project",element:s.jsx(FT,{})}),s.jsx(He,{path:"secrets",element:s.jsx(mJ,{})}),s.jsx(He,{path:"sites",element:s.jsx(gJ,{})}),s.jsx(He,{path:"members/:membershipId",element:s.jsx(uJ,{})})]}),s.jsx(He,{path:"/lab/assays",element:s.jsx(bJ,{})}),s.jsx(He,{path:"/lab/panels",element:s.jsx(SJ,{})}),s.jsx(He,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(QT,{})}),s.jsx(He,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(QT,{})}),s.jsxs(He,{path:"/:resourceType/new",element:s.jsx(LZ,{}),children:[s.jsx(He,{index:!0,element:s.jsx(uy,{})}),s.jsx(He,{path:"form",element:s.jsx(uy,{})}),s.jsx(He,{path:"json",element:s.jsx(qJ,{})}),s.jsx(He,{path:"profiles",element:s.jsx(uy,{})})]}),s.jsxs(He,{path:"/:resourceType/:id",element:s.jsx(mee,{}),children:[s.jsx(He,{index:!0,element:s.jsx(WT,{})}),s.jsx(He,{path:"apply",element:s.jsx(jJ,{})}),s.jsx(He,{path:"apps",element:s.jsx(CJ,{})}),s.jsx(He,{path:"event",element:s.jsx(TJ,{})}),s.jsx(He,{path:"blame",element:s.jsx(RJ,{})}),s.jsx(He,{path:"bots",element:s.jsx(XJ,{})}),s.jsx(He,{path:"builder",element:s.jsx(IJ,{})}),s.jsx(He,{path:"checklist",element:s.jsx(LJ,{})}),s.jsx(He,{path:"delete",element:s.jsx(zJ,{})}),s.jsx(He,{path:"details",element:s.jsx(BJ,{})}),s.jsx(He,{path:"edit",element:s.jsx(VJ,{})}),s.jsx(He,{path:"editor",element:s.jsx(OJ,{})}),s.jsx(He,{path:"history",element:s.jsx(HJ,{})}),s.jsx(He,{path:"json",element:s.jsx(GJ,{})}),s.jsx(He,{path:"preview",element:s.jsx(QJ,{})}),s.jsx(He,{path:"responses",element:s.jsx(JJ,{})}),s.jsx(He,{path:"report",element:s.jsx(tee,{})}),s.jsx(He,{path:"ranges",element:s.jsx(eee,{})}),s.jsx(He,{path:"subscriptions",element:s.jsx(gee,{})}),s.jsx(He,{path:"timeline",element:s.jsx(WT,{})}),s.jsx(He,{path:"tools",element:s.jsx(xee,{})}),s.jsx(He,{path:"profiles",element:s.jsx(WJ,{})}),s.jsx(He,{path:"export",element:s.jsx(FJ,{})})]}),s.jsx(He,{path:"/:resourceType",element:s.jsx(VT,{})}),s.jsx(He,{path:"/",element:s.jsx(VT,{})})]})})}function See(){const e=_e(),t=e.getUserConfiguration(),n=Mr(),[r]=Kb();return e.isLoading()?s.jsx(ma,{}):s.jsx(lH,{logo:s.jsx(Ua,{size:24}),pathname:n.pathname,searchParams:r,version:zA,menus:wee(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(y.Suspense,{fallback:s.jsx(ma,{}),children:s.jsx(bee,{})})})}function wee(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var a;return{title:r.title,links:((a=r.link)==null?void 0:a.map(o=>({label:o.name,href:o.target,icon:jee(o.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(YV,{})}]}),t}const YT={Patient:dF,Practitioner:QV,Organization:LV,ServiceRequest:aF,DiagnosticReport:sF,Questionnaire:GV,admin:OV,AccessPolicy:WV,Subscription:mF,batch:JV,Observation:ZV};function jee(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in YT){const n=YT[t];return s.jsx(n,{})}}catch{}return s.jsx(Vp,{w:30})}"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister()))).catch(e=>console.error("SW registration failed: ",e))});async function Cee(){const e=Bd(),t=new $A({baseUrl:e.baseUrl,clientId:e.clientId,cacheTime:6e4,autoBatchTime:100,onUnauthenticated:()=>{window.location.pathname!=="/signin"&&window.location.pathname!=="/oauth"&&(window.location.href="/signin?next="+encodeURIComponent(window.location.pathname+window.location.search))}}),n={headings:{sizes:{h1:{fontSize:"1.125rem",fontWeight:"500",lineHeight:"2.0"}}},fontSizes:{xs:"0.6875rem",sm:"0.875rem",md:"0.875rem",lg:"1.0rem",xl:"1.125rem"}},r=RX([{path:"*",element:s.jsx(See,{})}]),a=c=>r.navigate(c);_Y.createRoot(document.getElementById("root")).render(s.jsx(y.StrictMode,{children:s.jsx(mV,{medplum:t,navigate:a,children:s.jsxs(bR,{theme:n,children:[s.jsx(Zi,{position:"bottom-right"}),s.jsx(ZK,{router:r})]})})}))}Cee().catch(console.error);
581
- //# sourceMappingURL=index-pR6Sljiy.js.map