@medplum/app 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,235 @@
1
+ function Qw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var c0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Am(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kw={exports:{}},Dd={},Yw={exports:{}},Fe={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 Zl=Symbol.for("react.element"),jk=Symbol.for("react.portal"),Tk=Symbol.for("react.fragment"),Pk=Symbol.for("react.strict_mode"),kk=Symbol.for("react.profiler"),Rk=Symbol.for("react.provider"),Dk=Symbol.for("react.context"),Ik=Symbol.for("react.forward_ref"),_k=Symbol.for("react.suspense"),Ak=Symbol.for("react.memo"),Nk=Symbol.for("react.lazy"),u0=Symbol.iterator;function Ok(e){return e===null||typeof e!="object"?null:(e=u0&&e[u0]||e["@@iterator"],typeof e=="function"?e:null)}var Xw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jw=Object.assign,Zw={};function Ea(e,t,n){this.props=e,this.context=t,this.refs=Zw,this.updater=n||Xw}Ea.prototype.isReactComponent={};Ea.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ea.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eS(){}eS.prototype=Ea.prototype;function Nm(e,t,n){this.props=e,this.context=t,this.refs=Zw,this.updater=n||Xw}var Om=Nm.prototype=new eS;Om.constructor=Nm;Jw(Om,Ea.prototype);Om.isPureReactComponent=!0;var d0=Array.isArray,tS=Object.prototype.hasOwnProperty,Mm={current:null},nS={key:!0,ref:!0,__self:!0,__source:!0};function rS(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)tS.call(t,r)&&!nS.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Zl,type:e,key:i,ref:s,props:o,_owner:Mm.current}}function Mk(e,t){return{$$typeof:Zl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function $m(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zl}function $k(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var f0=/\/+/g;function rh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?$k(""+e.key):t.toString(36)}function mu(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Zl:case jk:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+rh(s,0):r,d0(o)?(n="",e!=null&&(n=e.replace(f0,"$&/")+"/"),mu(o,t,n,"",function(u){return u})):o!=null&&($m(o)&&(o=Mk(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(f0,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",d0(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+rh(i,l);s+=mu(i,t,n,c,o)}else if(c=Ok(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+rh(i,l++),s+=mu(i,t,n,c,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Fc(e,t,n){if(e==null)return e;var r=[],o=0;return mu(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Lk(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var wn={current:null},gu={transition:null},Fk={ReactCurrentDispatcher:wn,ReactCurrentBatchConfig:gu,ReactCurrentOwner:Mm};Fe.Children={map:Fc,forEach:function(e,t,n){Fc(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fc(e,function(){t++}),t},toArray:function(e){return Fc(e,function(t){return t})||[]},only:function(e){if(!$m(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Fe.Component=Ea;Fe.Fragment=Tk;Fe.Profiler=kk;Fe.PureComponent=Nm;Fe.StrictMode=Pk;Fe.Suspense=_k;Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fk;Fe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Jw({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Mm.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)tS.call(t,c)&&!nS.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Zl,type:e.type,key:o,ref:i,props:r,_owner:s}};Fe.createContext=function(e){return e={$$typeof:Dk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Rk,_context:e},e.Consumer=e};Fe.createElement=rS;Fe.createFactory=function(e){var t=rS.bind(null,e);return t.type=e,t};Fe.createRef=function(){return{current:null}};Fe.forwardRef=function(e){return{$$typeof:Ik,render:e}};Fe.isValidElement=$m;Fe.lazy=function(e){return{$$typeof:Nk,_payload:{_status:-1,_result:e},_init:Lk}};Fe.memo=function(e,t){return{$$typeof:Ak,type:e,compare:t===void 0?null:t}};Fe.startTransition=function(e){var t=gu.transition;gu.transition={};try{e()}finally{gu.transition=t}};Fe.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Fe.useCallback=function(e,t){return wn.current.useCallback(e,t)};Fe.useContext=function(e){return wn.current.useContext(e)};Fe.useDebugValue=function(){};Fe.useDeferredValue=function(e){return wn.current.useDeferredValue(e)};Fe.useEffect=function(e,t){return wn.current.useEffect(e,t)};Fe.useId=function(){return wn.current.useId()};Fe.useImperativeHandle=function(e,t,n){return wn.current.useImperativeHandle(e,t,n)};Fe.useInsertionEffect=function(e,t){return wn.current.useInsertionEffect(e,t)};Fe.useLayoutEffect=function(e,t){return wn.current.useLayoutEffect(e,t)};Fe.useMemo=function(e,t){return wn.current.useMemo(e,t)};Fe.useReducer=function(e,t,n){return wn.current.useReducer(e,t,n)};Fe.useRef=function(e){return wn.current.useRef(e)};Fe.useState=function(e){return wn.current.useState(e)};Fe.useSyncExternalStore=function(e,t,n){return wn.current.useSyncExternalStore(e,t,n)};Fe.useTransition=function(){return wn.current.useTransition()};Fe.version="18.2.0";Yw.exports=Fe;var p=Yw.exports;const b=Am(p),Lm=Qw({__proto__:null,default:b},[p]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 zk=p,Bk=Symbol.for("react.element"),Uk=Symbol.for("react.fragment"),Vk=Object.prototype.hasOwnProperty,Hk=zk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Wk={key:!0,ref:!0,__self:!0,__source:!0};function oS(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Vk.call(t,r)&&!Wk.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Bk,type:e,key:i,ref:s,props:o,_owner:Hk.current}}Dd.Fragment=Uk;Dd.jsx=oS;Dd.jsxs=oS;Kw.exports=Dd;var a=Kw.exports,Hr=function(){return Hr=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Hr.apply(this,arguments)};function iS(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function qk(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var yu="right-scroll-bar-position",vu="width-before-scroll-bar",Gk="with-scroll-bars-hidden",Qk="--removed-body-scroll-bar-size";function oh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Kk(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var h0=new WeakMap;function Yk(e,t){var n=Kk(t||null,function(r){return e.forEach(function(o){return oh(o,r)})});return p.useLayoutEffect(function(){var r=h0.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(l){i.has(l)||oh(l,null)}),i.forEach(function(l){o.has(l)||oh(l,s)})}h0.set(n,e)},[e]),n}function Xk(e){return e}function Jk(e,t){t===void 0&&(t=Xk);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(i),s=n}var c=function(){var d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function Zk(e){e===void 0&&(e={});var t=Jk(null);return t.options=Hr({async:!0,ssr:!1},e),t}var sS=function(e){var t=e.sideCar,n=iS(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 p.createElement(r,Hr({},n))};sS.isSideCarExport=!0;function e2(e,t){return e.useMedium(t),sS}var aS=Zk(),ih=function(){},Id=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:ih,onWheelCapture:ih,onTouchMoveCapture:ih}),o=r[0],i=r[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,C=e.as,v=C===void 0?"div":C,x=e.gapMode,w=iS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,j=Yk([n,t]),E=Hr(Hr({},w),o);return p.createElement(p.Fragment,null,d&&p.createElement(S,{sideCar:aS,removeScrollBar:u,shards:f,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:x}),s?p.cloneElement(p.Children.only(l),Hr(Hr({},E),{ref:j})):p.createElement(v,Hr({},E,{className:c,ref:j}),l))});Id.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Id.classNames={fullWidth:vu,zeroRight:yu};var t2=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function n2(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=t2();return t&&e.setAttribute("nonce",t),e}function r2(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function o2(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var i2=function(){var e=0,t=null;return{add:function(n){e==0&&(t=n2())&&(r2(t,n),o2(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},s2=function(){var e=i2();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lS=function(){var e=s2(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},a2={left:0,top:0,right:0,gap:0},sh=function(e){return parseInt(e||"",10)||0},l2=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[sh(n),sh(r),sh(o)]},c2=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return a2;var t=l2(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])}},u2=lS(),d2=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
18
+ .`.concat(Gk,` {
19
+ overflow: hidden `).concat(r,`;
20
+ padding-right: `).concat(l,"px ").concat(r,`;
21
+ }
22
+ body {
23
+ overflow: hidden `).concat(r,`;
24
+ overscroll-behavior: contain;
25
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
26
+ padding-left: `.concat(o,`px;
27
+ padding-top: `).concat(i,`px;
28
+ padding-right: `).concat(s,`px;
29
+ margin-left:0;
30
+ margin-top:0;
31
+ margin-right: `).concat(l,"px ").concat(r,`;
32
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
33
+ }
34
+
35
+ .`).concat(yu,` {
36
+ right: `).concat(l,"px ").concat(r,`;
37
+ }
38
+
39
+ .`).concat(vu,` {
40
+ margin-right: `).concat(l,"px ").concat(r,`;
41
+ }
42
+
43
+ .`).concat(yu," .").concat(yu,` {
44
+ right: 0 `).concat(r,`;
45
+ }
46
+
47
+ .`).concat(vu," .").concat(vu,` {
48
+ margin-right: 0 `).concat(r,`;
49
+ }
50
+
51
+ body {
52
+ `).concat(Qk,": ").concat(l,`px;
53
+ }
54
+ `)},f2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=p.useMemo(function(){return c2(o)},[o]);return p.createElement(u2,{styles:d2(i,!t,o,n?"":"!important")})},rp=!1;if(typeof window<"u")try{var zc=Object.defineProperty({},"passive",{get:function(){return rp=!0,!0}});window.addEventListener("test",zc,zc),window.removeEventListener("test",zc,zc)}catch{rp=!1}var Es=rp?{passive:!1}:!1,h2=function(e){return e.tagName==="TEXTAREA"},cS=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!h2(e)&&n[t]==="visible")},p2=function(e){return cS(e,"overflowY")},m2=function(e){return cS(e,"overflowX")},p0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=uS(e,r);if(o){var i=dS(e,r),s=i[1],l=i[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},g2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},y2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},uS=function(e,t){return e==="v"?p2(t):m2(t)},dS=function(e,t){return e==="v"?g2(t):y2(t)},v2=function(e,t){return e==="h"&&t==="rtl"?-1:1},x2=function(e,t,n,r,o){var i=v2(e,window.getComputedStyle(t).direction),s=i*r,l=n.target,c=t.contains(l),u=!1,d=s>0,f=0,h=0;do{var m=dS(e,l),g=m[0],y=m[1],C=m[2],v=y-C-i*g;(g||v)&&uS(e,l)&&(f+=v,h+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(o&&Math.abs(f)<1||!o&&s>f)||!d&&(o&&Math.abs(h)<1||!o&&-s>h))&&(u=!0),u},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},m0=function(e){return[e.deltaX,e.deltaY]},g0=function(e){return e&&"current"in e?e.current:e},w2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},S2=function(e){return`
55
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
56
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
+ `)},b2=0,js=[];function C2(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(b2++)[0],i=p.useState(lS)[0],s=p.useRef(e);p.useEffect(function(){s.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=qk([e.lockRef.current],(e.shards||[]).map(g0),!0).filter(Boolean);return y.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(y,C){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var v=Bc(y),x=n.current,w="deltaX"in y?y.deltaX:x[0]-v[0],S="deltaY"in y?y.deltaY:x[1]-v[1],j,E=y.target,T=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in y&&T==="h"&&E.type==="range")return!1;var P=p0(T,E);if(!P)return!0;if(P?j=T:(j=T==="v"?"h":"v",P=p0(T,E)),!P)return!1;if(!r.current&&"changedTouches"in y&&(w||S)&&(r.current=j),!j)return!0;var k=r.current||j;return x2(k,C,y,k==="h"?w:S,!0)},[]),c=p.useCallback(function(y){var C=y;if(!(!js.length||js[js.length-1]!==i)){var v="deltaY"in C?m0(C):Bc(C),x=t.current.filter(function(j){return j.name===C.type&&(j.target===C.target||C.target===j.shadowParent)&&w2(j.delta,v)})[0];if(x&&x.should){C.cancelable&&C.preventDefault();return}if(!x){var w=(s.current.shards||[]).map(g0).filter(Boolean).filter(function(j){return j.contains(C.target)}),S=w.length>0?l(C,w[0]):!s.current.noIsolation;S&&C.cancelable&&C.preventDefault()}}},[]),u=p.useCallback(function(y,C,v,x){var w={name:y,delta:C,target:v,should:x,shadowParent:E2(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=p.useCallback(function(y){n.current=Bc(y),r.current=void 0},[]),f=p.useCallback(function(y){u(y.type,m0(y),y.target,l(y,e.lockRef.current))},[]),h=p.useCallback(function(y){u(y.type,Bc(y),y.target,l(y,e.lockRef.current))},[]);p.useEffect(function(){return js.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Es),document.addEventListener("touchmove",c,Es),document.addEventListener("touchstart",d,Es),function(){js=js.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,Es),document.removeEventListener("touchmove",c,Es),document.removeEventListener("touchstart",d,Es)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(i,{styles:S2(o)}):null,m?p.createElement(f2,{gapMode:e.gapMode}):null)}function E2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const j2=e2(aS,C2);var _d=p.forwardRef(function(e,t){return p.createElement(Id,Hr({},e,{ref:t,sideCar:j2}))});_d.classNames=Id.classNames;function lt(e){return Object.keys(e)}function ah(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Fm(e,t){const n={...e},r=t;return ah(e)&&ah(t)&&Object.keys(t).forEach(o=>{ah(r[o])&&o in e?n[o]=Fm(n[o],r[o]):n[o]=r[o]}),n}function T2(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function P2(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 op(e){const t=P2(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 lh(e){return`calc(${e} * var(--mantine-scale))`}function fS(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const o=`${r/16}${e}`;return t?lh(o):o}if(typeof r=="string"){if(r.startsWith("calc(")||r.startsWith("var(")||r.startsWith("clamp("))return r;if(r.includes(" "))return r.split(" ").map(i=>n(i)).join(" ");if(r.includes(e))return t?lh(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?lh(i):i}}return r}return n}const z=fS("rem",{shouldScale:!0}),Mu=fS("em");function ts(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function hS(e){return typeof e=="number"?!0:typeof e=="string"?e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!==""?!0:/[0-9]/.test(e.trim().replace("-","")[0]):!1}function Co(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==b.Fragment:!1}function Sn(e){const t=p.createContext(null);return[({children:o,value:i})=>b.createElement(t.Provider,{value:i},o),()=>{const o=p.useContext(t);if(o===null)throw new Error(e);return o}]}function ec(e=null){const t=p.createContext(e);return[({children:o,value:i})=>b.createElement(t.Provider,{value:i},o),()=>p.useContext(t)]}function y0(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function $u(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function k2(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 R2(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 D2(e,t,n){return $u(e,n)===$u(t,n)}function pS({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:s}){return l=>{var g;n==null||n(l);const c=Array.from(((g=$u(l.currentTarget,e))==null?void 0:g.querySelectorAll(t))||[]).filter(y=>D2(l.currentTarget,y,e)),u=c.findIndex(y=>l.currentTarget===y),d=R2(u,c,r),f=k2(u,c,r),h=i==="rtl"?f:d,m=i==="rtl"?d:f;switch(l.key){case"ArrowRight":{s==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[h].focus(),o&&c[h].click());break}case"ArrowLeft":{s==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[m].focus(),o&&c[m].click());break}case"ArrowUp":{s==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[f].focus(),o&&c[f].click());break}case"ArrowDown":{s==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[d].focus(),o&&c[d].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!c[0].disabled&&c[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const y=c.length-1;!c[y].disabled&&c[y].focus();break}}}}const I2={app:100,modal:200,popover:300,overlay:400,max:9999};function Ir(e){return I2[e]}const _2=()=>{};function A2(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||_2:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function Ce(e,t="size",n=!0){if(e!==void 0)return hS(e)?n?z(e):e:`var(--${t}-${e})`}function Jt(e){return Ce(e,"mantine-spacing")}function ut(e){return e===void 0?"var(--mantine-radius-default)":Ce(e,"mantine-radius")}function Ht(e){return Ce(e,"mantine-font-size")}function mS(e){return Ce(e,"mantine-line-height",!1)}function zm(e){if(e)return Ce(e,"mantine-shadow",!1)}function Un(e,t){return n=>{e==null||e(n),t==null||t(n)}}function Bm(e,t){return e in t.breakpoints?op(t.breakpoints[e]):op(e)}function El(e,t){const n=e.map(r=>({value:r,px:Bm(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Wo(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function N2(e,t,n){var r;return n?Array.from(((r=$u(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function O2(){const[e,t]=p.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}var M2={};function gS(){return typeof process<"u"&&M2?"production":"development"}function yS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=yS(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Je(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=yS(e))&&(r&&(r+=" "),r+=t);return r}const $2={};function L2(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=Je(t[r],o):t[r]=o})}),t}function Ad({theme:e,classNames:t,props:n,stylesCtx:r}){const i=(Array.isArray(t)?t:[t]).map(s=>typeof s=="function"?s(e,n,r):s||$2);return L2(i)}function Lu({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((i,s)=>typeof s=="function"?{...i,...s(e,n,r)}:{...i,...s},{})}function Um(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function v0(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Ii(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Nd(e,t){const n=Ii(e),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}const x0=["mousedown","touchstart"];function F2(e,t,n){const r=p.useRef();return p.useEffect(()=>{const o=i=>{const{target:s}=i??{};if(Array.isArray(n)){const l=(s==null?void 0:s.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(s)&&s.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else r.current&&!r.current.contains(s)&&e()};return(t||x0).forEach(i=>document.addEventListener(i,o)),()=>{(t||x0).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function vS({timeout:e=2e3}={}){const[t,n]=p.useState(null),[r,o]=p.useState(!1),[i,s]=p.useState(null),l=d=>{window.clearTimeout(i),s(window.setTimeout(()=>o(!1),e)),o(d)};return{copy:d=>{"clipboard"in navigator?navigator.clipboard.writeText(d).then(()=>l(!0)).catch(f=>n(f)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(i)},error:t,copied:r}}function z2(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function B2(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function xS(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=p.useState(n?t:B2(e)),i=p.useRef();return p.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),z2(i.current,s=>o(s.matches))},[e]),r}function U2(e,t){return xS("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const ja=typeof document<"u"?p.useLayoutEffect:p.useEffect;function fo(e,t){const n=p.useRef(!1);p.useEffect(()=>()=>{n.current=!1},[]),p.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function wS({opened:e,shouldReturnFocus:t=!0}){const n=p.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return fo(()=>{let o=-1;const i=s=>{s.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}function V2(e,t="body > :not(script)"){const n=Um(),r=Array.from(document.querySelectorAll(t)).map(o=>{var c;if((c=o==null?void 0:o.shadowRoot)!=null&&c.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),s=o.getAttribute("data-hidden"),l=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!s&&!l&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:s||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}const H2=/input|select|textarea|button|object/,SS="a, input, select, textarea, button, object, [tabindex]";function W2(e){return e.style.display==="none"}function q2(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(W2(n))return!1;n=n.parentNode}return!0}function bS(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function ip(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(bS(e));return(H2.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&q2(e)}function CS(e){const t=bS(e);return(Number.isNaN(t)||t>=0)&&ip(e)}function G2(e){return Array.from(e.querySelectorAll(SS)).filter(CS)}function Q2(e,t){const n=G2(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let i=r===o.activeElement||e===o.activeElement;const s=o.activeElement;if(s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(i=n.filter(d=>d.getAttribute("type")==="radio"&&d.getAttribute("name")===s.getAttribute("name")).includes(r)),!i)return;t.preventDefault();const c=n[t.shiftKey?n.length-1:0];c&&c.focus()}function K2(e=!0){const t=p.useRef(),n=p.useRef(null),r=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const l=Array.from(i.querySelectorAll(SS));s=l.find(CS)||l.find(ip)||null,!s&&ip(i)&&(s=i)}s&&s.focus({preventScroll:!0})},o=p.useCallback(i=>{if(e){if(i===null){n.current&&(n.current(),n.current=null);return}n.current=V2(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&r(i)}),t.current=i):t.current=null)}},[e]);return p.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const i=s=>{s.key==="Tab"&&t.current&&Q2(t.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const Y2=e=>(e+1)%1e6;function X2(){const[,e]=p.useReducer(Y2,0);return e}const J2=b.useId||(()=>{});function Z2(){const e=J2();return e?`mantine-${e.replace(/:/g,"")}`:""}function bn(e){const t=Z2(),[n,r]=p.useState(t);return ja(()=>{r(Um())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function ES(e,t,n){p.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Vm(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function eR(...e){return t=>{e.forEach(n=>Vm(n,t))}}function Gt(...e){return p.useCallback(eR(...e),e)}function ln({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=p.useState(t!==void 0?t:n),s=(l,...c)=>{i(l),r==null||r(l,...c)};return e!==void 0?[e,r,!0]:[o,s,!1]}function Oo(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Uc="dots";function tR({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:i}){const s=Math.max(Math.trunc(e),0),[l,c]=ln({value:r,onChange:i,defaultValue:o,finalValue:o}),u=y=>{y<=0?c(1):y>s?c(s):c(y)},d=()=>u(l+1),f=()=>u(l-1),h=()=>u(1),m=()=>u(s);return{range:p.useMemo(()=>{if(t*2+3+n*2>=s)return Oo(1,s);const C=Math.max(l-t,n),v=Math.min(l+t,s-n),x=C>n+2,w=v<s-(n+1);if(!x&&w){const S=t*2+n+2;return[...Oo(1,S),Uc,...Oo(s-(n-1),s)]}if(x&&!w){const S=n+1+2*t;return[...Oo(1,n),Uc,...Oo(s-S,s)]}return[...Oo(1,n),Uc,...Oo(C,v),Uc,...Oo(s-n+1,s)]},[s,t,l]),active:l,setPage:u,next:d,previous:f,first:h,last:m}}function Hm(e,t){return xS("(prefers-reduced-motion: reduce)",e,t)}const nR={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function rR(){const e=p.useRef(0),t=p.useRef(null),[n,r]=p.useState(nR),o=p.useMemo(()=>typeof window<"u"?new ResizeObserver(i=>{const s=i[0];s&&(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{t.current&&r(s.contentRect)}))}):null,[]);return p.useEffect(()=>(t.current&&(o==null||o.observe(t.current)),()=>{o==null||o.disconnect(),e.current&&cancelAnimationFrame(e.current)}),[t.current]),[t,n]}function oR(e=!1,t){const{onOpen:n,onClose:r}=t||{},[o,i]=p.useState(e),s=p.useCallback(()=>{i(u=>u||(n==null||n(),!0))},[n]),l=p.useCallback(()=>{i(u=>u&&(r==null||r(),!1))},[r]),c=p.useCallback(()=>{o?l():s()},[l,s,o]);return[o,{open:s,close:l,toggle:c}]}function iR(e,t,n={autoInvoke:!1}){const r=p.useRef(null),o=p.useCallback((...s)=>{r.current||(r.current=window.setTimeout(()=>{e(s),r.current=null},t))},[t]),i=p.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return p.useEffect(()=>(n.autoInvoke&&o(),i),[i,o]),{start:o,clear:i}}const Wm=p.createContext(null);function Od(){const e=p.useContext(Wm);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function sR(){return Od().cssVariablesResolver}function aR(){return Od().classNamesPrefix}function qm(){return Od().getStyleNonce}function lR(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function cR(e){let t=e.replace("#","");if(t.length===3){const s=t.split("");t=[s[0],s[0],s[1],s[1],s[2],s[2]].join("")}if(t.length===8){const s=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:s}}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n&255;return{r,g:o,b:i,a:1}}function uR(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o||1}}function dR(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),o=parseInt(n[2],10)/100,i=parseInt(n[3],10)/100,s=n[5]?parseFloat(n[5]):void 0,l=(1-Math.abs(2*i-1))*o,c=r/60,u=l*(1-Math.abs(c%2-1)),d=i-l/2;let f,h,m;return c>=0&&c<1?(f=l,h=u,m=0):c>=1&&c<2?(f=u,h=l,m=0):c>=2&&c<3?(f=0,h=l,m=u):c>=3&&c<4?(f=0,h=u,m=l):c>=4&&c<5?(f=u,h=0,m=l):(f=l,h=0,m=u),{r:Math.round((f+d)*255),g:Math.round((h+d)*255),b:Math.round((m+d)*255),a:s||1}}function Gm(e){return lR(e)?cR(e):e.startsWith("rgb")?uR(e):e.startsWith("hsl")?dR(e):{r:0,g:0,b:0,a:1}}function Vc(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=Gm(e),s=1-t,l=c=>Math.round(c*s);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function Fu(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function ch(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function fR(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function hR(e){if(e.startsWith("oklch("))return(fR(e)||0)/100;const{r:t,g:n,b:r}=Gm(e),o=t/255,i=n/255,s=r/255,l=ch(o),c=ch(i),u=ch(s);return .2126*l+.7152*c+.0722*u}function Ba(e,t=.179){return e.startsWith("var(")?!1:hR(e)>t}function Jr({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:Ba(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:Ba(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:Ba(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),i=o?Number(o):void 0,s=r in t.colors;if(s){const l=i!==void 0?t.colors[r][i]:t.colors[r][Fu(t,n||"light")];return{color:r,value:l,shade:i,isThemeColor:s,isLight:Ba(l,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:s,isLight:Ba(e,t.luminanceThreshold),shade:i,variable:void 0}}function gt(e,t){const n=Jr({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function sp(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=gt(n.from,t),o=gt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function Xt(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const i=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${i}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=Gm(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const pR=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=Jr({color:e,theme:t}),s=typeof o=="boolean"?o:t.autoContrast;if(n==="filled"){const l=s&&i.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return i.isThemeColor?i.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:l,border:`${z(1)} solid transparent`}:{background:`var(--mantine-color-${i.color}-${i.shade})`,hover:`var(--mantine-color-${i.color}-${i.shade===9?8:i.shade+1})`,color:l,border:`${z(1)} solid transparent`}:{background:e,hover:Vc(e,.1),color:l,border:`${z(1)} solid transparent`}}if(n==="light"){if(i.isThemeColor){if(i.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:`${z(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:Xt(l,.1),hover:Xt(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${z(1)} solid transparent`}}return{background:Xt(e,.1),hover:Xt(e,.12),color:e,border:`${z(1)} solid transparent`}}if(n==="outline")return i.isThemeColor?i.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${z(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Xt(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${z(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:Xt(e,.05),color:e,border:`${z(1)} solid ${e}`};if(n==="subtle"){if(i.isThemeColor){if(i.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${z(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:"transparent",hover:Xt(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${z(1)} solid transparent`}}return{background:"transparent",hover:Xt(e,.12),color:e,border:`${z(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${z(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${z(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${z(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:Vc(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${z(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Vc(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${z(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Vc(t.white,.01),color:e,border:`${z(1)} solid transparent`}:n==="gradient"?{background:sp(r,t),hover:sp(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:`${z(1)} solid var(--mantine-color-default-border)`}:{}},mR={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"]},w0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Qm={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:mR,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:pR,autoContrast:!1,luminanceThreshold:.3,fontFamily:w0,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:w0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:z(34),lineHeight:"1.3"},h2:{fontSize:z(26),lineHeight:"1.35"},h3:{fontSize:z(22),lineHeight:"1.4"},h4:{fontSize:z(18),lineHeight:"1.45"},h5:{fontSize:z(16),lineHeight:"1.5"},h6:{fontSize:z(14),lineHeight:"1.5"}}},fontSizes:{xs:z(12),sm:z(14),md:z(16),lg:z(18),xl:z(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:z(2),sm:z(4),md:z(8),lg:z(16),xl:z(32)},spacing:{xs:z(10),sm:z(12),md:z(16),lg:z(20),xl:z(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), 0 ${z(1)} ${z(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${z(10)} ${z(15)} ${z(-5)}, rgba(0, 0, 0, 0.04) 0 ${z(7)} ${z(7)} ${z(-5)}`,md:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${z(20)} ${z(25)} ${z(-5)}, rgba(0, 0, 0, 0.04) 0 ${z(10)} ${z(10)} ${z(-5)}`,lg:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${z(28)} ${z(23)} ${z(-7)}, rgba(0, 0, 0, 0.04) 0 ${z(12)} ${z(12)} ${z(-7)}`,xl:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${z(36)} ${z(28)} ${z(-7)}, rgba(0, 0, 0, 0.04) 0 ${z(17)} ${z(17)} ${z(-7)}`},other:{},components:{}};function S0(e){return e==="auto"||e==="dark"||e==="light"}function gR({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 S0(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&&S0(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const yR="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",b0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function uh(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function C0(e){if(!(e.primaryColor in e.colors))throw new Error(yR);if(typeof e.primaryShade=="object"&&(!uh(e.primaryShade.dark)||!uh(e.primaryShade.light)))throw new Error(b0);if(typeof e.primaryShade=="number"&&!uh(e.primaryShade))throw new Error(b0)}function vR(e,t){var r;if(!t)return C0(e),e;const n=Fm(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),C0(n),n}const Km=p.createContext(null),xR=()=>p.useContext(Km)||Qm;function Rt(){const e=p.useContext(Km);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 jS({theme:e,children:t,inherit:n=!0}){const r=xR(),o=p.useMemo(()=>vR(n?r:Qm,e),[e,r,n]);return b.createElement(Km.Provider,{value:o},t)}jS.displayName="@mantine/core/MantineThemeProvider";function wR(){const e=Rt(),t=qm(),n=lt(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),s=op(e.breakpoints[o]),l=i?`${s-.1}px`:Mu(s-.1),c=i?`${s}px`:Mu(s);return`${r}@media (max-width: ${l}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${c}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return b.createElement("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function dh(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function fh(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function SR(e,t){const n=dh(e.variables),r=n?fh(t,n):"",o=dh(e.dark),i=o?fh(`${t}[data-mantine-color-scheme="dark"]`,o):"",s=dh(e.light),l=s?fh(`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${i}${l}`}function ns({color:e,theme:t,autoContrast:n=!0}){return(typeof n=="boolean"?n:t.autoContrast)&&Jr({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function E0(e,t){return ns({color:e.colors[e.primaryColor][Fu(e,t)],theme:e,autoContrast:null})}function Ts(e,t,n){lt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const TS=e=>{const t=Fu(e,"dark"),n=Fu(e,"light"),r=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:z(e.defaultRadius),o={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-color-scheme":"light dark","--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":r,"--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":E0(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}-${n})`,"--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)"},dark:{"--mantine-primary-color-contrast":E0(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)"}};Ts(o.variables,e.breakpoints,"breakpoint"),Ts(o.variables,e.spacing,"spacing"),Ts(o.variables,e.fontSizes,"font-size"),Ts(o.variables,e.lineHeights,"line-height"),Ts(o.variables,e.shadows,"shadow"),Ts(o.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((s,l)=>{o.variables[`--mantine-primary-color-${l}`]=`var(--mantine-color-${e.primaryColor}-${l})`}),lt(e.colors).forEach(s=>{e.colors[s].forEach((u,d)=>{o.variables[`--mantine-color-${s}-${d}`]=u});const l=`var(--mantine-color-${s}-${n===9?8:n+1})`,c=`var(--mantine-color-${s}-${t===9?8:t+1})`;o.light["--mantine-color-dimmed"]="var(--mantine-color-gray-6)",o.light[`--mantine-color-${s}-text`]=`var(--mantine-color-${s}-filled)`,o.light[`--mantine-color-${s}-filled`]=`var(--mantine-color-${s}-${n})`,o.light[`--mantine-color-${s}-filled-hover`]=l,o.light[`--mantine-color-${s}-light`]=Xt(e.colors[s][n],.1),o.light[`--mantine-color-${s}-light-hover`]=Xt(e.colors[s][n],.12),o.light[`--mantine-color-${s}-light-color`]=`var(--mantine-color-${s}-${n})`,o.light[`--mantine-color-${s}-outline`]=`var(--mantine-color-${s}-${n})`,o.light[`--mantine-color-${s}-outline-hover`]=Xt(e.colors[s][n],.05),o.dark["--mantine-color-dimmed"]="var(--mantine-color-dark-2)",o.dark[`--mantine-color-${s}-text`]=`var(--mantine-color-${s}-4)`,o.dark[`--mantine-color-${s}-filled`]=`var(--mantine-color-${s}-${t})`,o.dark[`--mantine-color-${s}-filled-hover`]=c,o.dark[`--mantine-color-${s}-light`]=Xt(e.colors[s][Math.max(0,t-2)],.15),o.dark[`--mantine-color-${s}-light-hover`]=Xt(e.colors[s][Math.max(0,t-2)],.2),o.dark[`--mantine-color-${s}-light-color`]=`var(--mantine-color-${s}-${Math.max(t-5,0)})`,o.dark[`--mantine-color-${s}-outline`]=`var(--mantine-color-${s}-${Math.max(t-4,0)})`,o.dark[`--mantine-color-${s}-outline-hover`]=Xt(e.colors[s][Math.max(t-4,0)],.05)});const i=e.headings.sizes;return lt(i).forEach(s=>{o.variables[`--mantine-${s}-font-size`]=i[s].fontSize,o.variables[`--mantine-${s}-line-height`]=i[s].lineHeight,o.variables[`--mantine-${s}-font-weight`]=i[s].fontWeight||e.headings.fontWeight}),o};function bR({theme:e,generator:t}){const n=TS(e),r=t==null?void 0:t(e);return r?Fm(n,r):n}const hh=TS(Qm);function CR(e){const t={variables:{},light:{},dark:{}};return lt(e.variables).forEach(n=>{hh.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),lt(e.light).forEach(n=>{hh.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),lt(e.dark).forEach(n=>{hh.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function ER(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 PS({cssVariablesSelector:e}){const t=Rt(),n=qm(),r=sR(),o=bR({theme:t,generator:r}),i=e===":root",s=i?CR(o):o,l=SR(s,e);return l?b.createElement("style",{"data-mantine-styles":!0,nonce:n==null?void 0:n(),dangerouslySetInnerHTML:{__html:`${l}${i?"":ER(e)}`}}):null}PS.displayName="@mantine/CssVariables";function jR(){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 Ps(e,t){var r;const n=e!=="auto"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";(r=t())==null||r.setAttribute("data-mantine-color-scheme",n)}function TR({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=p.useRef(),[i,s]=p.useState(()=>e.get(t)),l=r||i,c=p.useCallback(d=>{r||(Ps(d,n),s(d),e.set(d))},[e.set,l,r]),u=p.useCallback(()=>{s(t),Ps(t,n),e.clear()},[e.clear,t]);return p.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),ja(()=>{Ps(e.get(t),n)},[]),p.useEffect(()=>{var f;if(r)return Ps(r,n),()=>{};r===void 0&&Ps(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const d=h=>{i==="auto"&&Ps(h.matches?"dark":"light",n)};return(f=o.current)==null||f.addEventListener("change",d),()=>{var h;return(h=o.current)==null?void 0:h.removeEventListener("change",d)}},[i,r]),{colorScheme:l,setColorScheme:c,clearColorScheme:u}}function PR({respectReducedMotion:e,getRootElement:t}){ja(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}jR();function kS({theme:e,children:t,getStyleNonce:n,withCssVariables:r=!0,cssVariablesSelector:o=":root",classNamesPrefix:i="mantine",colorSchemeManager:s=gR(),defaultColorScheme:l="light",getRootElement:c=()=>document.documentElement,cssVariablesResolver:u,forceColorScheme:d}){const{colorScheme:f,setColorScheme:h,clearColorScheme:m}=TR({defaultColorScheme:l,forceColorScheme:d,manager:s,getRootElement:c});return PR({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:c}),b.createElement(Wm.Provider,{value:{colorSchemeManager:s,colorScheme:f,setColorScheme:h,clearColorScheme:m,getRootElement:c,classNamesPrefix:i,getStyleNonce:n,cssVariablesResolver:u,cssVariablesSelector:o}},b.createElement(jS,{theme:e},r&&b.createElement(PS,{cssVariablesSelector:o}),b.createElement(wR,null),t))}kS.displayName="@mantine/core/MantineProvider";function Md({classNames:e,styles:t,props:n,stylesCtx:r}){const o=Rt();return{resolvedClassNames:Ad({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Lu({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const kR={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function RR({theme:e,options:t,unstyled:n}){return Je((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||kR[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function DR({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Ad({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function IR({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Ad({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function _R({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function AR({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function NR({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function OR({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var s,l;return(l=Ad({theme:t,classNames:(s=t.components[i])==null?void 0:s.classNames,props:r,stylesCtx:o}))==null?void 0:l[n]})}function MR({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function $R({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:i,classes:s,unstyled:l,className:c,rootSelector:u,props:d,stylesCtx:f}){return Je(RR({theme:e,options:t,unstyled:l}),OR({theme:e,themeName:n,selector:r,props:d,stylesCtx:f}),MR({options:t,classes:s,selector:r,unstyled:l}),IR({selector:r,stylesCtx:f,theme:e,classNames:i,props:d}),DR({selector:r,stylesCtx:f,options:t,props:d,theme:e}),_R({rootSelector:u,selector:r,className:c}),AR({selector:r,classes:s,unstyled:l}),NR({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function LR({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var s;return Lu({theme:e,styles:(s=e.components[i])==null?void 0:s.styles,props:n,stylesCtx:r})[o]}).reduce((i,s)=>({...i,...s}),{})}function ap({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...ap({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function FR(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...ts(n[r])}}),t),{})}function zR({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:s}){var l;return(l=FR([t==null?void 0:t(n,r,o),...s.map(c=>{var u,d,f;return(f=(d=(u=n.components)==null?void 0:u[c])==null?void 0:d.vars)==null?void 0:f.call(d,n,r,o)}),e==null?void 0:e(n,r,o)]))==null?void 0:l[i]}function BR({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:s,styles:l,style:c,vars:u,varsResolver:d}){return{...LR({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...Lu({theme:e,styles:l,props:o,stylesCtx:i})[n],...Lu({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...zR({theme:e,props:o,stylesCtx:i,vars:u,varsResolver:d,selector:n,themeName:t}),...s===n?ap({style:c,theme:e}):null,...ap({style:r==null?void 0:r.style,theme:e})}}function le({name:e,classes:t,props:n,stylesCtx:r,className:o,style:i,rootSelector:s="root",unstyled:l,classNames:c,styles:u,vars:d,varsResolver:f}){const h=Rt(),m=aR(),g=(Array.isArray(e)?e:[e]).filter(y=>y);return(y,C)=>({className:$R({theme:h,options:C,themeName:g,selector:y,classNamesPrefix:m,classNames:c,classes:t,unstyled:l,className:o,rootSelector:s,props:n,stylesCtx:r}),style:BR({theme:h,themeName:g,selector:y,options:C,props:n,stylesCtx:r,rootSelector:s,styles:u,style:i,vars:d,varsResolver:f})})}function j0(){const e=document.createElement("style");return e.innerHTML="*, *::before, *::after {transition: none !important;}",e.setAttribute("data-mantine-disable-transition","true"),document.head.appendChild(e),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(n=>n.remove())}function UR({keepTransitions:e}={}){const t=p.useRef(),n=p.useRef(),r=p.useContext(Wm);if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const o=u=>{r.setColorScheme(u),t.current=e?()=>{}:j0(),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var d;(d=t.current)==null||d.call(t)},10)},i=()=>{r.clearColorScheme(),t.current=e?()=>{}:j0(),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var u;(u=t.current)==null||u.call(t)},10)},s=U2("light",{getInitialValueInEffect:!1}),l=r.colorScheme==="auto"?s:r.colorScheme,c=p.useCallback(()=>o(l==="light"?"dark":"light"),[o,l]);return p.useEffect(()=>()=>{var u;(u=t.current)==null||u.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:o,clearColorScheme:i,toggleColorScheme:c}}function U(e,t,n){var s;const r=Rt(),o=(s=r.components[e])==null?void 0:s.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...ts(n)}}function T0(e){return lt(e).reduce((t,n)=>e[n]!==void 0?`${t}${T2(n)}:${e[n]};`:t,"").trim()}function VR({selector:e,styles:t,media:n}){const r=t?T0(t):"",o=Array.isArray(n)?n.map(i=>`@media${i.query}{${e}{${T0(i.styles)}}}`):[];return`${r?`${e}{${r}}`:""}${o.join("")}`.trim()}function Ta({selector:e,styles:t,media:n}){const r=qm();return b.createElement("style",{"data-mantine-styles":"inline",nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:VR({selector:e,styles:t,media:n})}})}function Eo(e){const{m:t,mx:n,my:r,mt:o,mb:i,ml:s,mr:l,p:c,px:u,py:d,pt:f,pb:h,pl:m,pr:g,bg:y,c:C,opacity:v,ff:x,fz:w,fw:S,lts:j,ta:E,lh:T,fs:P,tt:k,td:D,w:M,miw:R,maw:O,h:N,mih:B,mah:I,bgsz:$,bgp:_,bgr:F,bga:q,pos:G,top:oe,left:Te,bottom:Ee,right:_e,inset:Pe,display:De,flex:Qe,hiddenFrom:qe,visibleFrom:dt,lightHidden:Y,darkHidden:je,...Ae}=e;return{styleProps:ts({m:t,mx:n,my:r,mt:o,mb:i,ml:s,mr:l,p:c,px:u,py:d,pt:f,pb:h,pl:m,pr:g,bg:y,c:C,opacity:v,ff:x,fz:w,fw:S,lts:j,ta:E,lh:T,fs:P,tt:k,td:D,w:M,miw:R,maw:O,h:N,mih:B,mah:I,bgsz:$,bgp:_,bgr:F,bga:q,pos:G,top:oe,left:Te,bottom:Ee,right:_e,inset:Pe,display:De,flex:Qe,hiddenFrom:qe,visibleFrom:dt,lightHidden:Y,darkHidden:je}),rest:Ae}}const HR={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"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},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"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},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:"identity",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 RS(e,t){const n=Jr({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 WR(e,t){const n=Jr({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:RS(e,t)}const P0={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)"};function qR(e){return typeof e=="string"&&e in P0?P0[e]:e}function GR(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="number"||typeof e=="string"?z(e):e}function QR(e){return e}function KR(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:e}function YR(e){return typeof e=="number"?z(e):e}function XR(e,t){if(typeof e=="number")return z(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return z(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const ph={color:RS,textColor:WR,fontSize:GR,spacing:XR,identity:QR,size:YR,lineHeight:KR,fontFamily:qR};function k0(e){return e.replace("(min-width: ","").replace("em)","")}function JR({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(k0(o))-Number(k0(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function ZR(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function eD(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function tD(e){return typeof e=="object"&&e!==null?lt(e).filter(t=>t!=="base"):[]}function nD(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function DS({styleProps:e,data:t,theme:n}){return JR(lt(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom")return r;const i=t[o],s=Array.isArray(i.property)?i.property:[i.property],l=eD(e[o]);if(!ZR(e[o]))return s.forEach(u=>{r.inlineStyles[u]=ph[i.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=tD(e[o]);return s.forEach(u=>{l&&(r.styles[u]=ph[i.type](l,n)),c.forEach(d=>{const f=`(min-width: ${n.breakpoints[d]})`;r.media[f]={...r.media[f],[u]:ph[i.type](nD(e[o],d),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function tc(){return`__m__-${p.useId().replace(/:/g,"")}`}function IS(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...IS(r,t)}),{}):typeof e=="function"?e(t):e??{}}function _S(e){return e.startsWith("data-")?e:`data-${e}`}function rD(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[_S(n)]=e[n]),t},{})}function AS(e){return e?typeof e=="string"?{[_S(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...AS(n)}),{}):rD(e):null}function lp(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...lp(r,t)}),{}):typeof e=="function"?e(t):e??{}}function oD({theme:e,style:t,vars:n,styleProps:r}){const o=lp(t,e),i=lp(n,e);return{...o,...i,...r}}const NS=p.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:i,size:s,hiddenFrom:l,visibleFrom:c,lightHidden:u,darkHidden:d,renderRoot:f,...h},m)=>{const g=Rt(),y=e||"div",{styleProps:C,rest:v}=Eo(h),x=tc(),w=DS({styleProps:C,theme:g,data:HR}),S={ref:m,style:oD({theme:g,style:t,vars:n,styleProps:w.inlineStyles}),className:Je(r,{[x]:w.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":d,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${c}`]:c}),"data-variant":o,"data-size":hS(s)?void 0:s||void 0,...AS(i),...v};return b.createElement(b.Fragment,null,w.hasResponsiveStyles&&b.createElement(Ta,{selector:`.${x}`,styles:w.styles,media:w.media}),typeof f=="function"?f(S):b.createElement(y,{...S}))});NS.displayName="@mantine/core/Box";const W=NS;function OS(e){return e}function Q(e){const t=p.forwardRef(e);return t.extend=OS,t}function un(e){const t=p.forwardRef(e);return t.extend=OS,t}const iD=p.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function rs(){return p.useContext(iD)}var MS={exports:{}},Kn={},$S={exports:{}},LS={};/**
61
+ * @license React
62
+ * scheduler.production.min.js
63
+ *
64
+ * Copyright (c) Facebook, Inc. and its 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
+ */(function(e){function t(_,F){var q=_.length;_.push(F);e:for(;0<q;){var G=q-1>>>1,oe=_[G];if(0<o(oe,F))_[G]=F,_[q]=oe,q=G;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var F=_[0],q=_.pop();if(q!==F){_[0]=q;e:for(var G=0,oe=_.length,Te=oe>>>1;G<Te;){var Ee=2*(G+1)-1,_e=_[Ee],Pe=Ee+1,De=_[Pe];if(0>o(_e,q))Pe<oe&&0>o(De,_e)?(_[G]=De,_[Pe]=q,G=Pe):(_[G]=_e,_[Ee]=q,G=Ee);else if(Pe<oe&&0>o(De,q))_[G]=De,_[Pe]=q,G=Pe;else break e}}return F}function o(_,F){var q=_.sortIndex-F.sortIndex;return q!==0?q:_.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,y=!1,C=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=_)r(u),F.sortIndex=F.expirationTime,t(c,F);else break;F=n(u)}}function S(_){if(y=!1,w(_),!g)if(n(c)!==null)g=!0,I(j);else{var F=n(u);F!==null&&$(S,F.startTime-_)}}function j(_,F){g=!1,y&&(y=!1,v(P),P=-1),m=!0;var q=h;try{for(w(F),f=n(c);f!==null&&(!(f.expirationTime>F)||_&&!M());){var G=f.callback;if(typeof G=="function"){f.callback=null,h=f.priorityLevel;var oe=G(f.expirationTime<=F);F=e.unstable_now(),typeof oe=="function"?f.callback=oe:f===n(c)&&r(c),w(F)}else r(c);f=n(c)}if(f!==null)var Te=!0;else{var Ee=n(u);Ee!==null&&$(S,Ee.startTime-F),Te=!1}return Te}finally{f=null,h=q,m=!1}}var E=!1,T=null,P=-1,k=5,D=-1;function M(){return!(e.unstable_now()-D<k)}function R(){if(T!==null){var _=e.unstable_now();D=_;var F=!0;try{F=T(!0,_)}finally{F?O():(E=!1,T=null)}}else E=!1}var O;if(typeof x=="function")O=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,B=N.port2;N.port1.onmessage=R,O=function(){B.postMessage(null)}}else O=function(){C(R,0)};function I(_){T=_,E||(E=!0,O())}function $(_,F){P=C(function(){_(e.unstable_now())},F)}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(_){_.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,I(j))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(_){switch(h){case 1:case 2:case 3:var F=3;break;default:F=h}var q=h;h=F;try{return _()}finally{h=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,F){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var q=h;h=_;try{return F()}finally{h=q}},e.unstable_scheduleCallback=function(_,F,q){var G=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?G+q:G):q=G,_){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=q+oe,_={id:d++,callback:F,priorityLevel:_,startTime:q,expirationTime:oe,sortIndex:-1},q>G?(_.sortIndex=q,t(u,_),n(c)===null&&_===n(u)&&(y?(v(P),P=-1):y=!0,$(S,q-G))):(_.sortIndex=oe,t(c,_),g||m||(g=!0,I(j))),_},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(_){var F=h;return function(){var q=h;h=F;try{return _.apply(this,arguments)}finally{h=q}}}})(LS);$S.exports=LS;var sD=$S.exports;/**
69
+ * @license React
70
+ * react-dom.production.min.js
71
+ *
72
+ * Copyright (c) Facebook, Inc. and its affiliates.
73
+ *
74
+ * This source code is licensed under the MIT license found in the
75
+ * LICENSE file in the root directory of this source tree.
76
+ */var FS=p,Gn=sD;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var zS=new Set,jl={};function os(e,t){ia(e,t),ia(e+"Capture",t)}function ia(e,t){for(jl[e]=t,e=0;e<t.length;e++)zS.add(t[e])}var ho=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cp=Object.prototype.hasOwnProperty,aD=/^[: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]*$/,R0={},D0={};function lD(e){return cp.call(D0,e)?!0:cp.call(R0,e)?!1:aD.test(e)?D0[e]=!0:(R0[e]=!0,!1)}function cD(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function uD(e,t,n,r){if(t===null||typeof t>"u"||cD(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Cn(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var tn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){tn[e]=new Cn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];tn[t]=new Cn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){tn[e]=new Cn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){tn[e]=new Cn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){tn[e]=new Cn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){tn[e]=new Cn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){tn[e]=new Cn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){tn[e]=new Cn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){tn[e]=new Cn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ym=/[\-:]([a-z])/g;function Xm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ym,Xm);tn[t]=new Cn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ym,Xm);tn[t]=new Cn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ym,Xm);tn[t]=new Cn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){tn[e]=new Cn(e,1,!1,e.toLowerCase(),null,!1,!1)});tn.xlinkHref=new Cn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){tn[e]=new Cn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jm(e,t,n,r){var o=tn.hasOwnProperty(t)?tn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(uD(t,n,o,r)&&(n=null),r||o===null?lD(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var jo=FS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Hc=Symbol.for("react.element"),Ns=Symbol.for("react.portal"),Os=Symbol.for("react.fragment"),Zm=Symbol.for("react.strict_mode"),up=Symbol.for("react.profiler"),BS=Symbol.for("react.provider"),US=Symbol.for("react.context"),eg=Symbol.for("react.forward_ref"),dp=Symbol.for("react.suspense"),fp=Symbol.for("react.suspense_list"),tg=Symbol.for("react.memo"),Lo=Symbol.for("react.lazy"),VS=Symbol.for("react.offscreen"),I0=Symbol.iterator;function Ua(e){return e===null||typeof e!="object"?null:(e=I0&&e[I0]||e["@@iterator"],typeof e=="function"?e:null)}var Et=Object.assign,mh;function sl(e){if(mh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mh=t&&t[1]||""}return`
77
+ `+mh+e}var gh=!1;function yh(e,t){if(!e||gh)return"";gh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
78
+ `),i=r.stack.split(`
79
+ `),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var c=`
80
+ `+o[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{gh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?sl(e):""}function dD(e){switch(e.tag){case 5:return sl(e.type);case 16:return sl("Lazy");case 13:return sl("Suspense");case 19:return sl("SuspenseList");case 0:case 2:case 15:return e=yh(e.type,!1),e;case 11:return e=yh(e.type.render,!1),e;case 1:return e=yh(e.type,!0),e;default:return""}}function hp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Os:return"Fragment";case Ns:return"Portal";case up:return"Profiler";case Zm:return"StrictMode";case dp:return"Suspense";case fp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case US:return(e.displayName||"Context")+".Consumer";case BS:return(e._context.displayName||"Context")+".Provider";case eg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tg:return t=e.displayName||null,t!==null?t:hp(e.type)||"Memo";case Lo:t=e._payload,e=e._init;try{return hp(e(t))}catch{}}return null}function fD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hp(t);case 8:return t===Zm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ai(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function HS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hD(e){var t=HS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wc(e){e._valueTracker||(e._valueTracker=hD(e))}function WS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=HS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function zu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function pp(e,t){var n=t.checked;return Et({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function _0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ai(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qS(e,t){t=t.checked,t!=null&&Jm(e,"checked",t,!1)}function mp(e,t){qS(e,t);var n=ai(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gp(e,t.type,n):t.hasOwnProperty("defaultValue")&&gp(e,t.type,ai(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function A0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function gp(e,t,n){(t!=="number"||zu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var al=Array.isArray;function Ys(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ai(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function yp(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return Et({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function N0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(al(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ai(n)}}function GS(e,t){var n=ai(t.value),r=ai(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function O0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function QS(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function vp(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?QS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var qc,KS=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(qc=qc||document.createElement("div"),qc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=qc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pD=["Webkit","ms","Moz","O"];Object.keys(hl).forEach(function(e){pD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),hl[t]=hl[e]})});function YS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||hl.hasOwnProperty(e)&&hl[e]?(""+t).trim():t+"px"}function XS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=YS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var mD=Et({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xp(e,t){if(t){if(mD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function wp(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Sp=null;function ng(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bp=null,Xs=null,Js=null;function M0(e){if(e=oc(e)){if(typeof bp!="function")throw Error(K(280));var t=e.stateNode;t&&(t=Bd(t),bp(e.stateNode,e.type,t))}}function JS(e){Xs?Js?Js.push(e):Js=[e]:Xs=e}function ZS(){if(Xs){var e=Xs,t=Js;if(Js=Xs=null,M0(e),t)for(e=0;e<t.length;e++)M0(t[e])}}function eb(e,t){return e(t)}function tb(){}var vh=!1;function nb(e,t,n){if(vh)return e(t,n);vh=!0;try{return eb(e,t,n)}finally{vh=!1,(Xs!==null||Js!==null)&&(tb(),ZS())}}function Pl(e,t){var n=e.stateNode;if(n===null)return null;var r=Bd(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(K(231,t,typeof n));return n}var Cp=!1;if(ho)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){Cp=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{Cp=!1}function gD(e,t,n,r,o,i,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var pl=!1,Bu=null,Uu=!1,Ep=null,yD={onError:function(e){pl=!0,Bu=e}};function vD(e,t,n,r,o,i,s,l,c){pl=!1,Bu=null,gD.apply(yD,arguments)}function xD(e,t,n,r,o,i,s,l,c){if(vD.apply(this,arguments),pl){if(pl){var u=Bu;pl=!1,Bu=null}else throw Error(K(198));Uu||(Uu=!0,Ep=u)}}function is(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function rb(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function $0(e){if(is(e)!==e)throw Error(K(188))}function wD(e){var t=e.alternate;if(!t){if(t=is(e),t===null)throw Error(K(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return $0(o),e;if(i===r)return $0(o),t;i=i.sibling}throw Error(K(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function ob(e){return e=wD(e),e!==null?ib(e):null}function ib(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ib(e);if(t!==null)return t;e=e.sibling}return null}var sb=Gn.unstable_scheduleCallback,L0=Gn.unstable_cancelCallback,SD=Gn.unstable_shouldYield,bD=Gn.unstable_requestPaint,Ot=Gn.unstable_now,CD=Gn.unstable_getCurrentPriorityLevel,rg=Gn.unstable_ImmediatePriority,ab=Gn.unstable_UserBlockingPriority,Vu=Gn.unstable_NormalPriority,ED=Gn.unstable_LowPriority,lb=Gn.unstable_IdlePriority,$d=null,Gr=null;function jD(e){if(Gr&&typeof Gr.onCommitFiberRoot=="function")try{Gr.onCommitFiberRoot($d,e,void 0,(e.current.flags&128)===128)}catch{}}var Er=Math.clz32?Math.clz32:kD,TD=Math.log,PD=Math.LN2;function kD(e){return e>>>=0,e===0?32:31-(TD(e)/PD|0)|0}var Gc=64,Qc=4194304;function ll(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=ll(l):(i&=s,i!==0&&(r=ll(i)))}else s=n&~o,s!==0?r=ll(s):i!==0&&(r=ll(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Er(t),o=1<<n,r|=e[n],t&=~o;return r}function RD(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function DD(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Er(i),l=1<<s,c=o[s];c===-1?(!(l&n)||l&r)&&(o[s]=RD(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function jp(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function cb(){var e=Gc;return Gc<<=1,!(Gc&4194240)&&(Gc=64),e}function xh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Er(t),e[t]=n}function ID(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Er(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function og(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Er(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var Xe=0;function ub(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var db,ig,fb,hb,pb,Tp=!1,Kc=[],Xo=null,Jo=null,Zo=null,kl=new Map,Rl=new Map,Vo=[],_D="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 submit".split(" ");function F0(e,t){switch(e){case"focusin":case"focusout":Xo=null;break;case"dragenter":case"dragleave":Jo=null;break;case"mouseover":case"mouseout":Zo=null;break;case"pointerover":case"pointerout":kl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rl.delete(t.pointerId)}}function Ha(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=oc(t),t!==null&&ig(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function AD(e,t,n,r,o){switch(t){case"focusin":return Xo=Ha(Xo,e,t,n,r,o),!0;case"dragenter":return Jo=Ha(Jo,e,t,n,r,o),!0;case"mouseover":return Zo=Ha(Zo,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return kl.set(i,Ha(kl.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Rl.set(i,Ha(Rl.get(i)||null,e,t,n,r,o)),!0}return!1}function mb(e){var t=Ai(e.target);if(t!==null){var n=is(t);if(n!==null){if(t=n.tag,t===13){if(t=rb(n),t!==null){e.blockedOn=t,pb(e.priority,function(){fb(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Pp(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sp=r,n.target.dispatchEvent(r),Sp=null}else return t=oc(n),t!==null&&ig(t),e.blockedOn=n,!1;t.shift()}return!0}function z0(e,t,n){xu(e)&&n.delete(t)}function ND(){Tp=!1,Xo!==null&&xu(Xo)&&(Xo=null),Jo!==null&&xu(Jo)&&(Jo=null),Zo!==null&&xu(Zo)&&(Zo=null),kl.forEach(z0),Rl.forEach(z0)}function Wa(e,t){e.blockedOn===t&&(e.blockedOn=null,Tp||(Tp=!0,Gn.unstable_scheduleCallback(Gn.unstable_NormalPriority,ND)))}function Dl(e){function t(o){return Wa(o,e)}if(0<Kc.length){Wa(Kc[0],e);for(var n=1;n<Kc.length;n++){var r=Kc[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Xo!==null&&Wa(Xo,e),Jo!==null&&Wa(Jo,e),Zo!==null&&Wa(Zo,e),kl.forEach(t),Rl.forEach(t),n=0;n<Vo.length;n++)r=Vo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Vo.length&&(n=Vo[0],n.blockedOn===null);)mb(n),n.blockedOn===null&&Vo.shift()}var Zs=jo.ReactCurrentBatchConfig,Wu=!0;function OD(e,t,n,r){var o=Xe,i=Zs.transition;Zs.transition=null;try{Xe=1,sg(e,t,n,r)}finally{Xe=o,Zs.transition=i}}function MD(e,t,n,r){var o=Xe,i=Zs.transition;Zs.transition=null;try{Xe=4,sg(e,t,n,r)}finally{Xe=o,Zs.transition=i}}function sg(e,t,n,r){if(Wu){var o=Pp(e,t,n,r);if(o===null)Rh(e,t,r,qu,n),F0(e,r);else if(AD(o,e,t,n,r))r.stopPropagation();else if(F0(e,r),t&4&&-1<_D.indexOf(e)){for(;o!==null;){var i=oc(o);if(i!==null&&db(i),i=Pp(e,t,n,r),i===null&&Rh(e,t,r,qu,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Rh(e,t,r,null,n)}}var qu=null;function Pp(e,t,n,r){if(qu=null,e=ng(r),e=Ai(e),e!==null)if(t=is(e),t===null)e=null;else if(n=t.tag,n===13){if(e=rb(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return qu=e,null}function gb(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(CD()){case rg:return 1;case ab:return 4;case Vu:case ED:return 16;case lb:return 536870912;default:return 16}default:return 16}}var qo=null,ag=null,wu=null;function yb(){if(wu)return wu;var e,t=ag,n=t.length,r,o="value"in qo?qo.value:qo.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return wu=o.slice(e,1<r?1-r:void 0)}function Su(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Yc(){return!0}function B0(){return!1}function Yn(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Yc:B0,this.isPropagationStopped=B0,this}return Et(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Yc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yc)},persist:function(){},isPersistent:Yc}),t}var Pa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lg=Yn(Pa),rc=Et({},Pa,{view:0,detail:0}),$D=Yn(rc),wh,Sh,qa,Ld=Et({},rc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cg,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==qa&&(qa&&e.type==="mousemove"?(wh=e.screenX-qa.screenX,Sh=e.screenY-qa.screenY):Sh=wh=0,qa=e),wh)},movementY:function(e){return"movementY"in e?e.movementY:Sh}}),U0=Yn(Ld),LD=Et({},Ld,{dataTransfer:0}),FD=Yn(LD),zD=Et({},rc,{relatedTarget:0}),bh=Yn(zD),BD=Et({},Pa,{animationName:0,elapsedTime:0,pseudoElement:0}),UD=Yn(BD),VD=Et({},Pa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),HD=Yn(VD),WD=Et({},Pa,{data:0}),V0=Yn(WD),qD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},GD={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"},QD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=QD[e])?!!t[e]:!1}function cg(){return KD}var YD=Et({},rc,{key:function(e){if(e.key){var t=qD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Su(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?GD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cg,charCode:function(e){return e.type==="keypress"?Su(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Su(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),XD=Yn(YD),JD=Et({},Ld,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),H0=Yn(JD),ZD=Et({},rc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cg}),eI=Yn(ZD),tI=Et({},Pa,{propertyName:0,elapsedTime:0,pseudoElement:0}),nI=Yn(tI),rI=Et({},Ld,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),oI=Yn(rI),iI=[9,13,27,32],ug=ho&&"CompositionEvent"in window,ml=null;ho&&"documentMode"in document&&(ml=document.documentMode);var sI=ho&&"TextEvent"in window&&!ml,vb=ho&&(!ug||ml&&8<ml&&11>=ml),W0=" ",q0=!1;function xb(e,t){switch(e){case"keyup":return iI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ms=!1;function aI(e,t){switch(e){case"compositionend":return wb(t);case"keypress":return t.which!==32?null:(q0=!0,W0);case"textInput":return e=t.data,e===W0&&q0?null:e;default:return null}}function lI(e,t){if(Ms)return e==="compositionend"||!ug&&xb(e,t)?(e=yb(),wu=ag=qo=null,Ms=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return vb&&t.locale!=="ko"?null:t.data;default:return null}}var cI={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 G0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cI[e.type]:t==="textarea"}function Sb(e,t,n,r){JS(r),t=Gu(t,"onChange"),0<t.length&&(n=new lg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var gl=null,Il=null;function uI(e){_b(e,0)}function Fd(e){var t=Fs(e);if(WS(t))return e}function dI(e,t){if(e==="change")return t}var bb=!1;if(ho){var Ch;if(ho){var Eh="oninput"in document;if(!Eh){var Q0=document.createElement("div");Q0.setAttribute("oninput","return;"),Eh=typeof Q0.oninput=="function"}Ch=Eh}else Ch=!1;bb=Ch&&(!document.documentMode||9<document.documentMode)}function K0(){gl&&(gl.detachEvent("onpropertychange",Cb),Il=gl=null)}function Cb(e){if(e.propertyName==="value"&&Fd(Il)){var t=[];Sb(t,Il,e,ng(e)),nb(uI,t)}}function fI(e,t,n){e==="focusin"?(K0(),gl=t,Il=n,gl.attachEvent("onpropertychange",Cb)):e==="focusout"&&K0()}function hI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fd(Il)}function pI(e,t){if(e==="click")return Fd(t)}function mI(e,t){if(e==="input"||e==="change")return Fd(t)}function gI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pr=typeof Object.is=="function"?Object.is:gI;function _l(e,t){if(Pr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!cp.call(t,o)||!Pr(e[o],t[o]))return!1}return!0}function Y0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function X0(e,t){var n=Y0(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Y0(n)}}function Eb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Eb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jb(){for(var e=window,t=zu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=zu(e.document)}return t}function dg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function yI(e){var t=jb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Eb(n.ownerDocument.documentElement,n)){if(r!==null&&dg(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=X0(n,i);var s=X0(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var vI=ho&&"documentMode"in document&&11>=document.documentMode,$s=null,kp=null,yl=null,Rp=!1;function J0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rp||$s==null||$s!==zu(r)||(r=$s,"selectionStart"in r&&dg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),yl&&_l(yl,r)||(yl=r,r=Gu(kp,"onSelect"),0<r.length&&(t=new lg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=$s)))}function Xc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ls={animationend:Xc("Animation","AnimationEnd"),animationiteration:Xc("Animation","AnimationIteration"),animationstart:Xc("Animation","AnimationStart"),transitionend:Xc("Transition","TransitionEnd")},jh={},Tb={};ho&&(Tb=document.createElement("div").style,"AnimationEvent"in window||(delete Ls.animationend.animation,delete Ls.animationiteration.animation,delete Ls.animationstart.animation),"TransitionEvent"in window||delete Ls.transitionend.transition);function zd(e){if(jh[e])return jh[e];if(!Ls[e])return e;var t=Ls[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Tb)return jh[e]=t[n];return e}var Pb=zd("animationend"),kb=zd("animationiteration"),Rb=zd("animationstart"),Db=zd("transitionend"),Ib=new Map,Z0="abort auxClick 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(" ");function pi(e,t){Ib.set(e,t),os(t,[e])}for(var Th=0;Th<Z0.length;Th++){var Ph=Z0[Th],xI=Ph.toLowerCase(),wI=Ph[0].toUpperCase()+Ph.slice(1);pi(xI,"on"+wI)}pi(Pb,"onAnimationEnd");pi(kb,"onAnimationIteration");pi(Rb,"onAnimationStart");pi("dblclick","onDoubleClick");pi("focusin","onFocus");pi("focusout","onBlur");pi(Db,"onTransitionEnd");ia("onMouseEnter",["mouseout","mouseover"]);ia("onMouseLeave",["mouseout","mouseover"]);ia("onPointerEnter",["pointerout","pointerover"]);ia("onPointerLeave",["pointerout","pointerover"]);os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));os("onBeforeInput",["compositionend","keypress","textInput","paste"]);os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cl="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(" "),SI=new Set("cancel close invalid load scroll toggle".split(" ").concat(cl));function ex(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,xD(r,t,void 0,e),e.currentTarget=null}function _b(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;ex(o,l,u),i=c}else for(s=0;s<r.length;s++){if(l=r[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;ex(o,l,u),i=c}}}if(Uu)throw e=Ep,Uu=!1,Ep=null,e}function ft(e,t){var n=t[Np];n===void 0&&(n=t[Np]=new Set);var r=e+"__bubble";n.has(r)||(Ab(t,e,2,!1),n.add(r))}function kh(e,t,n){var r=0;t&&(r|=4),Ab(n,e,r,t)}var Jc="_reactListening"+Math.random().toString(36).slice(2);function Al(e){if(!e[Jc]){e[Jc]=!0,zS.forEach(function(n){n!=="selectionchange"&&(SI.has(n)||kh(n,!1,e),kh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jc]||(t[Jc]=!0,kh("selectionchange",!1,t))}}function Ab(e,t,n,r){switch(gb(t)){case 1:var o=OD;break;case 4:o=MD;break;default:o=sg}n=o.bind(null,t,n,e),o=void 0,!Cp||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Rh(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;s=s.return}for(;l!==null;){if(s=Ai(l),s===null)return;if(c=s.tag,c===5||c===6){r=i=s;continue e}l=l.parentNode}}r=r.return}nb(function(){var u=i,d=ng(n),f=[];e:{var h=Ib.get(e);if(h!==void 0){var m=lg,g=e;switch(e){case"keypress":if(Su(n)===0)break e;case"keydown":case"keyup":m=XD;break;case"focusin":g="focus",m=bh;break;case"focusout":g="blur",m=bh;break;case"beforeblur":case"afterblur":m=bh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=U0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=FD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=eI;break;case Pb:case kb:case Rb:m=UD;break;case Db:m=nI;break;case"scroll":m=$D;break;case"wheel":m=oI;break;case"copy":case"cut":case"paste":m=HD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=H0}var y=(t&4)!==0,C=!y&&e==="scroll",v=y?h!==null?h+"Capture":null:h;y=[];for(var x=u,w;x!==null;){w=x;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,v!==null&&(S=Pl(x,v),S!=null&&y.push(Nl(x,S,w)))),C)break;x=x.return}0<y.length&&(h=new m(h,g,null,n,d),f.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Sp&&(g=n.relatedTarget||n.fromElement)&&(Ai(g)||g[po]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?Ai(g):null,g!==null&&(C=is(g),g!==C||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(y=U0,S="onMouseLeave",v="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=H0,S="onPointerLeave",v="onPointerEnter",x="pointer"),C=m==null?h:Fs(m),w=g==null?h:Fs(g),h=new y(S,x+"leave",m,n,d),h.target=C,h.relatedTarget=w,S=null,Ai(d)===u&&(y=new y(v,x+"enter",g,n,d),y.target=w,y.relatedTarget=C,S=y),C=S,m&&g)t:{for(y=m,v=g,x=0,w=y;w;w=ks(w))x++;for(w=0,S=v;S;S=ks(S))w++;for(;0<x-w;)y=ks(y),x--;for(;0<w-x;)v=ks(v),w--;for(;x--;){if(y===v||v!==null&&y===v.alternate)break t;y=ks(y),v=ks(v)}y=null}else y=null;m!==null&&tx(f,h,m,y,!1),g!==null&&C!==null&&tx(f,C,g,y,!0)}}e:{if(h=u?Fs(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var j=dI;else if(G0(h))if(bb)j=mI;else{j=hI;var E=fI}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=pI);if(j&&(j=j(e,u))){Sb(f,j,n,d);break e}E&&E(e,h,u),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&gp(h,"number",h.value)}switch(E=u?Fs(u):window,e){case"focusin":(G0(E)||E.contentEditable==="true")&&($s=E,kp=u,yl=null);break;case"focusout":yl=kp=$s=null;break;case"mousedown":Rp=!0;break;case"contextmenu":case"mouseup":case"dragend":Rp=!1,J0(f,n,d);break;case"selectionchange":if(vI)break;case"keydown":case"keyup":J0(f,n,d)}var T;if(ug)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Ms?xb(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(vb&&n.locale!=="ko"&&(Ms||P!=="onCompositionStart"?P==="onCompositionEnd"&&Ms&&(T=yb()):(qo=d,ag="value"in qo?qo.value:qo.textContent,Ms=!0)),E=Gu(u,P),0<E.length&&(P=new V0(P,e,null,n,d),f.push({event:P,listeners:E}),T?P.data=T:(T=wb(n),T!==null&&(P.data=T)))),(T=sI?aI(e,n):lI(e,n))&&(u=Gu(u,"onBeforeInput"),0<u.length&&(d=new V0("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=T))}_b(f,t)})}function Nl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gu(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Pl(e,n),i!=null&&r.unshift(Nl(e,i,o)),i=Pl(e,t),i!=null&&r.push(Nl(e,i,o))),e=e.return}return r}function ks(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function tx(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,o?(c=Pl(n,i),c!=null&&s.unshift(Nl(n,c,l))):o||(c=Pl(n,i),c!=null&&s.push(Nl(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var bI=/\r\n?/g,CI=/\u0000|\uFFFD/g;function nx(e){return(typeof e=="string"?e:""+e).replace(bI,`
81
+ `).replace(CI,"")}function Zc(e,t,n){if(t=nx(t),nx(e)!==t&&n)throw Error(K(425))}function Qu(){}var Dp=null,Ip=null;function _p(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ap=typeof setTimeout=="function"?setTimeout:void 0,EI=typeof clearTimeout=="function"?clearTimeout:void 0,rx=typeof Promise=="function"?Promise:void 0,jI=typeof queueMicrotask=="function"?queueMicrotask:typeof rx<"u"?function(e){return rx.resolve(null).then(e).catch(TI)}:Ap;function TI(e){setTimeout(function(){throw e})}function Dh(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Dl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Dl(t)}function ei(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ox(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ka=Math.random().toString(36).slice(2),Wr="__reactFiber$"+ka,Ol="__reactProps$"+ka,po="__reactContainer$"+ka,Np="__reactEvents$"+ka,PI="__reactListeners$"+ka,kI="__reactHandles$"+ka;function Ai(e){var t=e[Wr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[po]||n[Wr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ox(e);e!==null;){if(n=e[Wr])return n;e=ox(e)}return t}e=n,n=e.parentNode}return null}function oc(e){return e=e[Wr]||e[po],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function Bd(e){return e[Ol]||null}var Op=[],zs=-1;function mi(e){return{current:e}}function mt(e){0>zs||(e.current=Op[zs],Op[zs]=null,zs--)}function at(e,t){zs++,Op[zs]=e.current,e.current=t}var li={},cn=mi(li),_n=mi(!1),Ui=li;function sa(e,t){var n=e.type.contextTypes;if(!n)return li;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function An(e){return e=e.childContextTypes,e!=null}function Ku(){mt(_n),mt(cn)}function ix(e,t,n){if(cn.current!==li)throw Error(K(168));at(cn,t),at(_n,n)}function Nb(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(K(108,fD(e)||"Unknown",o));return Et({},n,r)}function Yu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||li,Ui=cn.current,at(cn,e),at(_n,_n.current),!0}function sx(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=Nb(e,t,Ui),r.__reactInternalMemoizedMergedChildContext=e,mt(_n),mt(cn),at(cn,e)):mt(_n),at(_n,n)}var io=null,Ud=!1,Ih=!1;function Ob(e){io===null?io=[e]:io.push(e)}function RI(e){Ud=!0,Ob(e)}function gi(){if(!Ih&&io!==null){Ih=!0;var e=0,t=Xe;try{var n=io;for(Xe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}io=null,Ud=!1}catch(o){throw io!==null&&(io=io.slice(e+1)),sb(rg,gi),o}finally{Xe=t,Ih=!1}}return null}var Bs=[],Us=0,Xu=null,Ju=0,tr=[],nr=0,Vi=null,so=1,ao="";function Pi(e,t){Bs[Us++]=Ju,Bs[Us++]=Xu,Xu=e,Ju=t}function Mb(e,t,n){tr[nr++]=so,tr[nr++]=ao,tr[nr++]=Vi,Vi=e;var r=so;e=ao;var o=32-Er(r)-1;r&=~(1<<o),n+=1;var i=32-Er(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,so=1<<32-Er(t)+o|n<<o|r,ao=i+e}else so=1<<i|n<<o|r,ao=e}function fg(e){e.return!==null&&(Pi(e,1),Mb(e,1,0))}function hg(e){for(;e===Xu;)Xu=Bs[--Us],Bs[Us]=null,Ju=Bs[--Us],Bs[Us]=null;for(;e===Vi;)Vi=tr[--nr],tr[nr]=null,ao=tr[--nr],tr[nr]=null,so=tr[--nr],tr[nr]=null}var Wn=null,Vn=null,xt=!1,br=null;function $b(e,t){var n=rr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ax(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Wn=e,Vn=ei(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Wn=e,Vn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Vi!==null?{id:so,overflow:ao}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=rr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Wn=e,Vn=null,!0):!1;default:return!1}}function Mp(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $p(e){if(xt){var t=Vn;if(t){var n=t;if(!ax(e,t)){if(Mp(e))throw Error(K(418));t=ei(n.nextSibling);var r=Wn;t&&ax(e,t)?$b(r,n):(e.flags=e.flags&-4097|2,xt=!1,Wn=e)}}else{if(Mp(e))throw Error(K(418));e.flags=e.flags&-4097|2,xt=!1,Wn=e}}}function lx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wn=e}function eu(e){if(e!==Wn)return!1;if(!xt)return lx(e),xt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!_p(e.type,e.memoizedProps)),t&&(t=Vn)){if(Mp(e))throw Lb(),Error(K(418));for(;t;)$b(e,t),t=ei(t.nextSibling)}if(lx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Vn=ei(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Vn=null}}else Vn=Wn?ei(e.stateNode.nextSibling):null;return!0}function Lb(){for(var e=Vn;e;)e=ei(e.nextSibling)}function aa(){Vn=Wn=null,xt=!1}function pg(e){br===null?br=[e]:br.push(e)}var DI=jo.ReactCurrentBatchConfig;function xr(e,t){if(e&&e.defaultProps){t=Et({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Zu=mi(null),ed=null,Vs=null,mg=null;function gg(){mg=Vs=ed=null}function yg(e){var t=Zu.current;mt(Zu),e._currentValue=t}function Lp(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ea(e,t){ed=e,mg=Vs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(In=!0),e.firstContext=null)}function sr(e){var t=e._currentValue;if(mg!==e)if(e={context:e,memoizedValue:t,next:null},Vs===null){if(ed===null)throw Error(K(308));Vs=e,ed.dependencies={lanes:0,firstContext:e}}else Vs=Vs.next=e;return t}var Ni=null;function vg(e){Ni===null?Ni=[e]:Ni.push(e)}function Fb(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,vg(t)):(n.next=o.next,o.next=n),t.interleaved=n,mo(e,r)}function mo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Fo=!1;function xg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zb(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function lo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ti(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,We&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,mo(e,n)}return o=r.interleaved,o===null?(t.next=t,vg(r)):(t.next=o.next,o.next=t),r.interleaved=t,mo(e,n)}function bu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,og(e,n)}}function cx(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function td(e,t,n,r){var o=e.updateQueue;Fo=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?i=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=o.baseState;s=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,y=l;switch(h=t,m=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){f=g.call(m,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,h=typeof g=="function"?g.call(m,f,h):g,h==null)break e;f=Et({},f,h);break e;case 2:Fo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,s|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(d===null&&(c=f),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Wi|=s,e.lanes=s,e.memoizedState=f}}function ux(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(K(191,o));o.call(r)}}}var Bb=new FS.Component().refs;function Fp(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Et({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vd={isMounted:function(e){return(e=e._reactInternals)?is(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=yn(),o=ri(e),i=lo(r,o);i.payload=t,n!=null&&(i.callback=n),t=ti(e,i,o),t!==null&&(jr(t,e,o,r),bu(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=yn(),o=ri(e),i=lo(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ti(e,i,o),t!==null&&(jr(t,e,o,r),bu(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yn(),r=ri(e),o=lo(n,r);o.tag=2,t!=null&&(o.callback=t),t=ti(e,o,r),t!==null&&(jr(t,e,r,n),bu(t,e,r))}};function dx(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!_l(n,r)||!_l(o,i):!0}function Ub(e,t,n){var r=!1,o=li,i=t.contextType;return typeof i=="object"&&i!==null?i=sr(i):(o=An(t)?Ui:cn.current,r=t.contextTypes,i=(r=r!=null)?sa(e,o):li),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Vd,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function fx(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vd.enqueueReplaceState(t,t.state,null)}function zp(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=Bb,xg(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=sr(i):(i=An(t)?Ui:cn.current,o.context=sa(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Fp(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Vd.enqueueReplaceState(o,o.state,null),td(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ga(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(K(309));var r=n.stateNode}if(!r)throw Error(K(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;l===Bb&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,e))}return e}function tu(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function hx(e){var t=e._init;return t(e._payload)}function Vb(e){function t(v,x){if(e){var w=v.deletions;w===null?(v.deletions=[x],v.flags|=16):w.push(x)}}function n(v,x){if(!e)return null;for(;x!==null;)t(v,x),x=x.sibling;return null}function r(v,x){for(v=new Map;x!==null;)x.key!==null?v.set(x.key,x):v.set(x.index,x),x=x.sibling;return v}function o(v,x){return v=oi(v,x),v.index=0,v.sibling=null,v}function i(v,x,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<x?(v.flags|=2,x):w):(v.flags|=2,x)):(v.flags|=1048576,x)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,x,w,S){return x===null||x.tag!==6?(x=Lh(w,v.mode,S),x.return=v,x):(x=o(x,w),x.return=v,x)}function c(v,x,w,S){var j=w.type;return j===Os?d(v,x,w.props.children,S,w.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Lo&&hx(j)===x.type)?(S=o(x,w.props),S.ref=Ga(v,x,w),S.return=v,S):(S=ku(w.type,w.key,w.props,null,v.mode,S),S.ref=Ga(v,x,w),S.return=v,S)}function u(v,x,w,S){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=Fh(w,v.mode,S),x.return=v,x):(x=o(x,w.children||[]),x.return=v,x)}function d(v,x,w,S,j){return x===null||x.tag!==7?(x=zi(w,v.mode,S,j),x.return=v,x):(x=o(x,w),x.return=v,x)}function f(v,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Lh(""+x,v.mode,w),x.return=v,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Hc:return w=ku(x.type,x.key,x.props,null,v.mode,w),w.ref=Ga(v,null,x),w.return=v,w;case Ns:return x=Fh(x,v.mode,w),x.return=v,x;case Lo:var S=x._init;return f(v,S(x._payload),w)}if(al(x)||Ua(x))return x=zi(x,v.mode,w,null),x.return=v,x;tu(v,x)}return null}function h(v,x,w,S){var j=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(v,x,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Hc:return w.key===j?c(v,x,w,S):null;case Ns:return w.key===j?u(v,x,w,S):null;case Lo:return j=w._init,h(v,x,j(w._payload),S)}if(al(w)||Ua(w))return j!==null?null:d(v,x,w,S,null);tu(v,w)}return null}function m(v,x,w,S,j){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(w)||null,l(x,v,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Hc:return v=v.get(S.key===null?w:S.key)||null,c(x,v,S,j);case Ns:return v=v.get(S.key===null?w:S.key)||null,u(x,v,S,j);case Lo:var E=S._init;return m(v,x,w,E(S._payload),j)}if(al(S)||Ua(S))return v=v.get(w)||null,d(x,v,S,j,null);tu(x,S)}return null}function g(v,x,w,S){for(var j=null,E=null,T=x,P=x=0,k=null;T!==null&&P<w.length;P++){T.index>P?(k=T,T=null):k=T.sibling;var D=h(v,T,w[P],S);if(D===null){T===null&&(T=k);break}e&&T&&D.alternate===null&&t(v,T),x=i(D,x,P),E===null?j=D:E.sibling=D,E=D,T=k}if(P===w.length)return n(v,T),xt&&Pi(v,P),j;if(T===null){for(;P<w.length;P++)T=f(v,w[P],S),T!==null&&(x=i(T,x,P),E===null?j=T:E.sibling=T,E=T);return xt&&Pi(v,P),j}for(T=r(v,T);P<w.length;P++)k=m(T,v,P,w[P],S),k!==null&&(e&&k.alternate!==null&&T.delete(k.key===null?P:k.key),x=i(k,x,P),E===null?j=k:E.sibling=k,E=k);return e&&T.forEach(function(M){return t(v,M)}),xt&&Pi(v,P),j}function y(v,x,w,S){var j=Ua(w);if(typeof j!="function")throw Error(K(150));if(w=j.call(w),w==null)throw Error(K(151));for(var E=j=null,T=x,P=x=0,k=null,D=w.next();T!==null&&!D.done;P++,D=w.next()){T.index>P?(k=T,T=null):k=T.sibling;var M=h(v,T,D.value,S);if(M===null){T===null&&(T=k);break}e&&T&&M.alternate===null&&t(v,T),x=i(M,x,P),E===null?j=M:E.sibling=M,E=M,T=k}if(D.done)return n(v,T),xt&&Pi(v,P),j;if(T===null){for(;!D.done;P++,D=w.next())D=f(v,D.value,S),D!==null&&(x=i(D,x,P),E===null?j=D:E.sibling=D,E=D);return xt&&Pi(v,P),j}for(T=r(v,T);!D.done;P++,D=w.next())D=m(T,v,P,D.value,S),D!==null&&(e&&D.alternate!==null&&T.delete(D.key===null?P:D.key),x=i(D,x,P),E===null?j=D:E.sibling=D,E=D);return e&&T.forEach(function(R){return t(v,R)}),xt&&Pi(v,P),j}function C(v,x,w,S){if(typeof w=="object"&&w!==null&&w.type===Os&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Hc:e:{for(var j=w.key,E=x;E!==null;){if(E.key===j){if(j=w.type,j===Os){if(E.tag===7){n(v,E.sibling),x=o(E,w.props.children),x.return=v,v=x;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Lo&&hx(j)===E.type){n(v,E.sibling),x=o(E,w.props),x.ref=Ga(v,E,w),x.return=v,v=x;break e}n(v,E);break}else t(v,E);E=E.sibling}w.type===Os?(x=zi(w.props.children,v.mode,S,w.key),x.return=v,v=x):(S=ku(w.type,w.key,w.props,null,v.mode,S),S.ref=Ga(v,x,w),S.return=v,v=S)}return s(v);case Ns:e:{for(E=w.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(v,x.sibling),x=o(x,w.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else t(v,x);x=x.sibling}x=Fh(w,v.mode,S),x.return=v,v=x}return s(v);case Lo:return E=w._init,C(v,x,E(w._payload),S)}if(al(w))return g(v,x,w,S);if(Ua(w))return y(v,x,w,S);tu(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(v,x.sibling),x=o(x,w),x.return=v,v=x):(n(v,x),x=Lh(w,v.mode,S),x.return=v,v=x),s(v)):n(v,x)}return C}var la=Vb(!0),Hb=Vb(!1),ic={},Qr=mi(ic),Ml=mi(ic),$l=mi(ic);function Oi(e){if(e===ic)throw Error(K(174));return e}function wg(e,t){switch(at($l,t),at(Ml,e),at(Qr,ic),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vp(t,e)}mt(Qr),at(Qr,t)}function ca(){mt(Qr),mt(Ml),mt($l)}function Wb(e){Oi($l.current);var t=Oi(Qr.current),n=vp(t,e.type);t!==n&&(at(Ml,e),at(Qr,n))}function Sg(e){Ml.current===e&&(mt(Qr),mt(Ml))}var bt=mi(0);function nd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _h=[];function bg(){for(var e=0;e<_h.length;e++)_h[e]._workInProgressVersionPrimary=null;_h.length=0}var Cu=jo.ReactCurrentDispatcher,Ah=jo.ReactCurrentBatchConfig,Hi=0,Ct=null,Ft=null,Ut=null,rd=!1,vl=!1,Ll=0,II=0;function rn(){throw Error(K(321))}function Cg(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pr(e[n],t[n]))return!1;return!0}function Eg(e,t,n,r,o,i){if(Hi=i,Ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Cu.current=e===null||e.memoizedState===null?OI:MI,e=n(r,o),vl){i=0;do{if(vl=!1,Ll=0,25<=i)throw Error(K(301));i+=1,Ut=Ft=null,t.updateQueue=null,Cu.current=$I,e=n(r,o)}while(vl)}if(Cu.current=od,t=Ft!==null&&Ft.next!==null,Hi=0,Ut=Ft=Ct=null,rd=!1,t)throw Error(K(300));return e}function jg(){var e=Ll!==0;return Ll=0,e}function Ur(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ct.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function ar(){if(Ft===null){var e=Ct.alternate;e=e!==null?e.memoizedState:null}else e=Ft.next;var t=Ut===null?Ct.memoizedState:Ut.next;if(t!==null)Ut=t,Ft=e;else{if(e===null)throw Error(K(310));Ft=e,e={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Ut===null?Ct.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function Fl(e,t){return typeof t=="function"?t(e):t}function Nh(e){var t=ar(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=Ft,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,c=null,u=i;do{var d=u.lane;if((Hi&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,s=r):c=c.next=f,Ct.lanes|=d,Wi|=d}u=u.next}while(u!==null&&u!==i);c===null?s=r:c.next=l,Pr(r,t.memoizedState)||(In=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Ct.lanes|=i,Wi|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Oh(e){var t=ar(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Pr(i,t.memoizedState)||(In=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function qb(){}function Gb(e,t){var n=Ct,r=ar(),o=t(),i=!Pr(r.memoizedState,o);if(i&&(r.memoizedState=o,In=!0),r=r.queue,Tg(Yb.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ut!==null&&Ut.memoizedState.tag&1){if(n.flags|=2048,zl(9,Kb.bind(null,n,r,o,t),void 0,null),Wt===null)throw Error(K(349));Hi&30||Qb(n,t,o)}return o}function Qb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Kb(e,t,n,r){t.value=n,t.getSnapshot=r,Xb(t)&&Jb(e)}function Yb(e,t,n){return n(function(){Xb(t)&&Jb(e)})}function Xb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pr(e,n)}catch{return!0}}function Jb(e){var t=mo(e,1);t!==null&&jr(t,e,1,-1)}function px(e){var t=Ur();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fl,lastRenderedState:e},t.queue=e,e=e.dispatch=NI.bind(null,Ct,e),[t.memoizedState,e]}function zl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Zb(){return ar().memoizedState}function Eu(e,t,n,r){var o=Ur();Ct.flags|=e,o.memoizedState=zl(1|t,n,void 0,r===void 0?null:r)}function Hd(e,t,n,r){var o=ar();r=r===void 0?null:r;var i=void 0;if(Ft!==null){var s=Ft.memoizedState;if(i=s.destroy,r!==null&&Cg(r,s.deps)){o.memoizedState=zl(t,n,i,r);return}}Ct.flags|=e,o.memoizedState=zl(1|t,n,i,r)}function mx(e,t){return Eu(8390656,8,e,t)}function Tg(e,t){return Hd(2048,8,e,t)}function eC(e,t){return Hd(4,2,e,t)}function tC(e,t){return Hd(4,4,e,t)}function nC(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function rC(e,t,n){return n=n!=null?n.concat([e]):null,Hd(4,4,nC.bind(null,t,e),n)}function Pg(){}function oC(e,t){var n=ar();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Cg(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function iC(e,t){var n=ar();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Cg(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function sC(e,t,n){return Hi&21?(Pr(n,t)||(n=cb(),Ct.lanes|=n,Wi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,In=!0),e.memoizedState=n)}function _I(e,t){var n=Xe;Xe=n!==0&&4>n?n:4,e(!0);var r=Ah.transition;Ah.transition={};try{e(!1),t()}finally{Xe=n,Ah.transition=r}}function aC(){return ar().memoizedState}function AI(e,t,n){var r=ri(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lC(e))cC(t,n);else if(n=Fb(e,t,n,r),n!==null){var o=yn();jr(n,e,r,o),uC(n,t,r)}}function NI(e,t,n){var r=ri(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lC(e))cC(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,Pr(l,s)){var c=t.interleaved;c===null?(o.next=o,vg(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=Fb(e,t,o,r),n!==null&&(o=yn(),jr(n,e,r,o),uC(n,t,r))}}function lC(e){var t=e.alternate;return e===Ct||t!==null&&t===Ct}function cC(e,t){vl=rd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,og(e,n)}}var od={readContext:sr,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useInsertionEffect:rn,useLayoutEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useMutableSource:rn,useSyncExternalStore:rn,useId:rn,unstable_isNewReconciler:!1},OI={readContext:sr,useCallback:function(e,t){return Ur().memoizedState=[e,t===void 0?null:t],e},useContext:sr,useEffect:mx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Eu(4194308,4,nC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Eu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Eu(4,2,e,t)},useMemo:function(e,t){var n=Ur();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ur();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=AI.bind(null,Ct,e),[r.memoizedState,e]},useRef:function(e){var t=Ur();return e={current:e},t.memoizedState=e},useState:px,useDebugValue:Pg,useDeferredValue:function(e){return Ur().memoizedState=e},useTransition:function(){var e=px(!1),t=e[0];return e=_I.bind(null,e[1]),Ur().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ct,o=Ur();if(xt){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),Wt===null)throw Error(K(349));Hi&30||Qb(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,mx(Yb.bind(null,r,i,e),[e]),r.flags|=2048,zl(9,Kb.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ur(),t=Wt.identifierPrefix;if(xt){var n=ao,r=so;n=(r&~(1<<32-Er(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ll++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=II++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},MI={readContext:sr,useCallback:oC,useContext:sr,useEffect:Tg,useImperativeHandle:rC,useInsertionEffect:eC,useLayoutEffect:tC,useMemo:iC,useReducer:Nh,useRef:Zb,useState:function(){return Nh(Fl)},useDebugValue:Pg,useDeferredValue:function(e){var t=ar();return sC(t,Ft.memoizedState,e)},useTransition:function(){var e=Nh(Fl)[0],t=ar().memoizedState;return[e,t]},useMutableSource:qb,useSyncExternalStore:Gb,useId:aC,unstable_isNewReconciler:!1},$I={readContext:sr,useCallback:oC,useContext:sr,useEffect:Tg,useImperativeHandle:rC,useInsertionEffect:eC,useLayoutEffect:tC,useMemo:iC,useReducer:Oh,useRef:Zb,useState:function(){return Oh(Fl)},useDebugValue:Pg,useDeferredValue:function(e){var t=ar();return Ft===null?t.memoizedState=e:sC(t,Ft.memoizedState,e)},useTransition:function(){var e=Oh(Fl)[0],t=ar().memoizedState;return[e,t]},useMutableSource:qb,useSyncExternalStore:Gb,useId:aC,unstable_isNewReconciler:!1};function ua(e,t){try{var n="",r=t;do n+=dD(r),r=r.return;while(r);var o=n}catch(i){o=`
82
+ Error generating stack: `+i.message+`
83
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function Mh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Bp(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var LI=typeof WeakMap=="function"?WeakMap:Map;function dC(e,t,n){n=lo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){sd||(sd=!0,Xp=r),Bp(e,t)},n}function fC(e,t,n){n=lo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Bp(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Bp(e,t),typeof r!="function"&&(ni===null?ni=new Set([this]):ni.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function gx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new LI;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=JI.bind(null,e,t,n),t.then(e,e))}function yx(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function vx(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=lo(-1,1),t.tag=2,ti(n,t,1))),n.lanes|=1),e)}var FI=jo.ReactCurrentOwner,In=!1;function hn(e,t,n,r){t.child=e===null?Hb(t,null,n,r):la(t,e.child,n,r)}function xx(e,t,n,r,o){n=n.render;var i=t.ref;return ea(t,o),r=Eg(e,t,n,r,i,o),n=jg(),e!==null&&!In?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,go(e,t,o)):(xt&&n&&fg(t),t.flags|=1,hn(e,t,r,o),t.child)}function wx(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Og(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,hC(e,t,i,r,o)):(e=ku(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:_l,n(s,r)&&e.ref===t.ref)return go(e,t,o)}return t.flags|=1,e=oi(i,r),e.ref=t.ref,e.return=t,t.child=e}function hC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(_l(i,r)&&e.ref===t.ref)if(In=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(In=!0);else return t.lanes=e.lanes,go(e,t,o)}return Up(e,t,n,r,o)}function pC(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},at(Ws,Bn),Bn|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,at(Ws,Bn),Bn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,at(Ws,Bn),Bn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,at(Ws,Bn),Bn|=r;return hn(e,t,o,n),t.child}function mC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Up(e,t,n,r,o){var i=An(n)?Ui:cn.current;return i=sa(t,i),ea(t,o),n=Eg(e,t,n,r,i,o),r=jg(),e!==null&&!In?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,go(e,t,o)):(xt&&r&&fg(t),t.flags|=1,hn(e,t,n,o),t.child)}function Sx(e,t,n,r,o){if(An(n)){var i=!0;Yu(t)}else i=!1;if(ea(t,o),t.stateNode===null)ju(e,t),Ub(t,n,r),zp(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=sr(u):(u=An(n)?Ui:cn.current,u=sa(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||c!==u)&&fx(t,s,r,u),Fo=!1;var h=t.memoizedState;s.state=h,td(t,r,s,o),c=t.memoizedState,l!==r||h!==c||_n.current||Fo?(typeof d=="function"&&(Fp(t,n,d,r),c=t.memoizedState),(l=Fo||dx(t,n,l,r,h,c,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,zb(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:xr(t.type,l),s.props=u,f=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=sr(c):(c=An(n)?Ui:cn.current,c=sa(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||h!==c)&&fx(t,s,r,c),Fo=!1,h=t.memoizedState,s.state=h,td(t,r,s,o);var g=t.memoizedState;l!==f||h!==g||_n.current||Fo?(typeof m=="function"&&(Fp(t,n,m,r),g=t.memoizedState),(u=Fo||dx(t,n,u,r,h,g,c)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Vp(e,t,n,r,i,o)}function Vp(e,t,n,r,o,i){mC(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&sx(t,n,!1),go(e,t,i);r=t.stateNode,FI.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=la(t,e.child,null,i),t.child=la(t,null,l,i)):hn(e,t,l,i),t.memoizedState=r.state,o&&sx(t,n,!0),t.child}function gC(e){var t=e.stateNode;t.pendingContext?ix(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ix(e,t.context,!1),wg(e,t.containerInfo)}function bx(e,t,n,r,o){return aa(),pg(o),t.flags|=256,hn(e,t,n,r),t.child}var Hp={dehydrated:null,treeContext:null,retryLane:0};function Wp(e){return{baseLanes:e,cachePool:null,transitions:null}}function yC(e,t,n){var r=t.pendingProps,o=bt.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),at(bt,o&1),e===null)return $p(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Gd(s,r,0,null),e=zi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Wp(n),t.memoizedState=Hp,e):kg(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return zI(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=oi(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=oi(l,i):(i=zi(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Wp(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Hp,r}return i=e.child,e=i.sibling,r=oi(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function kg(e,t){return t=Gd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nu(e,t,n,r){return r!==null&&pg(r),la(t,e.child,null,n),e=kg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zI(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Mh(Error(K(422))),nu(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Gd({mode:"visible",children:r.children},o,0,null),i=zi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&la(t,e.child,null,s),t.child.memoizedState=Wp(s),t.memoizedState=Hp,i);if(!(t.mode&1))return nu(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(K(419)),r=Mh(i,r,void 0),nu(e,t,s,r)}if(l=(s&e.childLanes)!==0,In||l){if(r=Wt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,mo(e,o),jr(r,e,o,-1))}return Ng(),r=Mh(Error(K(421))),nu(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=ZI.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Vn=ei(o.nextSibling),Wn=t,xt=!0,br=null,e!==null&&(tr[nr++]=so,tr[nr++]=ao,tr[nr++]=Vi,so=e.id,ao=e.overflow,Vi=t),t=kg(t,r.children),t.flags|=4096,t)}function Cx(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Lp(e.return,t,n)}function $h(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function vC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(hn(e,t,r.children,n),r=bt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cx(e,n,t);else if(e.tag===19)Cx(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(at(bt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&nd(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),$h(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&nd(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}$h(t,!0,n,null,i);break;case"together":$h(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ju(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function go(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function BI(e,t,n){switch(t.tag){case 3:gC(t),aa();break;case 5:Wb(t);break;case 1:An(t.type)&&Yu(t);break;case 4:wg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;at(Zu,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(at(bt,bt.current&1),t.flags|=128,null):n&t.child.childLanes?yC(e,t,n):(at(bt,bt.current&1),e=go(e,t,n),e!==null?e.sibling:null);at(bt,bt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return vC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),at(bt,bt.current),r)break;return null;case 22:case 23:return t.lanes=0,pC(e,t,n)}return go(e,t,n)}var xC,qp,wC,SC;xC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};qp=function(){};wC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Oi(Qr.current);var i=null;switch(n){case"input":o=pp(e,o),r=pp(e,r),i=[];break;case"select":o=Et({},o,{value:void 0}),r=Et({},r,{value:void 0}),i=[];break;case"textarea":o=yp(e,o),r=yp(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Qu)}xp(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(jl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(jl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ft("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};SC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Qa(e,t){if(!xt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function on(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function UI(e,t,n){var r=t.pendingProps;switch(hg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return on(t),null;case 1:return An(t.type)&&Ku(),on(t),null;case 3:return r=t.stateNode,ca(),mt(_n),mt(cn),bg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(eu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,br!==null&&(em(br),br=null))),qp(e,t),on(t),null;case 5:Sg(t);var o=Oi($l.current);if(n=t.type,e!==null&&t.stateNode!=null)wC(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return on(t),null}if(e=Oi(Qr.current),eu(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Wr]=t,r[Ol]=i,e=(t.mode&1)!==0,n){case"dialog":ft("cancel",r),ft("close",r);break;case"iframe":case"object":case"embed":ft("load",r);break;case"video":case"audio":for(o=0;o<cl.length;o++)ft(cl[o],r);break;case"source":ft("error",r);break;case"img":case"image":case"link":ft("error",r),ft("load",r);break;case"details":ft("toggle",r);break;case"input":_0(r,i),ft("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ft("invalid",r);break;case"textarea":N0(r,i),ft("invalid",r)}xp(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Zc(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Zc(r.textContent,l,e),o=["children",""+l]):jl.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&ft("scroll",r)}switch(n){case"input":Wc(r),A0(r,i,!0);break;case"textarea":Wc(r),O0(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Qu)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=QS(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Wr]=t,e[Ol]=r,xC(e,t,!1,!1),t.stateNode=e;e:{switch(s=wp(n,r),n){case"dialog":ft("cancel",e),ft("close",e),o=r;break;case"iframe":case"object":case"embed":ft("load",e),o=r;break;case"video":case"audio":for(o=0;o<cl.length;o++)ft(cl[o],e);o=r;break;case"source":ft("error",e),o=r;break;case"img":case"image":case"link":ft("error",e),ft("load",e),o=r;break;case"details":ft("toggle",e),o=r;break;case"input":_0(e,r),o=pp(e,r),ft("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Et({},r,{value:void 0}),ft("invalid",e);break;case"textarea":N0(e,r),o=yp(e,r),ft("invalid",e);break;default:o=r}xp(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?XS(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&KS(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Tl(e,c):typeof c=="number"&&Tl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(jl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&ft("scroll",e):c!=null&&Jm(e,i,c,s))}switch(n){case"input":Wc(e),A0(e,r,!1);break;case"textarea":Wc(e),O0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ai(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Ys(e,!!r.multiple,i,!1):r.defaultValue!=null&&Ys(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Qu)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return on(t),null;case 6:if(e&&t.stateNode!=null)SC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=Oi($l.current),Oi(Qr.current),eu(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wr]=t,(i=r.nodeValue!==n)&&(e=Wn,e!==null))switch(e.tag){case 3:Zc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Zc(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wr]=t,t.stateNode=r}return on(t),null;case 13:if(mt(bt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xt&&Vn!==null&&t.mode&1&&!(t.flags&128))Lb(),aa(),t.flags|=98560,i=!1;else if(i=eu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(K(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(K(317));i[Wr]=t}else aa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;on(t),i=!1}else br!==null&&(em(br),br=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||bt.current&1?zt===0&&(zt=3):Ng())),t.updateQueue!==null&&(t.flags|=4),on(t),null);case 4:return ca(),qp(e,t),e===null&&Al(t.stateNode.containerInfo),on(t),null;case 10:return yg(t.type._context),on(t),null;case 17:return An(t.type)&&Ku(),on(t),null;case 19:if(mt(bt),i=t.memoizedState,i===null)return on(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Qa(i,!1);else{if(zt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=nd(e),s!==null){for(t.flags|=128,Qa(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return at(bt,bt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ot()>da&&(t.flags|=128,r=!0,Qa(i,!1),t.lanes=4194304)}else{if(!r)if(e=nd(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Qa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!xt)return on(t),null}else 2*Ot()-i.renderingStartTime>da&&n!==1073741824&&(t.flags|=128,r=!0,Qa(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ot(),t.sibling=null,n=bt.current,at(bt,r?n&1|2:n&1),t):(on(t),null);case 22:case 23:return Ag(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Bn&1073741824&&(on(t),t.subtreeFlags&6&&(t.flags|=8192)):on(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function VI(e,t){switch(hg(t),t.tag){case 1:return An(t.type)&&Ku(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ca(),mt(_n),mt(cn),bg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sg(t),null;case 13:if(mt(bt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return mt(bt),null;case 4:return ca(),null;case 10:return yg(t.type._context),null;case 22:case 23:return Ag(),null;case 24:return null;default:return null}}var ru=!1,sn=!1,HI=typeof WeakSet=="function"?WeakSet:Set,ie=null;function Hs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pt(e,t,r)}else n.current=null}function Gp(e,t,n){try{n()}catch(r){Pt(e,t,r)}}var Ex=!1;function WI(e,t){if(Dp=Wu,e=jb(),dg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||o!==0&&f.nodeType!==3||(l=s+o),f!==i||r!==0&&f.nodeType!==3||(c=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===o&&(l=s),h===i&&++d===r&&(c=s),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ip={focusedElem:e,selectionRange:n},Wu=!1,ie=t;ie!==null;)if(t=ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ie=e;else for(;ie!==null;){t=ie;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,C=g.memoizedState,v=t.stateNode,x=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:xr(t.type,y),C);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(S){Pt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ie=e;break}ie=t.return}return g=Ex,Ex=!1,g}function xl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Gp(t,n,i)}o=o.next}while(o!==r)}}function Wd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Qp(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function bC(e){var t=e.alternate;t!==null&&(e.alternate=null,bC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wr],delete t[Ol],delete t[Np],delete t[PI],delete t[kI])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function CC(e){return e.tag===5||e.tag===3||e.tag===4}function jx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||CC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qu));else if(r!==4&&(e=e.child,e!==null))for(Kp(e,t,n),e=e.sibling;e!==null;)Kp(e,t,n),e=e.sibling}function Yp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Yp(e,t,n),e=e.sibling;e!==null;)Yp(e,t,n),e=e.sibling}var Kt=null,wr=!1;function Mo(e,t,n){for(n=n.child;n!==null;)EC(e,t,n),n=n.sibling}function EC(e,t,n){if(Gr&&typeof Gr.onCommitFiberUnmount=="function")try{Gr.onCommitFiberUnmount($d,n)}catch{}switch(n.tag){case 5:sn||Hs(n,t);case 6:var r=Kt,o=wr;Kt=null,Mo(e,t,n),Kt=r,wr=o,Kt!==null&&(wr?(e=Kt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Kt.removeChild(n.stateNode));break;case 18:Kt!==null&&(wr?(e=Kt,n=n.stateNode,e.nodeType===8?Dh(e.parentNode,n):e.nodeType===1&&Dh(e,n),Dl(e)):Dh(Kt,n.stateNode));break;case 4:r=Kt,o=wr,Kt=n.stateNode.containerInfo,wr=!0,Mo(e,t,n),Kt=r,wr=o;break;case 0:case 11:case 14:case 15:if(!sn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Gp(n,t,s),o=o.next}while(o!==r)}Mo(e,t,n);break;case 1:if(!sn&&(Hs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Pt(n,t,l)}Mo(e,t,n);break;case 21:Mo(e,t,n);break;case 22:n.mode&1?(sn=(r=sn)||n.memoizedState!==null,Mo(e,t,n),sn=r):Mo(e,t,n);break;default:Mo(e,t,n)}}function Tx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new HI),t.forEach(function(r){var o=e_.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function gr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Kt=l.stateNode,wr=!1;break e;case 3:Kt=l.stateNode.containerInfo,wr=!0;break e;case 4:Kt=l.stateNode.containerInfo,wr=!0;break e}l=l.return}if(Kt===null)throw Error(K(160));EC(i,s,o),Kt=null,wr=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){Pt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)jC(t,e),t=t.sibling}function jC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gr(t,e),Fr(e),r&4){try{xl(3,e,e.return),Wd(3,e)}catch(y){Pt(e,e.return,y)}try{xl(5,e,e.return)}catch(y){Pt(e,e.return,y)}}break;case 1:gr(t,e),Fr(e),r&512&&n!==null&&Hs(n,n.return);break;case 5:if(gr(t,e),Fr(e),r&512&&n!==null&&Hs(n,n.return),e.flags&32){var o=e.stateNode;try{Tl(o,"")}catch(y){Pt(e,e.return,y)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&qS(o,i),wp(l,s);var u=wp(l,i);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?XS(o,f):d==="dangerouslySetInnerHTML"?KS(o,f):d==="children"?Tl(o,f):Jm(o,d,f,u)}switch(l){case"input":mp(o,i);break;case"textarea":GS(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Ys(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?Ys(o,!!i.multiple,i.defaultValue,!0):Ys(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ol]=i}catch(y){Pt(e,e.return,y)}}break;case 6:if(gr(t,e),Fr(e),r&4){if(e.stateNode===null)throw Error(K(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(y){Pt(e,e.return,y)}}break;case 3:if(gr(t,e),Fr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Dl(t.containerInfo)}catch(y){Pt(e,e.return,y)}break;case 4:gr(t,e),Fr(e);break;case 13:gr(t,e),Fr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Ig=Ot())),r&4&&Tx(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(sn=(u=sn)||d,gr(t,e),sn=u):gr(t,e),Fr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ie=e,d=e.child;d!==null;){for(f=ie=d;ie!==null;){switch(h=ie,m=h.child,h.tag){case 0:case 11:case 14:case 15:xl(4,h,h.return);break;case 1:Hs(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(y){Pt(r,n,y)}}break;case 5:Hs(h,h.return);break;case 22:if(h.memoizedState!==null){kx(f);continue}}m!==null?(m.return=h,ie=m):kx(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{o=f.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=YS("display",s))}catch(y){Pt(e,e.return,y)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(y){Pt(e,e.return,y)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:gr(t,e),Fr(e),r&4&&Tx(e);break;case 21:break;default:gr(t,e),Fr(e)}}function Fr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(CC(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Tl(o,""),r.flags&=-33);var i=jx(e);Yp(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=jx(e);Kp(e,l,s);break;default:throw Error(K(161))}}catch(c){Pt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qI(e,t,n){ie=e,TC(e)}function TC(e,t,n){for(var r=(e.mode&1)!==0;ie!==null;){var o=ie,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||ru;if(!s){var l=o.alternate,c=l!==null&&l.memoizedState!==null||sn;l=ru;var u=sn;if(ru=s,(sn=c)&&!u)for(ie=o;ie!==null;)s=ie,c=s.child,s.tag===22&&s.memoizedState!==null?Rx(o):c!==null?(c.return=s,ie=c):Rx(o);for(;i!==null;)ie=i,TC(i),i=i.sibling;ie=o,ru=l,sn=u}Px(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ie=i):Px(e)}}function Px(e){for(;ie!==null;){var t=ie;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:sn||Wd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!sn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:xr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&ux(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ux(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Dl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}sn||t.flags&512&&Qp(t)}catch(h){Pt(t,t.return,h)}}if(t===e){ie=null;break}if(n=t.sibling,n!==null){n.return=t.return,ie=n;break}ie=t.return}}function kx(e){for(;ie!==null;){var t=ie;if(t===e){ie=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ie=n;break}ie=t.return}}function Rx(e){for(;ie!==null;){var t=ie;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Wd(4,t)}catch(c){Pt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){Pt(t,o,c)}}var i=t.return;try{Qp(t)}catch(c){Pt(t,i,c)}break;case 5:var s=t.return;try{Qp(t)}catch(c){Pt(t,s,c)}}}catch(c){Pt(t,t.return,c)}if(t===e){ie=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ie=l;break}ie=t.return}}var GI=Math.ceil,id=jo.ReactCurrentDispatcher,Rg=jo.ReactCurrentOwner,or=jo.ReactCurrentBatchConfig,We=0,Wt=null,Lt=null,en=0,Bn=0,Ws=mi(0),zt=0,Bl=null,Wi=0,qd=0,Dg=0,wl=null,Dn=null,Ig=0,da=1/0,oo=null,sd=!1,Xp=null,ni=null,ou=!1,Go=null,ad=0,Sl=0,Jp=null,Tu=-1,Pu=0;function yn(){return We&6?Ot():Tu!==-1?Tu:Tu=Ot()}function ri(e){return e.mode&1?We&2&&en!==0?en&-en:DI.transition!==null?(Pu===0&&(Pu=cb()),Pu):(e=Xe,e!==0||(e=window.event,e=e===void 0?16:gb(e.type)),e):1}function jr(e,t,n,r){if(50<Sl)throw Sl=0,Jp=null,Error(K(185));nc(e,n,r),(!(We&2)||e!==Wt)&&(e===Wt&&(!(We&2)&&(qd|=n),zt===4&&Ho(e,en)),Nn(e,r),n===1&&We===0&&!(t.mode&1)&&(da=Ot()+500,Ud&&gi()))}function Nn(e,t){var n=e.callbackNode;DD(e,t);var r=Hu(e,e===Wt?en:0);if(r===0)n!==null&&L0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&L0(n),t===1)e.tag===0?RI(Dx.bind(null,e)):Ob(Dx.bind(null,e)),jI(function(){!(We&6)&&gi()}),n=null;else{switch(ub(r)){case 1:n=rg;break;case 4:n=ab;break;case 16:n=Vu;break;case 536870912:n=lb;break;default:n=Vu}n=NC(n,PC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function PC(e,t){if(Tu=-1,Pu=0,We&6)throw Error(K(327));var n=e.callbackNode;if(ta()&&e.callbackNode!==n)return null;var r=Hu(e,e===Wt?en:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ld(e,r);else{t=r;var o=We;We|=2;var i=RC();(Wt!==e||en!==t)&&(oo=null,da=Ot()+500,Fi(e,t));do try{YI();break}catch(l){kC(e,l)}while(!0);gg(),id.current=i,We=o,Lt!==null?t=0:(Wt=null,en=0,t=zt)}if(t!==0){if(t===2&&(o=jp(e),o!==0&&(r=o,t=Zp(e,o))),t===1)throw n=Bl,Fi(e,0),Ho(e,r),Nn(e,Ot()),n;if(t===6)Ho(e,r);else{if(o=e.current.alternate,!(r&30)&&!QI(o)&&(t=ld(e,r),t===2&&(i=jp(e),i!==0&&(r=i,t=Zp(e,i))),t===1))throw n=Bl,Fi(e,0),Ho(e,r),Nn(e,Ot()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:ki(e,Dn,oo);break;case 3:if(Ho(e,r),(r&130023424)===r&&(t=Ig+500-Ot(),10<t)){if(Hu(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){yn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ap(ki.bind(null,e,Dn,oo),t);break}ki(e,Dn,oo);break;case 4:if(Ho(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Er(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ot()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*GI(r/1960))-r,10<r){e.timeoutHandle=Ap(ki.bind(null,e,Dn,oo),r);break}ki(e,Dn,oo);break;case 5:ki(e,Dn,oo);break;default:throw Error(K(329))}}}return Nn(e,Ot()),e.callbackNode===n?PC.bind(null,e):null}function Zp(e,t){var n=wl;return e.current.memoizedState.isDehydrated&&(Fi(e,t).flags|=256),e=ld(e,t),e!==2&&(t=Dn,Dn=n,t!==null&&em(t)),e}function em(e){Dn===null?Dn=e:Dn.push.apply(Dn,e)}function QI(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Pr(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ho(e,t){for(t&=~Dg,t&=~qd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Er(t),r=1<<n;e[n]=-1,t&=~r}}function Dx(e){if(We&6)throw Error(K(327));ta();var t=Hu(e,0);if(!(t&1))return Nn(e,Ot()),null;var n=ld(e,t);if(e.tag!==0&&n===2){var r=jp(e);r!==0&&(t=r,n=Zp(e,r))}if(n===1)throw n=Bl,Fi(e,0),Ho(e,t),Nn(e,Ot()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ki(e,Dn,oo),Nn(e,Ot()),null}function _g(e,t){var n=We;We|=1;try{return e(t)}finally{We=n,We===0&&(da=Ot()+500,Ud&&gi())}}function qi(e){Go!==null&&Go.tag===0&&!(We&6)&&ta();var t=We;We|=1;var n=or.transition,r=Xe;try{if(or.transition=null,Xe=1,e)return e()}finally{Xe=r,or.transition=n,We=t,!(We&6)&&gi()}}function Ag(){Bn=Ws.current,mt(Ws)}function Fi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,EI(n)),Lt!==null)for(n=Lt.return;n!==null;){var r=n;switch(hg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ku();break;case 3:ca(),mt(_n),mt(cn),bg();break;case 5:Sg(r);break;case 4:ca();break;case 13:mt(bt);break;case 19:mt(bt);break;case 10:yg(r.type._context);break;case 22:case 23:Ag()}n=n.return}if(Wt=e,Lt=e=oi(e.current,null),en=Bn=t,zt=0,Bl=null,Dg=qd=Wi=0,Dn=wl=null,Ni!==null){for(t=0;t<Ni.length;t++)if(n=Ni[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Ni=null}return e}function kC(e,t){do{var n=Lt;try{if(gg(),Cu.current=od,rd){for(var r=Ct.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}rd=!1}if(Hi=0,Ut=Ft=Ct=null,vl=!1,Ll=0,Rg.current=null,n===null||n.return===null){zt=1,Bl=t,Lt=null;break}e:{var i=e,s=n.return,l=n,c=t;if(t=en,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=yx(s);if(m!==null){m.flags&=-257,vx(m,s,l,i,t),m.mode&1&&gx(i,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var y=new Set;y.add(c),t.updateQueue=y}else g.add(c);break e}else{if(!(t&1)){gx(i,u,t),Ng();break e}c=Error(K(426))}}else if(xt&&l.mode&1){var C=yx(s);if(C!==null){!(C.flags&65536)&&(C.flags|=256),vx(C,s,l,i,t),pg(ua(c,l));break e}}i=c=ua(c,l),zt!==4&&(zt=2),wl===null?wl=[i]:wl.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=dC(i,c,t);cx(i,v);break e;case 1:l=c;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ni===null||!ni.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=fC(i,l,t);cx(i,S);break e}}i=i.return}while(i!==null)}IC(n)}catch(j){t=j,Lt===n&&n!==null&&(Lt=n=n.return);continue}break}while(!0)}function RC(){var e=id.current;return id.current=od,e===null?od:e}function Ng(){(zt===0||zt===3||zt===2)&&(zt=4),Wt===null||!(Wi&268435455)&&!(qd&268435455)||Ho(Wt,en)}function ld(e,t){var n=We;We|=2;var r=RC();(Wt!==e||en!==t)&&(oo=null,Fi(e,t));do try{KI();break}catch(o){kC(e,o)}while(!0);if(gg(),We=n,id.current=r,Lt!==null)throw Error(K(261));return Wt=null,en=0,zt}function KI(){for(;Lt!==null;)DC(Lt)}function YI(){for(;Lt!==null&&!SD();)DC(Lt)}function DC(e){var t=AC(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,t===null?IC(e):Lt=t,Rg.current=null}function IC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=VI(n,t),n!==null){n.flags&=32767,Lt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{zt=6,Lt=null;return}}else if(n=UI(n,t,Bn),n!==null){Lt=n;return}if(t=t.sibling,t!==null){Lt=t;return}Lt=t=e}while(t!==null);zt===0&&(zt=5)}function ki(e,t,n){var r=Xe,o=or.transition;try{or.transition=null,Xe=1,XI(e,t,n,r)}finally{or.transition=o,Xe=r}return null}function XI(e,t,n,r){do ta();while(Go!==null);if(We&6)throw Error(K(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ID(e,i),e===Wt&&(Lt=Wt=null,en=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ou||(ou=!0,NC(Vu,function(){return ta(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=or.transition,or.transition=null;var s=Xe;Xe=1;var l=We;We|=4,Rg.current=null,WI(e,n),jC(n,e),yI(Ip),Wu=!!Dp,Ip=Dp=null,e.current=n,qI(n),bD(),We=l,Xe=s,or.transition=i}else e.current=n;if(ou&&(ou=!1,Go=e,ad=o),i=e.pendingLanes,i===0&&(ni=null),jD(n.stateNode),Nn(e,Ot()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(sd)throw sd=!1,e=Xp,Xp=null,e;return ad&1&&e.tag!==0&&ta(),i=e.pendingLanes,i&1?e===Jp?Sl++:(Sl=0,Jp=e):Sl=0,gi(),null}function ta(){if(Go!==null){var e=ub(ad),t=or.transition,n=Xe;try{if(or.transition=null,Xe=16>e?16:e,Go===null)var r=!1;else{if(e=Go,Go=null,ad=0,We&6)throw Error(K(331));var o=We;for(We|=4,ie=e.current;ie!==null;){var i=ie,s=i.child;if(ie.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ie=u;ie!==null;){var d=ie;switch(d.tag){case 0:case 11:case 15:xl(8,d,i)}var f=d.child;if(f!==null)f.return=d,ie=f;else for(;ie!==null;){d=ie;var h=d.sibling,m=d.return;if(bC(d),d===u){ie=null;break}if(h!==null){h.return=m,ie=h;break}ie=m}}}var g=i.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var C=y.sibling;y.sibling=null,y=C}while(y!==null)}}ie=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ie=s;else e:for(;ie!==null;){if(i=ie,i.flags&2048)switch(i.tag){case 0:case 11:case 15:xl(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,ie=v;break e}ie=i.return}}var x=e.current;for(ie=x;ie!==null;){s=ie;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,ie=w;else e:for(s=x;ie!==null;){if(l=ie,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Wd(9,l)}}catch(j){Pt(l,l.return,j)}if(l===s){ie=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,ie=S;break e}ie=l.return}}if(We=o,gi(),Gr&&typeof Gr.onPostCommitFiberRoot=="function")try{Gr.onPostCommitFiberRoot($d,e)}catch{}r=!0}return r}finally{Xe=n,or.transition=t}}return!1}function Ix(e,t,n){t=ua(n,t),t=dC(e,t,1),e=ti(e,t,1),t=yn(),e!==null&&(nc(e,1,t),Nn(e,t))}function Pt(e,t,n){if(e.tag===3)Ix(e,e,n);else for(;t!==null;){if(t.tag===3){Ix(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ni===null||!ni.has(r))){e=ua(n,e),e=fC(t,e,1),t=ti(t,e,1),e=yn(),t!==null&&(nc(t,1,e),Nn(t,e));break}}t=t.return}}function JI(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=yn(),e.pingedLanes|=e.suspendedLanes&n,Wt===e&&(en&n)===n&&(zt===4||zt===3&&(en&130023424)===en&&500>Ot()-Ig?Fi(e,0):Dg|=n),Nn(e,t)}function _C(e,t){t===0&&(e.mode&1?(t=Qc,Qc<<=1,!(Qc&130023424)&&(Qc=4194304)):t=1);var n=yn();e=mo(e,t),e!==null&&(nc(e,t,n),Nn(e,n))}function ZI(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_C(e,n)}function e_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),_C(e,n)}var AC;AC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||_n.current)In=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return In=!1,BI(e,t,n);In=!!(e.flags&131072)}else In=!1,xt&&t.flags&1048576&&Mb(t,Ju,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ju(e,t),e=t.pendingProps;var o=sa(t,cn.current);ea(t,n),o=Eg(null,t,r,e,o,n);var i=jg();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,An(r)?(i=!0,Yu(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,xg(t),o.updater=Vd,t.stateNode=o,o._reactInternals=t,zp(t,r,e,n),t=Vp(null,t,r,!0,i,n)):(t.tag=0,xt&&i&&fg(t),hn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ju(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=n_(r),e=xr(r,e),o){case 0:t=Up(null,t,r,e,n);break e;case 1:t=Sx(null,t,r,e,n);break e;case 11:t=xx(null,t,r,e,n);break e;case 14:t=wx(null,t,r,xr(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xr(r,o),Up(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xr(r,o),Sx(e,t,r,o,n);case 3:e:{if(gC(t),e===null)throw Error(K(387));r=t.pendingProps,i=t.memoizedState,o=i.element,zb(e,t),td(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ua(Error(K(423)),t),t=bx(e,t,r,n,o);break e}else if(r!==o){o=ua(Error(K(424)),t),t=bx(e,t,r,n,o);break e}else for(Vn=ei(t.stateNode.containerInfo.firstChild),Wn=t,xt=!0,br=null,n=Hb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(aa(),r===o){t=go(e,t,n);break e}hn(e,t,r,n)}t=t.child}return t;case 5:return Wb(t),e===null&&$p(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,_p(r,o)?s=null:i!==null&&_p(r,i)&&(t.flags|=32),mC(e,t),hn(e,t,s,n),t.child;case 6:return e===null&&$p(t),null;case 13:return yC(e,t,n);case 4:return wg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=la(t,null,r,n):hn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xr(r,o),xx(e,t,r,o,n);case 7:return hn(e,t,t.pendingProps,n),t.child;case 8:return hn(e,t,t.pendingProps.children,n),t.child;case 12:return hn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,at(Zu,r._currentValue),r._currentValue=s,i!==null)if(Pr(i.value,s)){if(i.children===o.children&&!_n.current){t=go(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=lo(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Lp(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(K(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Lp(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}hn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ea(t,n),o=sr(o),r=r(o),t.flags|=1,hn(e,t,r,n),t.child;case 14:return r=t.type,o=xr(r,t.pendingProps),o=xr(r.type,o),wx(e,t,r,o,n);case 15:return hC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xr(r,o),ju(e,t),t.tag=1,An(r)?(e=!0,Yu(t)):e=!1,ea(t,n),Ub(t,r,o),zp(t,r,o,n),Vp(null,t,r,!0,e,n);case 19:return vC(e,t,n);case 22:return pC(e,t,n)}throw Error(K(156,t.tag))};function NC(e,t){return sb(e,t)}function t_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rr(e,t,n,r){return new t_(e,t,n,r)}function Og(e){return e=e.prototype,!(!e||!e.isReactComponent)}function n_(e){if(typeof e=="function")return Og(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eg)return 11;if(e===tg)return 14}return 2}function oi(e,t){var n=e.alternate;return n===null?(n=rr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ku(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Og(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Os:return zi(n.children,o,i,t);case Zm:s=8,o|=8;break;case up:return e=rr(12,n,t,o|2),e.elementType=up,e.lanes=i,e;case dp:return e=rr(13,n,t,o),e.elementType=dp,e.lanes=i,e;case fp:return e=rr(19,n,t,o),e.elementType=fp,e.lanes=i,e;case VS:return Gd(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case BS:s=10;break e;case US:s=9;break e;case eg:s=11;break e;case tg:s=14;break e;case Lo:s=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=rr(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function zi(e,t,n,r){return e=rr(7,e,r,t),e.lanes=n,e}function Gd(e,t,n,r){return e=rr(22,e,r,t),e.elementType=VS,e.lanes=n,e.stateNode={isHidden:!1},e}function Lh(e,t,n){return e=rr(6,e,null,t),e.lanes=n,e}function Fh(e,t,n){return t=rr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function r_(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xh(0),this.expirationTimes=xh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Mg(e,t,n,r,o,i,s,l,c){return e=new r_(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=rr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xg(i),e}function o_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ns,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function OC(e){if(!e)return li;e=e._reactInternals;e:{if(is(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(An(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if(An(n))return Nb(e,n,t)}return t}function MC(e,t,n,r,o,i,s,l,c){return e=Mg(n,r,!0,e,o,i,s,l,c),e.context=OC(null),n=e.current,r=yn(),o=ri(n),i=lo(r,o),i.callback=t??null,ti(n,i,o),e.current.lanes=o,nc(e,o,r),Nn(e,r),e}function Qd(e,t,n,r){var o=t.current,i=yn(),s=ri(o);return n=OC(n),t.context===null?t.context=n:t.pendingContext=n,t=lo(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ti(o,t,s),e!==null&&(jr(e,o,s,i),bu(e,o,s)),s}function cd(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function _x(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function $g(e,t){_x(e,t),(e=e.alternate)&&_x(e,t)}function i_(){return null}var $C=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lg(e){this._internalRoot=e}Kd.prototype.render=Lg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));Qd(e,t,null,null)};Kd.prototype.unmount=Lg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qi(function(){Qd(null,e,null,null)}),t[po]=null}};function Kd(e){this._internalRoot=e}Kd.prototype.unstable_scheduleHydration=function(e){if(e){var t=hb();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vo.length&&t!==0&&t<Vo[n].priority;n++);Vo.splice(n,0,e),n===0&&mb(e)}};function Fg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ax(){}function s_(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=cd(s);i.call(u)}}var s=MC(t,r,e,0,null,!1,!1,"",Ax);return e._reactRootContainer=s,e[po]=s.current,Al(e.nodeType===8?e.parentNode:e),qi(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=cd(c);l.call(u)}}var c=Mg(e,0,!1,null,null,!1,!1,"",Ax);return e._reactRootContainer=c,e[po]=c.current,Al(e.nodeType===8?e.parentNode:e),qi(function(){Qd(t,c,n,r)}),c}function Xd(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var c=cd(s);l.call(c)}}Qd(t,s,e,o)}else s=s_(n,t,e,o,r);return cd(s)}db=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ll(t.pendingLanes);n!==0&&(og(t,n|1),Nn(t,Ot()),!(We&6)&&(da=Ot()+500,gi()))}break;case 13:qi(function(){var r=mo(e,1);if(r!==null){var o=yn();jr(r,e,1,o)}}),$g(e,1)}};ig=function(e){if(e.tag===13){var t=mo(e,134217728);if(t!==null){var n=yn();jr(t,e,134217728,n)}$g(e,134217728)}};fb=function(e){if(e.tag===13){var t=ri(e),n=mo(e,t);if(n!==null){var r=yn();jr(n,e,t,r)}$g(e,t)}};hb=function(){return Xe};pb=function(e,t){var n=Xe;try{return Xe=e,t()}finally{Xe=n}};bp=function(e,t,n){switch(t){case"input":if(mp(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Bd(r);if(!o)throw Error(K(90));WS(r),mp(r,o)}}}break;case"textarea":GS(e,n);break;case"select":t=n.value,t!=null&&Ys(e,!!n.multiple,t,!1)}};eb=_g;tb=qi;var a_={usingClientEntryPoint:!1,Events:[oc,Fs,Bd,JS,ZS,_g]},Ka={findFiberByHostInstance:Ai,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},l_={bundleType:Ka.bundleType,version:Ka.version,rendererPackageName:Ka.rendererPackageName,rendererConfig:Ka.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ob(e),e===null?null:e.stateNode},findFiberByHostInstance:Ka.findFiberByHostInstance||i_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!iu.isDisabled&&iu.supportsFiber)try{$d=iu.inject(l_),Gr=iu}catch{}}Kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a_;Kn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fg(t))throw Error(K(200));return o_(e,t,null,n)};Kn.createRoot=function(e,t){if(!Fg(e))throw Error(K(299));var n=!1,r="",o=$C;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Mg(e,1,!1,null,null,n,!1,r,o),e[po]=t.current,Al(e.nodeType===8?e.parentNode:e),new Lg(t)};Kn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=ob(t),e=e===null?null:e.stateNode,e};Kn.flushSync=function(e){return qi(e)};Kn.hydrate=function(e,t,n){if(!Yd(t))throw Error(K(200));return Xd(null,e,t,!0,n)};Kn.hydrateRoot=function(e,t,n){if(!Fg(e))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=$C;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=MC(t,null,e,1,n??null,o,!1,i,s),e[po]=t.current,Al(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Kd(t)};Kn.render=function(e,t,n){if(!Yd(t))throw Error(K(200));return Xd(null,e,t,!1,n)};Kn.unmountComponentAtNode=function(e){if(!Yd(e))throw Error(K(40));return e._reactRootContainer?(qi(function(){Xd(null,null,e,!1,function(){e._reactRootContainer=null,e[po]=null})}),!0):!1};Kn.unstable_batchedUpdates=_g;Kn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Yd(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return Xd(e,t,n,!1,r)};Kn.version="18.2.0-next-9e3b772b8-20220608";function LC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(LC)}catch(e){console.error(e)}}LC(),MS.exports=Kn;var sc=MS.exports;const ul=Am(sc),c_=Qw({__proto__:null,default:ul},[sc]),[u_,ur]=Sn("ScrollArea.Root component was not found in tree");function fa(e,t){const n=Ii(t);ja(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const d_=b.forwardRef((e,t)=>{const{style:n,...r}=e,o=ur(),[i,s]=b.useState(0),[l,c]=b.useState(0),u=!!(i&&l);return fa(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),fa(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),u?b.createElement("div",{...r,ref:t,style:{...n,width:i,height:l}}):null}),f_=b.forwardRef((e,t)=>{const n=ur(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?b.createElement(d_,{...e,ref:t}):null}),h_={scrollHideDelay:1e3,type:"hover"},FC=p.forwardRef((e,t)=>{const n=U("ScrollAreaRoot",h_,e),{type:r,scrollHideDelay:o,scrollbars:i,...s}=n,[l,c]=p.useState(null),[u,d]=p.useState(null),[f,h]=p.useState(null),[m,g]=p.useState(null),[y,C]=p.useState(null),[v,x]=p.useState(0),[w,S]=p.useState(0),[j,E]=p.useState(!1),[T,P]=p.useState(!1),k=Gt(t,D=>c(D));return b.createElement(u_,{value:{type:r,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:j,onScrollbarXEnabledChange:E,scrollbarY:y,onScrollbarYChange:C,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:x,onCornerHeightChange:S}},b.createElement(W,{...s,ref:k,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${v}px`,"--sa-corner-height":i!=="xy"?"0px":`${w}px`}}))});FC.displayName="@mantine/core/ScrollAreaRoot";function zC(e,t){const n=e/t;return Number.isNaN(n)?0:n}function Jd(e){const t=zC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function BC(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 p_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Nx(e,t,n="ltr"){const r=Jd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,s]:[s*-1,0],u=p_(e,c);return BC([0,s],[0,l])(u)}function m_(e,t,n,r="ltr"){const o=Jd(n),i=o/2,s=t||i,l=o-s,c=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return BC([c,u],f)(e)}function UC(e,t){return e>0&&e<t}function ud(e){return e?parseInt(e,10):0}function Bi(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[g_,VC]=Sn("ScrollAreaScrollbar was not found in tree"),HC=p.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=ur(),[m,g]=b.useState(null),y=Gt(t,P=>g(P)),C=b.useRef(null),v=b.useRef(""),{viewport:x}=h,w=n.content-n.viewport,S=Ii(u),j=Ii(l),E=Nd(d,10),T=P=>{if(C.current){const k=P.clientX-C.current.left,D=P.clientY-C.current.top;c({x:k,y:D})}};return p.useEffect(()=>{const P=k=>{const D=k.target;(m==null?void 0:m.contains(D))&&S(k,w)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[x,m,w,S]),p.useEffect(j,[n,j]),fa(m,E),fa(h.content,E),b.createElement(g_,{value:{scrollbar:m,hasThumb:r,onThumbChange:Ii(o),onThumbPointerUp:Ii(i),onThumbPositionChange:j,onThumbPointerDown:Ii(s)}},b.createElement("div",{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:Bi(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",T(P))}),onPointerMove:Bi(e.onPointerMove,T),onPointerUp:Bi(e.onPointerUp,P=>{const k=P.target;k.hasPointerCapture(P.pointerId)&&k.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=v.current,C.current=null})}))}),y_=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,s=ur(),[l,c]=p.useState(),u=p.useRef(null),d=Gt(t,u,s.onScrollbarXChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),b.createElement(HC,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{...o,"--sa-thumb-width":`${Jd(n)}px`},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(s.viewport){const m=s.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),UC(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:ud(l.paddingLeft),paddingEnd:ud(l.paddingRight)}})}})}),v_=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,s=ur(),[l,c]=b.useState(),u=p.useRef(null),d=Gt(t,u,s.onScrollbarYChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),b.createElement(HC,{...i,"data-orientation":"vertical",ref:d,sizes:n,style:{"--sa-thumb-height":`${Jd(n)}px`,...o},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(s.viewport){const m=s.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),UC(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:ud(l.paddingTop),paddingEnd:ud(l.paddingBottom)}})}})}),zg=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=rs(),i=ur(),s=p.useRef(null),l=p.useRef(0),[c,u]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=zC(c.viewport,c.content),f={...r,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>{s.current=m},onThumbPointerUp:()=>{l.current=0},onThumbPointerDown:m=>{l.current=m}},h=(m,g)=>m_(m,l.current,c,g);return n==="horizontal"?b.createElement(y_,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const m=i.viewport.scrollLeft,g=Nx(m,c,o);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=h(m,o))}}):n==="vertical"?b.createElement(v_,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const m=i.viewport.scrollTop,g=Nx(m,c);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=h(m))}}):null}),WC=p.forwardRef((e,t)=>{const n=ur(),{forceMount:r,...o}=e,[i,s]=p.useState(!1),l=e.orientation==="horizontal",c=Nd(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(l?u:d)}},10);return fa(n.viewport,c),fa(n.content,c),r||i?b.createElement(zg,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),x_=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ur(),[i,s]=p.useState(!1);return p.useEffect(()=>{const{scrollArea:l}=o;let c=0;if(l){const u=()=>{window.clearTimeout(c),s(!0)},d=()=>{c=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),n||i?b.createElement(WC,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),w_=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ur(),i=e.orientation==="horizontal",[s,l]=p.useState("hidden"),c=Nd(()=>l("idle"),100);return p.useEffect(()=>{if(s==="idle"){const u=window.setTimeout(()=>l("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[s,o.scrollHideDelay]),p.useEffect(()=>{const{viewport:u}=o,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(l("scrolling"),c()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c]),n||s!=="hidden"?b.createElement(zg,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Bi(e.onPointerEnter,()=>l("interacting")),onPointerLeave:Bi(e.onPointerLeave,()=>l("idle"))}):null}),Ox=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ur(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,l=e.orientation==="horizontal";return b.useEffect(()=>(l?i(!0):s(!0),()=>{l?i(!1):s(!1)}),[l,i,s]),o.type==="hover"?b.createElement(x_,{...r,ref:t,forceMount:n}):o.type==="scroll"?b.createElement(w_,{...r,ref:t,forceMount:n}):o.type==="auto"?b.createElement(WC,{...r,ref:t,forceMount:n}):o.type==="always"?b.createElement(zg,{...r,ref:t}):null});function S_(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,l=n.top!==i.top;(s||l)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const b_=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=ur(),i=VC(),{onThumbPositionChange:s}=i,l=Gt(t,d=>i.onThumbChange(d)),c=p.useRef(),u=Nd(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const{viewport:d}=o;if(d){const f=()=>{if(u(),!c.current){const h=S_(d,s);c.current=h,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,u,s]),b.createElement("div",{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:Bi(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,g=d.clientY-h.top;i.onThumbPointerDown({x:m,y:g})}),onPointerUp:Bi(e.onPointerUp,i.onThumbPointerUp)})}),Mx=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=VC();return n||o.hasThumb?b.createElement(b_,{ref:t,...r}):null}),qC=p.forwardRef(({children:e,style:t,...n},r)=>{const o=ur(),i=Gt(r,o.onViewportChange);return b.createElement(W,{...n,ref:i,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t}},b.createElement("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange},e))});qC.displayName="@mantine/core/ScrollAreaViewport";var Bg={root:"m-d57069b5",viewport:"m-c0783ff9",viewportInner:"m-f8f631dd",scrollbar:"m-c44ba933",thumb:"m-d8b5e363",corner:"m-21657268"};const GC={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},C_=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":z(t)}}),dr=Q((e,t)=>{const n=U("ScrollArea",GC,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,scrollbarSize:c,vars:u,type:d,scrollHideDelay:f,viewportProps:h,viewportRef:m,onScrollPositionChange:g,children:y,offsetScrollbars:C,scrollbars:v,...x}=n,[w,S]=p.useState(!1),j=le({name:"ScrollArea",props:n,classes:Bg,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:C_});return b.createElement(FC,{type:d==="never"?"always":d,scrollHideDelay:f,ref:t,scrollbars:v,...j("root"),...x},b.createElement(qC,{...h,...j("viewport"),ref:m,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":v||void 0,onScroll:typeof g=="function"?({currentTarget:E})=>g({x:E.scrollLeft,y:E.scrollTop}):void 0},y),(v==="xy"||v==="x")&&b.createElement(Ox,{...j("scrollbar"),orientation:"horizontal","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1)},b.createElement(Mx,{...j("thumb")})),(v==="xy"||v==="y")&&b.createElement(Ox,{...j("scrollbar"),orientation:"vertical","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1)},b.createElement(Mx,{...j("thumb")})),b.createElement(f_,{...j("corner"),"data-hovered":w||void 0,"data-hidden":d==="never"||void 0}))});dr.displayName="@mantine/core/ScrollArea";const Ug=Q((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:i,scrollHideDelay:s,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,scrollbars:y,style:C,vars:v,...x}=U("ScrollAreaAutosize",GC,e);return b.createElement(W,{...x,ref:t,style:[{display:"flex",overflow:"auto"},C]},b.createElement(W,{style:{display:"flex",flexDirection:"column",flex:1}},b.createElement(dr,{classNames:r,styles:o,scrollHideDelay:s,scrollbarSize:i,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,vars:v,scrollbars:y},n)))});dr.classes=Bg;Ug.displayName="@mantine/core/ScrollAreaAutosize";Ug.classes=Bg;dr.Autosize=Ug;var QC={root:"m-87cf2631"};const E_={__staticSelector:"UnstyledButton"},Qn=un((e,t)=>{const n=U("UnstyledButton",E_,e),{className:r,component:o="button",__staticSelector:i,unstyled:s,classNames:l,styles:c,style:u,...d}=n,f=le({name:i,props:n,classes:QC,className:r,style:u,classNames:l,styles:c,unstyled:s});return b.createElement(W,{...f("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...d})});Qn.classes=QC;Qn.displayName="@mantine/core/UnstyledButton";var KC={root:"m-1b7284a3"};const j_={},T_=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:ut(t),"--paper-shadow":zm(n)}}),On=un((e,t)=>{const n=U("Paper",j_,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,withBorder:c,vars:u,radius:d,shadow:f,variant:h,mod:m,...g}=n,y=le({name:"Paper",props:n,classes:KC,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:T_});return b.createElement(W,{ref:t,mod:[{"data-with-border":c},m],...y("root"),variant:h,...g})});On.classes=KC;On.displayName="@mantine/core/Paper";const kr=Math.min,an=Math.max,dd=Math.round,su=Math.floor,ci=e=>({x:e,y:e}),P_={left:"right",right:"left",bottom:"top",top:"bottom"},k_={start:"end",end:"start"};function tm(e,t,n){return an(e,kr(t,n))}function yo(e,t){return typeof e=="function"?e(t):e}function Rr(e){return e.split("-")[0]}function Ra(e){return e.split("-")[1]}function Vg(e){return e==="x"?"y":"x"}function Hg(e){return e==="y"?"height":"width"}function ss(e){return["top","bottom"].includes(Rr(e))?"y":"x"}function Wg(e){return Vg(ss(e))}function R_(e,t,n){n===void 0&&(n=!1);const r=Ra(e),o=Wg(e),i=Hg(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=fd(s)),[s,fd(s)]}function D_(e){const t=fd(e);return[nm(e),t,nm(t)]}function nm(e){return e.replace(/start|end/g,t=>k_[t])}function I_(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function __(e,t,n,r){const o=Ra(e);let i=I_(Rr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(nm)))),i}function fd(e){return e.replace(/left|right|bottom|top/g,t=>P_[t])}function A_(e){return{top:0,right:0,bottom:0,left:0,...e}}function qg(e){return typeof e!="number"?A_(e):{top:e,right:e,bottom:e,left:e}}function ha(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function $x(e,t,n){let{reference:r,floating:o}=e;const i=ss(t),s=Wg(t),l=Hg(s),c=Rr(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Ra(t)){case"start":m[s]-=h*(n&&u?-1:1);break;case"end":m[s]+=h*(n&&u?-1:1);break}return m}const N_=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=$x(u,r,c),h=r,m={},g=0;for(let y=0;y<l.length;y++){const{name:C,fn:v}=l[y],{x,y:w,data:S,reset:j}=await v({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:u,platform:s,elements:{reference:e,floating:t}});d=x??d,f=w??f,m={...m,[C]:{...m[C],...S}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(u=j.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:f}=$x(u,h,c)),y=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:m}};async function Gg(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=yo(t,e),g=qg(m),C=l[h?f==="floating"?"reference":"floating":f],v=ha(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(C)))==null||n?C:C.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=f==="floating"?{...s.floating,x:r,y:o}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},j=ha(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(v.top-j.top+g.top)/S.y,bottom:(j.bottom-v.bottom+g.bottom)/S.y,left:(v.left-j.left+g.left)/S.x,right:(j.right-v.right+g.right)/S.x}}const O_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=yo(e,t)||{};if(u==null)return{};const f=qg(d),h={x:n,y:r},m=Wg(o),g=Hg(m),y=await s.getDimensions(u),C=m==="y",v=C?"top":"left",x=C?"bottom":"right",w=C?"clientHeight":"clientWidth",S=i.reference[g]+i.reference[m]-h[m]-i.floating[g],j=h[m]-i.reference[m],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let T=E?E[w]:0;(!T||!await(s.isElement==null?void 0:s.isElement(E)))&&(T=l.floating[w]||i.floating[g]);const P=S/2-j/2,k=T/2-y[g]/2-1,D=kr(f[v],k),M=kr(f[x],k),R=D,O=T-y[g]-M,N=T/2-y[g]/2+P,B=tm(R,N,O),I=!c.arrow&&Ra(o)!=null&&N!==B&&i.reference[g]/2-(N<R?D:M)-y[g]/2<0,$=I?N<R?N-R:N-O:0;return{[m]:h[m]+$,data:{[m]:B,centerOffset:N-B-$,...I&&{alignmentOffset:$}},reset:I}}}),M_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...C}=yo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Rr(o),x=Rr(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=h||(x||!y?[fd(l)]:D_(l));!h&&g!=="none"&&S.push(...__(l,y,g,w));const j=[l,...S],E=await Gg(t,C),T=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&T.push(E[v]),f){const R=R_(o,s,w);T.push(E[R[0]],E[R[1]])}if(P=[...P,{placement:o,overflows:T}],!T.every(R=>R<=0)){var k,D;const R=(((k=i.flip)==null?void 0:k.index)||0)+1,O=j[R];if(O)return{data:{index:R,overflows:P},reset:{placement:O}};let N=(D=P.filter(B=>B.overflows[0]<=0).sort((B,I)=>B.overflows[1]-I.overflows[1])[0])==null?void 0:D.placement;if(!N)switch(m){case"bestFit":{var M;const B=(M=P.map(I=>[I.placement,I.overflows.filter($=>$>0).reduce(($,_)=>$+_,0)]).sort((I,$)=>I[1]-$[1])[0])==null?void 0:M[0];B&&(N=B);break}case"initialPlacement":N=l;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function YC(e){const t=kr(...e.map(i=>i.left)),n=kr(...e.map(i=>i.top)),r=an(...e.map(i=>i.right)),o=an(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function $_(e){const t=e.slice().sort((o,i)=>o.y-i.y),n=[];let r=null;for(let o=0;o<t.length;o++){const i=t[o];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(o=>ha(YC(o)))}const L_=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:s}=t,{padding:l=2,x:c,y:u}=yo(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),f=$_(d),h=ha(YC(d)),m=qg(l);function g(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&u!=null)return f.find(C=>c>C.left-m.left&&c<C.right+m.right&&u>C.top-m.top&&u<C.bottom+m.bottom)||h;if(f.length>=2){if(ss(n)==="y"){const D=f[0],M=f[f.length-1],R=Rr(n)==="top",O=D.top,N=M.bottom,B=R?D.left:M.left,I=R?D.right:M.right,$=I-B,_=N-O;return{top:O,bottom:N,left:B,right:I,width:$,height:_,x:B,y:O}}const C=Rr(n)==="left",v=an(...f.map(D=>D.right)),x=kr(...f.map(D=>D.left)),w=f.filter(D=>C?D.left===x:D.right===v),S=w[0].top,j=w[w.length-1].bottom,E=x,T=v,P=T-E,k=j-S;return{top:S,bottom:j,left:E,right:T,width:P,height:k,x:E,y:S}}return h}const y=await i.getElementRects({reference:{getBoundingClientRect:g},floating:r.floating,strategy:s});return o.reference.x!==y.reference.x||o.reference.y!==y.reference.y||o.reference.width!==y.reference.width||o.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}};async function F_(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Rr(n),l=Ra(n),c=ss(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&c?-1:1,f=yo(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const XC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await F_(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},z_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:C=>{let{x:v,y:x}=C;return{x:v,y:x}}},...c}=yo(e,t),u={x:n,y:r},d=await Gg(t,c),f=ss(Rr(o)),h=Vg(f);let m=u[h],g=u[f];if(i){const C=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=m+d[C],w=m-d[v];m=tm(x,m,w)}if(s){const C=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=g+d[C],w=g-d[v];g=tm(x,g,w)}const y=l.fn({...t,[h]:m,[f]:g});return{...y,data:{x:y.x-n,y:y.y-r}}}}},B_=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=yo(e,t),d={x:n,y:r},f=ss(o),h=Vg(f);let m=d[h],g=d[f];const y=yo(l,t),C=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const w=h==="y"?"height":"width",S=i.reference[h]-i.floating[w]+C.mainAxis,j=i.reference[h]+i.reference[w]-C.mainAxis;m<S?m=S:m>j&&(m=j)}if(u){var v,x;const w=h==="y"?"width":"height",S=["top","left"].includes(Rr(o)),j=i.reference[f]-i.floating[w]+(S&&((v=s.offset)==null?void 0:v[f])||0)+(S?0:C.crossAxis),E=i.reference[f]+i.reference[w]+(S?0:((x=s.offset)==null?void 0:x[f])||0)-(S?C.crossAxis:0);g<j?g=j:g>E&&(g=E)}return{[h]:m,[f]:g}}}},U_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...l}=yo(e,t),c=await Gg(t,l),u=Rr(n),d=Ra(n),f=ss(n)==="y",{width:h,height:m}=r.floating;let g,y;u==="top"||u==="bottom"?(g=u,y=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(y=u,g=d==="end"?"top":"bottom");const C=m-c[g],v=h-c[y],x=!t.middlewareData.shift;let w=C,S=v;if(f){const E=h-c.left-c.right;S=d||x?kr(v,E):E}else{const E=m-c.top-c.bottom;w=d||x?kr(C,E):E}if(x&&!d){const E=an(c.left,0),T=an(c.right,0),P=an(c.top,0),k=an(c.bottom,0);f?S=h-2*(E!==0||T!==0?E+T:an(c.left,c.right)):w=m-2*(P!==0||k!==0?P+k:an(c.top,c.bottom))}await s({...t,availableWidth:S,availableHeight:w});const j=await o.getDimensions(i.floating);return h!==j.width||m!==j.height?{reset:{rects:!0}}:{}}}};function ui(e){return JC(e)?(e.nodeName||"").toLowerCase():"#document"}function qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function To(e){var t;return(t=(JC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function JC(e){return e instanceof Node||e instanceof qn(e).Node}function vo(e){return e instanceof Element||e instanceof qn(e).Element}function Zr(e){return e instanceof HTMLElement||e instanceof qn(e).HTMLElement}function Lx(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qn(e).ShadowRoot}function ac(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=lr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function V_(e){return["table","td","th"].includes(ui(e))}function Qg(e){const t=Kg(),n=lr(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function ZC(e){let t=pa(e);for(;Zr(t)&&!Zd(t);){if(Qg(t))return t;t=pa(t)}return null}function Kg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zd(e){return["html","body","#document"].includes(ui(e))}function lr(e){return qn(e).getComputedStyle(e)}function ef(e){return vo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function pa(e){if(ui(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lx(e)&&e.host||To(e);return Lx(t)?t.host:t}function eE(e){const t=pa(e);return Zd(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zr(t)&&ac(t)?t:eE(t)}function co(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=eE(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=qn(o);return i?t.concat(s,s.visualViewport||[],ac(o)?o:[],s.frameElement&&n?co(s.frameElement):[]):t.concat(o,co(o,[],n))}function tE(e){const t=lr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Zr(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=dd(n)!==i||dd(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Yg(e){return vo(e)?e:e.contextElement}function na(e){const t=Yg(e);if(!Zr(t))return ci(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=tE(t);let s=(i?dd(n.width):n.width)/r,l=(i?dd(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const H_=ci(0);function nE(e){const t=qn(e);return!Kg()||!t.visualViewport?H_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function W_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qn(e)?!1:t}function Gi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Yg(e);let s=ci(1);t&&(r?vo(r)&&(s=na(r)):s=na(e));const l=W_(i,n,r)?nE(i):ci(0);let c=(o.left+l.x)/s.x,u=(o.top+l.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const h=qn(i),m=r&&vo(r)?qn(r):r;let g=h.frameElement;for(;g&&r&&m!==h;){const y=na(g),C=g.getBoundingClientRect(),v=lr(g),x=C.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,w=C.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=x,u+=w,g=qn(g).frameElement}}return ha({width:d,height:f,x:c,y:u})}const q_=[":popover-open",":modal"];function rE(e){let t=!1,n=0,r=0;function o(s){try{t=t||e.matches(s)}catch{}}q_.forEach(s=>{o(s)});const i=ZC(e);if(t&&i){const s=i.getBoundingClientRect();n=s.x,r=s.y}return[t,n,r]}function G_(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=To(r),[s]=t?rE(t.floating):[!1];if(r===i||s)return n;let l={scrollLeft:0,scrollTop:0},c=ci(1);const u=ci(0),d=Zr(r);if((d||!d&&o!=="fixed")&&((ui(r)!=="body"||ac(i))&&(l=ef(r)),Zr(r))){const f=Gi(r);c=na(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function Q_(e){return Array.from(e.getClientRects())}function oE(e){return Gi(To(e)).left+ef(e).scrollLeft}function K_(e){const t=To(e),n=ef(e),r=e.ownerDocument.body,o=an(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=an(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+oE(e);const l=-n.scrollTop;return lr(r).direction==="rtl"&&(s+=an(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function Y_(e,t){const n=qn(e),r=To(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=Kg();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:l,y:c}}function X_(e,t){const n=Gi(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Zr(e)?na(e):ci(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:s,height:l,x:c,y:u}}function Fx(e,t,n){let r;if(t==="viewport")r=Y_(e,n);else if(t==="document")r=K_(To(e));else if(vo(t))r=X_(t,n);else{const o=nE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ha(r)}function iE(e,t){const n=pa(e);return n===t||!vo(n)||Zd(n)?!1:lr(n).position==="fixed"||iE(n,t)}function J_(e,t){const n=t.get(e);if(n)return n;let r=co(e,[],!1).filter(l=>vo(l)&&ui(l)!=="body"),o=null;const i=lr(e).position==="fixed";let s=i?pa(e):e;for(;vo(s)&&!Zd(s);){const l=lr(s),c=Qg(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ac(s)&&!c&&iE(e,s))?r=r.filter(d=>d!==s):o=l,s=pa(s)}return t.set(e,r),r}function Z_(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?J_(t,this._c):[].concat(n),r],l=s[0],c=s.reduce((u,d)=>{const f=Fx(t,d,o);return u.top=an(f.top,u.top),u.right=kr(f.right,u.right),u.bottom=kr(f.bottom,u.bottom),u.left=an(f.left,u.left),u},Fx(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function e4(e){const{width:t,height:n}=tE(e);return{width:t,height:n}}function t4(e,t,n,r){const o=Zr(t),i=To(t),s=n==="fixed",l=Gi(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=ci(0);if(o||!o&&!s)if((ui(t)!=="body"||ac(i))&&(c=ef(t)),o){const y=Gi(t,!0,s,t);u.x=y.x+t.clientLeft,u.y=y.y+t.clientTop}else i&&(u.x=oE(i));let d=l.left+c.scrollLeft-u.x,f=l.top+c.scrollTop-u.y;const[h,m,g]=rE(r);return h&&(d+=m,f+=g,o&&(d+=t.clientLeft,f+=t.clientTop)),{x:d,y:f,width:l.width,height:l.height}}function zx(e,t){return!Zr(e)||lr(e).position==="fixed"?null:t?t(e):e.offsetParent}function sE(e,t){const n=qn(e);if(!Zr(e))return n;let r=zx(e,t);for(;r&&V_(r)&&lr(r).position==="static";)r=zx(r,t);return r&&(ui(r)==="html"||ui(r)==="body"&&lr(r).position==="static"&&!Qg(r))?n:r||ZC(e)||n}const n4=async function(e){const t=this.getOffsetParent||sE,n=this.getDimensions;return{reference:t4(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function r4(e){return lr(e).direction==="rtl"}const o4={convertOffsetParentRelativeRectToViewportRelativeRect:G_,getDocumentElement:To,getClippingRect:Z_,getOffsetParent:sE,getElementRects:n4,getClientRects:Q_,getDimensions:e4,getScale:na,isElement:vo,isRTL:r4};function i4(e,t){let n=null,r;const o=To(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:f,height:h}=e.getBoundingClientRect();if(l||t(),!f||!h)return;const m=su(d),g=su(o.clientWidth-(u+f)),y=su(o.clientHeight-(d+h)),C=su(u),x={rootMargin:-m+"px "+-g+"px "+-y+"px "+-C+"px",threshold:an(0,kr(1,c))||1};let w=!0;function S(j){const E=j[0].intersectionRatio;if(E!==c){if(!w)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(S,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(e)}return s(!0),i}function s4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Yg(e),d=o||i?[...u?co(u):[],...co(t)]:[];d.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=u&&l?i4(u,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(v=>{let[x]=v;x&&x.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g,y=c?Gi(e):null;c&&C();function C(){const v=Gi(e);y&&(v.x!==y.x||v.y!==y.y||v.width!==y.width||v.height!==y.height)&&n(),y=v,g=requestAnimationFrame(C)}return n(),()=>{var v;d.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(v=m)==null||v.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Xg=z_,aE=M_,a4=U_,Bx=O_,lE=L_,l4=B_,c4=(e,t,n)=>{const r=new Map,o={platform:o4,...n},i={...o.platform,_c:r};return N_(e,t,{...o,platform:i})},cE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Bx({element:r.current,padding:o}).fn(n):{}:r?Bx({element:r,padding:o}).fn(n):{}}}};var Ru=typeof document<"u"?p.useLayoutEffect:p.useEffect;function hd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!hd(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!hd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function uE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ux(e,t){const n=uE(e);return Math.round(t*n)/n}function Vx(e){const t=p.useRef(e);return Ru(()=>{t.current=e}),t}function u4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);hd(h,r)||m(r);const[g,y]=p.useState(null),[C,v]=p.useState(null),x=p.useCallback($=>{$!==E.current&&(E.current=$,y($))},[]),w=p.useCallback($=>{$!==T.current&&(T.current=$,v($))},[]),S=i||g,j=s||C,E=p.useRef(null),T=p.useRef(null),P=p.useRef(d),k=c!=null,D=Vx(c),M=Vx(o),R=p.useCallback(()=>{if(!E.current||!T.current)return;const $={placement:t,strategy:n,middleware:h};M.current&&($.platform=M.current),c4(E.current,T.current,$).then(_=>{const F={..._,isPositioned:!0};O.current&&!hd(P.current,F)&&(P.current=F,sc.flushSync(()=>{f(F)}))})},[h,t,n,M]);Ru(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[u]);const O=p.useRef(!1);Ru(()=>(O.current=!0,()=>{O.current=!1}),[]),Ru(()=>{if(S&&(E.current=S),j&&(T.current=j),S&&j){if(D.current)return D.current(S,j,R);R()}},[S,j,R,D,k]);const N=p.useMemo(()=>({reference:E,floating:T,setReference:x,setFloating:w}),[x,w]),B=p.useMemo(()=>({reference:S,floating:j}),[S,j]),I=p.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const _=Ux(B.floating,d.x),F=Ux(B.floating,d.y);return l?{...$,transform:"translate("+_+"px, "+F+"px)",...uE(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:F}},[n,l,B.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:R,refs:N,elements:B,floatingStyles:I}),[d,R,N,B,I])}var uo=typeof document<"u"?p.useLayoutEffect:p.useEffect;let zh=!1,d4=0;const Hx=()=>"floating-ui-"+d4++;function f4(){const[e,t]=p.useState(()=>zh?Hx():void 0);return uo(()=>{e==null&&t(Hx())},[]),p.useEffect(()=>{zh||(zh=!0)},[]),e}const h4=Lm.useId,dE=h4||f4;function p4(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(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(o=>o!==n))||[])}}}const m4=p.createContext(null),g4=p.createContext(null),fE=()=>{var e;return((e=p.useContext(m4))==null?void 0:e.id)||null},Jg=()=>p.useContext(g4);function Qo(e){return(e==null?void 0:e.ownerDocument)||document}function y4(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function v4(){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 tf(e){return Qo(e).defaultView||window}function qr(e){return e?e instanceof Element||e instanceof tf(e).Element:!1}function hE(e){return e?e instanceof HTMLElement||e instanceof tf(e).HTMLElement:!1}function x4(e){if(typeof ShadowRoot>"u")return!1;const t=tf(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function w4(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(y4())||t.test(v4()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function S4(e){return e.width===0&&e.height===0||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}function pE(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function b4(e){return"nativeEvent"in e}function rm(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&x4(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function mE(e){return"data-floating-ui-"+e}function Wx(e){const t=p.useRef(e);return uo(()=>{t.current=e}),t}const qx=mE("safe-polygon");function Du(e,t,n){return n&&!pE(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function C4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:s,floating:l},refs:c}=e,{enabled:u=!0,delay:d=0,handleClose:f=null,mouseOnly:h=!1,restMs:m=0,move:g=!0}=t,y=Jg(),C=fE(),v=Wx(f),x=Wx(d),w=p.useRef(),S=p.useRef(),j=p.useRef(),E=p.useRef(),T=p.useRef(!0),P=p.useRef(!1),k=p.useRef(()=>{}),D=p.useCallback(()=>{var N;const B=(N=o.current.openEvent)==null?void 0:N.type;return(B==null?void 0:B.includes("mouse"))&&B!=="mousedown"},[o]);p.useEffect(()=>{if(!u)return;function N(){clearTimeout(S.current),clearTimeout(E.current),T.current=!0}return i.on("dismiss",N),()=>{i.off("dismiss",N)}},[u,i]),p.useEffect(()=>{if(!u||!v.current||!n)return;function N(I){D()&&r(!1,I)}const B=Qo(l).documentElement;return B.addEventListener("mouseleave",N),()=>{B.removeEventListener("mouseleave",N)}},[l,n,r,u,v,o,D]);const M=p.useCallback(function(N,B){B===void 0&&(B=!0);const I=Du(x.current,"close",w.current);I&&!j.current?(clearTimeout(S.current),S.current=setTimeout(()=>r(!1,N),I)):B&&(clearTimeout(S.current),r(!1,N))},[x,r]),R=p.useCallback(()=>{k.current(),j.current=void 0},[]),O=p.useCallback(()=>{if(P.current){const N=Qo(c.floating.current).body;N.style.pointerEvents="",N.removeAttribute(qx),P.current=!1}},[c]);return p.useEffect(()=>{if(!u)return;function N(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function B(_){if(clearTimeout(S.current),T.current=!1,h&&!pE(w.current)||m>0&&Du(x.current,"open")===0)return;const F=Du(x.current,"open",w.current);F?S.current=setTimeout(()=>{r(!0,_)},F):r(!0,_)}function I(_){if(N())return;k.current();const F=Qo(l);if(clearTimeout(E.current),v.current){n||clearTimeout(S.current),j.current=v.current({...e,tree:y,x:_.clientX,y:_.clientY,onClose(){O(),R(),M(_)}});const G=j.current;F.addEventListener("mousemove",G),k.current=()=>{F.removeEventListener("mousemove",G)};return}(w.current==="touch"?!rm(l,_.relatedTarget):!0)&&M(_)}function $(_){N()||v.current==null||v.current({...e,tree:y,x:_.clientX,y:_.clientY,onClose(){O(),R(),M(_)}})(_)}if(qr(s)){const _=s;return n&&_.addEventListener("mouseleave",$),l==null||l.addEventListener("mouseleave",$),g&&_.addEventListener("mousemove",B,{once:!0}),_.addEventListener("mouseenter",B),_.addEventListener("mouseleave",I),()=>{n&&_.removeEventListener("mouseleave",$),l==null||l.removeEventListener("mouseleave",$),g&&_.removeEventListener("mousemove",B),_.removeEventListener("mouseenter",B),_.removeEventListener("mouseleave",I)}}},[s,l,u,e,h,m,g,M,R,O,r,n,y,x,v,o]),uo(()=>{var N;if(u&&n&&(N=v.current)!=null&&N.__options.blockPointerEvents&&D()){const $=Qo(l).body;if($.setAttribute(qx,""),$.style.pointerEvents="none",P.current=!0,qr(s)&&l){var B,I;const _=s,F=y==null||(B=y.nodesRef.current.find(q=>q.id===C))==null||(I=B.context)==null?void 0:I.elements.floating;return F&&(F.style.pointerEvents=""),_.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{_.style.pointerEvents="",l.style.pointerEvents=""}}}},[u,n,C,l,s,y,v,o,D]),uo(()=>{n||(w.current=void 0,R(),O())},[n,R,O]),p.useEffect(()=>()=>{R(),clearTimeout(S.current),clearTimeout(E.current),O()},[u,R,O]),p.useMemo(()=>{if(!u)return{};function N(B){w.current=B.pointerType}return{reference:{onPointerDown:N,onPointerEnter:N,onMouseMove(B){n||m===0||(clearTimeout(E.current),E.current=setTimeout(()=>{T.current||r(!0,B.nativeEvent)},m))}},floating:{onMouseEnter(){clearTimeout(S.current)},onMouseLeave(B){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),M(B.nativeEvent,!1)}}}},[i,u,m,n,r,M])}const gE=p.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),yE=()=>p.useContext(gE),E4=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=p.useReducer((c,u)=>({...c,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),s=p.useRef(null),l=p.useCallback(c=>{i({currentId:c})},[]);return uo(()=>{o.currentId?s.current===null?s.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),s.current=null)},[o.currentId]),p.createElement(gE.Provider,{value:p.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,i,l])},t)},j4=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:i,setCurrentId:s,initialDelay:l,setState:c,timeoutMs:u}=yE();uo(()=>{i&&(c({delay:{open:1,close:Du(l,"close")}}),i!==o&&r(!1))},[o,r,c,i,l]),uo(()=>{function d(){r(!1),c({delay:l,currentId:null})}if(!n&&i===o)if(u){const f=window.setTimeout(d,u);return()=>{clearTimeout(f)}}else d()},[n,c,i,o,r,l,u]),uo(()=>{n&&s(o)},[n,s,o])};function T4(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Bh(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)}),r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var l;return o.parentId===s.id&&((l=o.context)==null?void 0:l.open)})}),n=n.concat(r);return n}function P4(e){return"composedPath"in e?e.composedPath()[0]:e.target}const k4=Lm.useInsertionEffect,R4=k4||(e=>e());function Iu(e){const t=p.useRef(()=>{});return R4(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function _u(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)}const D4={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},I4={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},_4=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function A4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:l,floating:c},dataRef:u}=e,{enabled:d=!0,escapeKey:f=!0,outsidePress:h=!0,outsidePressEvent:m="pointerdown",referencePress:g=!1,referencePressEvent:y="pointerdown",ancestorScroll:C=!1,bubbles:v}=t,x=Jg(),w=fE()!=null,S=Iu(typeof h=="function"?h:()=>!1),j=typeof h=="function"?S:h,E=p.useRef(!1),{escapeKeyBubbles:T,outsidePressBubbles:P}=_4(v),k=Iu(M=>{if(!n||!d||!f||M.key!=="Escape")return;const R=x?Bh(x.nodesRef.current,i):[];if(!T&&(M.stopPropagation(),R.length>0)){let O=!0;if(R.forEach(N=>{var B;if((B=N.context)!=null&&B.open&&!N.context.dataRef.current.__escapeKeyBubbles){O=!1;return}}),!O)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,b4(M)?M.nativeEvent:M)}),D=Iu(M=>{const R=E.current;if(E.current=!1,R||typeof j=="function"&&!j(M))return;const O=P4(M);if(hE(O)&&c){const I=O.clientWidth>0&&O.scrollWidth>O.clientWidth,$=O.clientHeight>0&&O.scrollHeight>O.clientHeight;let _=$&&M.offsetX>O.clientWidth;if($&&tf(c).getComputedStyle(O).direction==="rtl"&&(_=M.offsetX<=O.offsetWidth-O.clientWidth),_||I&&M.offsetY>O.clientHeight)return}const N=x&&Bh(x.nodesRef.current,i).some(I=>{var $;return _u(M,($=I.context)==null?void 0:$.elements.floating)});if(_u(M,c)||_u(M,l)||N)return;const B=x?Bh(x.nodesRef.current,i):[];if(B.length>0){let I=!0;if(B.forEach($=>{var _;if((_=$.context)!=null&&_.open&&!$.context.dataRef.current.__outsidePressBubbles){I=!1;return}}),!I)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:w4(M)||S4(M)}}),r(!1,M)});return p.useEffect(()=>{if(!n||!d)return;u.current.__escapeKeyBubbles=T,u.current.__outsidePressBubbles=P;function M(N){r(!1,N)}const R=Qo(c);f&&R.addEventListener("keydown",k),j&&R.addEventListener(m,D);let O=[];return C&&(qr(l)&&(O=co(l)),qr(c)&&(O=O.concat(co(c))),!qr(s)&&s&&s.contextElement&&(O=O.concat(co(s.contextElement)))),O=O.filter(N=>{var B;return N!==((B=R.defaultView)==null?void 0:B.visualViewport)}),O.forEach(N=>{N.addEventListener("scroll",M,{passive:!0})}),()=>{f&&R.removeEventListener("keydown",k),j&&R.removeEventListener(m,D),O.forEach(N=>{N.removeEventListener("scroll",M)})}},[u,c,l,s,f,j,m,n,r,C,d,T,P,k,D]),p.useEffect(()=>{E.current=!1},[j,m]),p.useMemo(()=>d?{reference:{onKeyDown:k,[D4[y]]:M=>{g&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,M.nativeEvent))}},floating:{onKeyDown:k,[I4[m]]:()=>{E.current=!0}}}:{},[d,o,g,m,y,r,k])}function Zg(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:o}=e,[i,s]=p.useState(null),l=((t=e.elements)==null?void 0:t.reference)||i,c=u4(e),u=Jg(),d=Iu((S,j)=>{S&&(h.current.openEvent=j),r==null||r(S,j)}),f=p.useRef(null),h=p.useRef({}),m=p.useState(()=>p4())[0],g=dE(),y=p.useCallback(S=>{const j=qr(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;c.refs.setReference(j)},[c.refs]),C=p.useCallback(S=>{(qr(S)||S===null)&&(f.current=S,s(S)),(qr(c.refs.reference.current)||c.refs.reference.current===null||S!==null&&!qr(S))&&c.refs.setReference(S)},[c.refs]),v=p.useMemo(()=>({...c.refs,setReference:C,setPositionReference:y,domReference:f}),[c.refs,C,y]),x=p.useMemo(()=>({...c.elements,domReference:l}),[c.elements,l]),w=p.useMemo(()=>({...c,refs:v,elements:x,dataRef:h,nodeId:o,floatingId:g,events:m,open:n,onOpenChange:d}),[c,o,g,m,n,d,v,x]);return uo(()=>{const S=u==null?void 0:u.nodesRef.current.find(j=>j.id===o);S&&(S.context=w)}),p.useMemo(()=>({...c,context:w,refs:v,elements:x}),[c,v,x,w])}function N4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:l,domReference:c}}=e,{enabled:u=!0,keyboardOnly:d=!0}=t,f=p.useRef(""),h=p.useRef(!1),m=p.useRef();return p.useEffect(()=>{if(!u)return;const y=Qo(l).defaultView||window;function C(){!n&&hE(c)&&c===T4(Qo(c))&&(h.current=!0)}return y.addEventListener("blur",C),()=>{y.removeEventListener("blur",C)}},[l,c,n,u]),p.useEffect(()=>{if(!u)return;function g(y){(y.type==="referencePress"||y.type==="escapeKey")&&(h.current=!0)}return i.on("dismiss",g),()=>{i.off("dismiss",g)}},[i,u]),p.useEffect(()=>()=>{clearTimeout(m.current)},[]),p.useMemo(()=>u?{reference:{onPointerDown(g){let{pointerType:y}=g;f.current=y,h.current=!!(y&&d)},onMouseLeave(){h.current=!1},onFocus(g){var y;h.current||g.type==="focus"&&((y=o.current.openEvent)==null?void 0:y.type)==="mousedown"&&_u(o.current.openEvent,c)||r(!0,g.nativeEvent)},onBlur(g){h.current=!1;const y=g.relatedTarget,C=qr(y)&&y.hasAttribute(mE("focus-guard"))&&y.getAttribute("data-type")==="outside";m.current=setTimeout(()=>{rm(s.floating.current,y)||rm(c,y)||C||r(!1,g.nativeEvent)})}}}:{},[u,d,c,s,o,r])}function Uh(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[n]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(s=>{let[l,c]=s;if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof c=="function"){var u;(u=r.get(l))==null||u.push(c),o[l]=function(){for(var d,f=arguments.length,h=new Array(f),m=0;m<f;m++)h[m]=arguments[m];return(d=r.get(l))==null?void 0:d.map(g=>g(...h)).find(g=>g!==void 0)}}}else o[l]=c}),o),{})}}function O4(e){e===void 0&&(e=[]);const t=e,n=p.useCallback(i=>Uh(i,e,"reference"),t),r=p.useCallback(i=>Uh(i,e,"floating"),t),o=p.useCallback(i=>Uh(i,e,"item"),e.map(i=>i==null?void 0:i.item));return p.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])}function M4(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,s=dE();return p.useMemo(()=>{const l={id:r,role:i};return o?i==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:l}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?r:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:s}},floating:{...l,...i==="menu"&&{"aria-labelledby":s}}}:{}},[o,i,n,r,s])}function vE(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}function Gx(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function Qx(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const $4={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function L4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:s,dir:l}){const[c,u="center"]=e.split("-"),d={width:z(t),height:z(t),transform:"rotate(45deg)",position:"absolute",[$4[c]]:z(r)},f=z(-t/2);return c==="left"?{...d,...Gx(u,s,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:c==="right"?{...d,...Gx(u,s,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:c==="top"?{...d,...Qx(u,i,n,o,l),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:c==="bottom"?{...d,...Qx(u,i,n,o,l),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const ey=p.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:s,arrowY:l,style:c,...u},d)=>{const{dir:f}=rs();return i?b.createElement("div",{...u,ref:d,style:{...c,...L4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:s,arrowY:l})}}):null});ey.displayName="@mantine/core/FloatingArrow";const[F4,xE]=Sn("Popover component was not found in the tree");function ty({children:e,active:t=!0,refProp:n="ref"}){const r=K2(t),o=Gt(r,e==null?void 0:e.ref);return Co(e)?p.cloneElement(e,{[n]:o}):e}ty.displayName="@mantine/core/FocusTrap";function z4(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}const B4={},wE=p.forwardRef((e,t)=>{const{children:n,target:r,...o}=U("Portal",B4,e),[i,s]=p.useState(!1),l=p.useRef(null);return ja(()=>(s(!0),l.current=r?typeof r=="string"?document.querySelector(r):r:z4(o),Vm(t,l.current),!r&&l.current&&document.body.appendChild(l.current),()=>{!r&&l.current&&document.body.removeChild(l.current)}),[r]),!i||!l.current?null:sc.createPortal(b.createElement(b.Fragment,null,n),l.current)});wE.displayName="@mantine/core/Portal";function as({withinPortal:e=!0,children:t,...n}){return e?b.createElement(wE,{...n},t):b.createElement(b.Fragment,null,t)}as.displayName="@mantine/core/OptionalPortal";const Ya=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${z(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),au={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},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(-${z(20)}) 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(${z(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${z(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${z(20)}) 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:{...Ya("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Ya("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Ya("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Ya("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Ya("top"),common:{transformOrigin:"top right"}}},Kx={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function U4({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in au?{transitionProperty:au[e].transitionProperty,...o,...au[e].common,...au[e][Kx[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[Kx[t]]}}function V4({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:s,onExited:l}){const c=Rt(),u=Hm(),d=c.respectReducedMotion?u:!1,[f,h]=p.useState(d?0:e),[m,g]=p.useState(r?"entered":"exited"),y=p.useRef(-1),C=v=>{const x=v?o:i,w=v?s:l;g(v?"pre-entering":"pre-exiting"),window.clearTimeout(y.current);const S=d?0:v?e:t;if(h(S),S===0)typeof x=="function"&&x(),typeof w=="function"&&w(),g(v?"entered":"exited");else{const j=window.setTimeout(()=>{typeof x=="function"&&x(),g(v?"entering":"exiting")},10);y.current=window.setTimeout(()=>{window.clearTimeout(j),typeof w=="function"&&w(),g(v?"entered":"exited")},S)}};return fo(()=>{C(r)},[r]),p.useEffect(()=>()=>window.clearTimeout(y.current),[]),{transitionDuration:f,transitionStatus:m,transitionTimingFunction:n||"ease"}}function ls({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:s="ease",onExit:l,onEntered:c,onEnter:u,onExited:d}){const{transitionDuration:f,transitionStatus:h,transitionTimingFunction:m}=V4({mounted:o,exitDuration:r,duration:n,timingFunction:s,onExit:l,onEntered:c,onEnter:u,onExited:d});return f===0?o?b.createElement(b.Fragment,null,i({})):e?i({display:"none"}):null:h==="exited"?e?i({display:"none"}):null:b.createElement(b.Fragment,null,i(U4({transition:t,duration:f,state:h,timingFunction:m})))}ls.displayName="@mantine/core/Transition";var SE={dropdown:"m-38a85659",arrow:"m-a31dc6c1"};const H4={},ny=Q((e,t)=>{var C,v,x,w;const n=U("PopoverDropdown",H4,e),{className:r,style:o,vars:i,children:s,onKeyDownCapture:l,variant:c,classNames:u,styles:d,...f}=n,h=xE(),m=wS({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},y=Gt(t,h.floating);return h.disabled?null:b.createElement(as,{...h.portalProps,withinPortal:h.withinPortal},b.createElement(ls,{mounted:h.opened,...h.transitionProps,transition:((C=h.transitionProps)==null?void 0:C.transition)||"fade",duration:((v=h.transitionProps)==null?void 0:v.duration)??150,keepMounted:h.keepMounted,exitDuration:typeof((x=h.transitionProps)==null?void 0:x.exitDuration)=="number"?h.transitionProps.exitDuration:(w=h.transitionProps)==null?void 0:w.duration},S=>b.createElement(ty,{active:h.trapFocus},b.createElement(W,{...g,...f,variant:c,ref:y,onKeyDownCapture:A2(h.onClose,{active:h.closeOnEscape,onTrigger:m,onKeyDown:l}),"data-position":h.placement,...h.getStyles("dropdown",{className:r,props:n,classNames:u,styles:d,style:[{...S,zIndex:h.zIndex,top:h.y??0,left:h.x??0,width:h.width==="target"?void 0:z(h.width)},o]})},s,b.createElement(ey,{ref:h.arrowRef,arrowX:h.arrowX,arrowY:h.arrowY,visible:h.withArrow,position:h.placement,arrowSize:h.arrowSize,arrowRadius:h.arrowRadius,arrowOffset:h.arrowOffset,arrowPosition:h.arrowPosition,...h.getStyles("arrow",{props:n,classNames:u,styles:d})})))))});ny.classes=SE;ny.displayName="@mantine/core/PopoverDropdown";const W4={refProp:"ref",popupType:"dialog"},bE=Q((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=U("PopoverTarget",W4,e);if(!Co(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 s=i,l=xE(),c=Gt(l.reference,n.ref,t),u=l.withRoles?{"aria-haspopup":o,"aria-expanded":l.opened,"aria-controls":l.getDropdownId(),id:l.getTargetId()}:{};return p.cloneElement(n,{...s,...u,...l.targetProps,className:Je(l.targetProps.className,s.className,n.props.className),[r]:c,...l.controlled?null:{onClick:l.onToggle}})});bE.displayName="@mantine/core/PopoverTarget";function CE({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=p.useState(0);p.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return s4(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),fo(()=>{t.update()},r),fo(()=>{i(s=>s+1)},[e])}function q4(e,t){var r,o,i,s;const n=[XC(e.offset)];return(r=e.middlewares)!=null&&r.shift&&n.push(Xg({limiter:l4()})),(o=e.middlewares)!=null&&o.flip&&n.push(aE()),(i=e.middlewares)!=null&&i.inline&&n.push(lE()),n.push(cE({element:e.arrowRef,padding:e.arrowOffset})),((s=e.middlewares)!=null&&s.size||e.width==="target")&&n.push(a4({apply({rects:l,availableWidth:c,availableHeight:u}){var h,m;const f=((h=t().refs.floating.current)==null?void 0:h.style)??{};(m=e.middlewares)!=null&&m.size&&Object.assign(f,{maxWidth:`${c}px`,maxHeight:`${u}px`}),e.width==="target"&&Object.assign(f,{width:`${l.reference.width}px`})}})),n}function G4(e){const[t,n]=ln({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var s;t&&((s=e.onClose)==null||s.call(e),n(!1))},o=()=>{var s,l;t?((s=e.onClose)==null||s.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},i=Zg({placement:e.position,middleware:q4(e,()=>i)});return CE({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:i}),fo(()=>{var s;(s=e.onPositionChange)==null||s.call(e,i.placement)},[i.placement]),fo(()=>{var s,l;e.opened?(l=e.onOpen)==null||l.call(e):(s=e.onClose)==null||s.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const Q4={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,clickOutsideEvents:["mousedown","touchstart"],zIndex:Ir("popover"),__staticSelector:"Popover",width:"max-content"},K4=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:ut(t),"--popover-shadow":zm(n)}});function _r(e){var It,jn,Or,Qt,no,te;const t=U("Popover",Q4,e),{children:n,position:r,offset:o,onPositionChange:i,positionDependencies:s,opened:l,transitionProps:c,width:u,middlewares:d,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:y,unstyled:C,classNames:v,styles:x,closeOnClickOutside:w,withinPortal:S,portalProps:j,closeOnEscape:E,clickOutsideEvents:T,trapFocus:P,onClose:k,onOpen:D,onChange:M,zIndex:R,radius:O,shadow:N,id:B,defaultOpened:I,__staticSelector:$,withRoles:_,disabled:F,returnFocus:q,variant:G,keepMounted:oe,vars:Te,...Ee}=t,_e=le({name:$,props:t,classes:SE,classNames:v,styles:x,unstyled:C,rootSelector:"dropdown",vars:Te,varsResolver:K4}),Pe=p.useRef(null),[De,Qe]=p.useState(null),[qe,dt]=p.useState(null),{dir:Y}=rs(),je=bn(B),Ae=G4({middlewares:d,width:u,position:vE(Y,r),offset:typeof o=="number"?o+(f?h/2:0):o,arrowRef:Pe,arrowOffset:m,onPositionChange:i,positionDependencies:s,opened:l,defaultOpened:I,onChange:M,onOpen:D,onClose:k});F2(()=>w&&Ae.onClose(),T,[De,qe]);const nt=p.useCallback(be=>{Qe(be),Ae.floating.refs.setReference(be)},[Ae.floating.refs.setReference]),Ge=p.useCallback(be=>{dt(be),Ae.floating.refs.setFloating(be)},[Ae.floating.refs.setFloating]);return b.createElement(F4,{value:{returnFocus:q,disabled:F,controlled:Ae.controlled,reference:nt,floating:Ge,x:Ae.floating.x,y:Ae.floating.y,arrowX:(Or=(jn=(It=Ae.floating)==null?void 0:It.middlewareData)==null?void 0:jn.arrow)==null?void 0:Or.x,arrowY:(te=(no=(Qt=Ae.floating)==null?void 0:Qt.middlewareData)==null?void 0:no.arrow)==null?void 0:te.y,opened:Ae.opened,arrowRef:Pe,transitionProps:c,width:u,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:y,placement:Ae.floating.placement,trapFocus:P,withinPortal:S,portalProps:j,zIndex:R,radius:O,shadow:N,closeOnEscape:E,onClose:Ae.onClose,onToggle:Ae.onToggle,getTargetId:()=>`${je}-target`,getDropdownId:()=>`${je}-dropdown`,withRoles:_,targetProps:Ee,__staticSelector:$,classNames:v,styles:x,unstyled:C,variant:G,keepMounted:oe,getStyles:_e}},n)}_r.Target=bE;_r.Dropdown=ny;_r.displayName="@mantine/core/Popover";_r.extend=e=>e;var Cr={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 Y4=p.forwardRef(({className:e,...t},n)=>b.createElement(W,{component:"span",className:Je(Cr.barsLoader,e),...t,ref:n},b.createElement("span",{className:Cr.bar}),b.createElement("span",{className:Cr.bar}),b.createElement("span",{className:Cr.bar}))),X4=p.forwardRef(({className:e,...t},n)=>b.createElement(W,{component:"span",className:Je(Cr.dotsLoader,e),...t,ref:n},b.createElement("span",{className:Cr.dot}),b.createElement("span",{className:Cr.dot}),b.createElement("span",{className:Cr.dot}))),J4=p.forwardRef(({className:e,...t},n)=>b.createElement(W,{component:"span",className:Je(Cr.ovalLoader,e),...t,ref:n})),EE={bars:Y4,oval:J4,dots:X4},Z4={loaders:EE,type:"oval"},eA=(e,{size:t,color:n})=>({root:{"--loader-size":Ce(t,"loader-size"),"--loader-color":n?gt(n,e):void 0}}),$n=Q((e,t)=>{const n=U("Loader",Z4,e),{size:r,color:o,type:i,vars:s,className:l,style:c,classNames:u,styles:d,unstyled:f,loaders:h,variant:m,children:g,...y}=n,C=le({name:"Loader",props:n,classes:Cr,className:l,style:c,classNames:u,styles:d,unstyled:f,vars:s,varsResolver:eA});return g?b.createElement(W,{...C("root"),ref:t,...y},g):b.createElement(W,{...C("root"),ref:t,component:h[i],variant:m,size:r,...y})});$n.defaultLoaders=EE;$n.classes=Cr;$n.displayName="@mantine/core/Loader";var nf={root:"m-8d3f4000",loader:"m-302b9fb1",icon:"m-8d3afb97",group:"m-1a0f1b21"};const Yx={orientation:"horizontal"},tA=(e,{borderWidth:t})=>({group:{"--ai-border-width":z(t)}}),ry=Q((e,t)=>{const n=U("ActionIconGroup",Yx,e),{className:r,style:o,classNames:i,styles:s,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=U("ActionIconGroup",Yx,e),g=le({name:"ActionIconGroup",props:n,classes:nf,className:r,style:o,classNames:i,styles:s,unstyled:l,vars:u,varsResolver:tA,rootSelector:"group"});return b.createElement(W,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});ry.classes=nf;ry.displayName="@mantine/core/ActionIconGroup";const nA={},rA=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:s});return{root:{"--ai-size":Ce(t,"ai-size"),"--ai-radius":n===void 0?void 0:ut(n),"--ai-bg":i||r?l.background:void 0,"--ai-hover":i||r?l.hover:void 0,"--ai-hover-color":i||r?l.hoverColor:void 0,"--ai-color":l.color,"--ai-bd":i||r?l.border:void 0}}},qt=un((e,t)=>{const n=U("ActionIcon",nA,e),{className:r,unstyled:o,variant:i,classNames:s,styles:l,style:c,loading:u,loaderProps:d,size:f,color:h,radius:m,__staticSelector:g,gradient:y,vars:C,children:v,disabled:x,"data-disabled":w,autoContrast:S,mod:j,...E}=n,T=le({name:["ActionIcon",g],props:n,className:r,style:c,classes:nf,classNames:s,styles:l,unstyled:o,vars:C,varsResolver:rA});return b.createElement(Qn,{...T("root",{active:!x&&!u&&!w}),...E,unstyled:o,variant:i,size:f,disabled:x||u,ref:t,mod:[{loading:u,disabled:x||w},j]},b.createElement(W,{component:"span",...T("loader"),"aria-hidden":!0},b.createElement($n,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d})),b.createElement(W,{component:"span",mod:{loading:u},...T("icon")},v))});qt.classes=nf;qt.displayName="@mantine/core/ActionIcon";qt.Group=ry;const jE=p.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>b.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n},b.createElement("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"})));jE.displayName="@mantine/core/CloseIcon";var TE={root:"m-86a44da5","root--subtle":"m-220c80f2"};const oA={variant:"subtle"},iA=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Ce(t,"cb-size"),"--cb-radius":n===void 0?void 0:ut(n),"--cb-icon-size":z(r)}}),cs=un((e,t)=>{const n=U("CloseButton",oA,e),{iconSize:r,children:o,vars:i,radius:s,className:l,classNames:c,style:u,styles:d,unstyled:f,"data-disabled":h,disabled:m,variant:g,icon:y,mod:C,...v}=n,x=le({name:"CloseButton",props:n,className:l,style:u,classes:TE,classNames:c,styles:d,unstyled:f,vars:i,varsResolver:iA});return b.createElement(Qn,{ref:t,...v,unstyled:f,variant:g,disabled:m,mod:[{disabled:m||h},C],...x("root",{variant:g,active:!0})},y||b.createElement(jE,null),o)});cs.classes=TE;cs.displayName="@mantine/core/CloseButton";function sA(e){return p.Children.toArray(e).filter(Boolean)}var PE={root:"m-4081bf90"};const aA={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},lA=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:i,wrap:s},{childWidth:l})=>({root:{"--group-child-width":t&&n?l:void 0,"--group-gap":Jt(r),"--group-align":o,"--group-justify":i,"--group-wrap":s}}),X=Q((e,t)=>{const n=U("Group",aA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,children:c,gap:u,align:d,justify:f,wrap:h,grow:m,preventGrowOverflow:g,vars:y,variant:C,__size:v,mod:x,...w}=n,S=sA(c),j=S.length,E=Jt(u??"md"),P={childWidth:`calc(${100/j}% - (${E} - ${E} / ${j}))`},k=le({name:"Group",props:n,stylesCtx:P,className:o,style:i,classes:PE,classNames:r,styles:s,unstyled:l,vars:y,varsResolver:lA});return b.createElement(W,{...k("root"),ref:t,variant:C,mod:[{grow:m},x],size:v,...w},S)});X.classes=PE;X.displayName="@mantine/core/Group";var kE={root:"m-9814e45f"};const cA={zIndex:Ir("modal")},uA=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:s})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&Xt(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${z(o)})`:void 0,"--overlay-radius":i===void 0?void 0:ut(i),"--overlay-z-index":s==null?void 0:s.toString()}}),Ul=un((e,t)=>{const n=U("Overlay",cA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,fixed:u,center:d,children:f,radius:h,zIndex:m,gradient:g,blur:y,color:C,backgroundOpacity:v,mod:x,...w}=n,S=le({name:"Overlay",props:n,classes:kE,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:uA});return b.createElement(W,{ref:t,...S("root"),mod:[{center:d,fixed:u},x],...w},f)});Ul.classes=kE;Ul.displayName="@mantine/core/Overlay";const[dA,Po]=Sn("ModalBase component was not found in tree");function fA({opened:e,transitionDuration:t}){const[n,r]=p.useState(e),o=p.useRef(),s=Hm()?0:t;return p.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):s===0?r(!1):o.current=window.setTimeout(()=>r(!1),s),()=>window.clearTimeout(o.current)),[e,s]),n}function hA({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:s}){const l=bn(e),[c,u]=p.useState(!1),[d,f]=p.useState(!1),h=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,m=fA({opened:n,transitionDuration:h});return ES("keydown",g=>{!r&&g.key==="Escape"&&o&&i()}),wS({opened:n,shouldReturnFocus:r&&s}),{_id:l,titleMounted:c,bodyMounted:d,shouldLockScroll:m,setTitleMounted:u,setBodyMounted:f}}const pA=p.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,trapFocus:i,closeOnEscape:s,returnFocus:l,closeOnClickOutside:c,withinPortal:u,portalProps:d,lockScroll:f,children:h,zIndex:m,shadow:g,padding:y,__vars:C,unstyled:v,removeScrollProps:x,...w},S)=>{const{_id:j,titleMounted:E,bodyMounted:T,shouldLockScroll:P,setTitleMounted:k,setBodyMounted:D}=hA({id:r,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:s,onClose:n,returnFocus:l});return b.createElement(as,{...d,withinPortal:u},b.createElement(dA,{value:{opened:t,onClose:n,closeOnClickOutside:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${j}-title`,getBodyId:()=>`${j}-body`,titleMounted:E,bodyMounted:T,setTitleMounted:k,setBodyMounted:D,trapFocus:i,closeOnEscape:s,zIndex:m,unstyled:v}},b.createElement(_d,{enabled:P&&f,...x},b.createElement(W,{ref:S,...w,__vars:{...C,"--mb-z-index":(m||Ir("modal")).toString(),"--mb-shadow":zm(g),"--mb-padding":Jt(y)}},h))))});function mA(){const e=Po();return p.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var ma={title:"m-615af6c9",header:"m-b5489c3c",inner:"m-60c222c7",content:"m-fd1ab0aa",close:"m-606cb269",body:"m-5df29311"};const RE=p.forwardRef(({className:e,...t},n)=>{const r=mA(),o=Po();return b.createElement(W,{ref:n,...t,id:r,className:Je({[ma.body]:!o.unstyled},e)})});RE.displayName="@mantine/core/ModalBaseBody";const DE=p.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Po();return b.createElement(cs,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:Je({[ma.close]:!o.unstyled},e),unstyled:o.unstyled})});DE.displayName="@mantine/core/ModalBaseCloseButton";const gA=p.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},s)=>{const l=Po(),c=u=>{var f;((f=u.target)==null?void 0:f.getAttribute("data-mantine-stop-propagation"))!=="true"&&u.key==="Escape"&&l.closeOnEscape&&l.onClose(),r==null||r(u)};return b.createElement(ls,{mounted:l.opened,transition:"pop",...l.transitionProps,...e},u=>b.createElement("div",{...n,className:Je({[ma.inner]:!l.unstyled},n.className)},b.createElement(ty,{active:l.opened&&l.trapFocus},b.createElement(On,{...i,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":l.bodyMounted?l.getBodyId():void 0,"aria-labelledby":l.titleMounted?l.getTitleId():void 0,onKeyDown:c,ref:s,style:[o,u],className:Je({[ma.content]:!l.unstyled},t),unstyled:l.unstyled},i.children))))}),IE=p.forwardRef(({className:e,...t},n)=>{const r=Po();return b.createElement(W,{component:"header",ref:n,className:Je({[ma.header]:!r.unstyled},e),...t})});IE.displayName="@mantine/core/ModalBaseHeader";const yA={duration:200,timingFunction:"ease",transition:"fade"};function vA(e){const t=Po();return{...yA,...t.transitionProps,...e}}const _E=p.forwardRef(({onClick:e,transitionProps:t,style:n,...r},o)=>{const i=Po(),s=vA(t);return b.createElement(ls,{mounted:i.opened,...s,transition:"fade"},l=>b.createElement(Ul,{ref:o,fixed:!0,style:[n,l],zIndex:i.zIndex,unstyled:i.unstyled,onClick:c=>{e==null||e(c),i.closeOnClickOutside&&i.onClose()},...r}))});_E.displayName="@mantine/core/ModalBaseOverlay";function xA(){const e=Po();return p.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const AE=p.forwardRef(({className:e,...t},n)=>{const r=xA(),o=Po();return b.createElement(W,{component:"h2",ref:n,className:Je({[ma.title]:!o.unstyled},e),...t,id:r})});AE.displayName="@mantine/core/ModalBaseTitle";function wA({children:e}){return b.createElement(b.Fragment,null,e)}const[SA,Da]=ec({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var fr={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 Xx={},bA=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Ht(t)} - ${z(2)})`}}),rf=Q((e,t)=>{const n=U("InputDescription",Xx,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=U("InputDescription",Xx,n),g=Da(),y=le({name:["InputWrapper",d],props:n,classes:fr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"description",vars:c,varsResolver:bA}),C=f&&(g==null?void 0:g.getStyles)||y;return b.createElement(W,{component:"p",ref:t,variant:h,size:u,...C("description"),...m})});rf.classes=fr;rf.displayName="@mantine/core/InputDescription";const CA={},EA=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Ht(t)} - ${z(2)})`}}),of=Q((e,t)=>{const n=U("InputError",CA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=n,g=le({name:["InputWrapper",d],props:n,classes:fr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"error",vars:c,varsResolver:EA}),y=Da(),C=f&&(y==null?void 0:y.getStyles)||g;return b.createElement(W,{component:"p",ref:t,variant:h,size:u,...C("error"),...m})});of.classes=fr;of.displayName="@mantine/core/InputError";const Jx={labelElement:"label"},jA=(e,{size:t})=>({label:{"--input-label-size":Ht(t),"--input-asterisk-color":void 0}}),sf=Q((e,t)=>{const n=U("InputLabel",Jx,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,labelElement:u,size:d,required:f,htmlFor:h,onMouseDown:m,children:g,__staticSelector:y,variant:C,mod:v,...x}=U("InputLabel",Jx,n),w=le({name:["InputWrapper",y],props:n,classes:fr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"label",vars:c,varsResolver:jA}),S=Da(),j=(S==null?void 0:S.getStyles)||w;return b.createElement(W,{...j("label"),component:u,variant:C,size:d,ref:t,htmlFor:u==="label"?h:void 0,mod:[{required:f},v],onMouseDown:E=>{m==null||m(E),!E.defaultPrevented&&E.detail>1&&E.preventDefault()},...x},g,f&&b.createElement("span",{...j("required"),"aria-hidden":!0}," *"))});sf.classes=fr;sf.displayName="@mantine/core/InputLabel";const Zx={},oy=Q((e,t)=>{const n=U("InputPlaceholder",Zx,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,__staticSelector:u,variant:d,error:f,mod:h,...m}=U("InputPlaceholder",Zx,n),g=le({name:["InputPlaceholder",u],props:n,classes:fr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"placeholder"});return b.createElement(W,{...g("placeholder"),mod:[{error:!!f},h],component:"span",variant:d,ref:t,...m})});oy.classes=fr;oy.displayName="@mantine/core/InputPlaceholder";function TA(e,{hasDescription:t,hasError:n}){const r=e.findIndex(c=>c==="input"),o=e[r-1],i=e[r+1];return{offsetBottom:t&&i==="description"||n&&i==="error",offsetTop:t&&o==="description"||n&&o==="error"}}const PA={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},kA=(e,{size:t})=>({label:{"--input-label-size":Ht(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Ht(t)} - ${z(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Ht(t)} - ${z(2)})`}}),iy=Q((e,t)=>{const n=U("InputWrapper",PA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,variant:d,__staticSelector:f,inputContainer:h,inputWrapperOrder:m,label:g,error:y,description:C,labelProps:v,descriptionProps:x,errorProps:w,labelElement:S,children:j,withAsterisk:E,id:T,required:P,__stylesApiProps:k,mod:D,...M}=n,R=le({name:["InputWrapper",f],props:k||n,classes:fr,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:kA}),O={size:u,variant:d,__staticSelector:f},N=bn(T),B=typeof E=="boolean"?E:P,I=(w==null?void 0:w.id)||`${N}-error`,$=(x==null?void 0:x.id)||`${N}-description`,_=N,F=!!y&&typeof y!="boolean",q=!!C,G=`${F?I:""} ${q?$:""}`,oe=G.trim().length>0?G.trim():void 0,Te=(v==null?void 0:v.id)||`${N}-label`,Ee=g&&b.createElement(sf,{key:"label",labelElement:S,id:Te,htmlFor:_,required:B,...O,...v},g),_e=q&&b.createElement(rf,{key:"description",...x,...O,size:(x==null?void 0:x.size)||O.size,id:(x==null?void 0:x.id)||$},C),Pe=b.createElement(b.Fragment,{key:"input"},h(j)),De=F&&b.createElement(of,{...w,...O,size:(w==null?void 0:w.size)||O.size,key:"error",id:(w==null?void 0:w.id)||I},y),Qe=m.map(qe=>{switch(qe){case"label":return Ee;case"input":return Pe;case"description":return _e;case"error":return De;default:return null}});return b.createElement(SA,{value:{getStyles:R,describedBy:oe,inputId:_,labelId:Te,...TA(m,{hasDescription:q,hasError:F})}},b.createElement(W,{ref:t,variant:d,size:u,mod:[{error:!!y},D],...R("root"),...M},Qe))});iy.classes=fr;iy.displayName="@mantine/core/InputWrapper";const RA={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},DA=(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":Ce(t.size,"input-height"),"--input-fz":Ht(t.size),"--input-radius":t.radius===void 0?void 0:ut(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?z(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?z(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?Ce(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),St=un((e,t)=>{const n=U("Input",RA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,required:c,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:h,error:m,disabled:g,leftSection:y,leftSectionProps:C,leftSectionWidth:v,rightSection:x,rightSectionProps:w,rightSectionWidth:S,rightSectionPointerEvents:j,leftSectionPointerEvents:E,variant:T,vars:P,pointer:k,multiline:D,radius:M,id:R,withAria:O,withErrorStyles:N,mod:B,...I}=n,{styleProps:$,rest:_}=Eo(I),F=Da(),q={offsetBottom:F==null?void 0:F.offsetBottom,offsetTop:F==null?void 0:F.offsetTop},G=le({name:["Input",u],props:d||n,classes:fr,className:o,style:i,classNames:r,styles:s,unstyled:l,stylesCtx:q,rootSelector:"wrapper",vars:P,varsResolver:DA}),oe=O?{required:c,disabled:g,"aria-invalid":!!m,"aria-describedby":F==null?void 0:F.describedBy,id:(F==null?void 0:F.inputId)||R}:{};return b.createElement(W,{...G("wrapper"),...$,...h,mod:[{error:!!m&&N,pointer:k,disabled:g,multiline:D,"data-with-right-section":!!x,"data-with-left-section":!!y},B],variant:T,size:f},y&&b.createElement("div",{...C,"data-position":"left",...G("section",{className:C==null?void 0:C.className,style:C==null?void 0:C.style})},y),b.createElement(W,{component:"input",..._,...oe,ref:t,required:c,mod:{disabled:g,error:!!m&&N},variant:T,...G("input")}),x&&b.createElement("div",{...w,"data-position":"right",...G("section",{className:w==null?void 0:w.className,style:w==null?void 0:w.style})},x))});St.classes=fr;St.Wrapper=iy;St.Label=sf;St.Error=of;St.Description=rf;St.Placeholder=oy;St.displayName="@mantine/core/Input";function IA(e,t,n){const r=U(e,t,n),{label:o,description:i,error:s,required:l,classNames:c,styles:u,className:d,unstyled:f,__staticSelector:h,__stylesApiProps:m,errorProps:g,labelProps:y,descriptionProps:C,wrapperProps:v,id:x,size:w,style:S,inputContainer:j,inputWrapperOrder:E,withAsterisk:T,variant:P,vars:k,mod:D,...M}=r,{styleProps:R,rest:O}=Eo(M),N={label:o,description:i,error:s,required:l,classNames:c,className:d,__staticSelector:h,__stylesApiProps:m||r,errorProps:g,labelProps:y,descriptionProps:C,unstyled:f,styles:u,size:w,style:S,inputContainer:j,inputWrapperOrder:E,withAsterisk:T,variant:P,id:x,mod:D,...v};return{...O,classNames:c,styles:u,unstyled:f,wrapperProps:{...N,...R},inputProps:{required:l,classNames:c,styles:u,unstyled:f,size:w,__staticSelector:h,__stylesApiProps:m||r,error:s,variant:P,id:x}}}const _A={__staticSelector:"InputBase",withAria:!0},hr=un((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=IA("InputBase",_A,e);return b.createElement(St.Wrapper,{...r},b.createElement(St,{...n,...o,ref:t}))});hr.classes={...St.classes,...St.Wrapper.classes};hr.displayName="@mantine/core/InputBase";const AA={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 NE={root:"m-8bffd616"};const NA={},ga=un((e,t)=>{const n=U("Flex",NA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:y,...C}=n,v=le({name:"Flex",classes:NE,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c}),x=Rt(),w=tc(),S=DS({styleProps:{gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:y},theme:x,data:AA});return b.createElement(b.Fragment,null,S.hasResponsiveStyles&&b.createElement(Ta,{selector:`.${w}`,styles:S.styles,media:S.media}),b.createElement(W,{ref:t,...v("root",{className:w,style:ts(S.inlineStyles)}),...C}))});ga.classes=NE;ga.displayName="@mantine/core/Flex";var OE={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 OA={},MA=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const i=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:ut(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},us=Q((e,t)=>{const n=U("Alert",OA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,color:d,title:f,children:h,id:m,icon:g,withCloseButton:y,onClose:C,closeButtonLabel:v,variant:x,autoContrast:w,...S}=n,j=le({name:"Alert",classes:OE,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:MA}),E=bn(m),T=f&&`${E}-title`||void 0,P=`${E}-body`;return b.createElement(W,{id:E,...j("root",{variant:x}),variant:x,ref:t,...S,role:"alert","aria-describedby":P,"aria-labelledby":T},b.createElement("div",{...j("wrapper")},g&&b.createElement("div",{...j("icon")},g),b.createElement("div",{...j("body")},f&&b.createElement("div",{...j("title"),"data-with-close-button":y||void 0},b.createElement("span",{id:T,...j("label")},f)),h&&b.createElement("div",{id:P,...j("message"),"data-variant":x},h)),y&&b.createElement(cs,{...j("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":v,unstyled:l})))});us.classes=OE;us.displayName="@mantine/core/Alert";var ME={root:"m-b6d8b162"};function $A(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const LA={inherit:!1},FA=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":Ht(o),"--text-lh":mS(o),"--text-gradient":t==="gradient"?sp(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?gt(i,e):void 0}}),ue=un((e,t)=>{const n=U("Text",LA,e),{lineClamp:r,truncate:o,inline:i,inherit:s,gradient:l,span:c,__staticSelector:u,vars:d,className:f,style:h,classNames:m,styles:g,unstyled:y,variant:C,mod:v,size:x,...w}=n,S=le({name:["Text",u],props:n,classes:ME,className:f,style:h,classNames:m,styles:g,unstyled:y,vars:d,varsResolver:FA});return b.createElement(W,{...S("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:C,mod:[{"data-truncate":$A(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":s},v],size:x,...w})});ue.classes=ME;ue.displayName="@mantine/core/Text";var $E={root:"m-849cf0da"};const zA={underline:"hover"},Ue=un((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...s}=U("Anchor",zA,e);return b.createElement(ue,{component:"a",ref:t,className:Je({[$E.root]:!o},r),...s,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});Ue.classes=$E;Ue.displayName="@mantine/core/Anchor";const[BA,Ia]=Sn("AppShell was not found in tree");var yi={root:"m-89ab340",navbar:"m-45252eee",aside:"m-9cdde9a",header:"m-3b16f56b",main:"m-8983817",footer:"m-3840c879",section:"m-6dcfc7c7"};const UA={},sy=Q((e,t)=>{const n=U("AppShellAside",UA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ia();return m.disabled?null:b.createElement(W,{component:"aside",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("aside",{className:o,classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-aside-z-index":`calc(${d??m.zIndex} + 1)`}})});sy.classes=yi;sy.displayName="@mantine/core/AppShellAside";const VA={},ay=Q((e,t)=>{var g;const n=U("AppShellFooter",VA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ia();return m.disabled?null:b.createElement(W,{component:"footer",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("footer",{className:Je({[_d.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-footer-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});ay.classes=yi;ay.displayName="@mantine/core/AppShellFooter";const HA={},ly=Q((e,t)=>{var g;const n=U("AppShellHeader",HA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ia();return m.disabled?null:b.createElement(W,{component:"header",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("header",{className:Je({[_d.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-header-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});ly.classes=yi;ly.displayName="@mantine/core/AppShellHeader";const WA={},cy=Q((e,t)=>{const n=U("AppShellMain",WA,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ia();return b.createElement(W,{component:"main",ref:t,...u.getStyles("main",{className:o,style:i,classNames:r,styles:s}),...c})});cy.classes=yi;cy.displayName="@mantine/core/AppShellMain";function lc(e){return typeof e=="object"?e.base:e}function cc(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 uc(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function qA({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,s="translateX(var(--app-shell-aside-width))",l="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((c=r==null?void 0:r.collapsed)!=null&&c.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"),cc(i)){const f=z(lc(i));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(uc(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=z(i.base),e["--app-shell-aside-offset"]=z(i.base)),lt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=z(i[f]),t[f]["--app-shell-aside-offset"]=z(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=s,t[f]["--app-shell-aside-transform-rtl"]=l,t[f]["--app-shell-aside-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=Bm(r.breakpoint,o)-.1;n[f]=n[f]||{},n[f]["--app-shell-aside-width"]="100%",n[f]["--app-shell-aside-offset"]="0px",n[f]["--app-shell-aside-transform"]=s,n[f]["--app-shell-aside-transform-rtl"]=l}}function GA({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,o="translateY(var(--app-shell-footer-height))",i=(n==null?void 0:n.offset)??!0;if(cc(r)){const s=z(lc(r));e["--app-shell-footer-height"]=s,i&&(e["--app-shell-footer-offset"]=s)}uc(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=z(r.base),i&&(e["--app-shell-footer-offset"]=z(r.base))),lt(r).forEach(s=>{s!=="base"&&(t[s]=t[s]||{},t[s]["--app-shell-footer-height"]=z(r[s]),i&&(t[s]["--app-shell-footer-offset"]=z(r[s])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function QA({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,o="translateY(calc(var(--app-shell-header-height) * -1))",i=(n==null?void 0:n.offset)??!0;if(cc(r)){const s=z(lc(r));e["--app-shell-header-height"]=s,i&&(e["--app-shell-header-offset"]=s)}uc(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=z(r.base),i&&(e["--app-shell-header-offset"]=z(r.base))),lt(r).forEach(s=>{s!=="base"&&(t[s]=t[s]||{},t[s]["--app-shell-header-height"]=z(r[s]),i&&(t[s]["--app-shell-header-offset"]=z(r[s])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function KA({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,s="translateX(calc(var(--app-shell-navbar-width) * -1))",l="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((c=r==null?void 0:r.collapsed)!=null&&c.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"),cc(i)){const f=z(lc(i));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(uc(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=z(i.base),e["--app-shell-navbar-offset"]=z(i.base)),lt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=z(i[f]),t[f]["--app-shell-navbar-offset"]=z(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=s,t[f]["--app-shell-navbar-transform-rtl"]=l,t[f]["--app-shell-navbar-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=Bm(r.breakpoint,o)-.1;n[f]=n[f]||{},n[f]["--app-shell-navbar-width"]="100%",n[f]["--app-shell-navbar-offset"]="0px",n[f]["--app-shell-navbar-transform"]=s,n[f]["--app-shell-navbar-transform-rtl"]=l}}function Vh(e){return Number(e)===0?"0px":Jt(e)}function YA({padding:e,baseStyles:t,minMediaStyles:n}){cc(e)&&(t["--app-shell-padding"]=Vh(lc(e))),uc(e)&&(e.base&&(t["--app-shell-padding"]=Vh(e.base)),lt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Vh(e[r]))}))}function XA({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const s={},l={},c={};KA({baseStyles:c,minMediaStyles:s,maxMediaStyles:l,navbar:e,theme:i}),qA({baseStyles:c,minMediaStyles:s,maxMediaStyles:l,aside:r,theme:i}),QA({baseStyles:c,minMediaStyles:s,header:t}),GA({baseStyles:c,minMediaStyles:s,footer:n}),YA({baseStyles:c,minMediaStyles:s,padding:o});const u=El(lt(s),i).map(h=>({query:`(min-width: ${Mu(h.px)})`,styles:s[h.value]})),d=El(lt(l),i).map(h=>({query:`(max-width: ${Mu(h.px)})`,styles:l[h.value]})),f=[...u,...d];return{baseStyles:c,media:f}}function JA({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=Rt(),s=Od(),{media:l,baseStyles:c}=XA({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return b.createElement(Ta,{media:l,styles:c,selector:s.cssVariablesSelector})}const ZA={},uy=Q((e,t)=>{const n=U("AppShellNavbar",ZA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ia();return m.disabled?null:b.createElement(W,{component:"nav",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("navbar",{className:o,classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-navbar-z-index":`calc(${d??m.zIndex} + 1)`}})});uy.classes=yi;uy.displayName="@mantine/core/AppShellNavbar";const e3={},dy=un((e,t)=>{const n=U("AppShellSection",e3,e),{classNames:r,className:o,style:i,styles:s,vars:l,grow:c,mod:u,...d}=n,f=Ia();return b.createElement(W,{ref:t,mod:[{grow:c},u],...f.getStyles("section",{className:o,style:i,classNames:r,styles:s}),...d})});dy.classes=yi;dy.displayName="@mantine/core/AppShellSection";function t3({transitionDuration:e,disabled:t}){const[n,r]=p.useState(!1),o=p.useRef(),i=p.useRef();return ES("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),200)}),ja(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>r(!1),e||0)},[t,e]),n}const n3={withBorder:!0,offsetScrollbars:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Ir("app")},r3=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Mn=Q((e,t)=>{const n=U("AppShell",n3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,navbar:u,withBorder:d,padding:f,transitionDuration:h,transitionTimingFunction:m,header:g,zIndex:y,layout:C,disabled:v,aside:x,footer:w,offsetScrollbars:S,mod:j,...E}=n,T=le({name:"AppShell",classes:yi,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:r3}),P=t3({disabled:v,transitionDuration:h});return b.createElement(BA,{value:{getStyles:T,withBorder:d,zIndex:y,disabled:v,offsetScrollbars:S}},b.createElement(JA,{navbar:u,header:g,aside:x,footer:w,padding:f}),b.createElement(W,{ref:t,...T("root"),mod:[{resizing:P,layout:C,disabled:v},j],...E}))});Mn.classes=yi;Mn.displayName="@mantine/core/AppShell";Mn.Navbar=uy;Mn.Header=ly;Mn.Main=cy;Mn.Aside=sy;Mn.Footer=ay;Mn.Section=dy;function LE(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=>LE(t))}:e}function FE(e){return e?e.map(t=>LE(t)):[]}function zE(e){return e.reduce((t,n)=>"group"in n?{...t,...zE(n.items)}:(t[n.value]=n,t),{})}var xn={dropdown:"m-88b62a41",options:"m-b2821a6e",option:"m-92253aa5",search:"m-985517d8",empty:"m-2530cd1d",header:"m-858f94bd",footer:"m-82b967cb",group:"m-254f3e4f",groupLabel:"m-2bb2e9e5",chevron:"m-2943220b",optionsDropdownScrollArea:"m-71d052f9",optionsDropdownOption:"m-390b5f4",optionsDropdownCheckIcon:"m-8ee53fc2"};const o3={error:null},i3=(e,{size:t})=>({chevron:{"--combobox-chevron-size":Ce(t,"combobox-chevron-size")}}),af=Q((e,t)=>{const n=U("ComboboxChevron",o3,e),{size:r,error:o,style:i,className:s,classNames:l,styles:c,unstyled:u,vars:d,mod:f,...h}=n,m=le({name:"ComboboxChevron",classes:xn,props:n,style:i,className:s,classNames:l,styles:c,unstyled:u,vars:d,varsResolver:i3,rootSelector:"chevron"});return b.createElement(W,{component:"svg",...h,...m("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},f],ref:t},b.createElement("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"}))});af.classes=xn;af.displayName="@mantine/core/ComboboxChevron";const[s3,pr]=Sn("Combobox component was not found in tree"),BE=p.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>b.createElement(cs,{ref:i,size:e||"sm",variant:"transparent",tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:s=>{s.preventDefault(),t==null||t(s)},onClick:s=>{r(),n==null||n(s)}}));BE.displayName="@mantine/core/ComboboxClearButton";const a3={},fy=Q((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:s,...l}=U("ComboboxDropdown",a3,e),c=pr();return b.createElement(_r.Dropdown,{...l,ref:t,role:"presentation","data-hidden":s||void 0,...c.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});fy.classes=xn;fy.displayName="@mantine/core/ComboboxDropdown";const l3={refProp:"ref"},UE=Q((e,t)=>{const{children:n,refProp:r}=U("ComboboxDropdownTarget",l3,e);if(pr(),!Co(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 b.createElement(_r.Target,{ref:t,refProp:r},n)});UE.displayName="@mantine/core/ComboboxDropdownTarget";const c3={},hy=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("ComboboxEmpty",c3,e),c=pr();return b.createElement(W,{ref:t,...c.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...l})});hy.classes=xn;hy.displayName="@mantine/core/ComboboxEmpty";function py({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o}){const i=pr(),[s,l]=p.useState(null),c=d=>{if(e==null||e(d),!i.readOnly&&t){if(d.nativeEvent.code==="ArrowDown"&&(d.preventDefault(),i.store.dropdownOpened?l(i.store.selectNextOption()):(i.store.openDropdown("keyboard"),l(i.store.selectActiveOption()))),d.nativeEvent.code==="ArrowUp"&&(d.preventDefault(),i.store.dropdownOpened?l(i.store.selectPreviousOption()):(i.store.openDropdown("keyboard"),l(i.store.selectActiveOption()))),d.nativeEvent.code==="Enter"||d.nativeEvent.code==="NumpadEnter"){const f=i.store.getSelectedOptionIndex();i.store.dropdownOpened&&f!==-1?(d.preventDefault(),i.store.clickSelectedOption()):o==="button"&&(d.preventDefault(),i.store.openDropdown("keyboard"))}d.nativeEvent.code==="Escape"&&i.store.closeDropdown("keyboard"),d.nativeEvent.code==="Space"&&o==="button"&&(d.preventDefault(),i.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(i.store.listId&&i.store.dropdownOpened)||void 0,"aria-controls":i.store.listId,"aria-activedescendant":i.store.dropdownOpened&&s||void 0,autoComplete:"off","data-expanded":i.store.dropdownOpened?!0:void 0}:{},onKeyDown:c}}const u3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1},VE=Q((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:s,targetType:l,...c}=U("ComboboxEventsTarget",u3,e);if(!Co(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 u=pr(),d=py({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown});return p.cloneElement(n,{...d,...c,[r]:Gt(t,u.store.targetRef,n==null?void 0:n.ref)})});VE.displayName="@mantine/core/ComboboxEventsTarget";const d3={},my=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("ComboboxFooter",d3,e),c=pr();return b.createElement(W,{ref:t,...c.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...l})});my.classes=xn;my.displayName="@mantine/core/ComboboxFooter";const f3={},gy=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,children:l,label:c,...u}=U("ComboboxGroup",f3,e),d=pr();return b.createElement(W,{ref:t,...d.getStyles("group",{className:r,classNames:n,style:o,styles:i}),...u},c&&b.createElement("div",{...d.getStyles("groupLabel",{classNames:n,styles:i})},c),l)});gy.classes=xn;gy.displayName="@mantine/core/ComboboxGroup";const h3={},yy=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("ComboboxHeader",h3,e),c=pr();return b.createElement(W,{ref:t,...c.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...l})});yy.classes=xn;yy.displayName="@mantine/core/ComboboxHeader";const p3={},vy=Q((e,t)=>{const n=U("ComboboxOption",p3,e),{classNames:r,className:o,style:i,styles:s,vars:l,onClick:c,id:u,active:d,onMouseDown:f,onMouseOver:h,disabled:m,selected:g,mod:y,...C}=n,v=pr(),x=p.useId(),w=u||x;return b.createElement(W,{...v.getStyles("option",{className:o,classNames:r,styles:s,style:i}),...C,ref:t,id:w,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":m,"combobox-selected":g},y],role:"option",onClick:S=>{var j;m?S.preventDefault():((j=v.onOptionSubmit)==null||j.call(v,n.value,n),c==null||c(S))},onMouseDown:S=>{S.preventDefault(),f==null||f(S)},onMouseOver:S=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),h==null||h(S)}})});vy.classes=xn;vy.displayName="@mantine/core/ComboboxOption";const m3={},xy=Q((e,t)=>{const n=U("ComboboxOptions",m3,e),{classNames:r,className:o,style:i,styles:s,id:l,onMouseDown:c,labelledBy:u,...d}=n,f=pr(),h=bn(l);return p.useEffect(()=>{f.store.setListId(h)},[h]),b.createElement(W,{ref:t,...f.getStyles("options",{className:o,style:i,classNames:r,styles:s}),...d,id:h,role:"listbox","aria-labelledby":u,onMouseDown:m=>{m.preventDefault(),c==null||c(m)}})});xy.classes=xn;xy.displayName="@mantine/core/ComboboxOptions";const g3={withAriaAttributes:!0,withKeyboardNavigation:!0},wy=Q((e,t)=>{const n=U("ComboboxSearch",g3,e),{classNames:r,styles:o,unstyled:i,vars:s,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:u,size:d,...f}=n,h=pr(),m=h.getStyles("search"),g=py({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:c});return b.createElement(St,{ref:Gt(t,h.store.searchRef),classNames:[{input:m.className},r],styles:[{input:m.style},o],size:d||h.size,...g,...f,__staticSelector:"Combobox"})});wy.classes=xn;wy.displayName="@mantine/core/ComboboxSearch";const y3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1},HE=Q((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:s,targetType:l,...c}=U("ComboboxTarget",y3,e);if(!Co(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 u=pr(),d=py({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown}),f=p.cloneElement(n,{...d,...c});return b.createElement(_r.Target,{ref:Gt(t,u.store.targetRef)},f)});HE.displayName="@mantine/core/ComboboxTarget";function v3(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 x3(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 w3(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Sy({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:s="instant"}={}){const[l,c]=ln({value:t,defaultValue:e,finalValue:!1,onChange:n}),u=p.useRef(null),d=p.useRef(-1),f=p.useRef(null),h=p.useRef(null),m=p.useRef(-1),g=p.useRef(-1),y=p.useRef(-1),C=p.useCallback((I="unknown")=>{l||(c(!0),o==null||o(I))},[c,o,l]),v=p.useCallback((I="unknown")=>{l&&(c(!1),r==null||r(I))},[c,r,l]),x=p.useCallback((I="unknown")=>{l?v(I):C(I)},[v,C,l]),w=p.useCallback(()=>{const I=document.querySelector(`#${u.current} [data-combobox-selected]`);I==null||I.removeAttribute("data-combobox-selected"),I==null||I.removeAttribute("aria-selected")},[]),S=p.useCallback(I=>{const $=document.getElementById(u.current),_=$==null?void 0:$.querySelectorAll("[data-combobox-option]");if(!_)return null;const F=I>=_.length?0:I<0?_.length-1:I;return d.current=F,_!=null&&_[F]&&!_[F].hasAttribute("data-combobox-disabled")?(w(),_[F].setAttribute("data-combobox-selected","true"),_[F].setAttribute("aria-selected","true"),_[F].scrollIntoView({block:"nearest",behavior:s}),_[F].id):null},[s,w]),j=p.useCallback(()=>{const I=document.querySelector(`#${u.current} [data-combobox-active]`);if(I){const $=document.querySelectorAll(`#${u.current} [data-combobox-option]`),_=Array.from($).findIndex(F=>F===I);return S(_)}return S(0)},[S]),E=p.useCallback(()=>S(x3(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[S,i]),T=p.useCallback(()=>S(v3(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[S,i]),P=p.useCallback(()=>S(w3(document.querySelectorAll(`#${u.current} [data-combobox-option]`))),[S]),k=p.useCallback((I="selected")=>{y.current=window.setTimeout(()=>{const $=document.querySelectorAll(`#${u.current} [data-combobox-option]`),_=Array.from($).findIndex(F=>F.hasAttribute(`data-combobox-${I}`));d.current=_},0)},[]),D=p.useCallback(()=>{d.current=-1,w()},[w]),M=p.useCallback(()=>{const I=document.querySelectorAll(`#${u.current} [data-combobox-option]`),$=I==null?void 0:I[d.current];$==null||$.click()},[]),R=p.useCallback(I=>{u.current=I},[]),O=p.useCallback(()=>{m.current=window.setTimeout(()=>f.current.focus(),0)},[]),N=p.useCallback(()=>{g.current=window.setTimeout(()=>h.current.focus(),0)},[]),B=p.useCallback(()=>d.current,[]);return p.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(g.current),window.clearTimeout(y.current)},[]),{dropdownOpened:l,openDropdown:C,closeDropdown:v,toggleDropdown:x,selectedOptionIndex:d.current,getSelectedOptionIndex:B,selectOption:S,selectFirstOption:P,selectActiveOption:j,selectNextOption:E,selectPreviousOption:T,resetSelectedOption:D,updateSelectedOptionIndex:k,listId:u.current,setListId:R,clickSelectedOption:M,searchRef:f,focusSearchInput:O,targetRef:h,focusTarget:N}}const S3={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},b3=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Ht(t),"--combobox-option-padding":Ce(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:z(n),"--combobox-option-fz":Ht(t),"--combobox-option-padding":Ce(t,"combobox-option-padding")}});function $e(e){const t=U("Combobox",S3,e),{classNames:n,styles:r,unstyled:o,children:i,store:s,vars:l,onOptionSubmit:c,onClose:u,size:d,dropdownPadding:f,resetSelectionOnOptionHover:h,__staticSelector:m,readOnly:g,...y}=t,C=Sy(),v=s||C,x=le({name:m||"Combobox",classes:xn,props:t,classNames:n,styles:r,unstyled:o,vars:l,varsResolver:b3}),w=()=>{u==null||u(),v.closeDropdown()};return b.createElement(s3,{value:{getStyles:x,store:v,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:h,readOnly:g}},b.createElement(_r,{opened:v.dropdownOpened,...y,onClose:w,withRoles:!1,unstyled:o},i))}const C3=e=>e;$e.extend=C3;$e.classes=xn;$e.displayName="@mantine/core/Combobox";$e.Target=HE;$e.Dropdown=fy;$e.Options=xy;$e.Option=vy;$e.Search=wy;$e.Empty=hy;$e.Chevron=af;$e.Footer=my;$e.Header=yy;$e.EventsTarget=VE;$e.DropdownTarget=UE;$e.Group=gy;$e.ClearButton=BE;var WE={root:"m-5f75b09e",body:"m-5f6e695e",labelWrapper:"m-d3ea56bb",label:"m-8ee546b8",description:"m-328f68c0",error:"m-8e8a99cc"};const qE=WE,lf=p.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:i,children:s,label:l,description:c,id:u,disabled:d,error:f,size:h,labelPosition:m="left",variant:g,style:y,vars:C,...v},x)=>{const w=le({name:e,props:t,className:n,style:y,classes:WE,classNames:r,styles:o,unstyled:i});return b.createElement(W,{...w("root"),ref:x,__vars:{"--label-fz":Ht(h),"--label-lh":Ce(h,"label-lh")},mod:{"label-position":m},variant:g,size:h,...v},b.createElement("div",{...w("body")},s,b.createElement("div",{...w("labelWrapper"),"data-disabled":d||void 0},l&&b.createElement("label",{...w("label"),"data-disabled":d||void 0,htmlFor:u},l),c&&b.createElement(St.Description,{size:h,__inheritStyles:!1,...w("description")},c),f&&f!=="boolean"&&b.createElement(St.Error,{size:h,__inheritStyles:!1,...w("error")},f))))});lf.displayName="@mantine/core/InlineInput";const GE=p.createContext(null),E3=GE.Provider,j3=()=>p.useContext(GE);function by({children:e,role:t}){const n=Da();return n?b.createElement("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy},e):b.createElement(b.Fragment,null,e)}const T3={},Cy=Q((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,readOnly:c,...u}=U("CheckboxGroup",T3,e),[d,f]=ln({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=m.currentTarget.value;!c&&f(d.includes(g)?d.filter(y=>y!==g):[...d,g])};return b.createElement(E3,{value:{value:d,onChange:h,size:i}},b.createElement(St.Wrapper,{size:i,ref:t,...s,...u,labelElement:"div",__staticSelector:"CheckboxGroup"},b.createElement(by,{role:"group"},l)))});Cy.classes=St.Wrapper.classes;Cy.displayName="@mantine/core/CheckboxGroup";function cf({size:e,style:t,...n}){const r=e!==void 0?{width:z(e),height:z(e),...t}:t;return b.createElement("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n},b.createElement("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 P3({indeterminate:e,...t}){return e?b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t},b.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):b.createElement(cf,{...t})}var QE={root:"m-bf2d988c",inner:"m-26062bec",input:"m-26063560",icon:"m-bf295423","input--outline":"m-215c4542"};const k3={labelPosition:"right",icon:P3},R3=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:s})=>{const l=Jr({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":Ce(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:ut(t),"--checkbox-color":i==="outline"?c:gt(n,e),"--checkbox-icon-color":o?gt(o,e):s?ns({color:n,theme:e}):void 0}}},cr=Q((e,t)=>{const n=U("Checkbox",k3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,label:d,id:f,size:h,radius:m,wrapperProps:g,children:y,checked:C,labelPosition:v,description:x,error:w,disabled:S,variant:j,indeterminate:E,icon:T,rootRef:P,iconColor:k,onChange:D,autoContrast:M,mod:R,...O}=n,N=j3(),B=h||(N==null?void 0:N.size),I=T,$=le({name:"Checkbox",props:n,classes:QE,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:R3}),{styleProps:_,rest:F}=Eo(O),q=bn(f),G=N?{checked:N.value.includes(F.value),onChange:oe=>{N.onChange(oe),D==null||D(oe)}}:{};return b.createElement(lf,{...$("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:q,size:B,labelPosition:v,label:d,description:x,error:w,disabled:S,classNames:r,styles:s,unstyled:l,"data-checked":G.checked||C||void 0,variant:j,ref:P,mod:R,..._,...g},b.createElement(W,{...$("inner"),mod:{"data-label-position":v}},b.createElement(W,{component:"input",id:q,ref:t,checked:C,disabled:S,mod:{error:!!w,indeterminate:E},...$("input",{focusable:!0,variant:j}),onChange:D,...F,...G,type:"checkbox"}),b.createElement(I,{indeterminate:E,...$("icon")})))});cr.classes={...QE,...qE};cr.displayName="@mantine/core/Checkbox";cr.Group=Cy;function ya(e){return"group"in e}function KE({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let i=0;i<e.length;i+=1){const s=e[i];if(o.length===n)return o;ya(s)&&o.push({group:s.group,items:KE({options:s.items,search:t,limit:n-o.length})}),ya(s)||s.label.toLowerCase().includes(r)&&o.push(s)}return o}function D3(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 YE(e,t=new Set){if(Array.isArray(e))for(const n of e)if(ya(n))YE(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 Hh(e,t){return Array.isArray(e)?e.includes(t):e===t}function XE({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o}){if(!ya(e)){const s=t&&Hh(n,e.value)&&b.createElement(cf,{className:xn.optionsDropdownCheckIcon});return b.createElement($e.Option,{value:e.value,disabled:e.disabled,className:Je({[xn.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":Hh(n,e.value)||void 0,"aria-selected":Hh(n,e.value)},r==="left"&&s,b.createElement("span",null,e.label),r==="right"&&s)}const i=e.items.map(s=>b.createElement(XE,{data:s,value:n,key:s.value,unstyled:o,withCheckIcon:t,checkIconPosition:r}));return b.createElement($e.Group,{label:e.group},i)}function I3({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:i,maxDropdownHeight:s,withScrollArea:l=!0,filterOptions:c=!0,withCheckIcon:u=!1,value:d,checkIconPosition:f,nothingFoundMessage:h,unstyled:m,labelId:g}){YE(e);const C=typeof o=="string"?(r||KE)({options:e,search:c?o:"",limit:i??1/0}):e,v=D3(C),x=C.map(w=>b.createElement(XE,{data:w,key:ya(w)?w.group:w.value,withCheckIcon:u,value:d,checkIconPosition:f,unstyled:m}));return b.createElement($e.Dropdown,{hidden:t||n&&v},b.createElement($e.Options,{labelledBy:g},l?b.createElement(dr.Autosize,{mah:s??220,type:"scroll",scrollbarSize:"var(--_combobox-padding)",offsetScrollbars:"y",className:xn.optionsDropdownScrollArea},x):x,v&&h&&b.createElement($e.Empty,null,h)))}const JE=p.createContext(null),_3=JE.Provider;function A3(){return{withinGroup:!!p.useContext(JE)}}var uf={group:"m-11def92b",root:"m-f85678b6",image:"m-11f8ac07",placeholder:"m-104cd71f"};const N3={},O3=(e,{spacing:t})=>({group:{"--ag-spacing":Jt(t)}}),Ey=Q((e,t)=>{const n=U("AvatarGroup",N3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,spacing:u,...d}=n,f=le({name:"AvatarGroup",classes:uf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:O3,rootSelector:"group"});return b.createElement(_3,{value:!0},b.createElement(W,{ref:t,...f("group"),...d}))});Ey.classes=uf;Ey.displayName="@mantine/core/AvatarGroup";function M3(e){return b.createElement("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.createElement("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"}))}const $3={},L3=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:s});return{root:{"--avatar-size":Ce(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:ut(n),"--avatar-bg":i||r?l.background:void 0,"--avatar-color":i||r?l.color:void 0,"--avatar-bd":i||r?l.border:void 0}}},Qi=un((e,t)=>{const n=U("Avatar",$3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,src:u,alt:d,radius:f,color:h,gradient:m,imageProps:g,children:y,autoContrast:C,mod:v,...x}=n,w=A3(),[S,j]=p.useState(!u),E=le({name:"Avatar",props:n,classes:uf,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:L3});return p.useEffect(()=>j(!u),[u]),b.createElement(W,{...E("root"),mod:[{"within-group":w.withinGroup},v],ref:t,...x},S?b.createElement("span",{...E("placeholder"),title:d},y||b.createElement(M3,null)):b.createElement("img",{...g,...E("image"),src:u,alt:d,onError:T=>{var P;j(!0),(P=g==null?void 0:g.onError)==null||P.call(g,T)}}))});Qi.classes=uf;Qi.displayName="@mantine/core/Avatar";Qi.Group=Ey;var ZE={root:"m-347db0ec","root--dot":"m-fbd81e3d",label:"m-5add502a",section:"m-91fdda9b"};const F3={},z3=(e,{radius:t,color:n,gradient:r,variant:o,size:i,autoContrast:s})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{root:{"--badge-height":Ce(i,"badge-height"),"--badge-padding-x":Ce(i,"badge-padding-x"),"--badge-fz":Ce(i,"badge-fz"),"--badge-radius":t===void 0?void 0:ut(t),"--badge-bg":n||o?l.background:void 0,"--badge-color":n||o?l.color:void 0,"--badge-bd":n||o?l.border:void 0,"--badge-dot-color":o==="dot"?gt(n,e):void 0}}},df=un((e,t)=>{const n=U("Badge",F3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,color:d,gradient:f,leftSection:h,rightSection:m,children:g,variant:y,fullWidth:C,autoContrast:v,circle:x,mod:w,...S}=n,j=le({name:"Badge",props:n,classes:ZE,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:z3});return b.createElement(W,{variant:y,mod:[{block:C,circle:x},w],...j("root",{variant:y}),ref:t,...S},h&&b.createElement("span",{...j("section"),"data-position":"left"},h),b.createElement("span",{...j("label")},g),m&&b.createElement("span",{...j("section"),"data-position":"right"},m))});df.classes=ZE;df.displayName="@mantine/core/Badge";var ej={root:"m-ddec01c0",icon:"m-dde7bd57",cite:"m-dde51a35"};const B3={iconSize:48},U3=(e,{color:t,iconSize:n,radius:r})=>{const o=Jr({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=Jr({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":Xt(i.value,.07),"--bq-bg-dark":Xt(o.value,.06),"--bq-bd":gt(t,e),"--bq-icon-size":z(n),"--bq-radius":ut(r)}}},jy=Q((e,t)=>{const n=U("Blockquote",B3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,icon:d,iconSize:f,cite:h,...m}=n,g=le({name:"Blockquote",classes:ej,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:U3});return b.createElement(W,{component:"blockquote",ref:t,...g("root"),...m},d&&b.createElement("span",{...g("icon")},d),u,h&&b.createElement("cite",{...g("cite")},h))});jy.classes=ej;jy.displayName="@mantine/core/Blockquote";var ff={root:"m-77c9d27d",inner:"m-80f1301b",loader:"m-a25b86ee",label:"m-811560b9",section:"m-a74036a",group:"m-80d6d844"};const e1={orientation:"horizontal"},V3=(e,{borderWidth:t})=>({group:{"--button-border-width":z(t)}}),Ty=Q((e,t)=>{const n=U("ButtonGroup",e1,e),{className:r,style:o,classNames:i,styles:s,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=U("ButtonGroup",e1,e),g=le({name:"ButtonGroup",props:n,classes:ff,className:r,style:o,classNames:i,styles:s,unstyled:l,vars:u,varsResolver:V3,rootSelector:"group"});return b.createElement(W,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});Ty.classes=ff;Ty.displayName="@mantine/core/ButtonGroup";const H3={},W3=(e,{radius:t,color:n,gradient:r,variant:o,size:i,justify:s,autoContrast:l})=>{const c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{root:{"--button-justify":s,"--button-height":Ce(i,"button-height"),"--button-padding-x":Ce(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?Ht(i.replace("compact-","")):Ht(i),"--button-radius":t===void 0?void 0:ut(t),"--button-bg":n||o?c.background:void 0,"--button-hover":n||o?c.hover:void 0,"--button-color":c.color,"--button-bd":n||o?c.border:void 0,"--button-hover-color":n||o?c.hoverColor:void 0}}},ee=un((e,t)=>{const n=U("Button",H3,e),{style:r,vars:o,className:i,color:s,disabled:l,children:c,leftSection:u,rightSection:d,fullWidth:f,variant:h,radius:m,loading:g,loaderProps:y,gradient:C,classNames:v,styles:x,unstyled:w,"data-disabled":S,autoContrast:j,mod:E,...T}=n,P=le({name:"Button",props:n,classes:ff,className:i,style:r,classNames:v,styles:x,unstyled:w,vars:o,varsResolver:W3}),k=!!u,D=!!d;return b.createElement(Qn,{ref:t,...P("root",{active:!l&&!g&&!S}),unstyled:w,variant:h,disabled:l||g,mod:[{disabled:l||S,loading:g,block:f,"with-left-section":k,"with-right-section":D},E],...T},b.createElement(W,{component:"span",...P("loader"),"aria-hidden":!0},b.createElement($n,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...y})),b.createElement("span",{...P("inner")},u&&b.createElement(W,{component:"span",...P("section"),mod:{position:"left"}},u),b.createElement(W,{component:"span",mod:{loading:g},...P("label")},c),d&&b.createElement(W,{component:"span",...P("section"),mod:{position:"right"}},d)))});ee.classes=ff;ee.displayName="@mantine/core/Button";ee.Group=Ty;var tj={root:"m-4451eb3a"};const q3={},Vt=un((e,t)=>{const n=U("Center",q3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,inline:u,mod:d,...f}=n,h=le({name:"Center",props:n,classes:tj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c});return b.createElement(W,{ref:t,mod:[{inline:u},d],...h("root"),...f})});Vt.classes=tj;Vt.displayName="@mantine/core/Center";const[G3,Q3]=ec(),K3={};function nj(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=U("ChipGroup",K3,e),[s,l]=ln({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),c=d=>Array.isArray(s)?s.includes(d):d===s,u=d=>{const f=d.currentTarget.value;Array.isArray(s)?l(s.includes(f)?s.filter(h=>h!==f):[...s,f]):l(f)};return b.createElement(G3,{value:{isChipSelected:c,onChange:u,multiple:o}},i)}nj.displayName="@mantine/core/ChipGroup";var rj={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 Y3={type:"checkbox"},X3=(e,{size:t,radius:n,variant:r,color:o,autoContrast:i})=>{const s=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:i});return{root:{"--chip-fz":Ht(t),"--chip-size":Ce(t,"chip-size"),"--chip-radius":n===void 0?void 0:ut(n),"--chip-checked-padding":Ce(t,"chip-checked-padding"),"--chip-padding":Ce(t,"chip-padding"),"--chip-icon-size":Ce(t,"chip-icon-size"),"--chip-bg":o||r?s.background:void 0,"--chip-hover":o||r?s.hover:void 0,"--chip-color":o||r?s.color:void 0,"--chip-bd":o||r?s.border:void 0,"--chip-spacing":Ce(t,"chip-spacing")}}},Vl=Q((e,t)=>{const n=U("Chip",Y3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,id:u,checked:d,defaultChecked:f,onChange:h,value:m,wrapperProps:g,type:y,disabled:C,children:v,size:x,variant:w,icon:S,rootRef:j,autoContrast:E,mod:T,...P}=n,k=le({name:"Chip",classes:rj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:X3}),D=Q3(),M=bn(u),{styleProps:R,rest:O}=Eo(P),[N,B]=ln({value:d,defaultValue:f,finalValue:!1,onChange:h}),I=D?{checked:D.isChipSelected(m),onChange:_=>{D.onChange(_),h==null||h(_.currentTarget.checked)},type:D.multiple?"checkbox":"radio"}:{},$=I.checked||N;return b.createElement(W,{size:x,variant:w,ref:j,mod:T,...k("root"),...R,...g},b.createElement("input",{type:y,...k("input"),checked:$,onChange:_=>B(_.currentTarget.checked),id:M,disabled:C,ref:t,value:m,...I,...O}),b.createElement("label",{htmlFor:M,"data-checked":$||void 0,"data-disabled":C||void 0,...k("label",{variant:w||"filled"})},$&&b.createElement("span",{...k("iconWrapper")},S||b.createElement(cf,{...k("checkIcon")})),v))});Vl.classes=rj;Vl.displayName="@mantine/core/Chip";Vl.Group=nj;var oj={root:"m-7485cace"};const J3={},Z3=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:Ce(t,"container-size")}}),Py=Q((e,t)=>{const n=U("Container",J3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,fluid:u,mod:d,...f}=n,h=le({name:"Container",classes:oj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:Z3});return b.createElement(W,{ref:t,mod:[{fluid:u},d],...h("root"),...f})});Py.classes=oj;Py.displayName="@mantine/core/Container";const eN={timeout:1e3};function ij(e){const{children:t,timeout:n,value:r,...o}=U("CopyButton",eN,e),i=vS({timeout:n}),s=()=>i.copy(r);return b.createElement(b.Fragment,null,t({copy:s,copied:i.copied,...o}))}ij.displayName="@mantine/core/CopyButton";var sj={root:"m-3eebeb36",label:"m-9e365f20"};const tN={orientation:"horizontal"},nN=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?gt(t,e):void 0,"--divider-border-style":n,"--divider-size":Ce(r,"divider-size")}}),Rn=Q((e,t)=>{const n=U("Divider",tN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,orientation:d,label:f,labelPosition:h,mod:m,...g}=n,y=le({name:"Divider",classes:sj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:nN});return b.createElement(W,{ref:t,mod:[{orientation:d,"with-label":!!f},m],...y("root"),...g,role:"separator"},f&&b.createElement(W,{component:"span",mod:{position:h},...y("label")},f))});Rn.classes=sj;Rn.displayName="@mantine/core/Divider";function rN({open:e,close:t,openDelay:n,closeDelay:r}){const o=p.useRef(-1),i=p.useRef(-1),s=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{s(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},c=()=>{s(),r===0||r===void 0?t():i.current=window.setTimeout(t,r)};return p.useEffect(()=>s,[]),{openDropdown:l,closeDropdown:c}}const[oN,aj]=Sn("Grid component was not found in tree"),om=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,t1=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":om(e,t),n1=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},r1=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function iN({span:e,order:t,offset:n,selector:r}){var h;const o=Rt(),i=aj(),l=Wo(e)===void 0?12:Wo(e),c=ts({"--col-order":(h=Wo(t))==null?void 0:h.toString(),"--col-flex-grow":n1(l,i.grow),"--col-flex-basis":om(l,i.columns),"--col-width":l==="content"?"auto":void 0,"--col-max-width":t1(l,i.columns,i.grow),"--col-offset":r1(Wo(n),i.columns)}),u=lt(o.breakpoints).reduce((m,g)=>{var y;return m[g]||(m[g]={}),typeof t=="object"&&t[g]!==void 0&&(m[g]["--col-order"]=(y=t[g])==null?void 0:y.toString()),typeof e=="object"&&e[g]!==void 0&&(m[g]["--col-flex-grow"]=n1(e[g],i.grow),m[g]["--col-flex-basis"]=om(e[g],i.columns),m[g]["--col-width"]=e[g]==="content"?"auto":void 0,m[g]["--col-max-width"]=t1(e[g],i.columns,i.grow)),typeof n=="object"&&n[g]!==void 0&&(m[g]["--col-offset"]=r1(n[g],i.columns)),m},{}),f=El(lt(u),o).filter(m=>lt(u[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:u[m.value]}));return b.createElement(Ta,{styles:c,media:f,selector:r})}var ky={root:"m-410352e9",inner:"m-dee7bd2f",col:"m-96bdd299"};const sN={span:12},Ry=Q((e,t)=>{const n=U("GridCol",sN,e),{classNames:r,className:o,style:i,styles:s,vars:l,span:c,order:u,offset:d,...f}=n,h=aj(),m=tc();return b.createElement(b.Fragment,null,b.createElement(iN,{selector:`.${m}`,span:c,order:u,offset:d}),b.createElement(W,{ref:t,...h.getStyles("col",{className:Je(o,m),style:i,classNames:r,styles:s}),...f}))});Ry.classes=ky;Ry.displayName="@mantine/core/GridCol";function aN({gutter:e,selector:t}){const n=Rt(),r=ts({"--grid-gutter":Jt(Wo(e))}),o=lt(n.breakpoints).reduce((l,c)=>(l[c]||(l[c]={}),typeof e=="object"&&e[c]!==void 0&&(l[c]["--grid-gutter"]=Jt(e[c])),l),{}),s=El(lt(o),n).filter(l=>lt(o[l.value]).length>0).map(l=>({query:`(min-width: ${n.breakpoints[l.value]})`,styles:o[l.value]}));return b.createElement(Ta,{styles:r,media:s,selector:t})}const lN={gutter:"md",grow:!1,columns:12},cN=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),Hn=Q((e,t)=>{const n=U("Grid",lN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,grow:u,gutter:d,columns:f,align:h,justify:m,children:g,...y}=n,C=le({name:"Grid",classes:ky,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:cN}),v=tc();return b.createElement(oN,{value:{getStyles:C,grow:u,columns:f}},b.createElement(aN,{selector:`.${v}`,...n}),b.createElement(W,{ref:t,...C("root",{className:v}),...y},b.createElement("div",{...C("inner")},g)))});Hn.classes=ky;Hn.displayName="@mantine/core/Grid";Hn.Col=Ry;function pd(){return pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pd.apply(this,arguments)}function Dy(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var uN=p.useLayoutEffect,dN=function(t){var n=p.useRef(t);return uN(function(){n.current=t}),n},o1=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},fN=function(t,n){var r=p.useRef();return p.useCallback(function(o){t.current=o,r.current&&o1(r.current,null),r.current=n,n&&o1(n,o)},[n])},i1={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},hN=function(t){Object.keys(i1).forEach(function(n){t.style.setProperty(n,i1[n],"important")})},s1=hN,fn=null,a1=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function pN(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),fn||(fn=document.createElement("textarea"),fn.setAttribute("tabindex","-1"),fn.setAttribute("aria-hidden","true"),s1(fn)),fn.parentNode===null&&document.body.appendChild(fn);var o=e.paddingSize,i=e.borderSize,s=e.sizingStyle,l=s.boxSizing;Object.keys(s).forEach(function(h){var m=h;fn.style[m]=s[m]}),s1(fn),fn.value=t;var c=a1(fn,e);fn.value=t,c=a1(fn,e),fn.value="x";var u=fn.scrollHeight-o,d=u*n;l==="border-box"&&(d=d+o+i),c=Math.max(d,c);var f=u*r;return l==="border-box"&&(f=f+o+i),c=Math.min(f,c),[c,u]}var l1=function(){},mN=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},gN=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],yN=!!document.documentElement.currentStyle,vN=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=mN(gN,n),o=r.boxSizing;if(o==="")return null;yN&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:s}},xN=vN;function lj(e,t,n){var r=dN(n);p.useLayoutEffect(function(){var o=function(s){return r.current(s)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var wN=function(t){lj(window,"resize",t)},SN=function(t){lj(document.fonts,"loadingdone",t)},bN=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],CN=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,s=t.onChange,l=s===void 0?l1:s,c=t.onHeightChange,u=c===void 0?l1:c,d=Dy(t,bN),f=d.value!==void 0,h=p.useRef(null),m=fN(h,n),g=p.useRef(0),y=p.useRef(),C=function(){var w=h.current,S=r&&y.current?y.current:xN(w);if(S){y.current=S;var j=pN(S,w.value||w.placeholder||"x",i,o),E=j[0],T=j[1];g.current!==E&&(g.current=E,w.style.setProperty("height",E+"px","important"),u(E,{rowHeight:T}))}},v=function(w){f||C(),l(w)};return p.useLayoutEffect(C),wN(C),SN(C),p.createElement("textarea",pd({},d,{onChange:v,ref:m}))},EN=p.forwardRef(CN);const jN={},ds=Q((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:s,...l}=U("Textarea",jN,e),c=n&&gS()!=="test",u=c?{maxRows:r,minRows:o}:{};return b.createElement(hr,{component:c?EN:"textarea",ref:t,...l,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":s},...u})});ds.classes=hr.classes;ds.displayName="@mantine/core/Textarea";function c1(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const TN={serialize:JSON.stringify,deserialize:JSON.parse},fs=Q((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:i,validationError:s,serialize:l,deserialize:c,onFocus:u,onBlur:d,readOnly:f,error:h,...m}=U("JsonInput",TN,e),[g,y]=ln({value:n,defaultValue:r,finalValue:"",onChange:o}),[C,v]=p.useState(c1(g,c)),x=S=>{u==null||u(S),v(!0)},w=S=>{typeof d=="function"&&d(S);const j=c1(S.currentTarget.value,c);i&&!f&&j&&S.currentTarget.value.trim()!==""&&y(l(c(S.currentTarget.value),null,2)),v(j)};return b.createElement(ds,{value:g,onChange:S=>y(S.currentTarget.value),onFocus:x,onBlur:w,ref:t,readOnly:f,...m,autoComplete:"off",__staticSelector:"JsonInput",error:C?h:s||!0,"data-monospace":!0})});fs.classes=hr.classes;fs.displayName="@mantine/core/JsonInput";const[PN,kN]=Sn("List component was not found in tree");var Iy={root:"m-abbac491",item:"m-abb6bec2",itemWrapper:"m-75cd9f71",itemIcon:"m-60f83e5b"};const RN={},_y=Q((e,t)=>{const n=U("ListItem",RN,e),{classNames:r,className:o,style:i,styles:s,vars:l,icon:c,children:u,mod:d,...f}=n,h=kN(),m=c||h.icon,g={classNames:r,styles:s};return b.createElement(W,{...h.getStyles("item",{...g,className:o,style:i}),component:"li",mod:[{"with-icon":!!m,centered:h.center},d],ref:t,...f},b.createElement("div",{...h.getStyles("itemWrapper",g)},m&&b.createElement("span",{...h.getStyles("itemIcon",g)},m),b.createElement("span",{...h.getStyles("itemLabel",g)},u)))});_y.classes=Iy;_y.displayName="@mantine/core/ListItem";const DN={type:"unordered"},IN=(e,{size:t,spacing:n})=>({root:{"--list-fz":Ht(t),"--list-lh":mS(t),"--list-spacing":Jt(n)}}),gn=Q((e,t)=>{const n=U("List",DN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,type:d,withPadding:f,icon:h,spacing:m,center:g,listStyleType:y,mod:C,...v}=n,x=le({name:"List",classes:Iy,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:IN});return b.createElement(PN,{value:{center:g,icon:h,getStyles:x}},b.createElement(W,{...x("root",{style:{listStyleType:y}}),component:d==="unordered"?"ul":"ol",mod:[{"with-padding":f},C],ref:t,...v},u))});gn.classes=Iy;gn.displayName="@mantine/core/List";gn.Item=_y;var cj={root:"m-6e45937b",loader:"m-e8eb006c",overlay:"m-df587f17"};const u1={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Ir("overlay")},_N=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),Ay=Q((e,t)=>{const n=U("LoadingOverlay",u1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,transitionProps:u,loaderProps:d,overlayProps:f,visible:h,zIndex:m,...g}=n,y=Rt(),C=le({name:"LoadingOverlay",classes:cj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:_N}),v={...u1.overlayProps,...f};return b.createElement(ls,{transition:"fade",...u,mounted:!!h},x=>b.createElement(W,{...C("root",{style:x}),ref:t,...g},b.createElement($n,{...C("loader"),unstyled:l,...d}),b.createElement(Ul,{...v,...C("overlay"),"data-light":!0,unstyled:l,color:(f==null?void 0:f.color)||y.white}),b.createElement(Ul,{...v,...C("overlay"),"data-dark":!0,unstyled:l,color:(f==null?void 0:f.color)||y.colors.dark[5]})))});Ay.classes=cj;Ay.displayName="@mantine/core/LoadingOverlay";const[AN,dc]=Sn("Menu component was not found in the tree");var _a={dropdown:"m-dc9b7c9f",label:"m-9bfac126",divider:"m-efdf90cb",item:"m-99ac2aa1",itemLabel:"m-5476e0d3",itemSection:"m-8b75e504"};const NN={},Ny=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("MenuDivider",NN,e),c=dc();return b.createElement(W,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...l})});Ny.classes=_a;Ny.displayName="@mantine/core/MenuDivider";const ON={},Oy=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,onMouseEnter:l,onMouseLeave:c,children:u,...d}=U("MenuDropdown",ON,e),f=p.useRef(null),h=dc(),m=C=>{var v,x;(C.key==="ArrowUp"||C.key==="ArrowDown")&&(C.preventDefault(),(x=(v=f.current)==null?void 0:v.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||x.focus())},g=Un(l,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.openDropdown()),y=Un(c,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.closeDropdown());return b.createElement(_r.Dropdown,{...d,onMouseEnter:g,onMouseLeave:y,role:"menu","aria-orientation":"vertical",ref:Gt(t,f),...h.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:m},b.createElement("div",{tabIndex:-1,"data-autofocus":!0}),u)});Oy.classes=_a;Oy.displayName="@mantine/core/MenuDropdown";const MN={},My=un((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,color:l,closeMenuOnClick:c,leftSection:u,rightSection:d,children:f,disabled:h,...m}=U("MenuItem",MN,e),g=dc(),y=Rt(),{dir:C}=rs(),v=p.useRef(),x=g.getItemIndex(v.current),w=m,S=Un(w.onMouseLeave,()=>g.setHovered(-1)),j=Un(w.onMouseEnter,()=>g.setHovered(g.getItemIndex(v.current))),E=Un(w.onClick,()=>{typeof c=="boolean"?c&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately()}),T=Un(w.onFocus,()=>g.setHovered(g.getItemIndex(v.current))),P=l?y.variantColorResolver({color:l,theme:y,variant:"light"}):void 0,k=l?Jr({color:l,theme:y}):null;return b.createElement(Qn,{...m,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,onFocus:T,...g.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:Gt(v,t),role:"menuitem",disabled:h,"data-menu-item":!0,"data-disabled":h||void 0,"data-hovered":g.hovered===x?!0:void 0,onMouseEnter:j,onMouseLeave:S,onClick:E,onKeyDown:pS({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:C,orientation:"vertical",onKeyDown:w.onKeydown}),__vars:{"--menu-item-color":k!=null&&k.isThemeColor&&(k==null?void 0:k.shade)===void 0?`var(--mantine-color-${k.color}-6)`:P==null?void 0:P.color,"--menu-item-hover":P==null?void 0:P.hover}},u&&b.createElement("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left"},u),f&&b.createElement("div",{...g.getStyles("itemLabel",{styles:i,classNames:n})},f),d&&b.createElement("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right"},d))});My.classes=_a;My.displayName="@mantine/core/MenuItem";const $N={},$y=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("MenuLabel",$N,e),c=dc();return b.createElement(W,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...l})});$y.classes=_a;$y.displayName="@mantine/core/MenuLabel";const LN={refProp:"ref"},uj=p.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=U("MenuTarget",LN,e);if(!Co(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 i=dc(),s=Un(n.props.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),l=Un(n.props.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),c=Un(n.props.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return b.createElement(_r.Target,{refProp:r,popupType:"menu",ref:t,...o},p.cloneElement(n,{onClick:s,onMouseEnter:l,onMouseLeave:c,"data-expanded":i.opened?!0:void 0}))});uj.displayName="@mantine/core/MenuTarget";const FN={trapFocus:!0,closeOnItemClick:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function J(e){const t=U("Menu",FN,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:s,trapFocus:l,onChange:c,closeOnItemClick:u,loop:d,closeOnEscape:f,trigger:h,openDelay:m,closeDelay:g,classNames:y,styles:C,unstyled:v,variant:x,vars:w,menuItemTabIndex:S,...j}=t,E=le({name:"Menu",classes:_a,props:t,classNames:y,styles:C,unstyled:v}),[T,{setHovered:P,resetHovered:k}]=O2(),[D,M]=ln({value:i,defaultValue:s,finalValue:!1,onChange:c}),[R,O]=p.useState(!1),N=()=>{M(!1),O(!1),D&&(o==null||o())},B=()=>{M(!0),!D&&(r==null||r())},I=()=>{D?N():B()},{openDropdown:$,closeDropdown:_}=rN({open:B,close:N,closeDelay:g,openDelay:m}),F=oe=>N2("[data-menu-item]","[data-menu-dropdown]",oe),{resolvedClassNames:q,resolvedStyles:G}=Md({classNames:y,styles:C,props:t});return fo(()=>{k()},[D]),b.createElement(AN,{value:{getStyles:E,opened:D,toggleDropdown:I,getItemIndex:F,hovered:T,setHovered:P,openedViaClick:R,setOpenedViaClick:O,closeOnItemClick:u,closeDropdown:h==="click"?N:_,openDropdown:h==="click"?B:$,closeDropdownImmediately:N,loop:d,trigger:h,unstyled:v,menuItemTabIndex:S}},b.createElement(_r,{...j,opened:D,onChange:I,defaultOpened:s,trapFocus:l,closeOnEscape:f,__staticSelector:"Menu",classNames:q,styles:G,unstyled:v,variant:x},n))}J.extend=e=>e;J.classes=_a;J.displayName="@mantine/core/Menu";J.Item=My;J.Label=$y;J.Dropdown=Oy;J.Target=uj;J.Divider=Ny;const[zN,Aa]=Sn("Modal component was not found in tree");var ko={root:"m-9df02822",content:"m-54c44539",inner:"m-1f958f16",header:"m-d0e2b9cd"};const BN={},hf=Q((e,t)=>{const n=U("ModalBody",BN,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Aa();return b.createElement(RE,{ref:t,...u.getStyles("body",{classNames:r,style:i,styles:s,className:o}),...c})});hf.classes=ko;hf.displayName="@mantine/core/ModalBody";const UN={},pf=Q((e,t)=>{const n=U("ModalCloseButton",UN,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Aa();return b.createElement(DE,{ref:t,...u.getStyles("close",{classNames:r,style:i,styles:s,className:o}),...c})});pf.classes=ko;pf.displayName="@mantine/core/ModalCloseButton";const VN={},mf=Q((e,t)=>{const n=U("ModalContent",VN,e),{classNames:r,className:o,style:i,styles:s,vars:l,children:c,...u}=n,d=Aa(),f=d.scrollAreaComponent||wA;return b.createElement(gA,{...d.getStyles("content",{className:o,style:i,styles:s,classNames:r}),innerProps:d.getStyles("inner",{className:o,style:i,styles:s,classNames:r}),ref:t,...u},b.createElement(f,{style:{maxHeight:`calc(100vh - (${z(d.yOffset)} * 2))`}},c))});mf.classes=ko;mf.displayName="@mantine/core/ModalContent";const HN={},gf=Q((e,t)=>{const n=U("ModalHeader",HN,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Aa();return b.createElement(IE,{ref:t,...u.getStyles("header",{classNames:r,style:i,styles:s,className:o}),...c})});gf.classes=ko;gf.displayName="@mantine/core/ModalHeader";const WN={},yf=Q((e,t)=>{const n=U("ModalOverlay",WN,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Aa();return b.createElement(_E,{ref:t,...u.getStyles("overlay",{classNames:r,style:i,styles:s,className:o}),...c})});yf.classes=ko;yf.displayName="@mantine/core/ModalOverlay";const qN={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Ir("modal"),transitionProps:{duration:200,transition:"pop"},yOffset:"5dvh"},GN=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:ut(t),"--modal-size":Ce(n,"modal-size"),"--modal-y-offset":z(r),"--modal-x-offset":z(o)}}),vf=Q((e,t)=>{const n=U("ModalRoot",qN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,yOffset:u,scrollAreaComponent:d,radius:f,fullScreen:h,centered:m,xOffset:g,__staticSelector:y,...C}=n,v=le({name:y,classes:ko,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:GN});return b.createElement(zN,{value:{yOffset:u,scrollAreaComponent:d,getStyles:v}},b.createElement(pA,{ref:t,...v("root"),"data-full-screen":h||void 0,"data-centered":m||void 0,unstyled:l,...C}))});vf.classes=ko;vf.displayName="@mantine/core/ModalRoot";const QN={},xf=Q((e,t)=>{const n=U("ModalTitle",QN,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Aa();return b.createElement(AE,{ref:t,...u.getStyles("title",{classNames:r,style:i,styles:s,className:o}),...c})});xf.classes=ko;xf.displayName="@mantine/core/ModalTitle";const KN={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Ir("modal"),transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0},En=Q((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:s,children:l,radius:c,...u}=U("Modal",KN,e),d=!!n||i;return b.createElement(vf,{ref:t,radius:c,...u},r&&b.createElement(yf,{...o}),b.createElement(mf,{radius:c},d&&b.createElement(gf,null,n&&b.createElement(xf,null,n),i&&b.createElement(pf,{...s})),b.createElement(hf,null,l)))});En.classes=ko;En.displayName="@mantine/core/Modal";En.Root=vf;En.Overlay=yf;En.Content=mf;En.Body=hf;En.Header=gf;En.Title=xf;En.CloseButton=pf;const[YN,Ly]=ec(),[XN,JN]=ec();var wf={root:"m-7cda1cd6","root--default":"m-44da308b","root--contrast":"m-e3a01f8",label:"m-1e0e6180",remove:"m-ae386778",group:"m-1dcfd90b"};const ZN={},e9=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?Ce(t):Ce(n,"pg-gap")}}),Fy=Q((e,t)=>{const n=U("PillGroup",ZN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,disabled:d,...f}=n,h=Ly(),m=(h==null?void 0:h.size)||u||void 0,g=le({name:"PillGroup",classes:wf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:e9,stylesCtx:{size:m},rootSelector:"group"});return b.createElement(XN,{value:{size:m,disabled:d}},b.createElement(W,{ref:t,size:m,...g("group"),...f}))});Fy.classes=wf;Fy.displayName="@mantine/core/PillGroup";const t9={variant:"default"},n9=(e,{radius:t},{size:n})=>({root:{"--pill-fz":Ce(n,"pill-fz"),"--pill-height":Ce(n,"pill-height"),"--pill-radius":t===void 0?void 0:ut(t)}}),Ki=Q((e,t)=>{const n=U("Pill",t9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,variant:u,children:d,withRemoveButton:f,onRemove:h,removeButtonProps:m,radius:g,size:y,disabled:C,mod:v,...x}=n,w=JN(),S=Ly(),j=y||(w==null?void 0:w.size)||void 0,E=(S==null?void 0:S.variant)==="filled"?"contrast":u||"default",T=le({name:"Pill",classes:wf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:n9,stylesCtx:{size:j}});return b.createElement(W,{component:"span",ref:t,variant:E,size:j,...T("root",{variant:E}),mod:[{"with-remove":f,disabled:C||(w==null?void 0:w.disabled)},v],...x},b.createElement("span",{...T("label")},d),f&&b.createElement(cs,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...m,...T("remove",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),onMouseDown:P=>{var k;P.preventDefault(),P.stopPropagation(),(k=m==null?void 0:m.onMouseDown)==null||k.call(m,P)},onClick:P=>{var k;P.stopPropagation(),h==null||h(),(k=m==null?void 0:m.onClick)==null||k.call(m,P)}}))});Ki.classes=wf;Ki.displayName="@mantine/core/Pill";Ki.Group=Fy;var dj={field:"m-45c4369d"};const r9={type:"visible"},zy=Q((e,t)=>{const n=U("PillsInputField",r9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,type:u,disabled:d,id:f,pointer:h,mod:m,...g}=n,y=Ly(),C=Da(),v=le({name:"PillsInputField",classes:dj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"field"}),x=d||(y==null?void 0:y.disabled);return b.createElement(W,{component:"input",ref:Gt(t,y==null?void 0:y.fieldRef),"data-type":u,disabled:x,mod:[{disabled:x,pointer:h},m],...v("field"),...g,id:(C==null?void 0:C.inputId)||f,"aria-invalid":y==null?void 0:y.hasError,"aria-describedby":C==null?void 0:C.describedBy,type:"text",onMouseDown:w=>!h&&w.stopPropagation()})});zy.classes=dj;zy.displayName="@mantine/core/PillsInputField";const o9={},va=Q((e,t)=>{const n=U("PillsInput",o9,e),{children:r,onMouseDown:o,onClick:i,size:s,disabled:l,__staticSelector:c,error:u,variant:d,...f}=n,h=p.useRef();return b.createElement(YN,{value:{fieldRef:h,size:s,disabled:l,hasError:!!u,variant:d}},b.createElement(hr,{size:s,error:u,variant:d,component:"div",ref:t,onMouseDown:m=>{var g;m.preventDefault(),o==null||o(m),(g=h.current)==null||g.focus()},onClick:m=>{var g;m.preventDefault(),i==null||i(m),(g=h.current)==null||g.focus()},...f,multiline:!0,disabled:l,__staticSelector:c||"PillsInput",withAria:!1},r))});va.displayName="@mantine/core/PillsInput";va.Field=zy;function i9({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(ya(i)?o.push({group:i.group,items:i.items.filter(s=>n.indexOf(s.value.toLowerCase().trim())===-1)}):n.indexOf(i.value.toLowerCase().trim())===-1&&o.push(i),o),[])}const s9={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Sf=Q((e,t)=>{const n=U("MultiSelect",s9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,value:d,defaultValue:f,onChange:h,onKeyDown:m,variant:g,data:y,dropdownOpened:C,defaultDropdownOpened:v,onDropdownOpen:x,onDropdownClose:w,selectFirstOptionOnChange:S,onOptionSubmit:j,comboboxProps:E,filter:T,limit:P,withScrollArea:k,maxDropdownHeight:D,searchValue:M,defaultSearchValue:R,onSearchChange:O,readOnly:N,disabled:B,onFocus:I,onBlur:$,onPaste:_,radius:F,rightSection:q,rightSectionWidth:G,rightSectionPointerEvents:oe,rightSectionProps:Te,leftSection:Ee,leftSectionWidth:_e,leftSectionPointerEvents:Pe,leftSectionProps:De,inputContainer:Qe,inputWrapperOrder:qe,withAsterisk:dt,labelProps:Y,descriptionProps:je,errorProps:Ae,wrapperProps:nt,description:Ge,label:It,error:jn,maxValues:Or,searchable:Qt,nothingFoundMessage:no,withCheckIcon:te,checkIconPosition:be,hidePickedOptions:rt,withErrorStyles:et,name:_t,form:Mr,id:Xn,clearable:Ci,clearButtonProps:Tn,hiddenInputProps:$r,placeholder:mr,hiddenInputValuesDivider:Ao,required:za,mod:Mc,...vs}=n,xs=bn(Xn),Ei=FE(y),ws=zE(Ei),dn=Sy({opened:C,defaultOpened:v,onDropdownOpen:x,onDropdownClose:()=>{w==null||w(),dn.resetSelectedOption()}}),{styleProps:Yf,rest:{type:Xf,...Jf}}=Eo(vs),[A,L]=ln({value:d,defaultValue:f,finalValue:[],onChange:h}),[H,Z]=ln({value:M,defaultValue:R,finalValue:"",onChange:O}),ae=le({name:"MultiSelect",classes:{},props:n,classNames:r,styles:s,unstyled:l}),{resolvedClassNames:Ie,resolvedStyles:xe}=Md({props:n,styles:s,classNames:r}),ve=fe=>{m==null||m(fe),fe.key===" "&&!Qt&&(fe.preventDefault(),dn.toggleDropdown()),fe.key==="Backspace"&&H.length===0&&A.length>0&&L(A.slice(0,A.length-1))},ge=A.map((fe,Ke)=>{var $t;return b.createElement(Ki,{key:`${fe}-${Ke}`,withRemoveButton:!N,onRemove:()=>L(A.filter(Pn=>fe!==Pn)),unstyled:l,...ae("pill")},(($t=ws[fe])==null?void 0:$t.label)||fe)});p.useEffect(()=>{S&&dn.selectFirstOption()},[S,A]);const Ne=Ci&&A.length>0&&!B&&!N&&b.createElement($e.ClearButton,{size:u,...Tn,onClear:()=>{L([]),Z("")}}),At=i9({data:Ei,value:A});return b.createElement(b.Fragment,null,b.createElement($e,{store:dn,classNames:Ie,styles:xe,unstyled:l,size:u,readOnly:N,__staticSelector:"MultiSelect",onOptionSubmit:fe=>{j==null||j(fe),Z(""),dn.updateSelectedOptionIndex("selected"),A.includes(ws[fe].value)?L(A.filter(Ke=>Ke!==ws[fe].value)):A.length<Or&&L([...A,ws[fe].value])},...E},b.createElement($e.DropdownTarget,null,b.createElement(va,{...Yf,__staticSelector:"MultiSelect",classNames:Ie,styles:xe,unstyled:l,size:u,className:o,style:i,variant:g,disabled:B,radius:F,rightSection:q||Ne||b.createElement($e.Chevron,{size:u,error:jn,unstyled:l}),rightSectionPointerEvents:oe||(Ne?"all":"none"),rightSectionWidth:G,rightSectionProps:Te,leftSection:Ee,leftSectionWidth:_e,leftSectionPointerEvents:Pe,leftSectionProps:De,inputContainer:Qe,inputWrapperOrder:qe,withAsterisk:dt,labelProps:Y,descriptionProps:je,errorProps:Ae,wrapperProps:nt,description:Ge,label:It,error:jn,multiline:!0,withErrorStyles:et,__stylesApiProps:{...n,rightSectionPointerEvents:oe||(Ne?"all":"none"),multiline:!0},pointer:!Qt,onClick:()=>Qt?dn.openDropdown():dn.toggleDropdown(),"data-expanded":dn.dropdownOpened||void 0,id:xs,required:za,mod:Mc},b.createElement(Ki.Group,{disabled:B,unstyled:l,...ae("pillsList")},ge,b.createElement($e.EventsTarget,null,b.createElement(va.Field,{...Jf,ref:t,id:xs,placeholder:mr,type:!Qt&&!mr?"hidden":"visible",...ae("inputField"),unstyled:l,onFocus:fe=>{I==null||I(fe),Qt&&dn.openDropdown()},onBlur:fe=>{$==null||$(fe),dn.closeDropdown(),Z("")},onKeyDown:ve,value:H,onChange:fe=>{Z(fe.currentTarget.value),Qt&&dn.openDropdown(),S&&dn.selectFirstOption()},disabled:B,readOnly:N||!Qt,pointer:!Qt}))))),b.createElement(I3,{data:rt?At:Ei,hidden:N||B,filter:T,search:H,limit:P,hiddenWhenEmpty:!Qt||!no||rt&&At.length===0&&H.trim().length===0,withScrollArea:k,maxDropdownHeight:D,filterOptions:Qt,value:A,checkIconPosition:be,withCheckIcon:te,nothingFoundMessage:no,unstyled:l,labelId:`${xs}-label`})),b.createElement("input",{type:"hidden",name:_t,value:A.join(Ao),form:Mr,disabled:B,...$r}))});Sf.classes={...hr.classes,...$e.classes};Sf.displayName="@mantine/core/MultiSelect";function a9(e){return"group"in e}function By({data:e}){if(a9(e)){const o=e.items.map(i=>b.createElement(By,{key:i.value,data:i}));return b.createElement("optgroup",{label:e.group},o)}const{value:t,label:n,...r}=e;return b.createElement("option",{key:e.value,value:e.value,...r},e.label)}By.displayName="@mantine/core/NativeSelectOption";const l9={rightSectionPointerEvents:"none"},yt=Q((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:s,unstyled:l,...c}=U("NativeSelect",l9,e),u=FE(n).map((d,f)=>b.createElement(By,{key:f,data:d}));return b.createElement(hr,{component:"select",ref:t,...c,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:l,rightSection:s||b.createElement(af,{size:o,error:i,unstyled:l})},r||u)});yt.classes=hr.classes;yt.displayName="@mantine/core/NativeSelect";var fj={root:"m-a513464",icon:"m-a4ceffb",loader:"m-b0920b15",body:"m-a49ed24",title:"m-3feedf16",description:"m-3d733a3a",closeButton:"m-919a4d88"};const c9={withCloseButton:!0},u9=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:ut(t),"--notification-color":n?gt(n,e):void 0}}),Uy=Q((e,t)=>{const n=U("Notification",c9,e),{className:r,color:o,radius:i,loading:s,withCloseButton:l,withBorder:c,title:u,icon:d,children:f,onClose:h,closeButtonProps:m,classNames:g,style:y,styles:C,unstyled:v,variant:x,vars:w,mod:S,...j}=n,E=le({name:"Notification",classes:fj,props:n,className:r,style:y,classNames:g,styles:C,unstyled:v,vars:w,varsResolver:u9});return b.createElement(W,{...E("root"),mod:[{"data-with-icon":!!d||s,"data-with-border":c},S],ref:t,variant:x,...j,role:"alert"},d&&!s&&b.createElement("div",{...E("icon")},d),s&&b.createElement($n,{size:28,color:o,...E("loader")}),b.createElement("div",{...E("body")},u&&b.createElement("div",{...E("title")},u),b.createElement(W,{...E("description"),mod:{"data-with-title":!!u}},f)),l&&b.createElement(cs,{iconSize:16,color:"gray",...m,unstyled:v,onClick:h,...E("closeButton")}))});Uy.classes=fj;Uy.displayName="@mantine/core/Notification";const[d9,bf]=Sn("Pagination.Root component was not found in tree");var fc={root:"m-4addd315",control:"m-326d024a",dots:"m-4ad7767d"};const f9={withPadding:!0},hc=Q((e,t)=>{const n=U("PaginationControl",f9,e),{classNames:r,className:o,style:i,styles:s,vars:l,active:c,disabled:u,withPadding:d,mod:f,...h}=n,m=bf(),g=u||m.disabled;return b.createElement(Qn,{ref:t,disabled:g,mod:[{active:c,disabled:g,"with-padding":d},f],...m.getStyles("control",{className:o,style:i,classNames:r,styles:s,active:!g}),...h})});hc.classes=fc;hc.displayName="@mantine/core/PaginationControl";function pc({style:e,children:t,path:n,...r}){return b.createElement("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},b.createElement("path",{d:n,fill:"currentColor"}))}const h9=e=>b.createElement(pc,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),p9=e=>b.createElement(pc,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),m9=e=>b.createElement(pc,{...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"}),g9=e=>b.createElement(pc,{...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"}),y9=e=>b.createElement(pc,{...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"}),v9={icon:y9},Cf=Q((e,t)=>{const n=U("PaginationDots",v9,e),{classNames:r,className:o,style:i,styles:s,vars:l,icon:c,...u}=n,d=bf(),f=c;return b.createElement(W,{ref:t,...d.getStyles("dots",{className:o,style:i,styles:s,classNames:r}),...u},b.createElement(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}}))});Cf.classes=fc;Cf.displayName="@mantine/core/PaginationDots";function Ef({icon:e,name:t,action:n,type:r}){const o={icon:e},i=p.forwardRef((s,l)=>{const{icon:c,...u}=U(t,o,s),d=c,f=bf(),h=r==="next"?f.active===f.total:f.active===1;return b.createElement(hc,{disabled:f.disabled||h,ref:l,onClick:f[n],withPadding:!1,...u},b.createElement(d,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}}))});return i.displayName=`@mantine/core/${t}`,i}const hj=Ef({icon:h9,name:"PaginationNext",action:"onNext",type:"next"}),pj=Ef({icon:p9,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),mj=Ef({icon:m9,name:"PaginationFirst",action:"onFirst",type:"previous"}),gj=Ef({icon:g9,name:"PaginationLast",action:"onLast",type:"next"});function Vy({dotsIcon:e}){const t=bf(),n=t.range.map((r,o)=>{var i;return r==="dots"?b.createElement(Cf,{icon:e,key:o}):b.createElement(hc,{key:o,active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(i=t.getItemProps)==null?void 0:i.call(t,r)},r)});return b.createElement(b.Fragment,null,n)}Vy.displayName="@mantine/core/PaginationItems";const x9={siblings:1,boundaries:1},w9=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:ut(n),"--pagination-control-size":Ce(t,"pagination-control-size"),"--pagination-control-fz":Ht(t),"--pagination-active-bg":r?gt(r,e):void 0,"--pagination-active-color":o?ns({color:r,theme:e}):void 0}}),jf=Q((e,t)=>{const n=U("PaginationRoot",x9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,total:u,value:d,defaultValue:f,onChange:h,disabled:m,siblings:g,boundaries:y,color:C,radius:v,onNextPage:x,onPreviousPage:w,onFirstPage:S,onLastPage:j,getItemProps:E,autoContrast:T,...P}=n,k=le({name:"Pagination",classes:fc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:w9}),{range:D,setPage:M,next:R,previous:O,active:N,first:B,last:I}=tR({page:d,initialPage:f,onChange:h,total:u,siblings:g,boundaries:y}),$=Un(x,R),_=Un(w,O),F=Un(S,B),q=Un(j,I);return b.createElement(d9,{value:{total:u,range:D,active:N,disabled:m,getItemProps:E,onChange:M,onNext:$,onPrevious:_,onFirst:F,onLast:q,getStyles:k}},b.createElement(W,{ref:t,...k("root"),...P}))});jf.classes=fc;jf.displayName="@mantine/core/PaginationRoot";const S9={withControls:!0,siblings:1,boundaries:1,gap:8},Ar=Q((e,t)=>{const n=U("Pagination",S9,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:s,previousIcon:l,lastIcon:c,firstIcon:u,dotsIcon:d,total:f,gap:h,...m}=n;return f<=0?null:b.createElement(jf,{ref:t,total:f,...m},b.createElement(X,{gap:h},r&&b.createElement(mj,{icon:u,...i==null?void 0:i("first")}),o&&b.createElement(pj,{icon:l,...i==null?void 0:i("previous")}),b.createElement(Vy,{dotsIcon:d}),o&&b.createElement(hj,{icon:s,...i==null?void 0:i("next")}),r&&b.createElement(gj,{icon:c,...i==null?void 0:i("last")})))});Ar.classes=fc;Ar.displayName="@mantine/core/Pagination";Ar.Root=jf;Ar.Control=hc;Ar.Dots=Cf;Ar.First=mj;Ar.Last=gj;Ar.Next=hj;Ar.Previous=pj;Ar.Items=Vy;const b9=({reveal:e})=>b.createElement("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)"}},b.createElement("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 im={root:"m-f61ca620",input:"m-ccf8da4c",innerInput:"m-f2d85dd2",visibilityToggle:"m-b1072d44"};const C9={visibilityToggleIcon:b9},E9=(e,{size:t})=>({root:{"--psi-icon-size":Ce(t,"psi-icon-size"),"--psi-button-size":Ce(t,"psi-button-size")}}),Tr=Q((e,t)=>{const n=U("PasswordInput",C9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,required:u,error:d,leftSection:f,disabled:h,id:m,variant:g,inputContainer:y,description:C,label:v,size:x,errorProps:w,descriptionProps:S,labelProps:j,withAsterisk:E,inputWrapperOrder:T,wrapperProps:P,radius:k,rightSection:D,rightSectionWidth:M,rightSectionPointerEvents:R,leftSectionWidth:O,visible:N,defaultVisible:B,onVisibilityChange:I,visibilityToggleIcon:$,visibilityToggleButtonProps:_,rightSectionProps:F,leftSectionProps:q,leftSectionPointerEvents:G,mod:oe,...Te}=n,Ee=bn(m),[_e,Pe]=ln({value:N,defaultValue:B,finalValue:!1,onChange:I}),De=()=>Pe(!_e),Qe=le({name:"PasswordInput",classes:im,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:E9}),{resolvedClassNames:qe,resolvedStyles:dt}=Md({classNames:r,styles:s,props:n}),{styleProps:Y,rest:je}=Eo(Te),Ae=$,nt=b.createElement(qt,{...Qe("visibilityToggle"),disabled:h,radius:k,"aria-hidden":!_,tabIndex:-1,..._,variant:"subtle",color:"gray",unstyled:l,onMouseDown:Ge=>{var It;Ge.preventDefault(),(It=_==null?void 0:_.onMouseDown)==null||It.call(_,Ge),De()},onKeyDown:Ge=>{var It;(It=_==null?void 0:_.onKeyDown)==null||It.call(_,Ge),Ge.key===" "&&(Ge.preventDefault(),De())}},b.createElement(Ae,{reveal:_e}));return b.createElement(St.Wrapper,{required:u,id:Ee,label:v,error:d,description:C,size:x,classNames:qe,styles:dt,__staticSelector:"PasswordInput",errorProps:w,descriptionProps:S,unstyled:l,withAsterisk:E,inputWrapperOrder:T,inputContainer:y,variant:g,labelProps:{...j,htmlFor:Ee},mod:oe,...Qe("root"),...Y,...P},b.createElement(St,{component:"div",error:d,leftSection:f,size:x,classNames:{...qe,input:Je(im.input,qe.input)},styles:dt,radius:k,disabled:h,__staticSelector:"PasswordInput",rightSectionWidth:M,rightSection:D??nt,variant:g,unstyled:l,leftSectionWidth:O,rightSectionPointerEvents:R||"all",rightSectionProps:F,leftSectionProps:q,leftSectionPointerEvents:G,withAria:!1},b.createElement("input",{required:u,"data-invalid":!!d||void 0,"data-with-left-section":!!f||void 0,...Qe("innerInput"),disabled:h,id:Ee,ref:t,...je,autoComplete:je.autoComplete||"off",type:_e?"text":"password"})))});Tr.classes={...hr.classes,...im};Tr.displayName="@mantine/core/PasswordInput";const[j9,T9]=ec(),P9={},Hy=Q((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,name:c,readOnly:u,...d}=U("RadioGroup",P9,e),f=bn(c),[h,m]=ln({value:n,defaultValue:r,finalValue:"",onChange:o}),g=y=>!u&&m(y.currentTarget.value);return b.createElement(j9,{value:{value:h,onChange:g,size:i,name:f}},b.createElement(St.Wrapper,{size:i,ref:t,...s,...d,labelElement:"div",__staticSelector:"RadioGroup"},b.createElement(by,{role:"radiogroup"},l)))});Hy.classes=St.Wrapper.classes;Hy.displayName="@mantine/core/RadioGroup";function k9({size:e,style:t,...n}){return b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:z(e),height:z(e),...t},"aria-hidden":!0,...n},b.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"}))}var yj={root:"m-f3f1af94",inner:"m-89c4f5e4",icon:"m-f3ed6b2b",radio:"m-8a3dbb89","radio--outline":"m-1bfe9d39"};const R9={labelPosition:"right"},D9=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:s})=>{const l=Jr({color:r||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--radio-size":Ce(t,"radio-size"),"--radio-radius":n===void 0?void 0:ut(n),"--radio-color":i==="outline"?c:gt(r,e),"--radio-icon-color":o?gt(o,e):s?ns({color:r,theme:e}):void 0,"--radio-icon-size":Ce(t,"radio-icon-size")}}},Hl=Q((e,t)=>{const n=U("Radio",R9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,id:u,size:d,label:f,labelPosition:h,description:m,error:g,radius:y,color:C,variant:v,disabled:x,wrapperProps:w,icon:S=k9,rootRef:j,iconColor:E,onChange:T,mod:P,...k}=n,D=le({name:"Radio",classes:yj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:D9}),M=T9(),R=(M==null?void 0:M.size)??d,O=n.size?d:R,{styleProps:N,rest:B}=Eo(k),I=bn(u),$=M?{checked:M.value===B.value,name:B.name??M.name,onChange:_=>{M.onChange(_),T==null||T(_)}}:{};return b.createElement(lf,{...D("root"),__staticSelector:"Radio",__stylesApiProps:n,id:I,size:O,labelPosition:h,label:f,description:m,error:g,disabled:x,classNames:r,styles:s,unstyled:l,"data-checked":$.checked||void 0,variant:v,ref:j,mod:P,...N,...w},b.createElement(W,{...D("inner"),mod:{"label-position":h}},b.createElement(W,{...D("radio",{focusable:!0,variant:v}),onChange:T,...B,...$,component:"input",mod:{error:!!g},ref:t,id:I,disabled:x,type:"radio"}),b.createElement(S,{...D("icon"),"aria-hidden":!0})))});Hl.classes=yj;Hl.displayName="@mantine/core/Radio";Hl.Group=Hy;const I9={duration:100,transition:"fade"};function _9(e,t){return{...I9,...t,...e}}function A9({offset:e,position:t}){const[n,r]=p.useState(!1),o=p.useRef(),{x:i,y:s,elements:l,refs:c,update:u,placement:d}=Zg({placement:t,middleware:[Xg({crossAxis:!0,padding:5,rootBoundary:"document"})]}),f=d.includes("right")?e:t.includes("left")?e*-1:0,h=d.includes("bottom")?e:t.includes("top")?e*-1:0,m=p.useCallback(({clientX:g,clientY:y})=>{c.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:g,y,left:g+f,top:y+h,right:g,bottom:y}}})},[l.reference]);return p.useEffect(()=>{if(c.floating.current){const g=o.current;g.addEventListener("mousemove",m);const y=co(c.floating.current);return y.forEach(C=>{C.addEventListener("scroll",u)}),()=>{g.removeEventListener("mousemove",m),y.forEach(C=>{C.removeEventListener("scroll",u)})}}},[l.reference,c.floating.current,u,m,n]),{handleMouseMove:m,x:i,y:s,opened:n,setOpened:r,boundaryRef:o,floating:c.setFloating}}var Tf={tooltip:"m-1b3c8819",arrow:"m-f898399f"};const N9={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Ir("popover")},O9=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:ut(t),"--tooltip-bg":n?gt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Wy=Q((e,t)=>{const n=U("TooltipFloating",N9,e),{children:r,refProp:o,withinPortal:i,style:s,className:l,classNames:c,styles:u,unstyled:d,radius:f,color:h,label:m,offset:g,position:y,multiline:C,zIndex:v,disabled:x,variant:w,vars:S,portalProps:j,...E}=n,T=Rt(),P=le({name:"TooltipFloating",props:n,classes:Tf,className:l,style:s,classNames:c,styles:u,unstyled:d,rootSelector:"tooltip",vars:S,varsResolver:O9}),{handleMouseMove:k,x:D,y:M,opened:R,boundaryRef:O,floating:N,setOpened:B}=A9({offset:g,position:y});if(!Co(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=Gt(O,r.ref,t),$=F=>{var q,G;(G=(q=r.props).onMouseEnter)==null||G.call(q,F),k(F),B(!0)},_=F=>{var q,G;(G=(q=r.props).onMouseLeave)==null||G.call(q,F),B(!1)};return b.createElement(b.Fragment,null,b.createElement(as,{...j,withinPortal:i},b.createElement(W,{...E,...P("tooltip",{style:{...IS(s,T),zIndex:v,display:!x&&R?"block":"none",top:(M&&Math.round(M))??"",left:(D&&Math.round(D))??""}}),variant:w,ref:N},m)),p.cloneElement(r,{...r.props,[o]:I,onMouseEnter:$,onMouseLeave:_}))});Wy.classes=Tf;Wy.displayName="@mantine/core/TooltipFloating";const vj=p.createContext(!1),M9=vj.Provider,$9=()=>p.useContext(vj),L9={openDelay:0,closeDelay:0};function xj(e){const{openDelay:t,closeDelay:n,children:r}=U("TooltipGroup",L9,e);return b.createElement(M9,{value:!0},b.createElement(E4,{delay:{open:t,close:n}},r))}xj.displayName="@mantine/core/TooltipGroup";function F9(e){var E,T,P;const[t,n]=p.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=$9(),s=bn(),{delay:l,currentId:c,setCurrentId:u}=yE(),d=p.useCallback(k=>{n(k),k&&u(s)},[u,s]),{x:f,y:h,context:m,refs:g,update:y,placement:C,middlewareData:{arrow:{x:v,y:x}={}}}=Zg({placement:e.position,open:o,onOpenChange:d,middleware:[XC(e.offset),Xg({padding:8}),aE(),cE({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[lE()]:[]]}),{getReferenceProps:w,getFloatingProps:S}=O4([C4(m,{enabled:(E=e.events)==null?void 0:E.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((T=e.events)!=null&&T.touch)}),N4(m,{enabled:(P=e.events)==null?void 0:P.focus,keyboardOnly:!0}),M4(m,{role:"tooltip"}),A4(m,{enabled:typeof e.opened>"u"}),j4(m,{id:s})]);CE({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:y}}),fo(()=>{var k;(k=e.onPositionChange)==null||k.call(e,C)},[C]);const j=o&&c&&c!==s;return{x:f,y:h,arrowX:v,arrowY:x,reference:g.setReference,floating:g.setFloating,getFloatingProps:S,getReferenceProps:w,isGroupPhase:j,opened:o,placement:C}}const d1={position:"top",refProp:"ref",withinPortal:!0,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Ir("popover"),positionDependencies:[]},z9=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:ut(t),"--tooltip-bg":n?gt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Na=Q((e,t)=>{const n=U("Tooltip",d1,e),{children:r,position:o,refProp:i,label:s,openDelay:l,closeDelay:c,onPositionChange:u,opened:d,withinPortal:f,radius:h,color:m,classNames:g,styles:y,unstyled:C,style:v,className:x,withArrow:w,arrowSize:S,arrowOffset:j,arrowRadius:E,arrowPosition:T,offset:P,transitionProps:k,multiline:D,events:M,zIndex:R,disabled:O,positionDependencies:N,onClick:B,onMouseEnter:I,onMouseLeave:$,inline:_,variant:F,keepMounted:q,vars:G,portalProps:oe,mod:Te,...Ee}=U("Tooltip",d1,n),{dir:_e}=rs(),Pe=p.useRef(null),De=F9({position:vE(_e,o),closeDelay:c,openDelay:l,onPositionChange:u,opened:d,events:M,arrowRef:Pe,arrowOffset:j,offset:typeof P=="number"?P+(w?S/2:0):P,positionDependencies:[...N,r],inline:_}),Qe=le({name:"Tooltip",props:n,classes:Tf,className:x,style:v,classNames:g,styles:y,unstyled:C,rootSelector:"tooltip",vars:G,varsResolver:z9});if(!Co(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 qe=Gt(De.reference,r.ref,t),dt=_9(k,{duration:100,transition:"fade"});return b.createElement(b.Fragment,null,b.createElement(as,{...oe,withinPortal:f},b.createElement(ls,{...dt,keepMounted:q,mounted:!O&&!!De.opened,duration:De.isGroupPhase?10:dt.duration},Y=>b.createElement(W,{...Ee,variant:F,mod:[{multiline:D},Te],...De.getFloatingProps({ref:De.floating,className:Qe("tooltip").className,style:{...Qe("tooltip").style,...Y,zIndex:R,top:De.y??0,left:De.x??0}})},s,b.createElement(ey,{ref:Pe,arrowX:De.arrowX,arrowY:De.arrowY,visible:w,position:De.placement,arrowSize:S,arrowOffset:j,arrowRadius:E,arrowPosition:T,...Qe("arrow")})))),p.cloneElement(r,De.getReferenceProps({onClick:B,onMouseEnter:I,onMouseLeave:$,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[i]:qe,className:Je(x,r.props.className),...r.props})))});Na.classes=Tf;Na.displayName="@mantine/core/Tooltip";Na.Floating=Wy;Na.Group=xj;function B9({size:e,thickness:t,sum:n,value:r,root:o,offset:i}){const s=(e*.9-t*2)/2,l=Math.PI*s*2/100,c=o||r===void 0?`${(100-n)*l}, ${n*l}`:`${r*l}, ${(100-r)*l}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:s||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:c,strokeDashoffset:o?0:i||0}}function wj({size:e,value:t,offset:n,sum:r,thickness:o,root:i,color:s,lineRoundCaps:l,tooltip:c,getStyles:u,display:d,...f}){const h=Rt();return b.createElement(Na.Floating,{disabled:!c,label:c},b.createElement(W,{component:"circle",...f,...u("curve"),__vars:{"--curve-color":s?gt(s,h):void 0},fill:"none",strokeLinecap:l?"round":"butt",...B9({sum:r,size:e,thickness:o,value:t,offset:n,root:i})}))}wj.displayName="@mantine/core/Curve";function U9({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const i=n.reduce((d,f)=>d+f.value,0),s=Math.PI*((e*.9-t*2)/2)*2;let l=s;const c=[],u=[];for(let d=0;d<n.length;d+=1)c.push({sum:i,offset:l,data:n[d],root:!1}),l-=n[d].value/100*s;if(c.push({sum:i,offset:l,data:{color:o},root:!0}),u.push({...c[c.length-1],lineRoundCaps:!1}),c.length>2){u.push({...c[0],lineRoundCaps:r}),u.push({...c[c.length-2],lineRoundCaps:r});for(let d=1;d<=c.length-3;d+=1)u.push({...c[d],lineRoundCaps:!1})}else u.push({...c[0],lineRoundCaps:r});return u}var Sj={root:"m-b32e4812",svg:"m-d43b5134",curve:"m-b1ca1fbf",label:"m-b23f9dc4"};function V9(e,t){return Math.min(e||12,(t||120)/4)}const H9={size:120,thickness:12},W9=(e,{size:t,thickness:n})=>({root:{"--rp-size":z(t),"--rp-label-offset":z(n*2)}}),Pf=Q((e,t)=>{const n=U("RingProgress",H9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,label:u,sections:d,size:f,thickness:h,roundCaps:m,rootColor:g,...y}=n,C=le({name:"RingProgress",classes:Sj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:W9}),v=V9(h,f),x=U9({size:f,thickness:v,sections:d,renderRoundedLineCaps:m,rootColor:g}).map(({data:w,sum:S,root:j,lineRoundCaps:E,offset:T},P)=>b.createElement(wj,{...w,key:P,size:f,thickness:v,sum:S,offset:T,color:w==null?void 0:w.color,root:j,lineRoundCaps:E,getStyles:C}));return b.createElement(W,{...C("root"),size:f,ref:t,...y},b.createElement("svg",{...C("svg")},x),u&&b.createElement("div",{...C("label")},u))});Pf.classes=Sj;Pf.displayName="@mantine/core/RingProgress";function lu(e,t){const n=parseFloat(e.replace("px",""));return Number.isNaN(n)?t:n}function q9(e,t){const n=window.getComputedStyle(e);return{top:lu(n.getPropertyValue("padding-top"),t),right:lu(n.getPropertyValue("padding-right"),t),bottom:lu(n.getPropertyValue("padding-bottom"),t),left:lu(n.getPropertyValue("padding-left"),t)}}var bj={root:"m-cf365364",indicator:"m-9e182ccd",label:"m-1738fcb2",input:"m-1714d588",control:"m-69686b9b"};const G9=4,Q9={withItemsBorders:!0},K9=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:ut(t),"--sc-color":n?gt(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":i,"--sc-padding":Ce(o,"sc-padding"),"--sc-font-size":Ht(o)}}),qy=Q((e,t)=>{var qe,dt;const n=U("SegmentedControl",Q9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,data:u,value:d,defaultValue:f,onChange:h,size:m,name:g,disabled:y,readOnly:C,fullWidth:v,orientation:x,radius:w,color:S,transitionDuration:j,transitionTimingFunction:E,variant:T,autoContrast:P,withItemsBorders:k,mod:D,...M}=n,R=le({name:"SegmentedControl",props:n,classes:bj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:K9}),{dir:O}=rs(),N=Rt(),B=u.map(Y=>typeof Y=="string"?{label:Y,value:Y}:Y),[I,$]=ln({value:d,defaultValue:f,finalValue:Array.isArray(u)?((qe=B.find(Y=>!Y.disabled))==null?void 0:qe.value)??((dt=u[0])==null?void 0:dt.value)??null:null,onChange:h}),[_,F]=p.useState({width:0,height:0,translate:[0,0]}),q=bn(g),G=p.useRef({}),oe=p.useRef(null),[Te,Ee]=p.useState(!1),[_e,Pe]=rR();p.useEffect(()=>{if(I in G.current&&_e.current){const Y=G.current[I];if(Y){const je=q9(oe.current,G9),Ae=Y.getBoundingClientRect(),nt=Y.offsetWidth/Ae.width,Ge=Y.clientWidth*nt||0,It=Y.clientHeight*nt||0,jn=Pe.width-Y.parentElement.offsetLeft+(O==="rtl"?je.left:je.right)-Ge,Or=Y.parentElement.offsetLeft-(O==="rtl"?je.right:je.left);F({width:Ge,height:It,translate:[O==="rtl"?jn*-1:Or,Y.parentElement.offsetTop-je.top]})}else F({width:0,height:0,translate:[0,0]})}},[I,Pe,O]),iR(()=>{gS()!=="test"&&Ee(!0)},20,{autoInvoke:!0});const De=B.map(Y=>b.createElement(W,{...R("control"),mod:{active:I===Y.value,orientation:x},key:Y.value},b.createElement("input",{...R("input"),disabled:y||Y.disabled,type:"radio",name:q,value:Y.value,id:`${q}-${Y.value}`,checked:I===Y.value,onChange:()=>!C&&$(Y.value),"data-focus-ring":N.focusRing}),b.createElement(W,{component:"label",...R("label"),mod:{active:I===Y.value&&!(y||Y.disabled),disabled:y||Y.disabled,"read-only":C},htmlFor:`${q}-${Y.value}`,ref:je=>{G.current[Y.value]=je},__vars:{"--sc-label-color":S!==void 0?ns({color:S,theme:N}):void 0}},Y.label))),Qe=Gt(_e,oe,t);return u.length===0?null:b.createElement(W,{...R("root"),variant:T,size:m,ref:Qe,mod:[{"full-width":v,orientation:x,initialization:!Te,"with-items-borders":k},D],...M,role:"radiogroup"},typeof I=="string"&&b.createElement(W,{component:"span",...R("indicator"),__vars:{"--sc-indicator-width":`${_.width}px`,"--sc-indicator-height":`${_.height}px`,"--sc-indicator-transform":`translate(${_.translate[0]}px, ${_.translate[1]}px)`}}),De)});qy.classes=bj;qy.displayName="@mantine/core/SegmentedControl";function Y9({spacing:e,verticalSpacing:t,cols:n,selector:r}){var d;const o=Rt(),i=t===void 0?e:t,s=ts({"--sg-spacing-x":Jt(Wo(e)),"--sg-spacing-y":Jt(Wo(i)),"--sg-cols":(d=Wo(n))==null?void 0:d.toString()}),l=lt(o.breakpoints).reduce((f,h)=>(f[h]||(f[h]={}),typeof e=="object"&&e[h]!==void 0&&(f[h]["--sg-spacing-x"]=Jt(e[h])),typeof i=="object"&&i[h]!==void 0&&(f[h]["--sg-spacing-y"]=Jt(i[h])),typeof n=="object"&&n[h]!==void 0&&(f[h]["--sg-cols"]=n[h]),f),{}),u=El(lt(l),o).filter(f=>lt(l[f.value]).length>0).map(f=>({query:`(min-width: ${o.breakpoints[f.value]})`,styles:l[f.value]}));return b.createElement(Ta,{styles:s,media:u,selector:r})}var Cj={root:"m-2415a157"};const X9={cols:1,spacing:"md"},Gy=Q((e,t)=>{const n=U("SimpleGrid",X9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,cols:u,verticalSpacing:d,spacing:f,...h}=n,m=le({name:"SimpleGrid",classes:Cj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c}),g=tc();return b.createElement(b.Fragment,null,b.createElement(Y9,{...n,selector:`.${g}`}),b.createElement(W,{ref:t,...m("root",{className:g}),...h}))});Gy.classes=Cj;Gy.displayName="@mantine/core/SimpleGrid";const J9={},kf=Q((e,t)=>{const{w:n,h:r,miw:o,mih:i,...s}=U("Space",J9,e);return b.createElement(W,{ref:t,...s,w:n,miw:o??n,h:r,mih:i??r})});kf.displayName="@mantine/core/Space";var Ej={root:"m-6d731127"};const Z9={gap:"md",align:"stretch",justify:"flex-start"},e5=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Jt(t),"--stack-align":n,"--stack-justify":r}}),Se=Q((e,t)=>{const n=U("Stack",Z9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,align:u,justify:d,gap:f,variant:h,...m}=n,g=le({name:"Stack",props:n,classes:Ej,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:e5});return b.createElement(W,{ref:t,...g("root"),variant:h,...m})});Se.classes=Ej;Se.displayName="@mantine/core/Stack";const[t5,n5]=Sn("Stepper component was not found in tree"),md=()=>null;md.displayName="@mantine/core/StepperCompleted";var Qy={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 cu=(e,t)=>typeof e=="function"?b.createElement(e,{step:t||0}):e,r5={withIcon:!0,allowStepClick:!0,iconPosition:"left"},Ky=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,step:l,state:c,color:u,icon:d,completedIcon:f,progressIcon:h,label:m,description:g,withIcon:y,iconSize:C,loading:v,allowStepClick:x,allowStepSelect:w,iconPosition:S,orientation:j,mod:E,...T}=U("StepperStep",r5,e),P=n5(),k=Rt(),D={classNames:n,styles:i},M=c==="stepCompleted"?null:c==="stepProgress"?h:d,R={"data-progress":c==="stepProgress"||void 0,"data-completed":c==="stepCompleted"||void 0};return b.createElement(Qn,{...P.getStyles("step",{className:r,style:o,variant:P.orientation,...D}),mod:[{"icon-position":S||P.iconPosition,"allow-click":x},E],ref:t,...R,...T,__vars:{"--step-color":u?gt(u,k):void 0},tabIndex:x?0:-1},y&&b.createElement("span",{...P.getStyles("stepWrapper",D)},b.createElement("span",{...P.getStyles("stepIcon",D),...R},b.createElement(ls,{mounted:c==="stepCompleted",transition:"pop",duration:200},O=>b.createElement("span",{...P.getStyles("stepCompletedIcon",{style:O,...D})},v?b.createElement($n,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...P.getStyles("stepLoader",D)}):cu(f,l)||b.createElement(cf,{size:"60%"}))),c!=="stepCompleted"?v?b.createElement($n,{...P.getStyles("stepLoader",D),size:"calc(var(--stepper-icon-size) / 2)",color:u}):cu(M||d,l):null),j==="vertical"&&b.createElement("span",{...P.getStyles("verticalSeparator",D),"data-active":c==="stepCompleted"||void 0})),(m||g)&&b.createElement("span",{...P.getStyles("stepBody",D),"data-orientation":P.orientation,"data-icon-position":S||P.iconPosition},m&&b.createElement("span",{...P.getStyles("stepLabel",D)},cu(m,l)),g&&b.createElement("span",{...P.getStyles("stepDescription",D)},cu(g,l))))});Ky.classes=Qy;Ky.displayName="@mantine/core/StepperStep";const o5={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},i5=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:s})=>({root:{"--stepper-color":t?gt(t,e):void 0,"--stepper-icon-color":s?ns({color:t,theme:e}):void 0,"--stepper-icon-size":n===void 0?Ce(r,"stepper-icon-size"):z(n),"--stepper-content-padding":Jt(o),"--stepper-radius":i===void 0?void 0:ut(i),"--stepper-fz":Ht(r),"--stepper-spacing":Jt(r)}}),xa=Q((e,t)=>{var $,_,F;const n=U("Stepper",o5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,onStepClick:d,active:f,icon:h,completedIcon:m,progressIcon:g,color:y,iconSize:C,contentPadding:v,orientation:x,iconPosition:w,size:S,radius:j,allowNextStepsSelect:E,wrap:T,...P}=n,k=le({name:"Stepper",classes:Qy,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:i5}),D=p.Children.toArray(u),M=D.filter(q=>q.type!==md),R=D.find(q=>q.type===md),O=M.reduce((q,G,oe)=>{const Te=f===oe?"stepProgress":f>oe?"stepCompleted":"stepInactive",_e=typeof d!="function"?!1:typeof G.props.allowStepSelect=="boolean"?G.props.allowStepSelect:Te==="stepCompleted"||E;return q.push(p.cloneElement(G,{icon:G.props.icon||h||oe+1,key:oe,step:oe,state:Te,onClick:()=>_e&&(d==null?void 0:d(oe)),allowStepClick:_e,completedIcon:G.props.completedIcon||m,progressIcon:G.props.progressIcon||g,color:G.props.color||y,iconSize:C,radius:j,iconPosition:G.props.iconPosition||w,orientation:x,unstyled:l})),x==="horizontal"&&oe!==M.length-1&&q.push(b.createElement("div",{...k("separator"),"data-active":oe<f||void 0,"data-orientation":x,key:`separator-${oe}`})),q},[]),N=(_=($=M[f])==null?void 0:$.props)==null?void 0:_.children,B=(F=R==null?void 0:R.props)==null?void 0:F.children,I=f>M.length-1?B:N;return b.createElement(t5,{value:{getStyles:k,orientation:x,iconPosition:w}},b.createElement(W,{...k("root"),ref:t,size:S,...P},b.createElement(W,{...k("steps"),mod:{orientation:x,"icon-position":w,wrap:T&&x!=="vertical"}},O),I&&b.createElement("div",{...k("content")},I)))});xa.classes=Qy;xa.displayName="@mantine/core/Stepper";xa.Completed=md;xa.Step=Ky;const jj=p.createContext(null),s5=jj.Provider,a5=()=>p.useContext(jj),l5={},Yy=Q((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,readOnly:c,...u}=U("SwitchGroup",l5,e),[d,f]=ln({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=m.currentTarget.value;!c&&f(d.includes(g)?d.filter(y=>y!==g):[...d,g])};return b.createElement(s5,{value:{value:d,onChange:h,size:i}},b.createElement(St.Wrapper,{size:i,ref:t,...s,...u,labelElement:"div",__staticSelector:"SwitchGroup"},b.createElement(by,{role:"group"},l)))});Yy.classes=St.Wrapper.classes;Yy.displayName="@mantine/core/SwitchGroup";var Tj={root:"m-5f93f3bb",input:"m-926b4011",track:"m-9307d992",thumb:"m-93039a1d",trackLabel:"m-8277e082"};const c5={labelPosition:"right"},u5=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:ut(t),"--switch-height":Ce(r,"switch-height"),"--switch-width":Ce(r,"switch-width"),"--switch-thumb-size":Ce(r,"switch-thumb-size"),"--switch-label-font-size":Ce(r,"switch-label-font-size"),"--switch-track-label-padding":Ce(r,"switch-track-label-padding"),"--switch-color":n?gt(n,e):void 0}}),mc=Q((e,t)=>{const n=U("Switch",c5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,label:d,offLabel:f,onLabel:h,id:m,size:g,radius:y,wrapperProps:C,children:v,thumbIcon:x,checked:w,defaultChecked:S,onChange:j,labelPosition:E,description:T,error:P,disabled:k,variant:D,rootRef:M,mod:R,...O}=n,N=a5(),B=g||(N==null?void 0:N.size),I=le({name:"Switch",props:n,classes:Tj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:u5}),{styleProps:$,rest:_}=Eo(O),F=bn(m),q=N?{checked:N.value.includes(_.value),onChange:N.onChange}:{},[G,oe]=ln({value:q.checked??w,defaultValue:S,finalValue:!1});return b.createElement(lf,{...I("root"),__staticSelector:"Switch",__stylesApiProps:n,id:F,size:B,labelPosition:E,label:d,description:T,error:P,disabled:k,classNames:r,styles:s,unstyled:l,"data-checked":q.checked||void 0,variant:D,ref:M,mod:R,...$,...C},b.createElement("input",{..._,disabled:k,checked:G,onChange:Te=>{var Ee;N?(Ee=q.onChange)==null||Ee.call(q,Te):j==null||j(Te),oe(Te.currentTarget.checked)},id:F,ref:t,type:"checkbox",...I("input")}),b.createElement(W,{component:"label",htmlFor:F,mod:{error:P,"label-position":E},...I("track")},b.createElement(W,{component:"span",mod:"reduce-motion",...I("thumb")},x),b.createElement("span",{...I("trackLabel")},G?h:f)))});mc.classes={...Tj,...qE};mc.displayName="@mantine/core/Switch";mc.Group=Yy;const[d5,f5]=Sn("Table component was not found in the tree");var gc={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 h5(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 hs(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=Q((o,i)=>{const s=U(n,{},o),{classNames:l,className:c,style:u,styles:d,...f}=s,h=f5();return b.createElement(W,{component:e,ref:i,...h5(h,t),...h.getStyles(e,{className:c,classNames:l,style:u,styles:d,props:s}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=gc,r}const sm=hs("th",{columnBorder:!0}),Pj=hs("td",{columnBorder:!0}),Au=hs("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),kj=hs("thead",{stickyHeader:!0}),Rj=hs("tbody"),Dj=hs("tfoot"),Ij=hs("caption",{captionSide:!0});function Xy({data:e}){return b.createElement(b.Fragment,null,e.caption&&b.createElement(Ij,null,e.caption),e.head&&b.createElement(kj,null,b.createElement(Au,null,e.head.map((t,n)=>b.createElement(sm,{key:n},t)))),e.body&&b.createElement(Rj,null,e.body.map((t,n)=>b.createElement(Au,{key:n},t.map((r,o)=>b.createElement(Pj,{key:o},r))))),e.foot&&b.createElement(Dj,null,b.createElement(Au,null,e.foot.map((t,n)=>b.createElement(sm,{key:n},t)))))}Xy.displayName="@mantine/core/TableDataRenderer";const p5={type:"scrollarea"},m5=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":z(t),"--table-overflow":n==="native"?"auto":void 0}}),Jy=Q((e,t)=>{const n=U("TableScrollContainer",p5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,minWidth:d,type:f,...h}=n,m=le({name:"TableScrollContainer",classes:gc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:m5,rootSelector:"scrollContainer"});return b.createElement(W,{component:f==="scrollarea"?dr:"div",...f==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...m("scrollContainer"),...h},b.createElement("div",{...m("scrollContainerInner")},u))});Jy.classes=gc;Jy.displayName="@mantine/core/TableScrollContainer";const g5={withRowBorders:!0,verticalSpacing:7},y5=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:i,stripedColor:s,highlightOnHoverColor:l,striped:c,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Jt(r),"--table-vertical-spacing":Jt(o),"--table-border-color":i?gt(i,e):void 0,"--table-striped-color":c&&s?gt(s,e):void 0,"--table-highlight-on-hover-color":u&&l?gt(l,e):void 0,"--table-sticky-header-offset":f?z(d):void 0}}),me=Q((e,t)=>{const n=U("Table",g5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,horizontalSpacing:u,verticalSpacing:d,captionSide:f,stripedColor:h,highlightOnHoverColor:m,striped:g,highlightOnHover:y,withColumnBorders:C,withRowBorders:v,withTableBorder:x,borderColor:w,layout:S,variant:j,data:E,children:T,stickyHeader:P,stickyHeaderOffset:k,mod:D,...M}=n,R=le({name:"Table",props:n,className:o,style:i,classes:gc,classNames:r,styles:s,unstyled:l,rootSelector:"table",vars:c,varsResolver:y5});return b.createElement(d5,{value:{getStyles:R,stickyHeader:P,striped:g===!0?"odd":g||void 0,highlightOnHover:y,withColumnBorders:C,withRowBorders:v,captionSide:f||"bottom"}},b.createElement(W,{component:"table",variant:j,ref:t,mod:[{"data-with-table-border":x},D],...R("table"),...M},T||!!E&&b.createElement(Xy,{data:E})))});me.classes=gc;me.displayName="@mantine/core/Table";me.Td=Pj;me.Th=sm;me.Tr=Au;me.Thead=kj;me.Tbody=Rj;me.Tfoot=Dj;me.Caption=Ij;me.ScrollContainer=Jy;me.DataRenderer=Xy;const[v5,Zy]=Sn("Tabs component was not found in the tree");var yc={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 x5={},ev=Q((e,t)=>{const n=U("TabsList",x5,e),{children:r,className:o,grow:i,justify:s,classNames:l,styles:c,style:u,mod:d,...f}=n,h=Zy();return b.createElement(W,{...f,...h.getStyles("list",{className:o,style:u,classNames:l,styles:c,props:n,variant:h.variant}),ref:t,role:"tablist",variant:h.variant,mod:[{grow:i,orientation:h.orientation,placement:h.orientation==="vertical"&&h.placement,inverted:h.inverted},d],"aria-orientation":h.orientation,__vars:{"--tabs-justify":s}},r)});ev.classes=yc;ev.displayName="@mantine/core/TabsList";const w5={},tv=Q((e,t)=>{const n=U("TabsPanel",w5,e),{children:r,className:o,value:i,classNames:s,styles:l,style:c,mod:u,...d}=n,f=Zy(),h=f.value===i,m=f.keepMounted||n.keepMounted||h?r:null;return b.createElement(W,{...d,...f.getStyles("panel",{className:o,classNames:s,styles:l,style:[c,h?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:f.orientation},u],role:"tabpanel",id:f.getPanelId(i),"aria-labelledby":f.getTabId(i)},m)});tv.classes=yc;tv.displayName="@mantine/core/TabsPanel";const S5={},nv=Q((e,t)=>{const n=U("TabsTab",S5,e),{className:r,children:o,rightSection:i,leftSection:s,value:l,onClick:c,onKeyDown:u,disabled:d,color:f,style:h,classNames:m,styles:g,vars:y,mod:C,...v}=n,x=Rt(),{dir:w}=rs(),S=Zy(),j=l===S.value,E=P=>{S.onChange(S.allowTabDeactivation&&l===S.value?null:l),c==null||c(P)},T={classNames:m,styles:g,props:n};return b.createElement(Qn,{...v,...S.getStyles("tab",{className:r,style:h,variant:S.variant,...T}),disabled:d,unstyled:S.unstyled,variant:S.variant,mod:[{active:j,disabled:d,orientation:S.orientation,inverted:S.inverted,placement:S.orientation==="vertical"&&S.placement},C],ref:t,role:"tab",id:S.getTabId(l),"aria-selected":j,tabIndex:j||S.value===null?0:-1,"aria-controls":S.getPanelId(l),onClick:E,__vars:{"--tabs-color":f?gt(f,x):void 0},onKeyDown:pS({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:S.activateTabWithKeyboard,loop:S.loop,orientation:S.orientation||"horizontal",dir:w,onKeyDown:u})},s&&b.createElement("span",{...S.getStyles("tabSection",T),"data-position":"left"},s),o&&b.createElement("span",{...S.getStyles("tabLabel",T)},o),i&&b.createElement("span",{...S.getStyles("tabSection",T),"data-position":"right"},i))});nv.classes=yc;nv.displayName="@mantine/core/TabsTab";const f1="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",b5={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},C5=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":ut(t),"--tabs-color":gt(n,e),"--tabs-text-color":r?ns({color:n,theme:e}):void 0}}),He=Q((e,t)=>{const n=U("Tabs",b5,e),{defaultValue:r,value:o,onChange:i,orientation:s,children:l,loop:c,id:u,activateTabWithKeyboard:d,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:y,placement:C,keepMounted:v,classNames:x,styles:w,unstyled:S,className:j,style:E,vars:T,autoContrast:P,mod:k,...D}=n,M=bn(u),[R,O]=ln({value:o,defaultValue:r,finalValue:null,onChange:i}),N=le({name:"Tabs",props:n,classes:yc,className:j,style:E,classNames:x,styles:w,unstyled:S,vars:T,varsResolver:C5});return b.createElement(v5,{value:{placement:C,value:R,orientation:s,id:M,loop:c,activateTabWithKeyboard:d,getTabId:y0(`${M}-tab`,f1),getPanelId:y0(`${M}-panel`,f1),onChange:O,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:y,keepMounted:v,unstyled:S,getStyles:N}},b.createElement(W,{ref:t,id:M,variant:h,mod:[{orientation:s,inverted:s==="horizontal"&&y,placement:s==="vertical"&&C},k],...N("root"),...D},l))});He.classes=yc;He.displayName="@mantine/core/Tabs";He.Tab=nv;He.Panel=tv;He.List=ev;const E5={},se=Q((e,t)=>{const n=U("TextInput",E5,e);return b.createElement(hr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});se.classes=hr.classes;se.displayName="@mantine/core/TextInput";var _j={root:"m-7341320d"};const j5={},T5=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:s});return{root:{"--ti-size":Ce(t,"ti-size"),"--ti-radius":n===void 0?void 0:ut(n),"--ti-bg":i||r?l.background:void 0,"--ti-color":i||r?l.color:void 0,"--ti-bd":i||r?l.border:void 0}}},rv=Q((e,t)=>{const n=U("ThemeIcon",j5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,autoContrast:u,...d}=n,f=le({name:"ThemeIcon",classes:_j,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:T5});return b.createElement(W,{ref:t,...f("root"),...d})});rv.classes=_j;rv.displayName="@mantine/core/ThemeIcon";const P5=["h1","h2","h3","h4","h5","h6"];function k5(e,t){const n=t!==void 0?t:`h${e}`;return P5.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:{fontSize:z(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var Aj={root:"m-8a5d1357"};const R5={order:1},D5=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=k5(t,n);return{root:{"--title-fw":i.fontWeight,"--title-lh":i.lineHeight,"--title-fz":i.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},ce=Q((e,t)=>{const n=U("Title",R5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,order:c,vars:u,size:d,variant:f,lineClamp:h,textWrap:m,mod:g,...y}=n,C=le({name:"Title",props:n,classes:Aj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:D5});return[1,2,3,4,5,6].includes(c)?b.createElement(W,{...C("root"),component:`h${c}`,variant:f,ref:t,mod:[{order:c,"data-line-clamp":typeof h=="number"},g],size:d,...y}):null});ce.classes=Aj;ce.displayName="@mantine/core/Title";function I5(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(o){t=typeof o=="function"?o(t):o},setState(o){this.updateState(o),r.forEach(i=>i(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function _5(e){return p.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}const A5=()=>I5({notifications:[],queue:[],limit:5}),ps=A5(),N5=(e=ps)=>_5(e);function Oa(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]);e.setState({notifications:r.slice(0,n.limit),queue:r.slice(n.limit),limit:n.limit})}function de(e,t=ps){const n=e.id||Um();return Oa(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function Nj(e,t=ps){return Oa(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function dl(e,t=ps){return Oa(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function O5(e=ps){Oa(e,()=>[])}function M5(e=ps){Oa(e,t=>t.slice(0,e.getState().limit))}const Kr={show:de,hide:Nj,update:dl,clean:O5,cleanQueue:M5,updateState:Oa};function am(e,t){return am=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},am(e,t)}function Oj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,am(e,t)}var Mj={exports:{}},$5="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",L5=$5,F5=L5;function $j(){}function Lj(){}Lj.resetWarningCache=$j;var z5=function(){function e(r,o,i,s,l,c){if(c!==F5){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Lj,resetWarningCache:$j};return n.PropTypes=n,n};Mj.exports=z5();var B5=Mj.exports;const ze=Am(B5),h1={disabled:!1},gd=b.createContext(null);var U5=function(t){return t.scrollTop},fl="unmounted",Ri="exited",Di="entering",As="entered",lm="exiting",Ro=function(e){Oj(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=o,l=s&&!s.isMounting?r.enter:r.appear,c;return i.appearStatus=null,r.in?l?(c=Ri,i.appearStatus=Di):c=As:r.unmountOnExit||r.mountOnEnter?c=fl:c=Ri,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===fl?{status:Ri}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==Di&&s!==As&&(i=Di):(s===Di||s===As)&&(i=lm)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,s,l;return i=s=l=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,l=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:l}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Di){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:ul.findDOMNode(this);s&&U5(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ri&&this.setState({status:fl})},n.performEnter=function(o){var i=this,s=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[ul.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!o&&!s||h1.disabled){this.safeSetState({status:As},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Di},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:As},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),l=this.props.nodeRef?void 0:ul.findDOMNode(this);if(!i||h1.disabled){this.safeSetState({status:Ri},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:lm},function(){o.props.onExiting(l),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Ri},function(){o.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(l){s&&(s=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:ul.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!s||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===fl)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=Dy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return b.createElement(gd.Provider,{value:null},typeof s=="function"?s(o,l):b.cloneElement(b.Children.only(s),l))},t}(b.Component);Ro.contextType=gd;Ro.propTypes={};function Rs(){}Ro.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Rs,onEntering:Rs,onEntered:Rs,onExit:Rs,onExiting:Rs,onExited:Rs};Ro.UNMOUNTED=fl;Ro.EXITED=Ri;Ro.ENTERING=Di;Ro.ENTERED=As;Ro.EXITING=lm;const V5=Ro;function H5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ov(e,t){var n=function(i){return t&&p.isValidElement(i)?t(i):i},r=Object.create(null);return e&&p.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function W5(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var s,l={};for(var c in t){if(r[c])for(s=0;s<r[c].length;s++){var u=r[c][s];l[r[c][s]]=n(u)}l[c]=n(c)}for(s=0;s<o.length;s++)l[o[s]]=n(o[s]);return l}function Mi(e,t,n){return n[t]!=null?n[t]:e.props[t]}function q5(e,t){return ov(e.children,function(n){return p.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Mi(n,"appear",e),enter:Mi(n,"enter",e),exit:Mi(n,"exit",e)})})}function G5(e,t,n){var r=ov(e.children),o=W5(t,r);return Object.keys(o).forEach(function(i){var s=o[i];if(p.isValidElement(s)){var l=i in t,c=i in r,u=t[i],d=p.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=p.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:Mi(s,"exit",e),enter:Mi(s,"enter",e)}):!c&&l&&!d?o[i]=p.cloneElement(s,{in:!1}):c&&l&&p.isValidElement(u)&&(o[i]=p.cloneElement(s,{onExited:n.bind(null,s),in:u.props.in,exit:Mi(s,"exit",e),enter:Mi(s,"enter",e)}))}}),o}var Q5=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},K5={component:"div",childFactory:function(t){return t}},iv=function(e){Oj(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=i.handleExited.bind(H5(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var s=i.children,l=i.handleExited,c=i.firstRender;return{children:c?q5(o,l):G5(o,s,l),firstRender:!1}},n.handleExited=function(o,i){var s=ov(this.props.children);o.key in s||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=pd({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,i=o.component,s=o.childFactory,l=Dy(o,["component","childFactory"]),c=this.state.contextValue,u=Q5(this.state.children).map(s);return delete l.appear,delete l.enter,delete l.exit,i===null?b.createElement(gd.Provider,{value:c},u):b.createElement(gd.Provider,{value:c},b.createElement(i,l,u))},t}(b.Component);iv.propTypes={};iv.defaultProps=K5;const Y5=iv,p1={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},X5={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function J5({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,i]=n.split("-"),s=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:p1[s],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"},c={opacity:1,transform:X5[s]},u={opacity:0,maxHeight:0,transform:p1[s]};return{...l,...{entering:c,entered:c,exiting:u,exited:u}[e]}}function Z5(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const Fj=p.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:s,...l}=e,c=Z5(n,e.autoClose),u=p.useRef(),d=()=>window.clearTimeout(u.current),f=()=>{t(e.id),d()},h=()=>{typeof c=="number"&&(u.current=window.setTimeout(f,c))};return p.useEffect(()=>{var m;(m=e.onOpen)==null||m.call(e,e)},[]),p.useEffect(()=>(h(),d),[c]),b.createElement(Uy,{...r,...l,onClose:f,ref:o,onMouseEnter:d,onMouseLeave:h},s)});Fj.displayName="@mantine/notifications/NotificationContainer";var zj={root:"m-b37d9ac7",notification:"m-5ed0edd0"};const eO=V5,tO={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Ir("overlay"),store:ps,withinPortal:!0},nO=(e,{zIndex:t,position:n,containerWidth:r})=>{const[o,i]=n.split("-");return{root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-top":o==="top"?"var(--mantine-spacing-md)":void 0,"--notifications-bottom":o==="bottom"?"var(--mantine-spacing-md)":void 0,"--notifications-left":i==="left"?"var(--mantine-spacing-md)":i==="center"?"50%":void 0,"--notifications-right":i==="right"?"var(--mantine-spacing-md)":void 0,"--notifications-transform":i==="center"?"translateX(-50%)":void 0,"--notifications-container-width":z(r)}}},Do=Q((e,t)=>{const n=U("Notifications",tO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,position:u,autoClose:d,transitionDuration:f,containerWidth:h,notificationMaxHeight:m,limit:g,zIndex:y,store:C,portalProps:v,withinPortal:x,...w}=n,S=Rt(),j=N5(C),E=X2(),T=Hm(),P=p.useRef({}),k=p.useRef(0),M=(S.respectReducedMotion?T:!1)?1:f,R=le({name:"Notifications",classes:zj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:nO});p.useEffect(()=>{C==null||C.updateState(N=>({...N,limit:g||5}))},[g]),fo(()=>{j.notifications.length>k.current&&setTimeout(()=>E(),0),k.current=j.notifications.length},[j.notifications]);const O=j.notifications.map(({style:N,...B})=>b.createElement(eO,{key:B.id,timeout:M,onEnter:()=>P.current[B.id].offsetHeight,nodeRef:{current:P.current[B.id]}},I=>b.createElement(Fj,{ref:$=>{P.current[B.id]=$},data:B,onHide:$=>Nj($,C),autoClose:d,...R("notification",{style:{...J5({state:I,position:u,transitionDuration:M,maxHeight:m}),...N}})})));return b.createElement(as,{withinPortal:x,...v},b.createElement(W,{...R("root"),ref:t,...w},b.createElement(Y5,null,O)))});Do.classes=zj;Do.displayName="@mantine/notifications/Notifications";Do.show=Kr.show;Do.hide=Kr.hide;Do.update=Kr.update;Do.clean=Kr.clean;Do.cleanQueue=Kr.cleanQueue;Do.updateState=Kr.updateState;class rO{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class vc{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class oO{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(o,i){const s=o.consumeAndParse(n);return r(i,s)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,i,s){const l=o.consumeAndParse(n);return r(i,s,l)},precedence:n})}construct(t){return new iO(t,this.prefixParselets,this.infixParselets)}}class iO{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 o=r.parse(this,n);for(;t>this.getPrecedence();){const i=this.consume();o=this.getInfixParselet(i).parse(this,o,i)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){var r,o;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const i=this.peek();throw Error(`Expected ${t} but got "${i.id}" (${i.value}) at line ${i.line} column ${i.column}.`)}if(n&&((o=this.peek())==null?void 0:o.value)!==n){const i=this.peek();throw Error(`Expected "${n}" but got "${i.value}" at line ${i.line} column ${i.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]}}const Bj="ok",sO="created",aO="gone",lO="not-modified",cO="not-found",uO="forbidden",dO="accepted",fO={resourceType:"OperationOutcome",id:Bj,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},hO={resourceType:"OperationOutcome",id:cO,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},Uj={resourceType:"OperationOutcome",id:uO,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function ii(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},expression:t?[t]:void 0}]}}function Mt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function Rf(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function Vj(e){return e.id===Bj||e.id===sO||e.id===lO||e.id===dO}function pO(e){return e.id===aO}class Ve extends Error{constructor(t,n){super(Hj(t)),this.outcome=t,this.cause=n}}function ct(e){return e instanceof Ve?e.outcome:Rf(e)?e:ii(Re(e))}function Re(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Rf(e)?Hj(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function Hj(e){var n;const t=((n=e.issue)==null?void 0:n.map(Wj))??[];return t.length>0?t.join("; "):"Unknown error"}function Wj(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 wt(e){const t=pt(e),n=xo(e);return n===t?{reference:t}:{reference:t,display:n}}function pt(e){return ys(e)?e.reference:`${e.resourceType}/${e.id}`}function sv(e){if(e)return ys(e)?e.reference.split("/")[1]:e.id}function mO(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function xo(e){var t;if(mO(e)){const n=gO(e);if(n)return n}if(e.resourceType==="Device"){const n=yO(e);if(n)return n}return e.resourceType==="Observation"&&"code"in e&&(t=e.code)!=null&&t.text?e.code.text:e.resourceType==="User"&&e.email?e.email:"name"in e&&e.name&&typeof e.name=="string"?e.name:pt(e)}function gO(e){const t=e.name;if(t&&t.length>0)return Sc(t[0])}function yO(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function vO(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=m1(n);if(r)return r}else return m1(t)}function m1(e){if(e.url&&e.contentType&&e.contentType.startsWith("image/"))return e.url}function qj(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const o=n.getUTCFullYear(),i=n.getUTCMonth(),s=n.getUTCDate(),l=r.getUTCFullYear(),c=r.getUTCMonth(),u=r.getUTCDate();let d=l-o;(c<i||c===i&&u<s)&&d--;let f=l*12+c-(o*12+i);u<s&&f--;const h=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:d,months:f,days:h}}function xO(e,t){const{years:n,months:r,days:o}=qj(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function xc(e,...t){var r;let n=e;for(let o=0;o<t.length&&n;o++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(i=>i.url===t[o]);return n}function Ln(e,t){return JSON.stringify(e,wO,t?2:void 0)}function wO(e,t){return!SO(e)&&Zt(t)?void 0:t}function SO(e){return!!/\d+$/.exec(e)}function Zt(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Df(e):!1}function Df(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 wc(e,t,n){return e===t||Zt(e)&&Zt(t)?!0:Zt(e)||Zt(t)?!1:Array.isArray(e)&&Array.isArray(t)?bO(e,t):Array.isArray(e)||Array.isArray(t)?!1:Ko(e)&&Ko(t)?CO(e,t,n):(Ko(e)||Ko(t),!1)}function bO(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!wc(e[n],t[n]))return!1;return!0}function CO(e,t,n){const r=new Set;Object.keys(e).forEach(o=>r.add(o)),Object.keys(t).forEach(o=>r.add(o)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const o of r){const i=e[o],s=t[o];if(!wc(i,s,o))return!1}return!0}function av(e,t){return Zt(e)?!0:Zt(t)?!1:Array.isArray(e)&&Array.isArray(t)?EO(e,t):Array.isArray(e)||Array.isArray(t)?!1:Ko(e)&&Ko(t)?jO(e,t):Ko(e)||Ko(t)?!1:e===t}function EO(e,t){return t.every(n=>e.some(r=>av(r,n)))}function jO(e,t){return Object.entries(t).every(([n,r])=>n in e&&av(e[n],r))}function vi(e){return JSON.parse(JSON.stringify(e))}function Gj(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function Ko(e){return e!==null&&typeof e=="object"}const Qj=[];for(let e=0;e<256;e++)Qj.push(e.toString(16).padStart(2,"0"));function TO(e){const t=new Uint8Array(e),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Qj[t[r]];return n.join("")}function PO(e){const t=new Uint8Array(e),n=[];for(let r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return window.btoa(n.join(""))}function nn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function kO(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(o=>o.system===t))==null?void 0:r.code}function RO(e){if(e)return Array.isArray(e)?e:[e]}const g1=e=>new Promise(t=>{setTimeout(t,e)});function DO(e,t,n){const r=[];for(let o=0;o<n-1;o++){let i=e.indexOf(t);i<0&&(i=e.length),r.push(e.slice(0,i)),e=e.slice(i+t.length)}return e&&r.push(e),r}function Xa(e,t){return e?(e.push(t),e):[t]}function IO(e,t){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.all||t!=null&&t.use)&&n.push("["+e.use+"]"),n.join((t==null?void 0:t.lineSeparator)??", ").trim()}function Sc(e,t){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=ql(e.text);if(r)return r}return n.join(" ").trim()}function If(e){return e instanceof Date&&!isNaN(e.getTime())}function _O(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return If(r)?r.toLocaleTimeString(t,n):""}function Fn(e,t,n){if(!e)return"";const r=new Date(e);return If(r)?r.toLocaleString(t,n):""}function AO(e,t,n){return!e||!e.start&&!e.end?"":Fn(e.start,t,n)+" - "+Fn(e.end,t,n)}const NO={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},OO={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},MO={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function Kj(e){if(!e)return"";const t=[];return $O(t,e.repeat),e.event&&t.push(e.event.map(n=>Fn(n)).join(", ")),nn(t.join(" ").trim())}function $O(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(NO[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+OO[o]):e.push("per "+r+" "+MO[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(nn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>_O(i)).join(", "))}function Wl(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},o=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(o==null?void 0:o.value)===void 0?n&&t!==void 0?(r.value=zO(r.value,t),`> ${zo(r,t)}`):`>= ${zo(r,t)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=FO(o.value,t),`< ${zo(o,t)}`):`<= ${zo(o,t)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${zo(r,t)} - ${zo(o,t)}`)}function zo(e,t){if(!e)return"";const n=[];return e.comparator&&(n.push(e.comparator),n.push(" ")),e.value!==void 0&&(t!==void 0?n.push(e.value.toFixed(t)):n.push(e.value)),e.unit&&(e.unit!=="%"&&n[n.length-1]!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function LO(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function wa(e){if(!e)return"";const t=ql(e.text);return t||(e.coding?e.coding.map(n=>ms(n)).join(", "):"")}function ms(e){return ql(e==null?void 0:e.display)??ql(e==null?void 0:e.code)??""}function Yj(e){if(!e)return"";if("component"in e)return e.component.map(n=>Yj(n)).join(" / ");if(e.valueQuantity)return zo(e.valueQuantity);if(e.valueCodeableConcept)return wa(e.valueCodeableConcept);const t=ql(e.valueString);return t||""}function ql(e){return typeof e=="string"?e:void 0}function FO(e,t,n=1){return(Xj(e,t)+n)*Math.pow(10,-t)}function zO(e,t,n=1){return(Xj(e,t)-n)*Math.pow(10,-t)}function Xj(e,t){return t===void 0?e:Math.round(e*Math.pow(10,t))}function BO(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 UO(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,i])=>[o,BO(o,i)])),constraints:[],innerTypes:[]};return t}const VO={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},HO={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},WO={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"}]}}},qO={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"}]}}},GO={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"}]}}},QO={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"}]}}},KO={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},YO={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"}]}}},XO={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},JO={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"}]}}},ZO={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"}]}}},eM={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"}]}}},tM={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"}]}}},nM={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"}]}}},rM={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"]}]}}},oM={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"}]}}},iM={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"}]}}},sM={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"}]}}},aM={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"}]}}},lM={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"}]}}},cM={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"]}]}}},uM={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"}]}}},dM={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"}]},account:{type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},fM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},hM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},pM={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"]}]}}},mM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},gM={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"}]}}},yM={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"}]}}},vM={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"}]}}},xM={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"}]}}},wM={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"]}]}}},SM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},bM={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"}]}}},CM={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"]}]}}},EM={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"}]}}},jM={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"}]}}},TM={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"}]}}},PM={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"}]}}},kM={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"}]}}},RM={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"]}]}}},DM={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"}]}}},IM={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"}]}}},_M={elements:{id:{type:[{code:"string"}]},meta:{type:[{code:"Meta"}]},implicitRules:{type:[{code:"uri"}]},language:{type:[{code:"code"}]},text:{type:[{code:"Narrative"}]},contained:{max:9007199254740991,type:[{code:"Resource"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},url:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},name:{type:[{code:"string"}]},title:{type:[{code:"string"}]},status:{min:1,type:[{code:"code"}]},experimental:{type:[{code:"boolean"}]},date:{type:[{code:"dateTime"}]},publisher:{type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]},description:{type:[{code:"markdown"}]},useContext:{max:9007199254740991,type:[{code:"UsageContext"}]},jurisdiction:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},AM={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"}]}}},NM={Element:VO,BackboneElement:HO,Address:WO,Age:qO,Annotation:GO,Attachment:QO,CodeableConcept:KO,Coding:YO,ContactDetail:XO,ContactPoint:JO,Contributor:ZO,Count:eM,DataRequirement:tM,Distance:nM,Dosage:rM,Duration:oM,ElementDefinition:iM,Expression:sM,Extension:aM,HumanName:lM,Identifier:cM,MarketingStatus:uM,Meta:dM,Money:fM,Narrative:hM,ParameterDefinition:pM,Period:mM,Population:gM,ProdCharacteristic:yM,ProductShelfLife:vM,Quantity:xM,Range:wM,Ratio:SM,Reference:bM,RelatedArtifact:CM,SampledData:EM,Signature:jM,SubstanceAmount:TM,Timing:PM,TriggerDefinition:kM,UsageContext:RM,MoneyQuantity:DM,SimpleQuantity:IM,MetadataResource:_M,IdentityProvider:AM},OM="http://hl7.org",Jj={base64Binary:/^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/,canonical:/^\S*$/,code:/^[^\s]+( [^\s]+)*$/,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)?)?)?$/,id:/^[A-Za-z0-9\-.]{1,64}$/,instant:/^(\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))$/,markdown:/^[\s\S]+$/,oid:/^urn:oid:[0-2](\.(0|[1-9]\d*))+$/,string:/^[\s\S]+$/,time:/^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/,uri:/^\S*$/,url:/^\S*$/,uuid:/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,xhtml:/.*/};function MM(e,t){return!(t.pattern&&!av(e,t.pattern)||t.fixed&&!wc(e,t.fixed))}function $M(e,t,n,r){if(Array.isArray(e))return!1;const o=(r??n.elements)[t.path],i=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(MM(e,o))return!0;break;case"type":return!e||!(i!=null&&i.length)?!1:i.some(s=>s.code===e.type)}return!1}function ye(e){return[{type:V.boolean,value:e}]}function eo(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:V.integer,value:e}:typeof e=="number"?{type:V.decimal,value:e}:typeof e=="boolean"?{type:V.boolean,value:e}:typeof e=="string"?{type:V.string,value:e}:ir(e)?{type:V.Quantity,value:e}:Io(e)?{type:e.resourceType,value:e}:{type:V.BackboneElement,value:e}}function Yo(e){return e.length===0?!1:!!e[0].value}function wo(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 vn(e,t){if(!e.value)return;const n=gs(e.type,t);return n?lv(e.value,t,n):LM(e,t)}function lv(e,t,n){const r=n.type;if(!r||r.length===0)return;let o,i="undefined",s;if(n.path.endsWith("[x]")){const l=n.path.split(".").pop().replace("[x]","");for(const c of r){const u=l+nn(c.code);if(o=e[u],s=e["_"+u],o!==void 0||s!==void 0){i=c.code;break}}}else console.assert(r.length===1,"Expected single type",n.path),o=e[t],i=r[0].code,s=e["_"+t];if(s)if(Array.isArray(o))for(let l=0;l<Math.max(o.length,s.length);l++)o[l]=w1(o[l],s[l]);else o=w1(o,s);if(!Zt(o))return(i==="Element"||i==="BackboneElement")&&(i=n.type[0].code),Array.isArray(o)?o.map(l=>y1(l,i)):y1(o,i)}function y1(e,t){return t==="Resource"&&Io(e)&&(t=e.resourceType),{type:t,value:e}}function LM(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n)r=n[t];else for(const o in V){const i=t+nn(o);if(i in n){r=n[i];break}}if(!Zt(r))return Array.isArray(r)?r.map(eo):eo(r)}function Zj(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(Yo(nT(n,o))){r=!0;break}r||t.push(n)}return t}function eT(e){return ye(!Yo(e))}function tT(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?ye(!1):ye(e.every((n,r)=>Yo(nT(n,t[r]))))}function nT(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?ye(Math.abs(n-r)<1e-8):ir(n)&&ir(r)?ye(iT(n,r)):ye(typeof n=="object"&&typeof r=="object"?cv(e,t):n===r)}function rT(e,t){return e.length===0&&t.length===0?ye(!0):e.length!==t.length?ye(!1):(e.sort(v1),t.sort(v1),ye(e.every((n,r)=>Yo(FM(n,t[r])))))}function FM(e,t){const{type:n,value:r}=e,{type:o,value:i}=t,s=r==null?void 0:r.valueOf(),l=i==null?void 0:i.valueOf();return typeof s=="number"&&typeof l=="number"?ye(Math.abs(s-l)<.01):ir(s)&&ir(l)?ye(iT(s,l)):ye(n==="Coding"&&o==="Coding"?typeof s!="object"||typeof l!="object"?!1:s.code===l.code&&s.system===l.system:typeof s=="object"&&typeof l=="object"?cv({...s,id:void 0},{...l,id:void 0}):typeof s=="string"&&typeof l=="string"?s.toLowerCase()===l.toLowerCase():s===l)}function v1(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function oT(e,t){const{value:n}=e;if(n==null)return!1;switch(t){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return zM(n);case"DateTime":return cm(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return BM(n);case"Quantity":return ir(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function zM(e){return typeof e=="string"&&!!Jj.date.exec(e)}function cm(e){return typeof e=="string"&&!!Jj.dateTime.exec(e)}function BM(e){return!!(e&&typeof e=="object"&&("start"in e&&cm(e.start)||"end"in e&&cm(e.end)))}function ir(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function iT(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 cv(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o],s=t[o];if(x1(i)&&x1(s)){if(!cv(i,s))return!1}else if(i!==s)return!1}return!0}function x1(e){return e!==null&&typeof e=="object"}function w1(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return UM(e??{},t)}return e}function UM(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function VM(e){return new qM(e).parse()}const sT=UO(NM),uv=Object.create(null),S1=Object.create(null);function dv(e){let t;return e?(t=S1[e],t||(t=S1[e]=Object.create(null))):t=sT,t}function b1(e,t){var r;const n=Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(o=>o.resource))??[];for(const o of n)HM(o,t)}function HM(e,t){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const n=VM(e),r=dv(t);r[e.name]=n,t&&e.url===t&&(uv[t]=n);for(const o of n.innerTypes)o.parentType=n,r[o.name]=o}function aT(e){return!!sT[e]}function fv(e,t){return dv(t)[e]}function WM(e,t){const n=dv(t)[e];if(!n)throw new Ve(ii("Unknown data type: "+e));return n}function lT(e){return!!uv[e]}function _f(e){return uv[e]}class qM{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,title:t.title,type:t.type,url:t.url,kind:t.kind,description:KM(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,o,i,s;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 l=Wh(t,this.slicingContext.path);this.slicingContext.current.elements[l]=this.parseElementDefinition(t)}}else{const l=this.parseElementDefinition(t);this.checkFieldEnter(t,l);let c=this.backboneContext;for(;c;){if((o=t.path)!=null&&o.startsWith(c.path+".")){c.type.elements[Wh(t,c.path)]=l;break}c=c.parent}if(!c){const u=Wh(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((s=this.resourceSchema.mandatoryProperties)==null||s.add(u.replace("[x]",""))),this.resourceSchema.elements[u]=l}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),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var n,r,o;for(;this.backboneContext&&!Ds((n=this.backboneContext)==null?void 0:n.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;this.backboneContext={type:{name:j1(t),title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:Ds((r=this.backboneContext)==null?void 0:r.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,n){var r,o,i,s;QM(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((o=t.slicing)==null?void 0:o.discriminator)??[]).map(l=>{if(l.type!=="value"&&l.type!=="pattern"&&l.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${l.type}`);return{path:l.path,type:l.type}}),slices:[],ordered:((i=t.slicing)==null?void 0:i.ordered)??!1,rule:(s=t.slicing)==null?void 0:s.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){var n;if(this.backboneContext&&!Ds(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&&!Ds(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),delete this.backboneContext;this.slicingContext&&!Ds(this.slicingContext.path,t==null?void 0:t.path)&&((n=this.slicingContext)!=null&&n.current&&this.slicingContext.field.slices.push(this.slicingContext.current),delete this.slicingContext)}next(){const t=this.peek();if(t)return this.index++,t}peek(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const n=this.elementIndex[t.contentReference.slice(t.contentReference.indexOf("#")+1)];return n?{...n,id:t.id,path:t.path,min:t.min??n.min,max:t.max??n.max,contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(Ds(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(o=>["BackboneElement","Element"].includes(o.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext.current={name:t.sliceName??"",path:t.path??"",definition:t.definition,type:this.parseElementDefinitionType(t),elements:{},min:t.min??0,max:t.max==="*"?Number.POSITIVE_INFINITY:Number.parseInt(t.max,10)}}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var o;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=j1(t)),r||(r=(o=xc(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:o.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var i,s;const n=C1(t.max),r=(i=t.base)!=null&&i.max?C1(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((s=t.base)==null?void 0:s.path)||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(l=>({key:l.key??"",severity:l.severity??"error",expression:l.expression??"",description:l.human??""})),type:this.parseElementDefinitionType(t),fixed:E1(vn(o,"fixed[x]")),pattern:E1(vn(o,"pattern[x]")),binding:t.binding}}}function C1(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Wh(e,t=""){return GM(e.path,t)}function GM(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Ds(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function E1(e){return Array.isArray(e)&&e.length>0?e[0]:Zt(e)?void 0:e}function QM(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function KM(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}const V={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 YM(e){for(const t of e.base??[]){let n=di.types[t];n||(n={searchParamsDetails:{}},di.types[t]=n),n.searchParams||(n.searchParams={_id:{base:[t],code:"_id",type:"token",expression:t+".id"},_lastUpdated:{base:[t],code:"_lastUpdated",type:"date",expression:t+".meta.lastUpdated"},_compartment:{base:[t],code:"_compartment",type:"reference",expression:t+".meta.compartment"},_profile:{base:[t],code:"_profile",type:"uri",expression:t+".meta.profile"},_security:{base:[t],code:"_security",type:"token",expression:t+".meta.security"},_source:{base:[t],code:"_source",type:"uri",expression:t+".meta.source"},_tag:{base:[t],code:"_tag",type:"token",expression:t+".meta.tag"}}),n.searchParams[e.code]=e}}function j1(e){var n,r,o,i;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?XM((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function XM(e){return e.length===1?e[0]:e.map(nn).join("")}function hv(e){var t;return(t=di.types[e])==null?void 0:t.searchParams}function JM(e,t){var n,r;return(r=(n=di.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function yd(e){const t=e.replaceAll("[x]","").split(".").pop();return cT(t)}function cT(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(e$).join(" ").replace("_"," ").replace(/\s+/g," ")}const ZM=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function e$(e){const t=e.toUpperCase();return e===t?e:ZM.has(t)?t:t.charAt(0)+e.slice(1)}function gs(e,t){const n=fv(e);if(n)return uT(n.elements,t)}function uT(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const o=t[r];if(o>="A"&&o<="Z"){const i=t.slice(0,r)+"[x]",s=e[i];if(s)return s}}}function Io(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function ys(e){return!!(e&&typeof e=="object"&&"reference"in e)}const di={types:{}};function Nu(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 Ja=()=>[],kn={empty:(e,t)=>ye(t.length===0),hasValue:(e,t)=>ye(t.length!==0),exists:(e,t,n)=>ye(n?t.filter(r=>Yo(n.eval(e,[r]))).length>0:t.length>0),all:(e,t,n)=>ye(t.every(r=>Yo(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return ye(!1);return ye(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return ye(!0);return ye(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return ye(!1);return ye(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return ye(!0);return ye(!1)},subsetOf:Ja,supersetOf:Ja,count:(e,t)=>[{type:V.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>ye(t.length===kn.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>Yo(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval(e,[r])).flat(),repeat:Ja,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 o;const r=(o=n.eval(e,t)[0])==null?void 0:o.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 o;const r=(o=n.eval(e,t)[0])==null?void 0:o.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,t),o=[];for(const i of t)!o.some(s=>s.value===i.value)&&r.some(s=>s.value===i.value)&&o.push(i);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t),o=[];for(const i of t)r.some(s=>s.value===i.value)||o.push(i);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t);return Zj([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t);return[...t,...r]},htmlChecks:(e,t,n)=>[eo(!0)],iif:(e,t,n,r,o)=>{const i=n.eval(e,t);if(i.length>1||i.length===1&&typeof i[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return Yo(i)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Vr(t,1);if(typeof n=="boolean")return[{type:V.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return ye(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return ye(!0);if(["false","f","no","n","0","0.0"].includes(r))return ye(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:ye(kn.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Vr(t,1);return typeof n=="number"?[{type:V.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:V.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:V.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:ye(kn.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Vr(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:V.date,value:Nu(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:ye(kn.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Vr(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:V.dateTime,value:Nu(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:ye(kn.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Vr(t,1);return typeof n=="number"?[{type:V.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:V.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:V.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:ye(kn.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Vr(t,1);return ir(n)?[{type:V.Quantity,value:n}]:typeof n=="number"?[{type:V.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:V.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:V.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:ye(kn.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Vr(t,1);return n==null?[]:ir(n)?[{type:V.string,value:`${n.value} '${n.unit}'`}]:[{type:V.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:ye(kn.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Vr(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:V.time,value:Nu("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:ye(kn.toTime(e,t).length===1),indexOf:(e,t,n)=>Jn((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>Jn((o,i,s)=>{const l=i,c=s?l+s:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,n,r),startsWith:(e,t,n)=>Jn((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>Jn((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>Jn((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>Jn(n=>n.toUpperCase(),e,t),lower:(e,t)=>Jn(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>Jn((o,i,s)=>o.replaceAll(i,s),e,t,n,r),matches:(e,t,n)=>Jn((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>Jn((o,i,s)=>o.replaceAll(i,s),e,t,n,r),length:(e,t)=>Jn(n=>n.length,e,t),toChars:(e,t)=>Jn(n=>n?n.split(""):void 0,e,t),abs:(e,t)=>zr(Math.abs,e,t),ceiling:(e,t)=>zr(Math.ceil,e,t),exp:(e,t)=>zr(Math.exp,e,t),floor:(e,t)=>zr(Math.floor,e,t),ln:(e,t)=>zr(Math.log,e,t),log:(e,t,n)=>zr((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>zr(Math.pow,e,t,n),round:(e,t)=>zr(Math.round,e,t),sqrt:(e,t)=>zr(Math.sqrt,e,t),truncate:(e,t)=>zr(n=>n|0,e,t),children:Ja,descendants:Ja,trace:(e,t,n)=>t,now:()=>[{type:V.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:V.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:V.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var u;const i=kn.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const s=kn.toDateTime(e,r.eval(e,t));if(s.length===0)throw new Error("Invalid end date");const l=(u=o.eval(e,t)[0])==null?void 0:u.value;if(l!=="years"&&l!=="months"&&l!=="days")throw new Error("Invalid units");const c=qj(i[0].value,s[0].value);return[{type:V.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,n)=>{let r="";return n instanceof pv?r=n.name:n instanceof gv&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:V.boolean,value:oT(o,r)})):[]},not:(e,t)=>kn.toBoolean(e,t).map(n=>({type:V.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const i=r;if(i.resource)return eo(i.resource);i.reference?o=i.reference:i.type&&i.identifier&&(o=`${i.type}?identifier=${i.identifier.system}|${i.identifier.value}`)}if(o!=null&&o.includes("?")){const[i]=o.split("?");return{type:i,value:{resourceType:i}}}if(o!=null&&o.includes("/")){const[i,s]=o.split("/");return{type:i,value:{resourceType:i,id:s}}}return{type:V.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:V.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:V.BackboneElement,value:{namespace:"System",name:"Integer"}}:Io(n)?{type:V.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:V.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(i=>{var s;return{type:V.boolean,value:((s=i.value)==null?void 0:s.resourceType)===o}})}};function Jn(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Vr(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...r.map(s=>{var l;return(l=s==null?void 0:s.eval(t,n)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(eo):[eo(i)]}function zr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Vr(n,1),i=ir(o),s=i?o.value:o;if(typeof s!="number")throw new Error("Math function cannot be called with non-number");const l=e(s,...r.map(d=>{var f;return(f=d.eval(t,n)[0])==null?void 0:f.value})),c=i?V.Quantity:n[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function Vr(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}class t${constructor(t,n){this.original=t,this.child=n}eval(t,n){try{return n.length>0?n.map(r=>this.child.eval(t,[r])).flat():this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`)}}toString(){return this.child.toString()}}class Is{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class pv{constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=t.variables[this.name];if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(o=>this.evalValue(o)).filter(o=>(o==null?void 0:o.value)!==void 0)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return Io(n)&&n.resourceType===this.name?t:vn(t,this.name)}toString(){return this.name}}class n${eval(){return[]}toString(){return"{}"}}class r$ extends rO{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 mv extends vc{constructor(t,n){super("as",t,n)}eval(t,n){return kn.ofType(t,this.left.eval(t,n),this.right)}}class zn extends vc{}class yr extends zn{constructor(t,n,r,o){super(t,n,r),this.impl=o}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.eval(t,n);if(o.length!==1)return[];const i=r[0].value,s=o[0].value,l=ir(i)?i.value:i,c=ir(s)?s.value:s,u=this.impl(l,c);return typeof u=="boolean"?ye(u):ir(i)?[{type:V.Quantity,value:{...i,value:u}}]:[eo(u)]}}class o$ extends vc{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),i=[...r,...o];return i.length>0&&i.every(s=>typeof s.value=="string")?[{type:V.string,value:i.map(s=>s.value).join("")}]:i}}class i$ extends zn{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return ye(r.some(i=>i.value===o[0].value))}}class s$ extends zn{constructor(t,n){super("in",t,n)}eval(t,n){const r=wo(this.left.eval(t,n)),o=this.right.eval(t,n);return r?ye(o.some(i=>i.value===r.value)):[]}}class gv extends vc{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 dT extends vc{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Zj([...r,...o])}}class a$ extends zn{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return tT(r,o)}}class l$ extends zn{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return eT(tT(r,o))}}class c$ extends zn{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return rT(r,o)}}class u$ extends zn{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return eT(rT(r,o))}}class yv extends zn{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.name;return ye(oT(r[0],o))}}class d$ extends zn{constructor(t,n){super("and",t,n)}eval(t,n){const r=wo(this.left.eval(t,n),"boolean"),o=wo(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(o==null?void 0:o.value)===!0?ye(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?ye(!1):[]}}class f$ extends zn{constructor(t,n){super("or",t,n)}eval(t,n){const r=wo(this.left.eval(t,n),"boolean"),o=wo(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(o==null?void 0:o.value)===!1?ye(!1):r!=null&&r.value||o!=null&&o.value?ye(!0):[]}}class h$ extends zn{constructor(t,n){super("xor",t,n)}eval(t,n){const r=wo(this.left.eval(t,n),"boolean"),o=wo(this.right.eval(t,n),"boolean");return!r||!o?[]:ye(r.value!==o.value)}}class p$ extends zn{constructor(t,n){super("implies",t,n)}eval(t,n){const r=wo(this.left.eval(t,n),"boolean"),o=wo(this.right.eval(t,n),"boolean");return(o==null?void 0:o.value)===!0||(r==null?void 0:r.value)===!1?ye(!0):!r||!o?[]:ye(!1)}}class vv{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=kn[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 xv{constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const o=r[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const i=this.left.eval(t,n);return o in i?[i[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const m$=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class g${constructor(t,n,r,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(o!=null&&o.dateTimeLiterals),this.symbolRegex=(o==null?void 0:o.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'?this.consumeString(t):t==="`"?this.consumeBacktickSymbol():t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():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()!==`
84
+ `))}consumeString(t){this.advance();const n=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t));return this.advance(),n}consumeBacktickSymbol(){this.advance();const t=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),t}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;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()))));let o=this.str.substring(t,this.pos.index);return o.endsWith("T")?o=o.substring(0,o.length-1):!o.startsWith("T")&&n&&!r&&(o+="Z"),this.buildToken("DateTime",o)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&y$(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()===`
85
+ `?(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 y$(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&m$.includes(e.value)))}const v$=["true","false"],x$=["!=","!~","<=",">=","{}","->"];function w$(e){return new g$(e,v$,x$).tokenize()}const Ye={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,IntegerDivide: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,Arrow:100,Semicolon:200},S$={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}},b$={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new xv(t,n)},precedence:Ye.Indexer},C$={parse(e,t){if(!(t instanceof pv))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new vv(t.name,n)},precedence:Ye.FunctionCall};function E$(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 j$(){return new oO().registerPrefix("String",{parse:(e,t)=>new Is({type:V.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Is({type:V.dateTime,value:Nu(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Is({type:V.Quantity,value:E$(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Is({type:t.value.includes(".")?V.decimal:V.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Is({type:V.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Is({type:V.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new pv(t.value)}).registerPrefix("{}",{parse:()=>new n$}).registerPrefix("(",S$).registerInfix("[",b$).registerInfix("(",C$).prefix("+",Ye.UnaryAdd,(e,t)=>new r$("+",t,n=>n)).prefix("-",Ye.UnarySubtract,(e,t)=>new yr("-",t,t,(n,r)=>-r)).infixLeft(".",Ye.Dot,(e,t,n)=>new gv(e,n)).infixLeft("/",Ye.Divide,(e,t,n)=>new yr("/",e,n,(r,o)=>r/o)).infixLeft("*",Ye.Multiply,(e,t,n)=>new yr("*",e,n,(r,o)=>r*o)).infixLeft("+",Ye.Add,(e,t,n)=>new yr("+",e,n,(r,o)=>r+o)).infixLeft("-",Ye.Subtract,(e,t,n)=>new yr("-",e,n,(r,o)=>r-o)).infixLeft("|",Ye.Union,(e,t,n)=>new dT(e,n)).infixLeft("=",Ye.Equals,(e,t,n)=>new a$(e,n)).infixLeft("!=",Ye.NotEquals,(e,t,n)=>new l$(e,n)).infixLeft("~",Ye.Equivalent,(e,t,n)=>new c$(e,n)).infixLeft("!~",Ye.NotEquivalent,(e,t,n)=>new u$(e,n)).infixLeft("<",Ye.LessThan,(e,t,n)=>new yr("<",e,n,(r,o)=>r<o)).infixLeft("<=",Ye.LessThanOrEquals,(e,t,n)=>new yr("<=",e,n,(r,o)=>r<=o)).infixLeft(">",Ye.GreaterThan,(e,t,n)=>new yr(">",e,n,(r,o)=>r>o)).infixLeft(">=",Ye.GreaterThanOrEquals,(e,t,n)=>new yr(">=",e,n,(r,o)=>r>=o)).infixLeft("&",Ye.Ampersand,(e,t,n)=>new o$(e,n)).infixLeft("and",Ye.And,(e,t,n)=>new d$(e,n)).infixLeft("as",Ye.As,(e,t,n)=>new mv(e,n)).infixLeft("contains",Ye.Contains,(e,t,n)=>new i$(e,n)).infixLeft("div",Ye.Divide,(e,t,n)=>new yr("div",e,n,(r,o)=>r/o|0)).infixLeft("in",Ye.In,(e,t,n)=>new s$(e,n)).infixLeft("is",Ye.Is,(e,t,n)=>new yv(e,n)).infixLeft("mod",Ye.Modulo,(e,t,n)=>new yr("mod",e,n,(r,o)=>r%o)).infixLeft("or",Ye.Or,(e,t,n)=>new f$(e,n)).infixLeft("xor",Ye.Xor,(e,t,n)=>new h$(e,n)).infixLeft("implies",Ye.Implies,(e,t,n)=>new p$(e,n))}const T$=j$();function fT(e){return new t$(e,T$.construct(w$(e)).consumeAndParse())}function P$(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const o=n[r];typeof o=="object"&&"type"in o&&"value"in o||(n[r]=eo(n[r]))}return Gl(e,n).map(r=>r.value)}function Gl(e,t,n){const r=n??{};return fT(e).eval({variables:r},t).map(i=>{var s;return{type:i.type,value:(s=i.value)==null?void 0:s.valueOf()}})}var Bo=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.QUANTITY="QUANTITY",e.TEXT="TEXT",e.REFERENCE="REFERENCE",e.CANONICAL="CANONICAL",e.DATE="DATE",e.DATETIME="DATETIME",e.PERIOD="PERIOD",e.UUID="UUID",e))(Bo||{});function Af(e,t){var r,o;let n=(o=(r=di.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=R$(e,t)),n}function k$(e,t,n){const r=di.types[e];r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function R$(e,t){const n=t.code,r=_$(n),o=N$(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=bl(l);c.length===1&&c[0]instanceof zn?i.propertyTypes.add("boolean"):hT(i,bl(l),e,1)}const s={columnName:r,type:A$(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return k$(e,n,s),s}function hT(e,t,n,r){const o=t[r];if(o instanceof mv){e.propertyTypes.add(o.right.toString());return}if(o instanceof vv){D$(e,o);return}const i=o.toString(),s=gs(n,i);if(!s)throw new Error(`Element definition not found for ${n} ${i}`);let l=!1,c=r+1;if(c<t.length&&t[c]instanceof xv&&(l=!0,c++),s.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(s);for(const u of s.type)e.propertyTypes.add(u.code);return}for(const u of s.type){let d=u.code;I$(d)&&(d=s.type[0].code),hT(e,t,d,c)}}function D$(e,t){if(t.name==="as"){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 yv){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function I$(e){return e==="Element"||e==="BackboneElement"}function _$(e){return e.split("-").reduce((t,n,r)=>t+(r?nn(n):n),"")}function A$(e,t){switch(e.type){case"date":return t.size===1&&t.has(V.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(V.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(V.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function N$(e,t){const n=[],r=fT(t);return um(e,r.child,n),n}function um(e,t,n){t instanceof dT?(um(e,t.left,n),um(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function bl(e){if(e instanceof mv||e instanceof xv)return[bl(e.left),e].flat();if(e instanceof zn)return[e];if(e instanceof gv)return[bl(e.left),bl(e.right)].flat();if(e instanceof vv){if(e.name==="where"&&!(e.args[0]instanceof yv))return[];if(e.name==="last")return[]}return[e]}const bc=20;var ne=(e=>(e.EQUALS="eq",e.NOT_EQUALS="ne",e.GREATER_THAN="gt",e.LESS_THAN="lt",e.GREATER_THAN_OR_EQUALS="ge",e.LESS_THAN_OR_EQUALS="le",e.STARTS_AFTER="sa",e.ENDS_BEFORE="eb",e.APPROXIMATELY="ap",e.CONTAINS="contains",e.EXACT="exact",e.TEXT="text",e.NOT="not",e.ABOVE="above",e.BELOW="below",e.IN="in",e.NOT_IN="not-in",e.OF_TYPE="of-type",e.MISSING="missing",e.IDENTIFIER="identifier",e.ITERATE="iterate",e))(ne||{});const pT={contains:"contains",exact:"exact",above:"above",below:"below",text:"text",not:"not",in:"in","not-in":"not-in","of-type":"of-type",missing:"missing",identifier:"identifier",iterate:"iterate"},wv={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function O$(e){let t;for(const n of e.pathname.split("/"))n&&(t=n);return $$(t,e.searchParams.entries())}function M$(e){return O$(new URL(e,"https://example.com/"))}function $$(e,t){const n={resourceType:e};for(const[r,o]of t)L$(n,r,o);return n}function L$(e,t,n){var s,l;let r,o;const i=t.indexOf(":");if(i>=0?(r=t.substring(0,i),o=t.substring(i+1)):(r=t,o=""),r==="_has"||t.includes(".")){e.filters=Xa(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":F$(e,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 c=T1(n);o==="iterate"&&(c.modifier="iterate"),e.include=Xa(e.include,c);break}case"_revinclude":{const c=T1(n);o==="iterate"&&(c.modifier="iterate"),e.revInclude=Xa(e.revInclude,c);break}case"_fields":case"_elements":e.fields=n.split(",");break;default:{const c=(l=(s=di.types[e.resourceType])==null?void 0:s.searchParams)==null?void 0:l[r];c?e.filters=Xa(e.filters,z$(c,o,n)):e.filters=Xa(e.filters,V$(r,o,n))}}}function F$(e,t){for(const n of t.split(",")){let r,o=!1;n.startsWith("-")?(r=n.substring(1),o=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:o})}}function z$(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":return B$(e,n);case"reference":case"string":case"token":case"uri":return U$(e,t,n);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function B$(e,t){const{operator:n,value:r}=H$(t);return{code:e.code,operator:n,value:r}}function U$(e,t,n){return{code:e.code,operator:W$(t),value:n}}function V$(e,t,n){var o;let r="eq";if(t)r=t;else if(n.length>=2){const i=n.substring(0,2);i in wv&&(n.length===2||(o=n.at(2))!=null&&o.match(/\d/))&&(r=i,n=n.substring(i.length))}return{code:e,operator:r,value:n}}function H$(e){const t=e.substring(0,2),n=wv[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function W$(e){return pT[e]??"eq"}function T1(e){const t=e.split(":");if(t.includes("*"))throw new Ve(ii("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new Ve(ii(`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 Ve(ii(`Invalid include value '${e}'`))}function qs(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(q$(n))),e.sortRules&&e.sortRules.length>0&&t.push(G$(e.sortRules)),e.offset!==void 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.include&&e.include.forEach(n=>t.push(P1("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(P1("_revinclude",n))),t.length===0?"":(t.sort((n,r)=>n.localeCompare(r)),"?"+t.join("&"))}function q$(e){const t=e.operator in pT?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in wv?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function G$(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function P1(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Q$(e){if(typeof window<"u")return window.atob(e);if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("binary");throw new Error("Unable to decode base64")}function K$(e){if(typeof window<"u")return window.btoa(e);if(typeof Buffer<"u")return Buffer.from(e,"binary").toString("base64");throw new Error("Unable to encode base64")}function k1(){const e=new Uint32Array(28);return crypto.getRandomValues(e),TO(e.buffer)}async function Y$(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function mT(){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 gT(e){var o,i,s;const t={};e=vi(e);for(const l of e.entry||[]){(o=l.resource)==null||delete o.meta;const c=(i=l.resource)==null?void 0:i.id;c&&(t[c]=mT(),l.fullUrl="urn:uuid:"+t[c],(s=l.resource)==null||delete s.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(l=>({fullUrl:l.fullUrl,request:{method:"POST",url:l.resource.resourceType},resource:l.resource}))},(l,c)=>X$(l,c,t),2);return J$(JSON.parse(r))}function X$(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const o=n[r];if(o)return"urn:uuid:"+o}}return t}function J$(e){const t=eL(e),{sorted:n,cycles:r}=Z$(t),o={};for(const s of e.entry||[])s.fullUrl&&(o[s.fullUrl]=s);const i=n.map(s=>o[s]);for(const s of r)for(const l of s){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function Z$(e){const t=[],n={},r=[];for(const i of Object.keys(e))n[i]=0;function o(i,s){if(n[i]===2)return!0;if(n[i]===1){const c=s.lastIndexOf(i);return c!==-1&&r.push(s.slice(c)),!0}n[i]=1,s.push(i);let l=!1;for(const c of e[i])o(c,s)||(l=!0);return n[i]=2,s.pop(),t.unshift(i),!l}for(const i in e)n[i]===0&&o(i,[]);return{sorted:t,cycles:r}}function yT(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(ys(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else yT(r,t)}}function eL(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&&yT(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class vT{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 Yt={CSS:"text/css",DICOM:"application/dicom",FAVICON:"image/vnd.microsoft.icon",FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",HTML:"text/html",JAVASCRIPT:"text/javascript",JSON:"application/json",JSON_PATCH:"application/json-patch+json",PNG:"image/png",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript"};class xT{constructor(){this.listeners={}}addEventListener(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}removeEventListener(t,n){const r=this.listeners[t];if(r){for(let o=0;o<r.length;o++)if(r[o]===n){r.splice(o,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}}class tL{constructor(){this.emitter=new xT}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,n){this.emitter.addEventListener(t,n)}removeEventListener(t,n){this.emitter.removeEventListener(t,n)}}const dm={"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"},nL=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],Sv=["DiagnosticReport-update"];function rL(e){return Sv.includes(e)}function oL(e){if(Sv.includes(e))throw new Ve(Mt(`'context.version' is required for '${e}'.`))}const iL={"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"},select:{resourceType:"*",isArray:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport"},patient:{resourceType:"Patient",optional:!0},study:{resourceType:"ImagingStudy",optional:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function sL(e){return nL.includes(e)}function wT(e){return!!e.endpoint}function R1(e){if(!bv(e))throw new Ve(Mt("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,i={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return wT(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function bv(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:o}=e;if(!(t&&n&&r&&o)||typeof r!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const i of o)if(!dm[i])return!1;return!(wT(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function D1(e,t,n,r){if(typeof t!="object")throw new Ve(Mt(`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 Ve(Mt(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new Ve(Mt(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!sL(t.resourceType))throw new Ve(Mt(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new Ve(Mt(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function aL(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)D1(e,t.resource,n,r);else{const{resources:i}=t;if(!i)throw new Ve(Mt(`context[${n}] is invalid. context[${n}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(const s of i)D1(e,s,n,r)}}function lL(e,t){const n=new Map,r=iL[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new Ve(Mt(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));aL(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new Ve(Mt(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)||0)>1)throw new Ve(Mt(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function I1(e,t,n,r){if(!(e&&typeof e=="string"))throw new Ve(Mt("Must provide a topic."));if(!dm[t])throw new Ve(Mt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(dm).join(", ")}`));if(typeof n!="object")throw new Ve(Mt("context must be a context object or array of context objects."));if(Sv.includes(t)&&!r)throw new Ve(Mt(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return lL(t,o),{timestamp:new Date().toISOString(),id:mT(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class cL extends tL{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new Ve(Mt("Subscription request should contain an endpoint."));if(!bv(t))throw new Ve(Mt("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const o=JSON.parse(r.data);if(o["hub.topic"])return;const i=o;i.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:i}),n.send(JSON.stringify({id:o==null?void 0:o.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function uL(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=Q$(t),r=Array.from(n).reduce((i,s)=>{const l=("00"+s.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(r);return JSON.parse(o)}function dL(e){return e.split(".").length===3}function Cv(e){const[t,n,r]=e.split(".");return uL(n)}function fL(e){try{return typeof Cv(e).login_id=="string"}catch{return!1}}function hL(e){try{const n=Cv(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}var _1;class vr{constructor(t){this[_1]="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)}}_1=Symbol.toStringTag;class pL{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new mL)}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?Ln(n):void 0)}}class mL{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}const gL="3.0.2-4de37800",yL=Yt.FHIR_JSON+", */*; q=0.1",vL="https://api.medplum.com/",xL=1e3,wL=6e4,SL=0,A1="Binary/",N1={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class bL extends xT{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");if(this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??CL(),this.storage=(t==null?void 0:t.storage)??new pL,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=M1((t==null?void 0:t.baseUrl)??vL),this.fhirBaseUrl=M1(uu(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4/")),this.authorizeUrl=uu(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=uu(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=uu(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?SL:wL),this.cacheTime>0?this.requestCache=new vT((t==null?void 0:t.resourceCacheSize)??xL):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.initPromise=Promise.resolve();else if(this.storage.getInitPromise!==void 0){const n=this.storage.getInitPromise(),r=new Promise(o=>{n.then(()=>{this.attemptResumeActiveLogin().then(o).catch(console.error),this.initComplete=!0}).catch(console.error)});this.initPromise=r,this.initComplete=!1}else this.initPromise=this.attemptResumeActiveLogin().catch(console.error);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}clear(){this.storage.clear(),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=this.fhirBaseUrl+t;if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue?o=new Promise((s,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:s,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const i=new vr(o);return this.setCacheEntry(t,i),i}post(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("POST",t,o)}put(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,Yt.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:o},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(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,o,i=!0){let s=o;i&&(s=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,s,i))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");const r=new URLSearchParams;return r.set("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),r.set("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),r.set("client_id",n),r.set("subject_token",t),this.fetchTokens(r)}getExternalAuthRedirectUri(t,n,r,o,i=!0){const s=new URL(t);if(s.searchParams.set("response_type","code"),s.searchParams.set("client_id",n),s.searchParams.set("redirect_uri",r),s.searchParams.set("scope",o.scope??"openid profile email"),s.searchParams.set("state",JSON.stringify(o)),i){const{codeChallenge:l,codeChallengeMethod:c}=o;if(!c)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!l)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");s.searchParams.set("code_challenge_method",c),s.searchParams.set("code_challenge",l)}return s.toString()}fhirUrl(...t){return new URL(t.join("/"),this.fhirBaseUrl)}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=new URLSearchParams(n).toString()),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),i="search-"+o.toString(),s=this.getCacheEntry(i,r);if(s)return s.value;const l=new vr((async()=>{const c=await this.get(o,r);if(c.entry)for(const u of c.entry)this.cacheResource(u.resource);return c})());return this.setCacheEntry(i,l),l}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const i="searchOne-"+o.toString(),s=this.getCacheEntry(i,r);if(s)return s.value;const l=new vr(this.search(t,o.searchParams,r).then(c=>{var u,d;return(d=(u=c.entry)==null?void 0:u[0])==null?void 0:d.resource}));return this.setCacheEntry(i,l),l}searchResources(t,n,r){const i="searchResources-"+this.fhirSearchUrl(t,n).toString(),s=this.getCacheEntry(i,r);if(s)return s.value;const l=new vr(this.search(t,n,r).then(L1));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,n,r){var i,s;let o=this.fhirSearchUrl(t,n);for(;o;){const l=new URL(o).searchParams,c=await this.search(t,l,r),u=(i=c.link)==null?void 0:i.find(d=>d.relation==="next");if(!((s=c.entry)!=null&&s.length)&&!u)break;yield L1(c),o=u!=null&&u.url?new URL(u.url):void 0}}searchValueSet(t,n,r){return this.valueSetExpand({url:t,filter:n},r)}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 o,i;const r=(i=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,n).toString()))==null?void 0:i.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return N1;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}readResource(t,n,r){return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new vr(Promise.reject(new Error("Missing reference")));if(r==="system")return new vr(Promise.resolve(N1));const[o,i]=r.split("/");return!o||!i?new vr(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(aT(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new vr((async()=>{const i=`{
86
+ StructureDefinitionList(name: "${t}") {
87
+ resourceType,
88
+ name,
89
+ kind,
90
+ description,
91
+ type,
92
+ snapshot {
93
+ element {
94
+ id,
95
+ path,
96
+ definition,
97
+ min,
98
+ max,
99
+ base {
100
+ path,
101
+ min,
102
+ max
103
+ },
104
+ contentReference,
105
+ type {
106
+ code,
107
+ profile,
108
+ targetProfile
109
+ },
110
+ binding {
111
+ strength,
112
+ valueSet
113
+ }
114
+ }
115
+ }
116
+ }
117
+ SearchParameterList(base: "${t}", _count: 100) {
118
+ base,
119
+ code,
120
+ type,
121
+ expression,
122
+ target
123
+ }
124
+ }`.replace(/\s+/g," "),s=await this.graphql(i);b1(s.data.StructureDefinitionList);for(const l of s.data.SearchParameterList)YM(l)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t){if(lT(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new vr((async()=>{const i=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});i?b1([i],t):console.warn(`No StructureDefinition found for ${t}!`)})());return this.setCacheEntry(n,o),o}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}readPatientEverything(t,n){return this.get(this.fhirUrl("Patient",t,"$everything"),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){return await this.searchOne(t.resourceType,n,r)??this.createResource(t,r)}async createAttachment(t,n,r,o,i){const s=await this.createBinary(t,n,r,o,i);return{contentType:r,url:s.url,title:n}}createBinary(t,n,r,o,i){const s=this.fhirUrl("Binary");return n&&s.searchParams.set("_filename",n),o?this.uploadwithProgress(s,t,r,o,i):this.post(s,t,r,i)}uploadwithProgress(t,n,r,o,i){return new Promise((s,l)=>{var f;const c=new XMLHttpRequest,u=()=>c.abort();(f=i==null?void 0:i.signal)==null||f.addEventListener("abort",u);const d=h=>{var m;(m=i==null?void 0:i.signal)==null||m.removeEventListener("abort",u),h instanceof Error?l(h):s(h)};c.responseType="json",c.onabort=()=>d(new Error("Request aborted")),c.onerror=()=>d(new Error("Request error")),o&&(c.upload.onprogress=h=>o(h),c.upload.onload=h=>o(h)),c.onload=()=>{c.status>=200&&c.status<300?d(c.response):d(new Ve(ct(c.response||c.statusText)))},c.open("POST",t),c.withCredentials=!0,c.setRequestHeader("Authorization","Bearer "+this.accessToken),c.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),c.setRequestHeader("Content-Type",r),c.setRequestHeader("X-Medplum","extended"),c.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=await this.createPdfImpl(t,r,o);return this.createBinary(i,n,"application/pdf")}createComment(t,n,r){const o=this.getProfile();let i,s;return t.resourceType==="Encounter"&&(i=wt(t),s=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,s=t.subject),t.resourceType==="Patient"&&(s=wt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[wt(t)],encounter:i,subject:s,sender:o?wt(o):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}patchResource(t,n,r,o){return this.invalidateSearches(t),this.patch(this.fhirUrl(t,n),r,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,o){let i;if(typeof t=="string"){const s=t;i=this.fhirUrl("Bot",s,"$execute")}else{const s=t;i=this.fhirUrl("Bot","$execute")+`?identifier=${s.system}|${s.value}`}return this.post(i,n,r,o)}executeBatch(t,n){return this.post(this.fhirBaseUrl.slice(0,-1),t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,Yt.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},Yt.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,i,s){return this.post(this.fhirUrl("Agent",sv(t),"$push"),{destination:pt(n),body:r,contentType:o,waitForResponse:i},Yt.FHIR_JSON,s)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||pt(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}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.sessionDetails=void 0,this.accessTokenExpires=hL(t),this.medplumServer=fL(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var o,i;return((o=r.profile)==null?void 0:o.reference)!==((i=t.profile)==null?void 0:i.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me").then(r=>{var i,s;this.profilePromise=void 0;const o=((s=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:s.id)!==r.profile.id;this.sessionDetails=r,o&&this.dispatchEvent({type:"change"}),t(r.profile)}).catch(n)}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!!this.profilePromise}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();return r.startsWith(A1)&&(t=this.fhirUrl(r)),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async uploadMedia(t,n,r,o,i){const s=await this.createBinary(t,r,n);return this.createResource({resourceType:"Media",status:"completed",content:{contentType:n,url:A1+s.id,title:r},...o},i)}async bulkExport(t="",n,r,o){const i=t&&`${t}/`,s=this.fhirUrl(`${i}$export`);return n&&s.searchParams.set("_type",n),r&&s.searchParams.set("_since",r),this.startAsyncRequest(s.toString(),o)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;r.Prefer="respond-async";const o=await this.fetchWithRetry(t,n);if(o.status===202){const i=await $1(o);if(i)return this.pollStatus(i)}return this.parseResponse(o,"POST",t)}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(o=>o.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new vr(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const o=await this.fetchWithRetry(n,r);return this.parseResponse(o,t,n,r)}async parseResponse(t,n,r,o={}){if(t.status===401)return this.handleUnauthenticated(n,r,o);if(t.status===204||t.status===304)return;const i=t.headers.get("content-type"),s=i==null?void 0:i.includes("json");if(t.status===404&&!s)throw new Ve(hO);const l=t.headers.get("content-location"),c=o.redirect??this.options.redirect;if(t.status===201&&l&&c==="follow")return this.request("GET",l,{...o,body:void 0});let u;if(s)try{u=await t.json()}catch(d){throw console.error("Error parsing response",t.status,d),d}else u=await t.text();if(t.status>=400)throw new Ve(ct(u));return u}async fetchWithRetry(t,n){t.startsWith("http")||(t=new URL(t,this.baseUrl).href);const r=3,o=200;let i;for(let s=0;s<r;s++){try{if(this.options.verbose&&this.logRequest(t,n),i=await this.fetch(t,n),this.options.verbose&&this.logResponse(i),i.status<500)return i}catch(l){this.retryCatch(s,r,l)}await g1(o)}return i}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers,o=Object.entries(r).sort((i,s)=>i[0].localeCompare(s[0]));for(const[i,s]of o)console.log(`> ${i}: ${s}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}async pollStatus(t){let n=!0,r;const o=2e3;for(;n;){const i={};this.addFetchOptionsDefaults(i);const s=await this.fetchWithRetry(t,i);if(s.status!==202&&(n=!1,r=s,s.status===201)){const l=await $1(s);l&&(r=await this.fetchWithRetry(l,i))}await g1(o)}return this.parseResponse(r,"POST",t)}async executeAutoBatch(){var o,i;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const s=t[0];try{s.resolve(await this.request(s.method,this.fhirBaseUrl+s.url,s.options))}catch(l){s.reject(new Ve(ct(l)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(s=>({request:{method:s.method,url:s.url},resource:s.options.body?JSON.parse(s.options.body):void 0}))},r=await this.post(this.fhirBaseUrl.slice(0,-1),n);for(let s=0;s<t.length;s++){const l=t[s],c=(o=r.entry)==null?void 0:o[s];(i=c==null?void 0:c.response)!=null&&i.outcome&&!Vj(c.response.outcome)?l.reject(new Ve(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){let n=t.headers;n||(n={},t.headers=n),n.Accept||(n.Accept=yL),n["X-Medplum"]="extended",t.body&&!n["Content-Type"]&&(n["Content-Type"]=Yt.FHIR_JSON),this.accessToken?n.Authorization="Bearer "+this.accessToken:this.basicAuth&&(n.Authorization="Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){t.headers||(t.headers={});const r=t.headers;r["Content-Type"]=n}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||n.constructor.name==="Blob")||typeof File<"u"&&(n instanceof File||n.constructor.name==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||n.constructor.name==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clearActiveLogin(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new Error("Unauthenticated")))}async startPkce(){const t=k1();sessionStorage.setItem("pkceState",t);const n=k1();sessionStorage.setItem("codeVerifier",n);const r=await Y$(n),o=PO(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",o),{codeChallengeMethod:"S256",codeChallenge:o}}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??O1()),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=new URLSearchParams;if(r.set("grant_type","authorization_code"),r.set("code",t),r.set("client_id",(n==null?void 0:n.clientId)??this.clientId),r.set("redirect_uri",(n==null?void 0:n.redirectUri)??O1()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&r.set("code_verifier",o)}return this.fetchTokens(r)}refreshIfExpired(){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&this.accessTokenExpires<Date.now()&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){const t=new URLSearchParams;return t.set("grant_type","refresh_token"),t.set("client_id",this.clientId),t.set("refresh_token",this.refreshToken),this.refreshPromise=this.fetchTokens(t),this.refreshPromise}if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){this.clientId=t,this.clientSecret=n;const r=new URLSearchParams;return r.set("grant_type","client_credentials"),r.set("client_id",t),r.set("client_secret",n),this.fetchTokens(r)}async startJwtBearerLogin(t,n,r){this.clientId=t;const o=new URLSearchParams;return o.set("grant_type","urn:ietf:params:oauth:grant-type:jwt-bearer"),o.set("client_id",t),o.set("assertion",n),o.set("scope",r),this.fetchTokens(o)}async startJwtAssertionLogin(t){const n=new URLSearchParams;return n.append("grant_type","client_credentials"),n.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),n.append("client_assertion",t),this.fetchTokens(n)}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=K$(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new Ve(Mt("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new Ve(Mt("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},i=(await this.post("/fhircast/STU3",R1(r),Yt.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!bv(t))throw new Ve(Mt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new Ve(Mt("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",R1(t),Yt.FORM_URL_ENCODED)}fhircastConnect(t){return new cL(t)}async fhircastPublish(t,n,r,o){return rL(n)?this.post(`/fhircast/STU3/${t}`,I1(t,n,r,o),Yt.JSON):(oL(n),this.post(`/fhircast/STU3/${t}`,I1(t,n,r),Yt.JSON))}async fhircastGetContext(t){return this.get(`/fhircast/STU3/${t}`)}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n={method:"POST",headers:{"Content-Type":Yt.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},r=n.headers;this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`);let o;try{o=await this.fetchWithRetry(this.tokenUrl,n)}catch(s){throw this.refreshPromise=void 0,s}if(!o.ok){this.clearActiveLogin();try{const s=await o.json();throw new Ve(ii(s.error_description))}catch(s){throw new Ve(ii("Failed to fetch tokens"),s)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(dL(n)){const r=Cv(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new Error("Token expired");if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}setupStorageListener(){try{window.addEventListener("storage",t=>{(t.key===null||t.key==="activeLogin")&&window.location.reload()})}catch{}}retryCatch(t,n,r){if(r.message==="Failed to fetch"&&t===1&&this.dispatchEvent({type:"offline"}),t>=n-1)throw r}}function CL(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function O1(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}function M1(e){return e.endsWith("/")?e:e+"/"}function uu(e,t){return new URL(t,e).toString()}async function $1(e){var o,i;const t=e.headers.get("content-location");if(t)return t;const n=e.headers.get("location");if(n)return n;const r=await e.json();if(Rf(r)&&((i=(o=r.issue)==null?void 0:o[0])!=null&&i.diagnostics))return r.issue[0].diagnostics}function L1(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}var ST=p.createContext(void 0);function Nf(){return p.useContext(ST)}function re(){return Nf().medplum}function Of(){return Nf().navigate}function Ev(){return Nf().profile}function EL(e){let t=e.medplum,n=e.navigate??jL,[r,o]=p.useState({profile:t.getProfile(),loading:!t.isInitialized});p.useEffect(()=>{t&&(t.isInitialized||(o(s=>({...s,loading:!0})),t.getInitPromise().then(()=>o(s=>({...s,loading:!1}))).catch(console.error)))},[t,t.isInitialized]),p.useEffect(()=>{function s(){o({...r,profile:t.getProfile()})}return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[t,r]);let i=p.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(ST.Provider,{value:i,children:e.children})}function jL(e){window.location.assign(e)}function st(e,t){let n=re(),[r,o]=p.useState(F1(n,e)),i=p.useCallback(s=>{wc(s,r)||o(s)},[r,o]);return p.useEffect(()=>{i(F1(n,e))},[n,e,i]),p.useEffect(()=>{let s=!0;return ys(e)&&n.readReference(e).then(l=>{s&&i(l)}).catch(l=>{s&&(i(void 0),t&&t(ct(l)))}),()=>s=!1},[n,r,e,i,t]),r}function F1(e,t){if(t){if(Io(t))return t;if(ys(t))return e.getCachedReference(t)}}function TL(e,t){return bT("searchOne",e,t)}function Sa(e,t){return bT("searchResources",e,t)}function bT(e,t,n){let r=re(),[o,i]=p.useState(),[s,l]=p.useState(!1),[c,u]=p.useState(),[d,f]=p.useState();return p.useEffect(()=>{let h=r.fhirSearchUrl(t,n).toString();h!==o&&(i(h),r[e](t,n).then(m=>{l(!1),u(m),f(fO)}).catch(m=>{l(!1),u(void 0),f(ct(m))}))},[r,e,t,n,o,u]),[c,s,d]}var z1=new Map,CT=e=>p.useMemo(()=>{if(!e)return;let 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;let r=n.get("Expires");if(!r||r.length>13)return e;let o=z1.get(t);if(o){let i=new URLSearchParams(new URL(o).search).get("Expires");if(i&&parseInt(i,10)*1e3-5e3>Date.now())return o}return z1.set(t,e),e},[e]);function PL(e){const t=e.value;return t?a.jsx(a.Fragment,{children:IO(t)}):null}function B1(e,t){return e.line&&e.line.length>t?e.line[t]:""}function U1(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function kL(e){const[t,n]=p.useState(e.defaultValue||{}),r=p.useRef();r.current=t;function o(h){n(h),e.onChange&&e.onChange(h)}function i(h){o({...r.current,use:h})}function s(h){o({...r.current,type:h})}function l(h){o(U1(r.current||{},0,h))}function c(h){o(U1(r.current||{},1,h))}function u(h){o({...r.current,city:h})}function d(h){o({...r.current,state:h})}function f(h){o({...r.current,postalCode:h})}return a.jsxs(X,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(yt,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>i(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(yt,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>s(h.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(se,{placeholder:"Line 1",defaultValue:B1(t,0),onChange:h=>l(h.currentTarget.value)}),a.jsx(se,{placeholder:"Line 2",defaultValue:B1(t,1),onChange:h=>c(h.currentTarget.value)}),a.jsx(se,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),a.jsx(se,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),a.jsx(se,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>f(h.currentTarget.value)})]})}function RL(e){const t=Ev(),[n,r]=p.useState(e.defaultValue||{});function o(i){const s=i?{text:i,authorReference:t&&wt(t),time:new Date().toISOString()}:{};r(s),e.onChange&&e.onChange(s)}return a.jsx(se,{name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}var DL={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"},IL=Object.defineProperty,_L=Object.defineProperties,AL=Object.getOwnPropertyDescriptors,vd=Object.getOwnPropertySymbols,ET=Object.prototype.hasOwnProperty,jT=Object.prototype.propertyIsEnumerable,V1=(e,t,n)=>t in e?IL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H1=(e,t)=>{for(var n in t||(t={}))ET.call(t,n)&&V1(e,n,t[n]);if(vd)for(var n of vd(t))jT.call(t,n)&&V1(e,n,t[n]);return e},NL=(e,t)=>_L(e,AL(t)),OL=(e,t)=>{var n={};for(var r in e)ET.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vd)for(var r of vd(e))t.indexOf(r)<0&&jT.call(e,r)&&(n[r]=e[r]);return n},pe=(e,t,n)=>{const r=p.forwardRef((o,i)=>{var s=o,{color:l="currentColor",size:c=24,stroke:u=2,children:d}=s,f=OL(s,["color","size","stroke","children"]);return p.createElement("svg",H1(NL(H1({ref:i},DL),{width:c,height:c,stroke:l,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),f),[...n.map(([h,m])=>p.createElement(h,m)),...d||[]])});return r.propTypes={color:ze.string,size:ze.oneOfType([ze.string,ze.number]),stroke:ze.oneOfType([ze.string,ze.number])},r.displayName=`${t}`,r},ML=pe("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"}]]),Cc=pe("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"}]]),$L=pe("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"}]]),LL=pe("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"}]]),FL=pe("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"}]]),zL=pe("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"}]]),BL=pe("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"}]]),UL=pe("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"}]]),VL=pe("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"}]]),HL=pe("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"}]]),WL=pe("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"}]]),qL=pe("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"}]]),Ti=pe("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"}]]),Mf=pe("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),GL=pe("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"}]]),QL=pe("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),KL=pe("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",fill:"currentColor",key:"svg-0",strokeWidth:"0"}]]),xd=pe("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"}]]),wd=pe("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"}]]),jv=pe("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"}]]),YL=pe("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"}]]),TT=pe("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"}]]),XL=pe("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"}]]),JL=pe("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"}]]),ZL=pe("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"}]]),e7=pe("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"}]]),Ec=pe("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"}]]),jc=pe("equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]),W1=pe("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"}]]),t7=pe("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"}]]),n7=pe("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"}]]),r7=pe("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"}]]),o7=pe("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"}]]),i7=pe("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"}]]),s7=pe("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"}]]),a7=pe("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"}]]),l7=pe("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"}]]),PT=pe("math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]),kT=pe("math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]),c7=pe("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"}]]),u7=pe("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"}]]),d7=pe("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"}]]),f7=pe("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"}]]),h7=pe("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"}]]),p7=pe("player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]),m7=pe("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),g7=pe("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"}]]),y7=pe("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"}]]),v7=pe("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"}]]),x7=pe("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"}]]),fm=pe("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"}]]),Tv=pe("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"}]]),Pv=pe("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"}]]),w7=pe("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"}]]),S7=pe("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"}]]),b7=pe("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"}]]),C7=pe("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"}]]),RT=pe("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"}]]),q1=pe("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"}]]),E7=pe("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"}]]),Sd=pe("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);class DT extends p.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?a.jsx(us,{icon:a.jsx(Cc,{size:16}),title:"Something went wrong",color:"red",children:Re(this.state.error)}):this.props.children}}function Dr(){return a.jsx(Vt,{style:{width:"100%",height:"100vh"},children:a.jsx($n,{})})}const j7="_main_1szoq_1",T7={main:j7};function kv(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Sc(t,e.options)}):null}function tt(e){e.preventDefault(),e.stopPropagation()}function IT(e){if(G1(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&G1(t[0]))return!0}return!1}function G1(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function Me(e){const t=Of(),{to:n,suffix:r,label:o,onClick:i,children:s,...l}=e;let c=P7(n);return r&&(c+="/"+r),a.jsx(Ue,{href:c,"aria-label":o,onClick:u=>{tt(u),i?i(u):n&&t(c)},...l,children:s})}function P7(e){if(e){if(typeof e=="string")return k7(e);if(Io(e))return R7(e);if(ys(e))return D7(e)}return"#"}function k7(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function R7(e){return`/${e.resourceType}/${e.id}`}function D7(e){return`/${e.reference}`}function fi(e){const t=st(e.value),n=t?xo(t):e.alt??"",r=(t&&vO(t))??e.src,o=CT(r??void 0),i=e.radius??"xl",s={...e};return delete s.value,delete s.link,e.link?a.jsx(Me,{to:t,children:a.jsx(Qi,{src:o,alt:n,radius:i,...s})}):a.jsx(Qi,{src:o,alt:n,radius:i,...s})}const I7="_logoButton_189g3_1",_7="_user_189g3_11",A7="_userName_189g3_21",N7="_userActive_189g3_31",du={logoButton:I7,user:_7,userName:A7,userActive:N7};function Rv(e){const t=Sy({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:i,defaultValue:s,toOption:l,loadOptions:c,itemComponent:u,onChange:d,onCreate:f,creatable:h,clearable:m,required:g,placeholder:y,leftSection:C,maxValues:v,...x}=e,w=O7(s),[S,j]=p.useState(""),[E,T]=p.useState(),[P,k]=p.useState(),[D,M]=p.useState(),[R,O]=p.useState(w.map(l)),[N,B]=p.useState([]),I=u??M7,$=p.useRef();$.current=S;const _=p.useRef(),F=p.useRef(),q=p.useRef();q.current=E;const G=p.useRef();G.current=P;const oe=p.useRef();oe.current=D;const Te=p.useRef();Te.current=N;const Ee=p.useCallback(()=>{if(T(void 0),$.current===F.current&&c===_.current)return;F.current=$.current,_.current=c;const Y=new AbortController;k(Y),c($.current??"",Y.signal).then(je=>{Y.signal.aborted||(B(je.map(l)),k(void 0),oe.current?(je.length>0&&d(je.slice(0,1)),M(!1)):je.length>0&&t.openDropdown())}).catch(je=>{Y.signal.aborted||je.message.includes("aborted")||de({color:"red",message:Re(je)})})},[t,c,d,l]),_e=p.useCallback(Y=>{N&&N.length>0&&t.openDropdown(),t.updateSelectedOptionIndex(),j(Y.currentTarget.value),G.current&&(G.current.abort(),k(void 0)),q.current!==void 0&&window.clearTimeout(q.current);const je=window.setTimeout(()=>Ee(),100);T(je)},[t,N,Ee]),Pe=p.useCallback(Y=>{const je=[],Ae=[...R];let nt=N==null?void 0:N.find(It=>It.value===Y),Ge=nt==null?void 0:nt.resource;if(!Ge&&h!==!1&&f&&(Ge=f(Y),nt=l(Ge)),Ge&&je.push(Ge),nt&&Ae.push(nt),v!==void 0)for(;Ae.length>v;)Ae.shift();d(je),O(Ae)},[h,N,R,v,d,f,l]),De=Y=>{j(""),B([]),F.current=void 0,Pe(Y==="$create"?S:Y)},Qe=p.useCallback(Y=>{const je=R.filter(Ae=>Ae.value!==Y.value);d(je.map(Ae=>Ae.resource)),O(je)},[R,d]),qe=p.useCallback(Y=>{Y.key==="Enter"?!E&&!P?(tt(Y),N&&N.length>0&&(B(N.slice(0,1)),Pe(N[0].value))):M(!0):Y.key==="Backspace"&&S.length===0&&(tt(Y),Qe(R[R.length-1]))},[S,R,N,E,P,Pe,Qe]);p.useEffect(()=>()=>{G.current&&G.current.abort()},[]);const dt=m&&R.length>0&&a.jsx($e.ClearButton,{title:"Clear all",size:16,onClear:()=>{j(""),O([]),d([])}});return a.jsxs($e,{store:t,onOptionSubmit:De,withinPortal:!0,shadow:"xl",...x,children:[a.jsx($e.DropdownTarget,{children:a.jsx(va,{label:r,description:o,error:i,className:e.className,leftSection:C,rightSection:P?a.jsx($n,{size:16}):dt,required:g,children:a.jsxs(Ki.Group,{children:[R.map(Y=>a.jsx(Ki,{withRemoveButton:!0,onRemove:()=>Qe(Y),children:Y.label},Y.value)),a.jsx($e.EventsTarget,{children:a.jsx(va.Field,{role:"searchbox",name:n,value:S,placeholder:y,onFocus:_e,onBlur:()=>t.closeDropdown(),onKeyDown:qe,onChange:_e})})]})})}),a.jsx($e.Dropdown,{children:a.jsxs($e.Options,{children:[N.map(Y=>a.jsx($e.Option,{value:Y.value,active:R.includes(Y),children:a.jsx(I,{...Y})},Y.value)),h&&S.trim().length>0&&a.jsxs($e.Option,{value:"$create",children:["+ Create ",S]}),!h&&S.trim().length>0&&N.length===0&&a.jsx($e.Empty,{children:"Nothing found"})]})})]})}function O7(e){return e?Array.isArray(e)?e:[e]:[]}function M7(e){return a.jsx(X,{gap:"sm",children:a.jsx("span",{children:e.label})})}const $7="_searchInput_dick8_1",L7={searchInput:$7};function F7(e){return{value:e.id,label:xo(e),resource:e}}function z7(e){const t=Of(),n=re(),r=p.useCallback(async(i,s)=>{const l=U7(i),c={signal:s},u=await n.graphql(l,void 0,void 0,c);return V7(u,i)},[n]),o=p.useCallback(i=>{i.length>0&&t(`/${pt(i[0])}`)},[t]);return a.jsx(Rv,{size:"sm",radius:"md",className:L7.searchInput,leftSection:a.jsx(x7,{size:16}),placeholder:"Search",itemComponent:B7,toOption:F7,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const B7=p.forwardRef(({resource:e,...t},n)=>{var o;let r;return e.resourceType==="Patient"?r=e.birthDate:e.resourceType==="ServiceRequest"&&(r=(o=e.subject)==null?void 0:o.display),a.jsx("div",{ref:n,...t,children:a.jsxs(X,{wrap:"nowrap",children:[a.jsx(fi,{value:e}),a.jsxs("div",{children:[a.jsx(ue,{children:xo(e)}),a.jsx(ue,{size:"xs",c:"dimmed",children:r})]})]})})});function U7(e){const t=JSON.stringify(e);return Gj(e)?`{
125
+ Patients1: PatientList(_id: ${t}, _count: 1) {
126
+ resourceType
127
+ id
128
+ identifier {
129
+ system
130
+ value
131
+ }
132
+ name {
133
+ given
134
+ family
135
+ }
136
+ birthDate
137
+ }
138
+ ServiceRequestList(_id: ${t}, _count: 1) {
139
+ resourceType
140
+ id
141
+ identifier {
142
+ system
143
+ value
144
+ }
145
+ subject {
146
+ display
147
+ }
148
+ }
149
+ }`.replace(/\s+/g," "):`{
150
+ Patients1: PatientList(name: ${t}, _count: 5) {
151
+ resourceType
152
+ id
153
+ identifier {
154
+ system
155
+ value
156
+ }
157
+ name {
158
+ given
159
+ family
160
+ }
161
+ birthDate
162
+ }
163
+ Patients2: PatientList(identifier: ${t}, _count: 5) {
164
+ resourceType
165
+ id
166
+ identifier {
167
+ system
168
+ value
169
+ }
170
+ name {
171
+ given
172
+ family
173
+ }
174
+ birthDate
175
+ }
176
+ ServiceRequestList(identifier: ${t}, _count: 5) {
177
+ resourceType
178
+ id
179
+ identifier {
180
+ system
181
+ value
182
+ }
183
+ subject {
184
+ display
185
+ }
186
+ }
187
+ }`.replace(/\s+/g," ")}function V7(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),W7(H7(n),t).slice(0,5)}function H7(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 W7(e,t){return e.sort((n,r)=>Q1(r,t)-Q1(n,t))}function Q1(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,K1(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,K1(Sc(r),t));return n}function K1(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function q7(e){var d,f,h,m;const t=Nf(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),[s,l]=p.useState(!1),{colorScheme:c,setColorScheme:u}=UR();return a.jsx(Mn.Header,{p:8,style:{zIndex:101},children:a.jsxs(X,{justify:"space-between",children:[a.jsxs(X,{gap:"xs",children:[a.jsx(Qn,{className:du.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&a.jsx(z7,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(J,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:s,onClose:()=>l(!1),children:[a.jsx(J.Target,{children:a.jsx(Qn,{className:Je(du.user,{[du.userActive]:s}),onClick:()=>l(g=>!g),children:a.jsxs(X,{gap:7,children:[a.jsx(fi,{value:r,radius:"xl",size:24}),a.jsx(ue,{size:"sm",className:du.userName,children:Sc((d=r==null?void 0:r.name)==null?void 0:d[0])}),a.jsx(QL,{size:12,stroke:1.5})]})})}),a.jsxs(J.Dropdown,{children:[a.jsxs(Se,{align:"center",p:"xl",children:[a.jsx(fi,{size:"xl",radius:100,value:t.profile}),a.jsx(kv,{value:(h=(f=t.profile)==null?void 0:f.name)==null?void 0:h[0]}),a.jsx(ue,{c:"dimmed",size:"xs",children:(m=n.getActiveLogin())==null?void 0:m.project.display})]}),i.length>1&&a.jsx(J.Divider,{}),i.map(g=>g.profile.reference!==pt(t.profile)&&a.jsx(J.Item,{onClick:()=>{n.setActiveLogin(g).then(()=>window.location.reload()).catch(console.log)},children:a.jsxs(X,{children:[a.jsx(Qi,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(ue,{size:"sm",fw:500,children:g.profile.display}),a.jsx(ue,{c:"dimmed",size:"xs",children:g.project.display})]})]})},g.profile.reference)),a.jsx(J.Divider,{}),a.jsx(X,{justify:"center",children:a.jsx(qy,{size:"xs",value:c,onChange:g=>u(g),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(b7,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),a.jsx(J.Item,{leftSection:a.jsx(fm,{size:14,stroke:1.5}),onClick:()=>o(`/${pt(r)}`),children:"Account settings"}),a.jsx(J.Item,{leftSection:a.jsx(l7,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsx(ue,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})]})]})})}function G7(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?Q7(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&K7(t,n);return t}function Q7(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function K7(e,t){e[t.name]=t.value}function Be(e){return a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=G7(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function Y7(e){const t=re(),n=t.getUserConfiguration();function r(o){var d,f;const{menuname:i,bookmarkname:s}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=vi(n),u=(d=c.menu)==null?void 0:d.find(({title:h})=>h===i);(f=u==null?void 0:u.link)==null||f.push({name:s,target:l}),t.updateResource(c).then(h=>{n.menu=h.menu,t.dispatchEvent({type:"change"}),de({color:"green",message:"Success"}),e.onOk()}).catch(h=>{de({color:"red",message:Re(h)})})}return a.jsx(En,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(Be,{onSubmit:r,children:a.jsxs(Se,{children:[a.jsx(X7,{config:n}),a.jsx(se,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(X,{justify:"flex-end",children:a.jsx(ee,{mt:"sm",type:"submit",children:"OK"})})]})})})}function X7(e){function t(r){var o;return(o=r==null?void 0:r.menu)==null?void 0:o.map(i=>i.title)}const n=t(e.config);return a.jsx(yt,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function _T(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function J7(e){return typeof e.display=="string"?e.display:_T(e)}function Z7(e){return{value:_T(e),label:J7(e),resource:e}}function e6(e){return{code:e,display:e}}function Dv(e){const t=re(),{binding:n,creatable:r,clearable:o,expandParams:i,...s}=e,l=p.useCallback(async(c,u)=>{var m;if(!n)return[];const f=(m=(await t.valueSetExpand({...i,url:n,filter:c},{signal:u})).expansion)==null?void 0:m.contains,h=[];for(const g of f)g.code&&!h.some(y=>y.code===g.code)&&h.push(g);return h},[t,i,n]);return a.jsx(Rv,{...s,creatable:r??!0,clearable:o??!0,toOption:Z7,loadOptions:l,onCreate:e6})}function AT(e){const{defaultValue:t,onChange:n,...r}=e,[o,i]=p.useState(t);function s(l){const c=l[0],u=n6(c);i(u),n&&n(u)}return a.jsx(Dv,{defaultValue:t6(o),onChange:s,...r})}function t6(e){return e?{code:e}:void 0}function n6(e){return e==null?void 0:e.code}function Iv(e){const[t,n]=p.useState(e.defaultValue),r=e.onChange,o=p.useCallback(i=>{n(i),r&&r(i)},[r]);return a.jsx(AT,{"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:0,clearable:!1})}const r6="_menuTitle_9g6l5_1",o6="_link_9g6l5_9",i6="_linkActive_9g6l5_38",hm={menuTitle:r6,link:o6,linkActive:i6};function s6(e){var l;const t=Of(),n=c6(e.pathname,e.searchParams,e.menus),[r,o]=p.useState(!1);function i(c,u){c.stopPropagation(),c.preventDefault(),t(u),window.innerWidth<768&&e.closeNavbar()}function s(c){c&&t(`/${c}`)}return a.jsxs(a.Fragment,{children:[a.jsx(Mn.Navbar,{children:a.jsxs(dr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&a.jsx(Mn.Section,{mb:"sm",children:a.jsx(Iv,{name:"resourceType",placeholder:"Resource Type",onChange:c=>s(c)},window.location.pathname)}),a.jsxs(Mn.Section,{grow:!0,children:[(l=e.menus)==null?void 0:l.map(c=>{var u;return a.jsxs(p.Fragment,{children:[a.jsx(ue,{className:hm.menuTitle,children:c.title}),(u=c.links)==null?void 0:u.map(d=>a.jsxs(a6,{to:d.href,active:d.href===(n==null?void 0:n.href),onClick:f=>i(f,d.href),children:[a.jsx(l6,{to:d.href,icon:d.icon}),a.jsx("span",{children:d.label})]},d.href))]},`menu-${c.title}`)}),e.displayAddBookmark&&a.jsx(ee,{variant:"subtle",size:"xs",mt:"xl",leftSection:a.jsx(m7,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&a.jsx(Y7,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function a6(e){return a.jsx(Me,{onClick:e.onClick,to:e.to,className:Je(hm.link,{[hm.linkActive]:e.active}),children:e.children})}function l6(e){return e.icon?e.icon:a.jsx(kf,{w:30})}function c6(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const i of n)if(i.links)for(const s of i.links){const l=u6(e,t,s.href);l>o&&(o=l,r=s)}return r}function u6(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[s,l]of r.searchParams.entries())if(!o.includes(s)&&t.get(s)!==l)return 0;let i=1;for(const[s,l]of t.entries())o.includes(s)||r.searchParams.get(s)===l&&i++;return i}function d6(e){const[t,n]=p.useState(localStorage.navbarOpen==="true"),r=re(),o=Ev();p.useEffect(()=>{function c(){de({color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",c),()=>r.removeEventListener("offline",c)},[r]);function i(c){localStorage.navbarOpen=c.toString(),n(c)}function s(){i(!1)}function l(){i(!t)}return r.isLoading()?a.jsx(Dr,{}):a.jsxs(Mn,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&a.jsx(q7,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:l}),o&&t?a.jsx(s6,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:s,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,a.jsx(Mn.Main,{className:T7.main,children:a.jsx(DT,{children:a.jsx(p.Suspense,{fallback:a.jsx(Dr,{}),children:e.children})})})]})}function Tc(e){const{contentType:t,url:n,title:r}=e.value??{},o=CT(n);return o?a.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),(t==null?void 0:t.startsWith("video/"))&&a.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:a.jsx("source",{type:t,src:o})}),t==="application/pdf"&&a.jsx("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400},children:a.jsx("iframe",{width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(Ue,{href:o,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:f6(r),children:r||"Download"})})]}):null}function f6(e){return e!=null&&e.includes(".")?e:void 0}function h6(e){var t;return a.jsx("div",{children:(t=e.values)==null?void 0:t.map((n,r)=>a.jsx("div",{children:a.jsx(Tc,{value:n,maxWidth:e.maxWidth})},"attatchment-"+r))})}function _v(e){const t=re(),n=p.useRef(null);function r(s){var l;tt(s),(l=n.current)==null||l.click()}function o(s){tt(s);const l=s.target.files;l&&Array.from(l).forEach(i)}function i(s){if(!s||!s.name)return;e.onUploadStart&&e.onUploadStart();const c=s.name,u=s.type||"application/octet-stream";t.createBinary(s,c,u,e.onUploadProgress).then(d=>{e.onUpload({contentType:d.contentType,url:d.url,title:c})}).catch(d=>{e.onUploadError&&e.onUploadError(ct(d))})}return a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:s=>o(s)}),e.children({onClick:r})]})}function p6(e){const[t,n]=p.useState(e.defaultValue??[]),r=p.useRef();r.current=t;function o(i){n(i),e.onChange&&e.onChange(i)}return a.jsxs("table",{style:{width:"100%"},children:[a.jsxs("colgroup",{children:[a.jsx("col",{width:"97%"}),a.jsx("col",{width:"3%"})]}),a.jsxs("tbody",{children:[t.map((i,s)=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Tc,{value:i,maxWidth:200})}),a.jsx("td",{children:a.jsx(qt,{title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:l=>{tt(l);const c=t.slice();c.splice(s,1),o(c)},children:a.jsx(xd,{})})})]},`${s}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(_v,{onUpload:i=>{o([...r.current,i])},children:i=>a.jsx(qt,{...i,title:"Add",variant:"subtle",size:"sm",color:"green",children:a.jsx(jv,{})})})})]})]})]})}function NT(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?a.jsxs(a.Fragment,{children:[a.jsx(Tc,{value:t,maxWidth:200}),a.jsx(ee,{onClick:o=>{tt(o),r(void 0)},children:"Remove"})]}):a.jsx(_v,{onUpload:r,children:o=>a.jsx(ee,{...o,children:"Upload..."})})}const OT=["meta","implicitRules","contained","extension","modifierExtension"],MT=["language","text"],m6="_root_watd4_1",g6="_compact_watd4_14",Y1={root:m6,compact:g6};function Av(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:Je(Y1.root,{[Y1.compact]:n}),children:t})}function ra(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function Yr(e){return a.jsx(a.Fragment,{children:wa(e.value)})}function y6(e){return a.jsx(a.Fragment,{children:ms(e.value)})}function $T(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),a.jsx(a.Fragment,{children:n.join("").trim()})}function v6(e){var n;const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>a.jsx($T,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function x6(e){var t,n;return a.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function w6(e){return a.jsx(a.Fragment,{children:LO(e.value)})}function Ql(e){return a.jsx(a.Fragment,{children:zo(e.value)})}function Nv(e){return a.jsx(a.Fragment,{children:Wl(e.value)})}function S6(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(Ql,{value:t.numerator})," / ",a.jsx(Ql,{value:t.denominator})]}):null}function bd(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Ln(e.value);return e.link!==!1&&e.value.reference?a.jsx(Me,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function b6(e){const{property:t,values:n}=e,r=t.type[0].code;return e.values?a.jsx(a.Fragment,{children:n.map((o,i)=>a.jsx("div",{children:a.jsx(So,{arrayElement:!0,property:t,propertyType:r,value:o,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${i}-${n.length}`))}):a.jsx(a.Fragment,{})}function So(e){var i;const{property:t,propertyType:n,value:r}=e;if((i=t==null?void 0:t.path)==null?void 0:i.endsWith(".id"))return a.jsxs(W,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Zt(r)&&a.jsx(ij,{value:r,timeout:2e3,children:({copied:s,copy:l})=>a.jsx(Na,{label:s?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(qt,{variant:"subtle",color:s?"teal":"gray",onClick:l,children:s?a.jsx(Mf,{size:"1rem"}):a.jsx(TT,{size:"1rem"})})})})]});if(t!=null&&t.max&&t.max>1&&!e.arrayElement)return n===V.Attachment?a.jsx(h6,{values:r,maxWidth:e.maxWidth}):a.jsx(b6,{property:t,values:r,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case V.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case V.SystemString:case V.string:return a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case V.code:case V.date:case V.decimal:case V.id:case V.integer:case V.positiveInt:case V.unsignedInt:case V.uri:case V.url:return a.jsx(a.Fragment,{children:r});case V.canonical:return a.jsx(bd,{value:{reference:r},link:e.link});case V.dateTime:case V.instant:return a.jsx(a.Fragment,{children:Fn(r)});case V.markdown:return a.jsx("pre",{children:r});case V.Address:return a.jsx(PL,{value:r});case V.Annotation:return a.jsx(a.Fragment,{children:r==null?void 0:r.text});case V.Attachment:return a.jsx(Tc,{value:r,maxWidth:e.maxWidth});case V.CodeableConcept:return a.jsx(Yr,{value:r});case V.Coding:return a.jsx(y6,{value:r});case V.ContactDetail:return a.jsx(v6,{value:r});case V.ContactPoint:return a.jsx($T,{value:r});case V.HumanName:return a.jsx(kv,{value:r});case V.Identifier:return a.jsx(x6,{value:r});case V.Money:return a.jsx(w6,{value:r});case V.Period:return a.jsx(a.Fragment,{children:AO(r)});case V.Quantity:case V.Duration:return a.jsx(Ql,{value:r});case V.Range:return a.jsx(Nv,{value:r});case V.Ratio:return a.jsx(S6,{value:r});case V.Reference:return a.jsx(bd,{value:r,link:e.link});case V.Timing:return a.jsx(a.Fragment,{children:Kj(r)});case V.Dosage:case V.UsageContext:return a.jsx(pm,{value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);return a.jsx(pm,{value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function $f(e,t){const n=vn(e,t);return n?Array.isArray(n)?[n.map(r=>r.value),n[0].type]:[n.value,n.type]:[void 0,"undefined"]}function C6(e,t,n){const r=lv(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function pm(e){const t=e.value,n=t.value;if(!n)return null;const r=t.type,o=fv(r);return o?typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string"?a.jsx("div",{children:n.name}):a.jsx(Av,{compact:e.compact,children:Object.entries(o.elements).map(i=>{const[s,l]=i;if(OT.includes(s)||MT.includes(s)&&l.path.split(".").length===2)return null;const[c,u]=$f(t,s);return e.ignoreMissingValues&&(!c||Array.isArray(c)&&c.length===0)?null:a.jsx(ra,{term:yd(s),children:a.jsx(So,{property:l,propertyType:u,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},s)})}):a.jsxs("div",{children:[r," not implemented"]})}function E6(e,t){const n=e.lastIndexOf(t);if(n===-1)return["",e];const r=e.substring(0,n),o=e.substring(n+t.length);return[r,o]}const ba=b.createContext({profileUrl:void 0,debugMode:!1,getModifiedNestedElement:()=>{}});function j6(e,t,n){const r=Object.create(null);function o(s){return r[s]}const i=e==null?void 0:e.elements;if(i){const s=new Set;for(const[l,c]of Object.entries(i)){const[u,d]=E6(l,".");s.has(u)&&(r[e.type+"."+l]=c),s.add(l)}}return{debugMode:n??!1,profileUrl:t,getModifiedNestedElement:o}}function LT(e){const{debugMode:t}=p.useContext(ba);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,a.jsxs(X,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(St.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,children:null})})]})}function Le(e,t){var n,r,o;return(o=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(i=>{var s;return FT((s=i.expression)==null?void 0:s[0],t)}))==null?void 0:r.map(i=>{var s;return(s=i.details)==null?void 0:s.text}))==null?void 0:o.join(`
188
+ `)}function Lf(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return FT((o=r.expression)==null?void 0:o[0],t)})}function FT(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=e.indexOf(".");if(n>=0&&e.substring(n+1)===t)return!0;const r=t.indexOf(".");return r>=0&&t.substring(r+1)===e}function it(e){const{debugMode:t}=p.useContext(ba);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,a.jsx(St.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,error:Le(e.outcome,e.htmlFor),"data-testid":e.testId,children:e.children})}function mm(e,t,n,r,o){const i=r.type;if(i.length>1)for(const s of i){const l=t.replace("[x]",nn(s.code));l in e&&delete e[l]}return e[n]=o,e}function T6(e){return!!e&&!Zt(e.url)&&!Zt(e.name)}function P6(e){const{defaultValue:t,onChange:n,...r}=e,[o,i]=p.useState(t);function s(l){const c=R6(l);i(c),n&&n(c)}return a.jsx(Dv,{defaultValue:o&&k6(o),onChange:s,...r})}function k6(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function R6(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function zT(e){const{defaultValue:t,onChange:n,...r}=e,[o,i]=p.useState(t);function s(l){const c=l[0],u=c&&I6(c);i(u),n&&n(u)}return a.jsx(Dv,{defaultValue:o&&D6(o),maxValues:1,onChange:s,...r})}function D6(e){return{system:e.system,code:e.code,display:e.display}}function I6(e){return{system:e.system,code:e.code,display:e.display}}function BT(e){const{path:t,outcome:n}=e,{getModifiedNestedElement:r}=p.useContext(ba),[o,i]=p.useState(e.defaultValue),s=p.useRef();s.current=o;const[l,c,u]=p.useMemo(()=>["system","use","value"].map(g=>r(t+"."+g)),[r,t]);function d(g){g&&Object.keys(g).length===0&&(g=void 0),i(g),e.onChange&&e.onChange(g)}function f(g){const y={...s.current,system:g};g||delete y.system,d(y)}function h(g){const y={...s.current,use:g};g||delete y.use,d(y)}function m(g){const y={...s.current,value:g};g||delete y.value,d(y)}return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(yt,{"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((l==null?void 0:l.min)??0)>0,onChange:g=>f(g.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Le(n,t+".system")}),a.jsx(yt,{"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((c==null?void 0:c.min)??0)>0,onChange:g=>h(g.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Le(n,t+".use")}),a.jsx(se,{placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((u==null?void 0:u.min)??0)>0,onChange:g=>m(g.currentTarget.value),error:Le(n,t+".value")})]})}function _6(e){var l;const[t,n]=p.useState(e.defaultValue),r=p.useRef();r.current=t;function o(c){n(c),e.onChange&&e.onChange(c)}function i(c){const u={...r.current,name:c};c||delete u.name,o(u)}function s(c){const u={...r.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(se,{"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:c=>i(c.currentTarget.value)}),a.jsx(BT,{name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:s,outcome:e.outcome})]})}function A6(e){if(!e)return"";const t=new Date(e);return If(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function UT(e){if(!e)return"";const t=new Date(e);return If(t)?t.toISOString():""}var N6={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.0.2-4de37800",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function Yi(e){return a.jsx(se,{id:e.name,name:e.name,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:O6(),defaultValue:A6(e.defaultValue),autoFocus:e.autoFocus,error:Le(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(UT(n))}}})}function O6(){return N6.NODE_ENV==="test"?"text":"datetime-local"}function M6(e){const{propertyType:t}=e,n=re(),[r,o]=p.useState(!1),[i,s]=p.useState(),l=p.useMemo(()=>{if(!(!t.profile||t.profile.length===0))return t.profile[0]},[t]);p.useEffect(()=>{l&&(o(!0),n.requestProfileSchema(l).then(()=>{const u=_f(l);o(!1),s(u)}).catch(u=>{o(!1),console.warn(u)}))},[n,l]);function c(u){e.onChange&&(console.log("Extension",u),e.onChange(u))}return l?l&&(r||!lT(l))?a.jsx("div",{children:"Loading..."}):i?a.jsx($v,{profileUrl:l,typeName:i.name,defaultValue:e.defaultValue,onChange:c}):a.jsxs("div",{children:["StructureDefinition for ",l," not found"]}):a.jsx($6,{...e})}function $6(e){return a.jsx(fs,{id:e.name,name:e.name,"data-testid":"extension-json-input",defaultValue:Ln(e.defaultValue),deserialize:JSON.parse,onChange:t=>{e.onChange&&e.onChange(JSON.parse(t))}})}function L6(e){var f,h,m;const{outcome:t,path:n}=e,[r,o]=p.useState(e.defaultValue);function i(g){o(g),e.onChange&&e.onChange(g)}function s(g){i({...r,use:g||void 0})}function l(g){i({...r,prefix:g?g.split(" "):void 0})}function c(g){i({...r,given:g?g.split(" "):void 0})}function u(g){i({...r,family:g||void 0})}function d(g){i({...r,suffix:g?g.split(" "):void 0})}return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(yt,{defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:g=>s(g.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Le(t,n+".use")}),a.jsx(se,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(f=r==null?void 0:r.prefix)==null?void 0:f.join(" "),onChange:g=>l(g.currentTarget.value),error:Le(t,n+".prefix")}),a.jsx(se,{placeholder:"Given",name:e.name+"-given",defaultValue:(h=r==null?void 0:r.given)==null?void 0:h.join(" "),onChange:g=>c(g.currentTarget.value),error:Le(t,n+".given")}),a.jsx(se,{name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:g=>u(g.currentTarget.value),error:Le(t,n+".family")}),a.jsx(se,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(m=r==null?void 0:r.suffix)==null?void 0:m.join(" "),onChange:g=>d(g.currentTarget.value),error:Le(t,n+".suffix")})]})}function F6(e){const{path:t,outcome:n}=e,[r,o]=p.useState(e.defaultValue),{getModifiedNestedElement:i}=p.useContext(ba),[s,l]=p.useMemo(()=>["system","value"].map(u=>i(t+"."+u)),[i,t]);function c(u){o(u),e.onChange&&e.onChange(u)}return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(se,{placeholder:"System",required:((s==null?void 0:s.min)??0)>0,defaultValue:r==null?void 0:r.system,onChange:u=>c({...r,system:u.currentTarget.value}),error:Le(n,t+".system")}),a.jsx(se,{placeholder:"Value",required:((l==null?void 0:l.min)??0)>0,defaultValue:r==null?void 0:r.value,onChange:u=>c({...r,value:u.currentTarget.value}),error:Le(n,t+".value")})]})}const z6=["USD","EUR","CAD","GBP","AUD"];function B6(e){var c;const{onChange:t}=e,[n,r]=p.useState(e.defaultValue),o=p.useCallback(u=>{r(u),t&&t(u)},[t]),i=p.useCallback(u=>{o({...n,currency:u.currentTarget.value})},[n,o]),s=p.useCallback(u=>{o({...n,value:u.currentTarget.valueAsNumber})},[n,o]),l=a.jsx(yt,{defaultValue:n==null?void 0:n.currency,data:z6,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:i});return a.jsx(se,{type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((c=n==null?void 0:n.value)==null?void 0:c.toString())??"USD",leftSection:a.jsx(XL,{size:14}),rightSection:l,rightSectionWidth:92,onChange:s})}function U6(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Yi,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>r({...t,start:o})}),a.jsx(Yi,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>r({...t,end:o})})]})}function Xi(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(yt,{style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:o=>r({...t,comparator:o.currentTarget.value})}),a.jsx(se,{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:o=>{e.disableWheel&&o.currentTarget.blur()},onChange:o=>{r({...t,value:V6(o.currentTarget.value)})}}),a.jsx(se,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>r({...t,unit:o.currentTarget.value})})]})}function V6(e){if(e)return parseFloat(e)}function Ov(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Xi,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>r({...t,low:o})}),a.jsx(Xi,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>r({...t,high:o})})]})}function H6(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Xi,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>r({...t,numerator:o})}),a.jsx(Xi,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>r({...t,denominator:o})})]})}const W6={Observation:"code",User:"email:contains"},q6=["AccessPolicy","Account","ActivityDefinition","Bot","CapabilityStatement","ClientApplication","CodeSystem","CompartmentDefinition","ConceptMap","EffectEvidenceSynthesis","Endpoint","EventDefinition","Evidence","EvidenceVariable","ExampleScenario","GraphDefinition","HealthcareService","ImplementationGuide","InsurancePlan","Library","Location","Measure","MedicinalProduct","MessageDefinition","NamingSystem","OperationDefinition","Organization","Patient","Person","PlanDefinition","Practitioner","Project","Questionnaire","RelatedPerson","ResearchDefinition","ResearchElementDefinition","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function G6(e){return{value:pt(e),label:xo(e),resource:e}}function Ma(e){const t=re(),{resourceType:n,searchCriteria:r}=e,[o,i]=p.useState(),s=st(e.defaultValue,i),l=e.onChange,c=p.useCallback(async(d,f)=>{const h=K6(n),m=new URLSearchParams({[h]:d??"",_count:"10",...r});return await t.searchResources(n,m,{signal:f})},[t,n,r]),u=p.useCallback(d=>{l&&l(d[0])},[l]);return e.defaultValue&&!o&&!s?null:a.jsx(Rv,{name:e.name,required:e.required,itemComponent:Q6,defaultValue:s,placeholder:e.placeholder,maxValues:1,toOption:G6,loadOptions:c,onChange:u,clearable:!0})}const Q6=p.forwardRef(({label:e,resource:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs(X,{wrap:"nowrap",children:[a.jsx(fi,{value:t}),a.jsxs("div",{children:[a.jsx(ue,{children:e}),a.jsx(ue,{size:"xs",c:"dimmed",children:t.birthDate})]})]})}));function K6(e){return W6[e]??(q6.includes(e)?"name":"_id")}function Ff(e){const{onChange:t}=e,n=re(),[r,o]=p.useState(e.defaultValue),[i,s]=p.useState(()=>Y6(e.targetTypes)),[l,c]=p.useState(()=>X6(e.defaultValue,i)),u=p.useRef(new vT),d=p.useMemo(()=>(l==null?void 0:l.type)==="profile"?{...e.searchCriteria,_profile:l.value}:e.searchCriteria,[e.searchCriteria,l]);p.useEffect(()=>{let m=!1;const g=i==null?void 0:i.map(y=>{if(!Z6(y))return Promise.resolve(y);m=!0;const C=y.value,v=u.current.get(C);if(v)return v;const x=J6(n,y.value).then(S=>{const j={...y};return S?Df(S.type)?(j.resourceType=S.type,j.name=S.name,j.title=S.title):(console.error(`StructureDefinition.type missing for ${y.value}`),j.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${y.value}`),j.error="StructureDefinition not found"),j}).catch(S=>(console.error(S),{...y,error:S})),w=new vr(x);return u.current.set(C,w),w});!g||!m||Promise.all(g).then(y=>{if(s(y),!l)return;const C=y.findIndex(v=>v.value===l.value||v.resourceType===l.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${l.resourceType}`);return}c(y[C])}).catch(console.error)},[n,l,i]);const f=p.useCallback(m=>{const g=m?wt(m):void 0;o(g),t&&t(g)},[t]),h=p.useMemo(()=>i?i.map(m=>({value:m.value,label:m.type==="profile"?m.title??m.name??m.resourceType??m.value:m.value})):[],[i]);return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&a.jsx(yt,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:l==null?void 0:l.resourceType,autoFocus:e.autoFocus,onChange:m=>{const g=m.currentTarget.value,y=i.find(C=>C.value===g);c(y)},data:h}),!i&&a.jsx(Iv,{autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:l==null?void 0:l.resourceType,onChange:m=>{c(m?{type:"resourceType",value:m,resourceType:m}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(Ma,{resourceType:l==null?void 0:l.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:d,onChange:f})]})}function Y6(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 X6(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const o=t==null?void 0:t.find(i=>i.resourceType===n);return o||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function J6(e,t){const n=_f(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
189
+ StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
190
+ type,
191
+ name,
192
+ title,
193
+ }
194
+ }`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function Z6(e){return e.type==="profile"&&!(e!=null&&e.error)&&Zt(e.resourceType)}const e8="_indented_ldk1d_1",VT={indented:e8};function t8(e,t,n){var r,o;for(const i of[n.elements,(r=n.typeSchema)==null?void 0:r.elements]){let s;if(Df(i)){const l=uT(i,t.path);l&&(s=lv(e.value,t.path,l))}if(s)return((o=RO(s))==null?void 0:o.some(l=>$M(l,t,n,i)))??!1}return!1}function n8(e,t,n){var r;if(e)for(const o of t){const i={value:e,type:((r=o.typeSchema)==null?void 0:r.name)??o.type[0].code};if(n.every(s=>t8(i,s,o)))return o.name}}function X1(e,t,n){if(!n||n.slices.length===0)return[e];const r=new Array(t.length+1);for(let o=0;o<r.length;o++)r[o]=[];for(const o of e){const i=n8(o,t,n.discriminator);let s=i?t.findIndex(l=>l.name===i):-1;s===-1&&(s=t.length),r[s].push(o)}for(let o=0;o<t.length;o++)r[o].length===0&&r[o].push(void 0);return r}function r8(e){return e.type!==void 0&&e.type.length>0}function o8(e){var C;const{property:t}=e,n=re(),[r,o]=p.useState(!0),[i,s]=p.useState([]),[l]=p.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[c,u]=p.useState([[]]),d=(C=t.type[0])==null?void 0:C.code;p.useEffect(()=>{if(!t.slicing){const S=[];s(S);const j=X1(l,S,t.slicing);u(j),o(!1);return}const v=[],x=[],w=[];for(const S of t.slicing.slices){if(!r8(S))continue;const j=S.type[0];let E;Zt(S.elements)&&j.profile&&(E=j.profile[0]),v.push(S),x.push(E),E?w.push(n.requestProfileSchema(E)):w.push(Promise.resolve())}Promise.all(w).then(()=>{for(let j=0;j<v.length;j++){const E=v[j],T=x[j];if(T){const P=_f(T);E.typeSchema=P}}s(v);const S=X1(l,v,t.slicing);u(S),o(!1)}).catch(S=>{console.error(S),o(!1)})},[n,t.slicing,d,l]);function f(v,x){const w=[...c];if(w[x]=v,u(w),e.onChange){const S=w.flat().filter(j=>j!==void 0);e.onChange(S)}}if(r)return a.jsx("div",{children:"Loading..."});const h=i.length,m=c[h],g=!(e.hideNonSliceValues??(d==="Extension"&&i.length>0)),y=yd(t.path);return a.jsxs(Se,{className:e.indent?VT.indented:void 0,children:[i.map((v,x)=>a.jsx(i8,{slice:v,property:t,defaultValue:c[x],onChange:w=>{f(w,x)},testId:`slice-${v.name}`},v.name)),g&&m.map((v,x)=>a.jsxs(X,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx($a,{arrayElement:!0,property:e.property,name:e.name+"."+x,defaultValue:v,onChange:w=>{const S=[...m];S[x]=w,f(S,h)},defaultPropertyType:void 0,outcome:e.outcome})}),a.jsx(WT,{propertyDisplayName:y,testId:`nonsliced-remove-${x}`,onClick:w=>{tt(w);const S=[...m];S.splice(x,1),f(S,h)}})]},`${x}-${m.length}`)),g&&c.flat().length<t.max&&a.jsx(X,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(HT,{propertyDisplayName:y,onClick:v=>{tt(v);const x=[...m];x.push(void 0),f(x,h)},testId:"nonsliced-add"})})]})}function i8(e){const{slice:t,property:n}=e,[r,o]=p.useState(()=>e.defaultValue.map(u=>u??{}));function i(u){o(u),e.onChange&&e.onChange(u)}const s=t.min>0,l=Zt(t.elements),c=cT(t.name);return a.jsx(it,{title:c,description:t.definition,withAsterisk:s,fhirPath:`${n.path}:${t.name}`,testId:e.testId,children:a.jsxs(Se,{className:l?VT.indented:void 0,children:[r.map((u,d)=>a.jsxs(X,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(Se,{children:Zt(t.elements)?a.jsx(Mv,{elementDefinitionType:t.type[0],name:t.name,defaultValue:u,onChange:f=>{const h=[...r];h[d]=f,i(h)},outcome:void 0,min:t.min,max:t.max,binding:void 0,path:t.path}):a.jsx(qT,{type:t.type[0].code,elements:t.elements,defaultValue:u,outcome:e.outcome,onChange:f=>{const h=[...r];h[d]=f,i(h)},testId:e.testId&&`${e.testId}-elements-${d}`})})}),r.length>t.min&&a.jsx(WT,{propertyDisplayName:c,testId:e.testId&&`${e.testId}-remove-${d}`,onClick:f=>{tt(f);const h=[...r];h.splice(d,1),i(h)}})]},`${d}-${r.length}`)),r.length<t.max&&a.jsx(X,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(HT,{propertyDisplayName:c,onClick:u=>{tt(u);const d=[...r,void 0];i(d)},testId:e.testId&&`${e.testId}-add`})})]})})}function HT({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(ee,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(wd,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(qt,{title:r,color:"green.6",variant:"subtle","data-testid":n,onClick:t,children:a.jsx(wd,{size:"1.25rem"})})}function WT({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(qt,{title:e?`Remove ${e}`:"Remove",color:"red.5",variant:"subtle","data-testid":n,onClick:t,children:a.jsx(xd,{size:"1.25rem"})})}function s8(e){const[t,n]=p.useState(!1),r=vS(),o=p.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),a.jsxs(ga,{gap:"xs",children:[a.jsx(ds,{...e,styles:{...i,root:{...i.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(qt,{title:"Copy secret",onClick:()=>{var s;r.copy((s=o.current)==null?void 0:s.value),de({color:"green",message:"Copied"})},children:a.jsx(TT,{})})]})}const a8=["sun","mon","tue","wed","thu","fri","sat"];function l8(e){const[t,n]=p.useState(e.defaultValue),[r,o]=p.useState(!1),i=p.useRef();return i.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:Kj(i.current)||"No repeat"}),a.jsx(ee,{onClick:()=>o(!0),children:"Edit"})]}),a.jsx(c8,{visible:r,defaultValue:i.current,onOk:s=>{e.onChange&&e.onChange(s),n(s),o(!1)},onCancel:()=>o(!1)})]})}const J1={repeat:{period:1,periodUnit:"d"}};function c8(e){const[t,n]=p.useState(e.defaultValue||J1),r=p.useRef();r.current=t;function o(u){n({...r.current,event:[u]})}function i(u){n({...r.current,repeat:u})}function s(u){var d;i({...(d=r.current)==null?void 0:d.repeat,period:u})}function l(u){var d;i({...(d=r.current)==null?void 0:d.repeat,periodUnit:u})}function c(u){var d;i({...(d=r.current)==null?void 0:d.repeat,dayOfWeek:u})}return a.jsx(En,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Se,{children:[a.jsx(it,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(Yi,{name:"timing-dialog-start",onChange:u=>o(u)})}),a.jsx(mc,{label:"Repeat",checked:!!t.repeat,onChange:u=>i(u.currentTarget.checked?J1.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(it,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(se,{type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:u=>s(parseInt(u.currentTarget.value,10)||1)}),a.jsx(yt,{id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:u=>l(u.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"&&a.jsx(it,{title:"Repeat on",children:a.jsx(Vl.Group,{multiple:!0,onChange:c,children:a.jsx(X,{justify:"space-between",mt:"md",gap:"xs",children:a8.map(u=>a.jsx(Vl,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),a.jsx(X,{justify:"flex-end",children:a.jsx(ee,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function $a(e){var l;const{property:t,name:n,defaultValue:r,onChange:o}=e,i=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,s=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(i===V.Attachment)return a.jsx(p6,{name:n,defaultValue:r,onChange:o});const c=((l=s[0])==null?void 0:l.code)!==V.Extension;return a.jsx(o8,{property:t,name:n,defaultValue:r,indent:c,onChange:o,outcome:e.outcome})}return s.length>1?a.jsx(u8,{elementDefinitionTypes:s,...e}):a.jsx(Mv,{name:n,defaultValue:r,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",nn(s[0].code));e.onChange(c,u)}},outcome:e.outcome,elementDefinitionType:s[0],min:t.min,max:t.min,binding:t.binding,path:t.path})}function u8(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(i=>i.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=p.useState(n);return a.jsxs(X,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(yt,{style:{width:"200px"},defaultValue:r.code,onChange:i=>{o(t.find(s=>s.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),a.jsx(Mv,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",nn(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path})]})}function Mv(e){const{name:t,defaultValue:n,onChange:r,outcome:o,binding:i,path:s}=e,l=e.min!==void 0&&e.min>0,c=e.elementDefinitionType.code;if(!c)return a.jsx("div",{children:"Property type not specified "});const u={name:t,defaultValue:n,onChange:r,outcome:o,path:s};switch(c){case V.SystemString:case V.canonical:case V.string:case V.time:case V.uri:case V.url:return e.path==="Project.secret.value[x]"?a.jsx(s8,{id:t,name:t,"data-testid":t,defaultValue:n,required:l,onChange:d=>{e.onChange&&e.onChange(d.currentTarget.value)},error:Le(e.outcome,t)}):a.jsx(se,{id:t,name:t,"data-testid":t,defaultValue:n,required:l,onChange:d=>{r&&r(d.currentTarget.value)},error:Le(o,t)});case V.date:return a.jsx(se,{type:"date",id:t,name:t,"data-testid":t,defaultValue:n,required:l,onChange:d=>{r&&r(d.currentTarget.value)},error:Le(o,t)});case V.dateTime:case V.instant:return a.jsx(Yi,{name:t,defaultValue:n,onChange:r,outcome:o});case V.decimal:case V.integer:case V.positiveInt:case V.unsignedInt:return a.jsx(se,{type:"number",step:c===V.decimal?"any":"1",id:t,name:t,"data-testid":t,defaultValue:n,required:l,onChange:d=>{r&&r(d.currentTarget.valueAsNumber)}});case V.code:return a.jsx(AT,{...u,binding:i==null?void 0:i.valueSet});case V.boolean:return a.jsx(cr,{id:t,name:t,"data-testid":t,defaultChecked:!!n,onChange:d=>{r&&r(d.currentTarget.checked)}});case V.base64Binary:case V.markdown:return a.jsx(ds,{id:t,spellCheck:c!==V.base64Binary,name:t,"data-testid":t,defaultValue:n,required:l,onChange:d=>{r&&r(d.currentTarget.value)}});case V.Address:return a.jsx(kL,{...u});case V.Annotation:return a.jsx(RL,{...u});case V.Attachment:return a.jsx(NT,{...u});case V.CodeableConcept:return a.jsx(P6,{binding:i==null?void 0:i.valueSet,...u});case V.Coding:return a.jsx(zT,{binding:i==null?void 0:i.valueSet,...u});case V.ContactDetail:return a.jsx(_6,{...u});case V.ContactPoint:return a.jsx(BT,{...u});case V.Extension:return a.jsx(M6,{...u,propertyType:e.elementDefinitionType});case V.HumanName:return a.jsx(L6,{...u});case V.Identifier:return a.jsx(F6,{...u});case V.Money:return a.jsx(B6,{...u});case V.Period:return a.jsx(U6,{...u});case V.Duration:case V.Quantity:return a.jsx(Xi,{...u});case V.Range:return a.jsx(Ov,{...u});case V.Ratio:return a.jsx(H6,{...u});case V.Reference:return a.jsx(Ff,{...u,targetTypes:f8(e.elementDefinitionType)});case V.Timing:return a.jsx(l8,{...u});case V.Dosage:case V.UsageContext:default:return a.jsx($v,{typeName:c,defaultValue:n,onChange:r,outcome:o})}}const d8=[`${OM}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function f8(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=d8.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}const gm=new Set(["extension","modifierExtension"]),h8=new Set(["id",...OT].filter(e=>!gm.has(e)));function qT(e){const{elements:t}=e,[n,r]=p.useState(e.defaultValue??{}),o=p.useMemo(()=>{const s=Object.create(null);for(const[l,c]of Object.entries(t))c.fixed&&(s[l]=c);return s},[t]);function i(s){for(const[l,c]of Object.entries(o))mm(s,l,l,c,c.fixed.value);r(s),e.onChange&&e.onChange(s)}return a.jsx(Se,{style:{flexGrow:1},"data-testid":e.testId,children:Object.entries(t).map(([s,l])=>{var h;if(!l.type||l.max===0||s==="url"&&l.fixed||gm.has(s)&&!Df((h=l.slicing)==null?void 0:h.slices))return null;if(h8.has(s))return null;if(MT.includes(s)&&l.path.split(".").length===2||s.includes("."))return null;const[c,u]=C6(n,s,l),d=l.min!==void 0&&l.min>0,f=a.jsx($a,{property:l,name:s,defaultValue:c,defaultPropertyType:u,onChange:(m,g)=>{i(mm({...n},s,g??s,l,m))},arrayElement:void 0,outcome:e.outcome},s);return e.type==="Extension"||gm.has(s)?f:l.type.length===1&&l.type[0].code==="boolean"?a.jsx(LT,{title:yd(s),description:l.description,htmlFor:s,fhirPath:l.path,withAsterisk:d,children:f},s):a.jsx(it,{title:yd(s),description:l.description,withAsterisk:d,htmlFor:s,outcome:e.outcome,fhirPath:l.path,children:f},s)})})}function $v(e){const{typeName:t}=e,[n,r]=p.useState(e.defaultValue??{}),o=p.useContext(ba),i=e.profileUrl??o.profileUrl,s=p.useMemo(()=>fv(t,i),[t,i]),l=p.useMemo(()=>j6(s,i),[s,i]);if(!s)return a.jsxs("div",{children:[t," not implemented"]});function c(u){r(u),e.onChange&&e.onChange(u)}return a.jsx(ba.Provider,{value:l,children:a.jsx(qT,{type:s.type,elements:s.elements,defaultValue:n,onChange:c,outcome:e.outcome})})}const p8="_root_1vii2_1",m8={root:p8};function Pc(e){const{children:t,...n}=e;return a.jsx(Py,{className:m8.root,...n,children:t})}const g8="_noteBody_10swh_1",y8="_noteCite_10swh_5",v8="_noteRoot_10swh_10",Z1={noteBody:g8,noteCite:y8,noteRoot:v8};function GT({value:e}){return e?a.jsx(Se,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&a.jsx(jy,{classNames:{cite:Z1.noteCite,root:Z1.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function kc(e){const{value:t,link:n,...r}=e,[o,i]=p.useState(),s=st(t,i);let l;if(o&&!Vj(o))l=`[${Re(o)}]`;else if(s)l=xo(s);else return null;return n?a.jsx(Me,{to:t,...r,children:l}):a.jsx(ue,{component:"span",...r,children:l})}function oa(e){return a.jsxs(X,{gap:"xs",children:[a.jsx(fi,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(kc,{value:e.value,link:e.link})]})}const x8={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"};function QT(e){return a.jsx(df,{color:x8[e.status],children:e.status})}const w8="_table_pe9td_1",S8="_criticalRow_pe9td_12",b8="_noteBody_pe9td_23",C8="_noteCite_pe9td_27",E8="_noteRoot_pe9td_32",KT={table:w8,criticalRow:S8,noteBody:b8,noteCite:C8,noteRoot:E8};Lv.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Lv(e){var s;const t=re(),n=st(e.value),[r,o]=p.useState();if(p.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,n]),!n)return null;const i=(r==null?void 0:r.flatMap(l=>l.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const l=n.presentedForm[0];(s=l.contentType)!=null&&s.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return a.jsxs(Se,{children:[a.jsx(ce,{children:"Diagnostic Report"}),a.jsx(j8,{value:n}),r&&!e.hideSpecimenInfo&&T8(r),n.result&&a.jsx(P8,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&a.jsx(GT,{value:i})]})}function j8({value:e}){var t,n;return a.jsxs(X,{mt:"md",gap:30,children:[e.subject&&a.jsxs("div",{children:[a.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(oa,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>a.jsxs("div",{children:[a.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(oa,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>a.jsxs("div",{children:[a.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(oa,{value:r,link:!0})]},r.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(ue,{children:Fn(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(ue,{children:nn(e.status)})]})]})}function T8(e){return a.jsxs(Se,{gap:"xs",children:[a.jsx(ce,{order:2,size:"h6",children:"Specimens"}),a.jsx(gn,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return a.jsx(gn.Item,{ml:"sm",children:a.jsxs(X,{gap:20,children:[a.jsxs(X,{gap:5,children:[a.jsx(ue,{fw:500,children:"Collected:"})," ",Fn((n=t.collection)==null?void 0:n.collectedDateTime)]}),a.jsxs(X,{gap:5,children:[a.jsx(ue,{fw:500,children:"Received:"})," ",Fn(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function P8(e){return a.jsxs("table",{className:KT.table,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Test"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Reference Range"}),a.jsx("th",{children:"Interpretation"}),a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Performer"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:a.jsx(YT,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function YT(e){var t;return a.jsx(a.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>a.jsx(k8,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${ys(n)?n.reference:n.id}`))})}function k8(e){var o,i;const t=st(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=I8(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:Je({[KT.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(Me,{to:t,children:a.jsx(Yr,{value:t.code})})}),a.jsx("td",{children:a.jsx(R8,{value:t})}),a.jsx("td",{children:a.jsx(D8,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(Yr,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(s=>a.jsx("div",{children:a.jsx(Yr,{value:s})},`category-${wa(s)}`))})}),a.jsx("td",{children:(i=t.performer)==null?void 0:i.map(s=>a.jsx(bd,{value:s},s.reference))}),a.jsx("td",{children:t.status&&a.jsx(QT,{status:t.status})})]}),t.hasMember&&a.jsx(YT,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,children:a.jsx(GT,{value:t.note})})})]})}function R8(e){const t=e.value;return a.jsx(a.Fragment,{children:Yj(t)})}function D8(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?a.jsx(a.Fragment,{children:t.text}):a.jsx(Nv,{value:t}):null}function I8(e){var n,r,o,i;const t=(i=(o=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}const _8="_paper_1igaj_1",A8="_fill_1igaj_20",ew={paper:_8,fill:A8};function Fv(e){const{width:t,fill:n,className:r,children:o,...i}=e,s=t?{width:t}:void 0;return a.jsx(On,{className:Je(ew.paper,n&&ew.fill,r),style:s,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}var XT={},Rc={};Object.defineProperty(Rc,"__esModule",{value:!0});Rc.Pointer=void 0;function N8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function O8(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var M8=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var n=t.split("/").map(N8);if(n[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(n)},e.prototype.toString=function(){return this.tokens.map(O8).join("/")},e.prototype.evaluate=function(t){for(var n=null,r="",o=t,i=1,s=this.tokens.length;i<s;i++)n=o,r=this.tokens[i],!(r=="__proto__"||r=="constructor"||r=="prototype")&&(o=(n||{})[r]);return{parent:n,key:r,value:o}},e.prototype.get=function(t){return this.evaluate(t).value},e.prototype.set=function(t,n){var r=this.evaluate(t);r.parent&&(r.parent[r.key]=n)},e.prototype.push=function(t){this.tokens.push(t)},e.prototype.add=function(t){var n=this.tokens.concat(String(t));return new e(n)},e}();Rc.Pointer=M8;var Tt={},zv={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function n(o){return o!=null&&typeof o=="object"}function r(o){if(!n(o))return o;if(o.constructor==Array){for(var i=o.length,s=new Array(i),l=0;l<i;l++)s[l]=r(o[l]);return s}if(o.constructor==Date){var c=new Date(+o);return c}var u={};for(var d in o)e.hasOwnProperty.call(o,d)&&(u[d]=r(o[d]));return u}e.clone=r})(zv);var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.diffAny=mn.diffObjects=mn.diffArrays=mn.intersection=mn.subtract=mn.isDestructive=void 0;var Kl=zv;function $8(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}mn.isDestructive=$8;function ym(e,t){var n={};for(var r in e)Kl.hasOwnProperty.call(e,r)&&e[r]!==void 0&&(n[r]=1);for(var o in t)Kl.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete n[o];return Object.keys(n)}mn.subtract=ym;function JT(e){for(var t=e.length,n={},r=0;r<t;r++){var o=e[r];for(var i in o)Kl.hasOwnProperty.call(o,i)&&o[i]!==void 0&&(n[i]=(n[i]||0)+1)}for(var i in n)n[i]<t&&delete n[i];return Object.keys(n)}mn.intersection=JT;function L8(e){return e.op==="add"}function F8(e){return e.op==="remove"}function qh(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function ZT(e,t,n,r){r===void 0&&(r=zf);var o={"0,0":{operations:[],cost:0}};function i(d,f){var h="".concat(d,",").concat(f),m=o[h];if(m===void 0){if(d>0&&f>0&&!r(e[d-1],t[f-1],n.add(String(d-1))).length)m=i(d-1,f-1);else{var g=[];if(d>0){var y=i(d-1,f),C={op:"remove",index:d-1};g.push(qh(y,C))}if(f>0){var v=i(d,f-1),x={op:"add",index:d-1,value:t[f-1]};g.push(qh(v,x))}if(d>0&&f>0){var w=i(d-1,f-1),S={op:"replace",index:d-1,original:e[d-1],value:t[f-1]};g.push(qh(w,S))}var j=g.sort(function(E,T){return E.cost-T.cost})[0];m=j}o[h]=m}return m}var s=isNaN(e.length)||e.length<=0?0:e.length,l=isNaN(t.length)||t.length<=0?0:t.length,c=i(s,l).operations,u=c.reduce(function(d,f){var h=d[0],m=d[1];if(L8(f)){var g=f.index+1+m,y=g<s+m?String(g):"-",C={op:f.op,path:n.add(y).toString(),value:f.value};return[h.concat(C),m+1]}else if(F8(f)){var C={op:f.op,path:n.add(String(f.index+m)).toString()};return[h.concat(C),m-1]}else{var v=n.add(String(f.index+m)),x=r(f.original,f.value,v);return[h.concat.apply(h,x),m]}},[[],0])[0];return u}mn.diffArrays=ZT;function eP(e,t,n,r){r===void 0&&(r=zf);var o=[];return ym(e,t).forEach(function(i){o.push({op:"remove",path:n.add(i).toString()})}),ym(t,e).forEach(function(i){o.push({op:"add",path:n.add(i).toString(),value:t[i]})}),JT([e,t]).forEach(function(i){o.push.apply(o,r(e[i],t[i],n.add(i)))}),o}mn.diffObjects=eP;function zf(e,t,n,r){if(r===void 0&&(r=zf),e===t)return[];var o=(0,Kl.objectType)(e),i=(0,Kl.objectType)(t);return o=="array"&&i=="array"?ZT(e,t,n,r):o=="object"&&i=="object"?eP(e,t,n,r):[{op:"replace",path:n.toString(),value:t}]}mn.diffAny=zf;var Bv=c0&&c0.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Tt,"__esModule",{value:!0});Tt.apply=Tt.InvalidOperationError=Tt.test=Tt.copy=Tt.move=Tt.replace=Tt.remove=Tt.add=Tt.TestError=Tt.MissingError=void 0;var bo=Rc,Uv=zv,z8=mn,Xr=function(e){Bv(t,e);function t(n){var r=e.call(this,"Value required at path: ".concat(n))||this;return r.path=n,r.name="MissingError",r}return t}(Error);Tt.MissingError=Xr;var tP=function(e){Bv(t,e);function t(n,r){var o=e.call(this,"Test failed: ".concat(n," != ").concat(r))||this;return o.actual=n,o.expected=r,o.name="TestError",o}return t}(Error);Tt.TestError=tP;function Vv(e,t,n){if(Array.isArray(e))if(t=="-")e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function nP(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function rP(e,t){var n=bo.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new Xr(t.path):(Vv(n.parent,n.key,(0,Uv.clone)(t.value)),null)}Tt.add=rP;function oP(e,t){var n=bo.Pointer.fromJSON(t.path).evaluate(e);return n.value===void 0?new Xr(t.path):(nP(n.parent,n.key),null)}Tt.remove=oP;function iP(e,t){var n=bo.Pointer.fromJSON(t.path).evaluate(e);if(n.parent===null)return new Xr(t.path);if(Array.isArray(n.parent)){if(parseInt(n.key,10)>=n.parent.length)return new Xr(t.path)}else if(n.value===void 0)return new Xr(t.path);return n.parent[n.key]=(0,Uv.clone)(t.value),null}Tt.replace=iP;function sP(e,t){var n=bo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new Xr(t.from);var r=bo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new Xr(t.path):(nP(n.parent,n.key),Vv(r.parent,r.key,n.value),null)}Tt.move=sP;function aP(e,t){var n=bo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new Xr(t.from);var r=bo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new Xr(t.path):(Vv(r.parent,r.key,(0,Uv.clone)(n.value)),null)}Tt.copy=aP;function lP(e,t){var n=bo.Pointer.fromJSON(t.path).evaluate(e);return(0,z8.diffAny)(n.value,t.value,new bo.Pointer).length?new tP(n.value,t.value):null}Tt.test=lP;var cP=function(e){Bv(t,e);function t(n){var r=e.call(this,"Invalid operation: ".concat(n.op))||this;return r.operation=n,r.name="InvalidOperationError",r}return t}(Error);Tt.InvalidOperationError=cP;function B8(e,t){switch(t.op){case"add":return rP(e,t);case"remove":return oP(e,t);case"replace":return iP(e,t);case"move":return sP(e,t);case"copy":return aP(e,t);case"test":return lP(e,t)}return new cP(t)}Tt.apply=B8;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=Rc;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=Tt,r=mn;function o(u,d){return d.map(function(f){return(0,n.apply)(u,f)})}e.applyPatch=o;function i(u){function d(f,h,m){var g=u(f,h,m);return Array.isArray(g)?g:(0,r.diffAny)(f,h,m,d)}return d}function s(u,d,f){var h=new t.Pointer;return(f?i(f):r.diffAny)(u,d,h)}e.createPatch=s;function l(u,d){var f=t.Pointer.fromJSON(d).evaluate(u);if(f!==void 0)return{op:"test",path:d,value:f.value}}function c(u,d){var f=new Array;return d.filter(r.isDestructive).forEach(function(h){var m=l(u,h.path);if(m&&f.push(m),"from"in h){var g=l(u,h.from);g&&f.push(g)}}),f}e.createTests=c})(XT);const U8="_root_w6lfx_1",V8="_removed_w6lfx_16",H8="_added_w6lfx_21",Gh={root:U8,removed:V8,added:H8};function W8(e){const t=re(),[n,r]=p.useState(!1);if(p.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.original.resourceType]),!n)return null;const o=XT.createPatch(e.original,e.revised),i=[eo(e.original)],s=[eo(e.revised)];return a.jsxs(me,{className:Gh.root,children:[a.jsx(me.Thead,{children:a.jsxs(me.Tr,{children:[a.jsx(me.Th,{}),a.jsx(me.Th,{children:"Before"}),a.jsx(me.Th,{children:"After"})]})}),a.jsx(me.Tbody,{children:o.map(l=>{var y,C,v;if(l.path.startsWith("/meta"))return null;const c=l.path,u=q8(c),d=Af(e.original.resourceType,{resourceType:"SearchParameter",base:[e.original.resourceType],code:e.original.resourceType+"."+u,expression:e.original.resourceType+"."+u}),f=(y=d==null?void 0:d.elementDefinitions)==null?void 0:y[0],h=!!(f!=null&&f.isArray),m=l.op==="add"||(C=Gl(u,i))==null?void 0:C[0],g=l.op==="remove"||(v=Gl(u,s))==null?void 0:v[0];return a.jsxs(me.Tr,{children:[a.jsxs(me.Td,{children:[nn(l.op)," ",u]}),a.jsx(me.Td,{className:Gh.removed,children:m&&a.jsx(So,{property:f,propertyType:m.type,value:tw(m.value,h),ignoreMissingValues:!0})}),a.jsx(me.Td,{className:Gh.added,children:g&&a.jsx(So,{property:f,propertyType:g.type,value:tw(g.value,h),ignoreMissingValues:!0})})]},`op-${l.op}-${l.path}`)})})]})}function q8(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const o=t[r];o==="-"?n+=".last()":/^\d+$/.test(o)?n+=`[${o}]`:(r>0&&(n+="."),n+=o)}return n}function tw(e,t){return Array.isArray(e)&&!t?e[0]:!Array.isArray(e)&&t?[e]:e}function Hv(e){const t=re(),n=st(e.value),[r,o]=p.useState(!1);return p.useEffect(()=>{n&&t.requestSchema(n.resourceType).then(()=>o(!0)).catch(console.log)},[t,n]),!r||!n?null:a.jsx(pm,{value:{type:n.resourceType,value:e.forceUseInput?e.value:n},ignoreMissingValues:e.ignoreMissingValues})}function G8(e){return a.jsx(Pc,{children:e.children})}function Ji(e){var c,u;const{resource:t,profile:n,padding:r,popupMenuItems:o,...i}=e,s=n??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return a.jsxs(Fv,{"data-testid":"timeline-item",fill:!0,...i,children:[a.jsxs(X,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(fi,{value:s,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(ue,{size:"sm",children:a.jsx(kc,{c:"dark",fw:500,value:s,link:!0})}),a.jsxs(ue,{size:"xs",children:[a.jsx(Me,{c:"dimmed",to:e.resource,children:Fn(l)}),a.jsx(ue,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(Me,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(J,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(J.Target,{children:a.jsx(qt,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${pt(e.resource)}`,children:a.jsx(ZL,{})})}),o]})]}),a.jsxs(DT,{children:[r&&a.jsx("div",{style:{padding:"0 16px 16px 16px"},children:e.children}),!r&&a.jsx(a.Fragment,{children:e.children})]})]})}function uP(e,t){e.sort((n,r)=>{const o=nw(n,t),i=nw(r,t);return o>i?1:o<i?-1:rw(n,t)-rw(r,t)})}function nw(e,t){if(!dP(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function rw(e,t){var r;if(!dP(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 dP(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const Q8="_pinnedComment_5uxzi_2",K8={pinnedComment:Q8};function Bf(e){const t=re(),n=Of(),r=t.getProfile(),o=p.useRef(null),i=st(e.value),[s,l]=p.useState(),[c,u]=p.useState([]),d=e.loadTimelineResources,f=p.useRef(c);f.current=c;const h=p.useCallback(R=>{uP(R,i),R.reverse(),u(R)},[i]),m=p.useCallback(R=>{const O=[];for(const N of R){if(N.status!=="fulfilled")continue;const B=N.value;if(B.type==="history"&&l(B),B.entry)for(const I of B.entry)O.push(I.resource)}h(O)},[h]),g=p.useCallback(R=>h([...f.current,R]),[h]),y=p.useCallback(()=>{var N;let R,O;"resourceType"in e.value?(R=e.value.resourceType,O=e.value.id):[R,O]=(N=e.value.reference)==null?void 0:N.split("/"),d(t,R,O).then(m).catch(console.log)},[t,e.value,d,m]);p.useEffect(()=>y(),[y]);function C(R){!i||!e.createCommunication||t.createResource(e.createCommunication(i,r,R)).then(O=>g(O)).catch(console.log)}function v(R){!i||!e.createMedia||t.createResource(e.createMedia(i,r,R)).then(O=>g(O)).then(()=>dl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(Mf,{size:16}),autoClose:2e3})).catch(O=>dl({id:"upload-notification",color:"red",title:"Upload error",message:Re(O),icon:a.jsx(W1,{size:16}),autoClose:2e3}))}function x(R,O){return t.updateResource({...R,priority:O})}function w(R){x(R,"stat").then(y).catch(console.log)}function S(R){x(R,"routine").then(y).catch(console.log)}function j(R){n(`/${R.resourceType}/${R.id}`)}function E(R){n(`/${R.resourceType}/${R.id}/edit`)}function T(R){n(`/${R.resourceType}/${R.id}/delete`)}function P(R){var O;n(`/${R.resourceType}/${R.id}/_history/${(O=R.meta)==null?void 0:O.versionId}`)}function k(){de({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function D(R){dl({id:"upload-notification",loading:!0,title:"Uploading...",message:nF(R),autoClose:!1,withCloseButton:!1})}function M(R){dl({id:"upload-notification",color:"red",title:"Upload error",message:Re(R),icon:a.jsx(W1,{size:16}),autoClose:2e3})}return i?a.jsxs(G8,{children:[e.createCommunication&&a.jsx(Fv,{children:a.jsx(Be,{testid:"timeline-form",onSubmit:R=>{C(R.text);const O=o.current;O&&(O.value="",O.focus())},children:a.jsxs(X,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(fi,{value:r}),a.jsx(se,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(qt,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(c7,{size:16})}),a.jsx(_v,{onUpload:v,onUploadStart:k,onUploadProgress:D,onUploadError:M,children:R=>a.jsx(qt,{...R,radius:"xl",color:"blue",variant:"filled",children:a.jsx(jv,{size:16})})})]})})}),c.map(R=>{var N;if(!R)return null;const O=`${R.resourceType}/${R.id}/${(N=R.meta)==null?void 0:N.versionId}`;if(R.resourceType===i.resourceType&&R.id===i.id)return a.jsx(Y8,{history:s,resource:R,onDetails:P},O);switch(R.resourceType){case"AuditEvent":return a.jsx(eF,{resource:R,onDetails:j},O);case"Communication":return a.jsx(J8,{resource:R,onPin:R.priority!=="stat"?w:void 0,onUnpin:R.priority==="stat"?S:void 0,onDetails:j,onEdit:E,onDelete:T},O);case"DiagnosticReport":return a.jsx(tF,{resource:R,onDetails:j,onEdit:E,onDelete:T},O);case"Media":return a.jsx(Z8,{resource:R,onDetails:j,onEdit:E,onDelete:T},O);default:return a.jsx(Ji,{resource:R,padding:!0,children:a.jsx(Hv,{value:R,ignoreMissingValues:!0})},O)}})]}):a.jsx(Vt,{style:{width:"100%",height:"100%"},children:a.jsx($n,{})})}function Ca(e){return a.jsxs(J.Dropdown,{children:[a.jsx(J.Label,{children:"Resource"}),e.onPin&&a.jsx(J.Item,{leftSection:a.jsx(f7,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${pt(e.resource)}`,children:"Pin"}),e.onUnpin&&a.jsx(J.Item,{leftSection:a.jsx(h7,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${pt(e.resource)}`,children:"Unpin"}),e.onDetails&&a.jsx(J.Item,{leftSection:a.jsx(i7,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${pt(e.resource)}`,children:"Details"}),e.onEdit&&a.jsx(J.Item,{leftSection:a.jsx(e7,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${pt(e.resource)}`,children:"Edit"}),e.onDelete&&a.jsxs(a.Fragment,{children:[a.jsx(J.Divider,{}),a.jsx(J.Label,{children:"Danger zone"}),a.jsx(J.Item,{color:"red",leftSection:a.jsx(RT,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${pt(e.resource)}`,children:"Delete"})]})]})}function Y8(e){const t=X8(e.history,e.resource);return t?a.jsx(Ji,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(Ca,{...e}),children:a.jsx(W8,{original:t,revised:e.resource})}):a.jsxs(Ji,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(Ca,{...e}),children:[a.jsx("h3",{children:"Created"}),a.jsx(Hv,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function X8(e,t){const n=e.entry,r=n.findIndex(o=>{var i,s,l;return((s=(i=o.resource)==null?void 0:i.meta)==null?void 0:s.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function J8(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:K8.pinnedComment;return a.jsx(Ji,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:a.jsx(Ca,{...e}),children:a.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function Z8(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 a.jsx(Ji,{resource:e.resource,padding:!!n,popupMenuItems:a.jsx(Ca,{...e}),children:a.jsx(Tc,{value:e.resource.content})})}function eF(e){return a.jsx(Ji,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(Ca,{...e}),children:a.jsx(dr,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function tF(e){return a.jsx(Ji,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(Ca,{...e}),children:a.jsx(Lv,{value:e.resource})})}function nF(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Qh(e.loaded)} / ${Qh(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Qh(e.loaded)}`}function Qh(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 rF(e){return a.jsx(Bf,{value:e.resource,loadTimelineResources:async(t,n,r)=>{const o=`${n}/${r}`;return Promise.allSettled([t.readHistory(n,r),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:100})])}})}function we(e){const{children:t,...n}=e;return a.jsx(Pc,{children:a.jsx(Fv,{...n,children:t})})}function oF(e){return a.jsx(Bf,{value:e.encounter,loadTimelineResources:async(t,n,r)=>Promise.allSettled([t.readHistory("Encounter",r),t.search("Communication","encounter=Encounter/"+r),t.search("Media","encounter=Encounter/"+r)]),createCommunication:(t,n,r)=>({resourceType:"Communication",status:"completed",encounter:wt(t),subject:t.subject,sender:wt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",encounter:wt(t),subject:t.subject,operator:wt(n),issued:new Date().toISOString(),content:r})})}function iF(e){let t;try{t=P$(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return a.jsx(So,{value:t[0]||"",propertyType:e.propertyType})}function sF(e){return a.jsxs(En,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(W,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(ow,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(ow,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(ue,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function ow(e){return a.jsx(ee,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const aF={string:[ne.EQUALS,ne.NOT,ne.CONTAINS,ne.EXACT],fulltext:[ne.EQUALS,ne.NOT,ne.CONTAINS,ne.EXACT],token:[ne.EQUALS,ne.NOT],reference:[ne.EQUALS,ne.NOT],numeric:[ne.EQUALS,ne.NOT_EQUALS,ne.GREATER_THAN,ne.LESS_THAN,ne.GREATER_THAN_OR_EQUALS,ne.LESS_THAN_OR_EQUALS],quantity:[ne.EQUALS,ne.NOT_EQUALS,ne.GREATER_THAN,ne.LESS_THAN,ne.GREATER_THAN_OR_EQUALS,ne.LESS_THAN_OR_EQUALS],date:[ne.EQUALS,ne.NOT_EQUALS,ne.GREATER_THAN,ne.LESS_THAN,ne.GREATER_THAN_OR_EQUALS,ne.LESS_THAN_OR_EQUALS,ne.STARTS_AFTER,ne.ENDS_BEFORE,ne.APPROXIMATELY],datetime:[ne.EQUALS,ne.NOT_EQUALS,ne.GREATER_THAN,ne.LESS_THAN,ne.GREATER_THAN_OR_EQUALS,ne.LESS_THAN_OR_EQUALS,ne.STARTS_AFTER,ne.ENDS_BEFORE,ne.APPROXIMATELY]},lF={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",contains:"contains",exact:"exact",text:"text",not:"not",above:"above",below:"below",in:"in","not-in":"not in","of-type":"of type",missing:"missing",identifier:"identifier",iterate:"iterate"};function Wv(e,t){return{...e,filters:t,offset:0,name:void 0}}function qv(e,t){return Wv(e,(e.filters??[]).filter(n=>n.code!==t))}function Uf(e,t,n,r,o){o&&(e=qv(e,t));const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),Wv(e,i)}function cF(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function uF(e,t){return Gv(e,t,-1)}function dF(e,t){return Gv(e,t,0)}function fF(e,t){return Gv(e,t,1)}function Gv(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),Kv(e,t,r,o)}function hF(e,t){return Qv(e,t,-1)}function pF(e,t){return Qv(e,t,0)}function mF(e,t){return Qv(e,t,1)}function Qv(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),Kv(e,t,r,o)}function gF(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),Kv(e,t,n,new Date)}function Kv(e,t,n,r){return e=qv(e,t),e=iw(e,t,ne.GREATER_THAN_OR_EQUALS,n),e=iw(e,t,ne.LESS_THAN_OR_EQUALS,r),e}function iw(e,t,n,r){return Uf(e,t,n,r.toISOString())}function sw(e,t,n=!0){return Uf(e,t,ne.MISSING,n.toString())}function yF(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function vF(e,t){const n=e.count??bc,r=(t-1)*n;return yF(e,r)}function xF(e,t,n){return t===wF(e)&&n!==void 0&&n===SF(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function wF(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function SF(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function bF(e){return aF[e.type]}function Yv(e){return lF[e]??""}function hi(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(nn).join(" "))}function CF(e,t){var r,o;const n=t.name;return n==="id"?e.id:n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?Fn((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?EF(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?jF(e,t.searchParams[0]):null}function EF(e,t){var i,s,l;const n=((l=(s=(i=t.path)==null?void 0:i.split("."))==null?void 0:s.pop())==null?void 0:l.replaceAll("[x]",""))??"",[r,o]=$f({type:e.resourceType,value:e},n);return r?a.jsx(So,{property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function jF(e,t){const n=Gl(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(So,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function TF(e){const t=p.useRef(!1),[n,r]=p.useState({search:JSON.parse(Ln(e.search))}),[o,i]=p.useState(!1);p.useEffect(()=>{r({search:e.search})},[e.search]);const s=p.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=WM(c),d=hv(c);return PF(u,d).sort((f,h)=>f.localeCompare(h)).map(f=>({value:f,label:hi(f)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){r({search:{...n.search,fields:c}})}return a.jsx(En,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs(Se,{children:[a.jsx(Sf,{style:{width:550},placeholder:"Select fields to display",data:s,value:n.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),a.jsx(X,{justify:"flex-end",children:a.jsx(ee,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function PF(e,t){const n=[],r=new Set,o=new Set;for(const i of Object.keys(e.elements))n.push(i),r.add(i.toLowerCase()),o.add(hi(i));if(t)for(const i of Object.keys(t)){const s=hi(i);!r.has(i)&&!o.has(s)&&(n.push(i),r.add(i),o.add(s))}return n}function fP(e){var o;const{resourceType:t,filter:n}=e,r=(o=di.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===ne.EQUALS||n.operator===ne.NOT_EQUALS))return a.jsx(kc,{value:{reference:n.value}});const i=Af(t,r);if(n.code==="_lastUpdated"||i.type===Bo.DATETIME)return a.jsx(a.Fragment,{children:Fn(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function hP(e){const t=Af(e.resourceType,e.searchParam),n="filter-value";switch(t.type){case Bo.REFERENCE:return a.jsx(Ff,{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 Bo.BOOLEAN:return a.jsx(cr,{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 Bo.DATE:return a.jsx(se,{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 Bo.DATETIME:return a.jsx(Yi,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Bo.NUMBER:return a.jsx(se,{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 Bo.QUANTITY:return a.jsx(Xi,{name:n,defaultValue:kF(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(se,{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 kF(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function RF(e){const[t,n]=p.useState(JSON.parse(Ln(e.search))),[r,o]=p.useState(-1),i=p.useRef(t);i.current=t,p.useEffect(()=>{n(JSON.parse(Ln(e.search)))},[e.search]);function s(d){n(Uf(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=hv(l)??{},u=t.filters||[];return a.jsxs(En,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[a.jsx("div",{children:a.jsxs("table",{children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:380}}),a.jsx("col",{style:{width:120}})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Field"}),a.jsx("th",{children:"Operation"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Actions"})]})}),a.jsxs("tbody",{children:[u.map((d,f)=>f===r?a.jsx(aw,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[f]=h,n(Wv(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):a.jsx(DF,{resourceType:l,filter:d,onEdit:()=>o(f),onDelete:()=>n(cF(i.current,f))},`filter-${d.code}-${d.operator}-${d.value}-display`)),a.jsx(aw,{resourceType:l,searchParams:c,okText:"Add",onOk:s})]})]})}),a.jsx(X,{justify:"flex-end",mt:"xl",children:a.jsx(ee,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function DF(e){const{filter:t}=e;return a.jsxs("tr",{children:[a.jsx("td",{children:hi(t.code)}),a.jsx("td",{children:Yv(t.operator)}),a.jsx("td",{children:a.jsx(fP,{resourceType:e.resourceType,filter:t})}),a.jsxs("td",{children:[a.jsx(ee,{size:"compact-md",variant:"outline",onClick:e.onEdit,children:"Edit"}),a.jsx(ee,{size:"size-md",variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function aw(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useRef(t);r.current=t;function o(u){n({...r.current,code:u})}function i(u){n({...r.current,operator:u})}function s(u){n({...r.current,value:u})}const l=e.searchParams[t.code],c=l&&bF(l);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(yt,{"data-testid":"filter-field",defaultValue:r.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:hi(u)}))]})}),a.jsx("td",{children:c&&a.jsx(yt,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:Yv(u)}))]})}),a.jsx("td",{children:l&&t.operator&&a.jsx(hP,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:s})}),a.jsxs("td",{children:[t.code&&t.operator&&a.jsx(ee,{size:"compact-md",variant:"outline",onClick:()=>{e.onOk(r.current),n({})},children:e.okText}),e.onCancel&&a.jsx(ee,{size:"compact-md",variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function IF(e){const[t,n]=p.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return a.jsx(En,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(Be,{onSubmit:r,children:a.jsxs(Hn,{children:[a.jsx(Hn.Col,{span:10,children:a.jsx(hP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(Hn.Col,{span:2,children:a.jsx(ee,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function _F(e){if(!e.searchParams)return null;function t(i,s){o(xF(e.search,i.code,s))}function n(i){o(qv(e.search,i.code))}function r(i,s){e.onPrompt(i,{code:i.code,operator:s,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?a.jsx(AF,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(J.Dropdown,{children:e.searchParams.map(i=>a.jsx(J.Item,{children:hi(i.code)},i.code))})}function AF(e){switch(e.searchParam.type){case"date":return a.jsx(NF,{...e});case"number":case"quantity":return a.jsx(OF,{...e});case"reference":return a.jsx(MF,{...e});case"string":return a.jsx($F,{...e});case"token":case"uri":return a.jsx(LF,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function NF(e){const{searchParam:t}=e,n=t.code;return a.jsxs(J.Dropdown,{children:[a.jsx(J.Item,{leftSection:a.jsx(Tv,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(J.Item,{leftSection:a.jsx(Pv,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(jc,{size:14}),onClick:()=>e.onPrompt(t,ne.EQUALS),children:"Equals..."}),a.jsx(J.Item,{leftSection:a.jsx(Ec,{size:14}),onClick:()=>e.onPrompt(t,ne.NOT_EQUALS),children:"Does not equal..."}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(kT,{size:14}),onClick:()=>e.onPrompt(t,ne.ENDS_BEFORE),children:"Before..."}),a.jsx(J.Item,{leftSection:a.jsx(PT,{size:14}),onClick:()=>e.onPrompt(t,ne.STARTS_AFTER),children:"After..."}),a.jsx(J.Item,{leftSection:a.jsx(UL,{size:14}),onClick:()=>e.onPrompt(t,ne.EQUALS),children:"Between..."}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(Ti,{size:14}),onClick:()=>e.onChange(fF(e.search,n)),children:"Tomorrow"}),a.jsx(J.Item,{leftSection:a.jsx(Ti,{size:14}),onClick:()=>e.onChange(dF(e.search,n)),children:"Today"}),a.jsx(J.Item,{leftSection:a.jsx(Ti,{size:14}),onClick:()=>e.onChange(uF(e.search,n)),children:"Yesterday"}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(Ti,{size:14}),onClick:()=>e.onChange(mF(e.search,n)),children:"Next Month"}),a.jsx(J.Item,{leftSection:a.jsx(Ti,{size:14}),onClick:()=>e.onChange(pF(e.search,n)),children:"This Month"}),a.jsx(J.Item,{leftSection:a.jsx(Ti,{size:14}),onClick:()=>e.onChange(hF(e.search,n)),children:"Last Month"}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(Ti,{size:14}),onClick:()=>e.onChange(gF(e.search,n)),children:"Year to date"}),a.jsx(Dc,{...e})]})}function OF(e){const{searchParam:t}=e;return a.jsxs(J.Dropdown,{children:[a.jsx(J.Item,{leftSection:a.jsx(Tv,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(J.Item,{leftSection:a.jsx(Pv,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(jc,{size:14}),onClick:()=>e.onPrompt(t,ne.EQUALS),children:"Equals..."}),a.jsx(J.Item,{leftSection:a.jsx(Ec,{size:14}),onClick:()=>e.onPrompt(t,ne.NOT_EQUALS),children:"Does not equal..."}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(PT,{size:14}),onClick:()=>e.onPrompt(t,ne.GREATER_THAN),children:"Greater than..."}),a.jsx(J.Item,{leftSection:a.jsx(fm,{size:14}),onClick:()=>e.onPrompt(t,ne.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(J.Item,{leftSection:a.jsx(kT,{size:14}),onClick:()=>e.onPrompt(t,ne.LESS_THAN),children:"Less than..."}),a.jsx(J.Item,{leftSection:a.jsx(fm,{size:14}),onClick:()=>e.onPrompt(t,ne.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(Dc,{...e})]})}function MF(e){const{searchParam:t}=e;return a.jsxs(J.Dropdown,{children:[a.jsx(J.Item,{leftSection:a.jsx(jc,{size:14}),onClick:()=>e.onPrompt(t,ne.EQUALS),children:"Equals..."}),a.jsx(J.Item,{leftSection:a.jsx(Ec,{size:14}),onClick:()=>e.onPrompt(t,ne.NOT),children:"Does not equal..."}),a.jsx(Dc,{...e})]})}function $F(e){const{searchParam:t}=e;return a.jsxs(J.Dropdown,{children:[a.jsx(J.Item,{leftSection:a.jsx(Tv,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(J.Item,{leftSection:a.jsx(Pv,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(jc,{size:14}),onClick:()=>e.onPrompt(t,ne.EQUALS),children:"Equals..."}),a.jsx(J.Item,{leftSection:a.jsx(Ec,{size:14}),onClick:()=>e.onPrompt(t,ne.NOT),children:"Does not equal..."}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(WL,{size:14}),onClick:()=>e.onPrompt(t,ne.CONTAINS),children:"Contains..."}),a.jsx(J.Item,{leftSection:a.jsx(HL,{size:14}),onClick:()=>e.onPrompt(t,ne.EQUALS),children:"Does not contain..."}),a.jsx(Dc,{...e})]})}function LF(e){const{searchParam:t}=e;return a.jsxs(J.Dropdown,{children:[a.jsx(J.Item,{leftSection:a.jsx(jc,{size:14}),onClick:()=>e.onPrompt(t,ne.EQUALS),children:"Equals..."}),a.jsx(J.Item,{leftSection:a.jsx(Ec,{size:14}),onClick:()=>e.onPrompt(t,ne.NOT),children:"Does not equal..."}),a.jsx(Dc,{...e})]})}function Dc(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(zL,{size:14}),onClick:()=>e.onChange(sw(e.search,n)),children:"Missing"}),a.jsx(J.Item,{leftSection:a.jsx(FL,{size:14}),onClick:()=>e.onChange(sw(e.search,n,!1)),children:"Not missing"}),a.jsx(J.Divider,{}),a.jsx(J.Item,{leftSection:a.jsx(Sd,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const FF="_root_vlout_1",zF="_table_vlout_8",BF="_tr_vlout_12",UF="_th_vlout_18",VF="_control_vlout_22",HF="_icon_vlout_31",Za={root:FF,table:zF,tr:BF,th:UF,control:VF,icon:HF};function WF(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(qF(t,r));return n}function qF(e,t){var o;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=gs(e,t),r=JM(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=hv(e);let s;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);s=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),s.length===0&&(s=void 0)}return{name:t,elementDefinition:n,searchParams:s}}if(r){const i=Af(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class GF extends Event{constructor(t){super("change"),this.definition=t}}class QF extends Event{constructor(t){super("load"),this.response=t}}class Cd extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function KF(e){var O,N,B;const t=re(),[n,r]=p.useState(),[o,i]=p.useState(),{search:s,onLoad:l}=e,[c,u]=p.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),d=p.useRef(c);d.current=c;const f=p.useCallback(I=>{i(void 0),t.search(s.resourceType,qs({...s,fields:void 0}),I).then($=>{u({...d.current,searchResponse:$}),l&&l(new QF($))}).catch($=>{u({...d.current,searchResponse:void 0}),i($)})},[t,s,l]),h=p.useCallback(()=>{u({...d.current,searchResponse:void 0}),f({cache:"reload"})},[f]);p.useEffect(()=>{f()},[f]);function m(I,$){I.stopPropagation();const F=I.target.checked,q={...d.current.selected};F?q[$]=!0:delete q[$],u({...d.current,selected:q})}function g(I){I.stopPropagation();const _=I.target.checked,F={},q=d.current.searchResponse;_&&(q!=null&&q.entry)&&q.entry.forEach(G=>{var oe;(oe=G.resource)!=null&&oe.id&&(F[G.resource.id]=!0)}),u({...d.current,selected:F})}function y(){var $,_;const I=d.current;if(!(($=I.searchResponse)!=null&&$.entry)||I.searchResponse.entry.length===0)return!1;for(const F of I.searchResponse.entry)if((_=F.resource)!=null&&_.id&&!I.selected[F.resource.id])return!1;return!0}function C(I){e.onChange&&e.onChange(new GF(I))}function v(I,$){if(IT(I.target)||I.button===2)return;tt(I);const _=I.button===1||I.ctrlKey||I.metaKey;!_&&e.onClick&&e.onClick(new Cd($,I)),_&&e.onAuxClick&&e.onAuxClick(new Cd($,I))}function x(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(p.useEffect(()=>{r(e.search.resourceType),t.requestSchema(e.search.resourceType).catch(console.error).finally(()=>r(void 0))},[t,e.search.resourceType]),!aT(e.search.resourceType)||n===e.search.resourceType)return a.jsx(Vt,{style:{width:"100%",height:"100%"},children:a.jsx($n,{})});const w=e.checkboxesEnabled,S=WF(s),j=s.resourceType,E=c.searchResponse,T=E==null?void 0:E.entry,P=T==null?void 0:T.map(I=>I.resource),k="subtle",D="gray",M=16,R=window.innerWidth<768;return a.jsxs("div",{className:Za.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(X,{justify:"space-between",mb:"xl",children:[a.jsxs(X,{gap:2,children:[a.jsx(ee,{size:"compact-md",variant:k,color:D,leftSection:a.jsx(YL,{size:M}),onClick:()=>u({...d.current,fieldEditorVisible:!0}),children:"Fields"}),a.jsx(ee,{size:"compact-md",variant:k,color:D,leftSection:a.jsx(n7,{size:M}),onClick:()=>u({...d.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&a.jsx(ee,{size:"compact-md",variant:k,color:D,leftSection:a.jsx(t7,{size:M}),onClick:e.onNew,children:"New..."}),!R&&x()&&a.jsx(ee,{size:"compact-md",variant:k,color:D,leftSection:a.jsx(C7,{size:M}),onClick:e.onExport?e.onExport:()=>u({...d.current,exportDialogVisible:!0}),children:"Export..."}),!R&&e.onDelete&&a.jsx(ee,{size:"compact-md",variant:k,color:D,leftSection:a.jsx(RT,{size:M}),onClick:()=>e.onDelete(Object.keys(c.selected)),children:"Delete..."}),!R&&e.onBulk&&a.jsx(ee,{size:"compact-md",variant:k,color:D,leftSection:a.jsx(BL,{size:M}),onClick:()=>e.onBulk(Object.keys(c.selected)),children:"Bulk..."})]}),a.jsxs(X,{gap:2,children:[E&&a.jsxs(ue,{size:"xs",c:"dimmed",children:[ZF(s,E),"-",ez(s,E),E.total!==void 0&&` of ${s.total==="estimate"?"~":""}${(O=E.total)==null?void 0:O.toLocaleString()}`]}),a.jsx(qt,{variant:k,color:D,title:"Refresh",onClick:h,children:a.jsx(y7,{size:M})})]})]}),a.jsxs(me,{className:Za.table,children:[a.jsxs(me.Thead,{children:[a.jsxs(me.Tr,{children:[w&&a.jsx(me.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:y(),onChange:I=>g(I)})}),S.map(I=>a.jsx(me.Th,{children:a.jsxs(J,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(J.Target,{children:a.jsx(Qn,{className:Za.control,p:2,children:a.jsxs(X,{justify:"space-between",wrap:"nowrap",children:[a.jsx(ue,{fw:500,children:hi(I.name)}),a.jsx(Vt,{className:Za.icon,children:a.jsx(ML,{size:14,stroke:1.5})})]})})}),a.jsx(_F,{search:e.search,searchParams:I.searchParams,onPrompt:($,_)=>{u({...d.current,filterDialogVisible:!0,filterDialogSearchParam:$,filterDialogFilter:_})},onChange:$=>{C($)}})]})},I.name))]}),!e.hideFilters&&a.jsxs(me.Tr,{children:[w&&a.jsx(me.Th,{}),S.map(I=>a.jsx(me.Th,{children:I.searchParams&&a.jsx(YF,{resourceType:j,searchParams:I.searchParams,filters:e.search.filters})},I.name))]})]}),a.jsx(me.Tbody,{children:P==null?void 0:P.map(I=>I&&a.jsxs(me.Tr,{className:Za.tr,"data-testid":"search-control-row",onClick:$=>v($,I),onAuxClick:$=>v($,I),children:[w&&a.jsx(me.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${I.id}`,checked:!!c.selected[I.id],onChange:$=>m($,I.id)})}),S.map($=>a.jsx(me.Td,{children:CF(I,$)},$.name))]},I.id))})]}),(P==null?void 0:P.length)===0&&a.jsx(Pc,{children:a.jsx(Vt,{style:{height:150},children:a.jsx(ue,{size:"xl",c:"dimmed",children:"No results"})})}),E&&a.jsx(Vt,{m:"md",p:"md",children:a.jsx(Ar,{value:XF(s),total:JF(s,E),onChange:I=>C(vF(s,I)),getControlProps:I=>{switch(I){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),a.jsx(TF,{search:e.search,visible:d.current.fieldEditorVisible,onOk:I=>{C(I),u({...d.current,fieldEditorVisible:!1})},onCancel:()=>{u({...d.current,fieldEditorVisible:!1})}}),a.jsx(RF,{search:e.search,visible:d.current.filterEditorVisible,onOk:I=>{C(I),u({...d.current,filterEditorVisible:!1})},onCancel:()=>{u({...d.current,filterEditorVisible:!1})}}),a.jsx(sF,{visible:d.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{u({...d.current,exportDialogVisible:!1})}}),a.jsx(IF,{visible:d.current.filterDialogVisible,title:(N=c.filterDialogSearchParam)!=null&&N.code?hi(c.filterDialogSearchParam.code):"",resourceType:j,searchParam:c.filterDialogSearchParam,filter:c.filterDialogFilter,defaultValue:"",onOk:I=>{C(Uf(e.search,I.code,I.operator,I.value)),u({...d.current,filterDialogVisible:!1})},onCancel:()=>{u({...d.current,filterDialogVisible:!1})}},(B=c.filterDialogSearchParam)==null?void 0:B.code)]})}const Ic=p.memo(KF);function YF(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?a.jsx("span",{children:"no filters"}):a.jsx(a.Fragment,{children:t.map(n=>a.jsxs("div",{children:[Yv(n.operator)," ",a.jsx(fP,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function XF(e){return Math.floor((e.offset??0)/(e.count??bc))+1}function JF(e,t){const n=e.count??bc;return Math.ceil(Xv(e,t)/n)}function ZF(e,t){return Math.min(Xv(e,t),(e.offset??0)+1)}function ez(e,t){return Math.min(Xv(e,t),((e.offset??0)+1)*(e.count??bc))}function Xv(e,t){var r,o;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((o=t.link)!=null&&o.some(i=>i.relation==="next")?1:0)),n}function tz(e){const t=re(),[n,r]=p.useState(!1),[o,i]=p.useState(),{query:s,fields:l}=e,[c,u]=p.useState(),[d,f]=p.useState({}),h=p.useRef();h.current=c;const m=p.useRef({});m.current=d,p.useEffect(()=>{i(void 0),t.graphql(s).then(u).catch(w=>i(ct(w)))},[t,s]);function g(w,S){w.stopPropagation();const E=w.target.checked,T={...m.current};E?T[S]=!0:delete T[S],f(T)}function y(w){var P;w.stopPropagation();const j=w.target.checked,E={},T=(P=h.current)==null?void 0:P.data.ResourceList;j&&T&&T.forEach(k=>{k.id&&(E[k.id]=!0)}),f(E)}function C(){var S;const w=(S=h.current)==null?void 0:S.data.ResourceList;if(!w||w.length===0)return!1;for(const j of w)if(j.id&&!m.current[j.id])return!1;return!0}function v(w,S){IT(w.target)||(tt(w),w.button!==1&&e.onClick&&e.onClick(new Cd(S,w)),w.button===1&&e.onAuxClick&&e.onAuxClick(new Cd(S,w)))}if(p.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx($n,{});const x=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:w=>tt(w),"data-testid":"search-control",children:[a.jsxs(me,{children:[a.jsx(me.Thead,{children:a.jsxs(me.Tr,{children:[x&&a.jsx(me.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:w=>y(w)})}),l.map(w=>a.jsx(me.Th,{children:w.name},w.name))]})}),a.jsx(me.Tbody,{children:c==null?void 0:c.data.ResourceList.map(w=>w&&a.jsxs(me.Tr,{"data-testid":"search-control-row",onClick:S=>v(S,w),onAuxClick:S=>v(S,w),children:[x&&a.jsx(me.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${w.id}`,checked:!!d[w.id],onChange:S=>g(S,w.id)})}),l.map(S=>a.jsx(me.Td,{children:a.jsx(iF,{propertyType:S.propertyType,path:S.fhirPath,resource:w})},S.name))]},w.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&a.jsx(ee,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const nz=p.memo(tz);function Nr(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[a.jsx("title",{children:"Medplum Logo"}),a.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),a.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"}),a.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"}),a.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),a.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function rz(e){const{group:t}=e;return a.jsx(On,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(X,{children:[t.measureScore&&a.jsx(sz,{group:t}),!t.measureScore&&a.jsx(iz,{group:t})]})})}function oz(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(ue,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(ue,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function iz(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(c=>wa(c.code)==="numerator"),o=n==null?void 0:n.find(c=>wa(c.code)==="denominator"),i=r==null?void 0:r.count,s=o==null?void 0:o.count;if(s===0)return a.jsxs(W,{children:[a.jsx(ce,{order:3,children:"Not Applicable"}),a.jsx(ue,{children:`Denominator: ${s}`})]});if(i===void 0||s===void 0)return a.jsxs(W,{children:[a.jsx(ce,{order:3,children:"Insufficient Data"}),a.jsx(ue,{children:`Numerator: ${i}`}),a.jsx(ue,{children:`Denominator: ${s}`})]});const l=i/s*100;return a.jsx(Pf,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:pP(l)}],label:a.jsx(ga,{justify:"center",children:a.jsxs(ue,{fw:700,fz:18,children:[i," / ",s]})})})}function sz(e){var r,o,i;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((o=t.measureScore)==null?void 0:o.code);return a.jsx(a.Fragment,{children:n==="%"?a.jsx(Pf,{size:120,thickness:12,roundCaps:!0,sections:[{value:az(t),color:pP(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:a.jsx(ga,{justify:"center",children:a.jsx(ue,{fw:700,fz:18,children:a.jsx(Ql,{value:t.measureScore})})})}):a.jsx(ga,{h:120,align:"center",children:a.jsx(ce,{order:3,children:a.jsx(Ql,{value:t.measureScore})})})})}function az(e){var r,o;const t=(r=e.measureScore)==null?void 0:r.value,n=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&n==="%"?t*100:t:0}function pP(e){return e<=33?"red":e<=67?"yellow":"green"}function lz(e){var r;const t=st(e.measureReport),[n]=TL("Measure",{url:t==null?void 0:t.measure});return t?a.jsxs(W,{children:[n&&a.jsx(oz,{measure:n}),a.jsx(Gy,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>a.jsx(rz,{group:o},o.id??i))})]}):null}function to(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:a.jsx(us,{icon:a.jsx(Cc,{size:16}),color:"red",children:t.map(r=>{var o;return a.jsx("div",{"data-testid":"text-field-error",children:Wj(r)},(o=r.details)==null?void 0:o.text)})})}function cz(e){const t=p.useCallback((n,r,o)=>{const i=`${r}/${o}`,s=100;return Promise.allSettled([n.readHistory("Patient",o),n.search("Communication",{subject:i,_count:s}),n.search("Device",{patient:i,_count:s}),n.search("DeviceRequest",{patient:i,_count:s}),n.search("DiagnosticReport",{subject:i,_count:s}),n.search("Media",{subject:i,_count:s}),n.search("ServiceRequest",{subject:i,_count:s}),n.search("Task",{subject:i,_count:s})])},[]);return a.jsx(Bf,{value:e.patient,loadTimelineResources:t,createCommunication:(n,r,o)=>({resourceType:"Communication",status:"completed",subject:wt(n),sender:wt(r),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(n,r,o)=>({resourceType:"Media",status:"completed",subject:wt(n),operator:wt(r),issued:new Date().toISOString(),content:o})})}const uz="_section_14dzq_2",dz="_hovering_14dzq_11",fz="_editing_14dzq_15",hz="_bottomActions_14dzq_20",Gs={section:uz,hovering:dz,editing:fz,bottomActions:hz};function pz(e){const t=re(),n=st(e.value),[r,o]=p.useState(!1),[i,s]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){c(void 0)}function h(){s(void 0)}const m=p.useRef();if(m.current=u,p.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(d(wz(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]),!r||!u)return null;function g(y,C){d({...m.current,[y]:C})}return a.jsx("div",{children:a.jsxs(Be,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[a.jsx(se,{label:"Plan Title",defaultValue:u.title,onChange:y=>g("title",y.currentTarget.value)}),a.jsx(mP,{actions:u.action||[],selectedKey:i,setSelectedKey:s,hoverKey:l,setHoverKey:c,onChange:y=>g("action",y)}),a.jsx(ee,{type:"submit",children:"Save"})]})})}function mP(e){const t=p.useRef();t.current=e.actions;function n(i){e.onChange(t.current.map(s=>s.id===i.id?i:s))}function r(i){e.onChange([...t.current,i]),e.setSelectedKey(i.id)}function o(i){e.onChange(t.current.filter(s=>s!==i))}return a.jsxs("div",{className:Gs.section,children:[e.actions.map(i=>a.jsx("div",{children:a.jsx(mz,{action:i,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(i)})},i.id)),a.jsx("div",{className:Gs.bottomActions,children:a.jsx(Ue,{href:"#",onClick:i=>{tt(i),r({id:yP()})},children:"Add action"})})]})}function mz(e){const{action:t}=e,n=xz(t),r=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function i(c){c.stopPropagation(),e.setSelectedKey(e.action.id)}function s(c){tt(c),e.setHoverKey(e.action.id)}const l=Je(Gs.section,{[Gs.editing]:r,[Gs.hovering]:o&&!r});return a.jsxs("div",{"data-testid":t.id,className:l,onClick:i,onMouseOver:s,onFocus:s,children:[r?a.jsx(yz,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):a.jsx(gz,{action:t,actionType:n}),a.jsx("div",{className:Gs.bottomActions,children:a.jsx(Ue,{href:"#",onClick:c=>{c.preventDefault(),e.onRemove()},children:"Remove"})})]})}const vm={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function gz(e){const{action:t,actionType:n}=e,[r,o]=gP(t);return a.jsxs("div",{children:[a.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&a.jsx("div",{children:a.jsx(bd,{value:{reference:t.definitionCanonical}})}),r&&a.jsx("div",{children:a.jsx(So,{property:vm,propertyType:o,value:r})})]})}function yz(e){const{action:t}=e,[n,r]=p.useState(e.actionType);function o(i,s){e.onChange({...t,[i]:s})}return a.jsxs(Se,{gap:"xl",children:[a.jsx(se,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),a.jsx(se,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),a.jsx(yt,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:n,onChange:i=>r(i.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&a.jsx(mP,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:i=>o("action",i)}),(()=>{switch(n){case"appointment":return a.jsx(fu,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return a.jsx(fu,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return a.jsx(fu,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return a.jsx(fu,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),a.jsx(it,{title:"Timing",description:"When the action should take place.",children:a.jsx(vz,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function fu(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(Ma,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:pt(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function vz(e){const t=e.action,n="timing",[r,o]=gP(t);return a.jsx($a,{property:vm,name:"timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(i,s)=>{e.onChange(mm(t,n,s??n,vm,i))},outcome:void 0})}function xz(e){var t,n,r;if((t=e.definitionCanonical)!=null&&t.startsWith("Schedule"))return"appointment";if((n=e.definitionCanonical)!=null&&n.startsWith("Questionnaire/"))return"questionnaire";if((r=e.definitionCanonical)!=null&&r.startsWith("ActivityDefinition/"))return"task"}function gP(e){return $f({type:"PlanDefinitionAction",value:e},"timing")}let Kh=1;function yP(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Kh=Math.max(Kh,t+1))}return e}return"id-"+Kh++}function wz(e){return{...e,action:vP(e.action)}}function vP(e){if(e)return e.map(t=>({...t,id:yP(t.id),action:vP(t.action)}))}var ht=(e=>(e.group="group",e.display="display",e.question="question",e.boolean="boolean",e.decimal="decimal",e.integer="integer",e.date="date",e.dateTime="dateTime",e.time="time",e.string="string",e.text="text",e.url="url",e.choice="choice",e.openChoice="open-choice",e.attachment="attachment",e.reference="reference",e.quantity="quantity",e))(ht||{});function Sz(e){return e.type==="choice"||e.type==="open-choice"}function bz(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=xP(t,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(o!=null&&o.length)){if(n==="any")return!0;continue}const{anyMatch:i,allMatch:s}=jz(r,o,n);if(n==="any"&&i)return!0;if(n==="all"&&!s)return!1}return n!=="any"}function Cz(e,t,n){return e.map(r=>{var s;const o=(s=n.answerOption)==null?void 0:s.find(l=>ms(l.valueCoding)===r||l[t]===r),i=vn({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function xP(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=xP(n.item,t);if(r)return r}}}function Ez(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:o}]=Gl(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function jz(e,t,n){const r=t||[],o=vn({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,s=!0;for(const l of r){const c=vn({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(Ez(c,o,u)?i=!0:s=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:s}}function wP(e){var n,r;const t=xc(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(o=>o.code)}}function Yh(e,t){var o;const n=vi(e);let r=xc(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(o=n.extension)==null?void 0:o.filter(i=>i!==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(i=>({code:i}))},delete r.valueCode),n)}function Tz(e,t,n){const r=xc(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(r!=null&&r.valueString))return;let o=r.valueString;t!=null&&t.reference&&(o=o.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(o=o.replaceAll("$encounter",n.reference));const i={},s=o.split("&");for(const l of s){const[c,u]=DO(l,"=",2);i[c]=u}return i}function Pz(e){return{resourceType:"QuestionnaireResponse",questionnaire:pt(e),item:SP(e.item),status:"in-progress"}}function SP(e){return(e==null?void 0:e.map(bP))??[]}function bP(e){var t;return{id:Rz(),linkId:e.linkId,text:e.text,item:SP(e.item),answer:((t=e.initial)==null?void 0:t.map(Dz))??[]}}let kz=1;function Rz(){return"id-"+kz++}function Dz(e){return{...e}}function Iz(e){return e.value.display||e.value.reference||Ln(e.value)}function _z(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const s=xc(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(r=s==null?void 0:s.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}const CP=p.createContext({});function xm(e){const t=p.useContext(CP),n=e.item,r=e.response;function o(u){var f,h,m,g;let d;Array.isArray(u)?d=u:e.index>=(((h=(f=e.response)==null?void 0:f.answer)==null?void 0:h.length)??0)?d=(((m=e.response)==null?void 0:m.answer)??[]).concat([u]):d=(((g=e.response)==null?void 0:g.answer)??[]).map((C,v)=>v===e.index?u:C)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:d})}const i=n.type;if(!i)return null;const s=n.linkId;if(!s)return null;const l=n.initial&&n.initial.length>0?n.initial[0]:void 0,c=Jv(r,e.index)??vn({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case ht.display:return a.jsx("p",{children:e.item.text},e.item.linkId);case ht.boolean:return a.jsx(LT,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx(cr,{id:e.item.linkId,name:e.item.linkId,defaultChecked:c==null?void 0:c.value,onChange:u=>o({valueBoolean:u.currentTarget.checked})})},e.item.linkId);case ht.decimal:return a.jsx(se,{type:"number",step:"any",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDecimal:u.currentTarget.valueAsNumber})});case ht.integer:return a.jsx(se,{type:"number",step:1,id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueInteger:u.currentTarget.valueAsNumber})});case ht.date:return a.jsx(se,{type:"date",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case ht.dateTime:return a.jsx(Yi,{name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case ht.time:return a.jsx(se,{type:"time",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case ht.string:case ht.url:return a.jsx(se,{id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case ht.text:return a.jsx(ds,{id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case ht.attachment:return a.jsx(X,{py:4,children:a.jsx(NT,{name:s,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case ht.reference:return a.jsx(Ff,{name:s,required:n.required,targetTypes:wP(n),searchCriteria:Tz(n,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case ht.quantity:return a.jsx(Xi,{name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case ht.choice:case ht.openChoice:return Lz(n)&&!n.answerValueSet?a.jsx(Az,{name:s,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)}):a.jsx(Nz,{name:s,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)});default:return null}}function Az(e){var c;const{name:t,item:n,initial:r,response:o}=e;if(!((c=n.answerOption)!=null&&c.length))return a.jsx(EP,{});const i=vn({type:"QuestionnaireItemInitial",value:r},"value"),s=[""];for(const u of n.answerOption){const d=vn({type:"QuestionnaireItemAnswerOption",value:u},"value");s.push(lw(d))}const l=Jv(o)??i;if(n.repeats){const{propertyName:u,data:d}=Fz(e.item),f=Mz(o);return a.jsx(Sf,{data:d,placeholder:"Select items",searchable:!0,defaultValue:f||[lw(i)],onChange:h=>{const m=Cz(h,u,n);e.onChangeAnswer(m)}})}return a.jsx(yt,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const f=n.answerOption[d-1],h=vn({type:"QuestionnaireItemAnswerOption",value:f},"value"),m="value"+nn(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:ms(l==null?void 0:l.value)||(l==null?void 0:l.value),data:s})}function Nz(e){var s;const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e;return!((s=n.answerOption)!=null&&s.length)&&!n.answerValueSet?a.jsx(EP,{}):n.answerValueSet?a.jsx(zT,{name:t,binding:n.answerValueSet,onChange:l=>o({valueCoding:l})}):a.jsx(Oz,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function Oz(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,s=gs("QuestionnaireItemAnswerOption","value[x]"),l=vn({type:"QuestionnaireItemInitial",value:r},"value"),c=[];let u;if(n.answerOption)for(let h=0;h<n.answerOption.length;h++){const m=n.answerOption[h],g=`${t}-option-${h}`,y=vn({type:"QuestionnaireItemAnswerOption",value:m},"value");y!=null&&y.value&&(l&&Ln(y)===Ln(l)&&(u=g),c.push([g,y]))}const d=Jv(i),f=$z(c,d);return a.jsx(Hl.Group,{name:t,value:f??u,onChange:h=>{const m=c.find(g=>g[0]===h);if(m){const g=m[1],y="value"+nn(g.type);o({[y]:g.value})}},children:c.map(([h,m])=>a.jsx(Hl,{id:h,value:h,py:4,label:a.jsx(So,{property:s,propertyType:m.type,value:m.value})},h))})}function EP(){return a.jsx(se,{disabled:!0,placeholder:"No Answers Defined"})}function jP(e){return vn({type:"QuestionnaireItemAnswer",value:e},"value")}function Jv(e,t=0){const n=e.answer;return jP((n==null?void 0:n[t])??{})}function Mz(e){const t=e.answer;return t?t.map(r=>jP(r)).map(r=>ms(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function $z(e,t){var n;return(n=e.find(r=>wc(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function lw(e){if(e)return e.type==="CodeableConcept"?wa(e.value):e.type==="Coding"?ms(e.value):e.type==="Reference"?Iz(e):e.value.toString()}function Lz(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,o,i;return n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="drop-down"}))}function Fz(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=vn({type:"QuestionnaireItemAnswerOption",value:t},"value"),r="value"+nn(n.type),o=(e.answerOption??[]).map(s=>({value:cw(s,r),label:cw(s,r)}));return{propertyName:r,data:o}}function cw(e,t){var n;return ms(e.valueCoding)||((n=e[t])==null?void 0:n.toString())}const zz="_section_cpwxo_1",Bz="_hovering_cpwxo_10",Uz="_editing_cpwxo_14",Vz="_questionBody_cpwxo_19",Hz="_topActions_cpwxo_23",Wz="_bottomActions_cpwxo_32",qz="_movementActions_cpwxo_43",Gz="_movementIcons_cpwxo_55",Qz="_columnAlignment_cpwxo_59",Kz="_linkIdInput_cpwxo_64",Yz="_typeSelect_cpwxo_69",Zn={section:zz,hovering:Bz,editing:Uz,questionBody:Vz,topActions:Hz,bottomActions:Wz,movementActions:qz,movementIcons:Gz,columnAlignment:Qz,linkIdInput:Kz,typeSelect:Yz};function Xz(e){const t=re(),n=st(e.questionnaire),[r,o]=p.useState(!1),[i,s]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){d(void 0)}function h(){c(void 0)}p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(s(tB(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]);const m=(g,y)=>{s(g),e.autoSave&&!y&&e.onSubmit&&e.onSubmit(g)};return!r||!i?null:a.jsx("div",{children:a.jsxs(Be,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[a.jsx(TP,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:m}),a.jsx(ee,{type:"submit",children:"Save"})]})})}function TP(e){var w;const t=e.item,n=e.item,r=Io(e.item),o=r||n.type===ht.group,i=n.linkId??"[untitled]",s=e.selectedKey===e.item.id,l=e.hoverKey===e.item.id,c=p.useRef();c.current=e.item;function u(S){tt(S),e.setSelectedKey(e.item.id)}function d(S){tt(S),e.setHoverKey(e.item.id)}function f(S){var E;const j=c.current;e.onChange({...j,item:(E=j.item)==null?void 0:E.map(T=>T.id===S.id?S:T)})}function h(S,j){e.onChange({...e.item,item:[...e.item.item??[],S]},j)}function m(S){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.filter(E=>E!==S)})}function g(S,j){e.onChange({...c.current,[S]:j})}function y(S){e.onChange({...e.item,...S})}function C(S){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.map(E=>E===S?{...E,repeats:!E.repeats}:E)})}function v(S,j){const E=oB(e.item.item,S,j);e.onChange({...e.item,item:E})}const x=Je(Zn.section,{[Zn.editing]:s,[Zn.hovering]:l&&!s});return a.jsxs("div",{"data-testid":n.linkId,className:x,onClick:u,onMouseOver:d,onFocus:d,children:[a.jsx("div",{className:Zn.questionBody,children:s?a.jsxs(a.Fragment,{children:[r&&a.jsx(se,{size:"xl",defaultValue:t.title,onBlur:S=>g("title",S.currentTarget.value)}),!r&&a.jsx(ds,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:S=>g("text",S.currentTarget.value)}),n.type==="reference"&&a.jsx(eB,{item:n,onChange:y}),Sz(n)&&a.jsx(Jz,{item:n,onChange:S=>y(S)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(ce,{children:t.title}),n.text&&a.jsx("div",{children:n.text}),!o&&a.jsx(xm,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(w=n.item)==null?void 0:w.map((S,j)=>a.jsx("div",{children:a.jsx(TP,{item:S,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:j===0,isLast:j===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:f,onRemove:()=>m(S),onRepeatable:C,onMoveUp:()=>v(j,-1),onMoveDown:()=>v(j,1)})},S.id)),!o&&a.jsx("div",{className:Zn.topActions,children:s?a.jsxs(a.Fragment,{children:[a.jsx(se,{size:"xs",className:Zn.linkIdInput,defaultValue:n.linkId,onBlur:S=>g("linkId",S.currentTarget.value)}),!o&&a.jsx(yt,{size:"xs",className:Zn.typeSelect,defaultValue:n.type,onChange:S=>g("type",S.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):a.jsx("div",{children:i})}),!r&&a.jsx(W,{className:Zn.movementActions,children:a.jsxs(W,{className:Zn.columnAlignment,children:[!e.isFirst&&a.jsx(Ue,{href:"#",onClick:S=>{S.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(LL,{"data-testid":"up-button",size:15,className:Zn.movementIcons})}),!e.isLast&&a.jsx(Ue,{href:"#",onClick:S=>{S.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx($L,{"data-testid":"down-button",size:15,className:Zn.movementIcons})})]})}),a.jsxs("div",{className:Zn.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Ue,{href:"#",onClick:S=>{S.preventDefault(),h({id:Zi(),linkId:bm("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Ue,{href:"#",onClick:S=>{S.preventDefault(),h({id:Zi(),linkId:bm("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Ue,{href:"#",onClick:S=>{S.preventDefault(),h(rB(),!0)},children:"Add Page"}),s&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Ue,{href:"#",onClick:S=>{S.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Ue,{href:"#",onClick:S=>{S.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function Jz(e){const t=gs("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(se,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(Zz,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(W,{display:"flex",children:[a.jsx(Ue,{href:"#",onClick:r=>{tt(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Zi()}]})},children:"Add choice"}),a.jsx(kf,{w:"lg"}),a.jsx(Ue,{href:"#",onClick:r=>{tt(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function Zz(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=$f({type:"QuestionnaireItemAnswerOption",value:t},"value");return a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[a.jsx("div",{children:a.jsx($a,{name:"value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,i)=>{const s=[...e.options],l=s.findIndex(c=>c.id===t.id);s[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:s})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(Ue,{href:"#",onClick:o=>{tt(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function eB(e){const t=wP(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(X,{children:[a.jsx(Iv,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(Yh(e.item,t.map(i=>i===n?o:i)))}}),a.jsx(Ue,{href:"#",onClick:o=>{tt(o),e.onChange(Yh(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Ue,{href:"#",onClick:n=>{tt(n),e.onChange(Yh(e.item,[...t,""]))},children:"Add Resource Type"})]})}let wm=1,Sm=1;function bm(e){return e+wm++}function Zi(){return"id-"+Sm++}function tB(e){return{...e,id:e.id||Zi(),item:PP(e.item)}}function PP(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Sm=Math.max(Sm,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(wm=Math.max(wm,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Zi(),item:PP(t.item),answerOption:nB(t.answerOption)}))}function nB(e){if(e)return e.map(t=>({...t,id:t.id||Zi()}))}function rB(){return{id:Zi(),linkId:bm("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 oB(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const i=[...r];return[i[t],i[o]]=[i[o],i[t]],i}function kP(e){const{item:t,response:n,onChange:r}=e,[o,i]=p.useState(iB(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===ht.display)return a.jsx("p",{children:t.text},t.linkId);const s=(t==null?void 0:t.repeats)&&t.type!==ht.choice&&t.type!==ht.openChoice;return t.type===ht.boolean?a.jsx(xm,{item:t,response:n,onChange:l=>r([l]),index:0},t.linkId):a.jsxs(it,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>a.jsx(xm,{item:t,response:n,onChange:u=>r([u]),index:c},`${t.linkId}-${c}`)),s&&a.jsx(Ue,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function iB(e,t){if(e.type===ht.choice||e.type===ht.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function RP(e){const[t,n]=p.useState(e.response);if(t.length===0)return null;function r(i,s){const l=t.map((c,u)=>u===s?i[0]:c);n(l),e.onChange(l)}function o(){const i=bP(e.item);n([...t,i])}return a.jsxs(a.Fragment,{children:[t.map((i,s)=>a.jsx(DP,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>r(l,s)},i.id)),e.item.repeats&&a.jsx(Ue,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function DP(e){var i;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function o(s){var d;const l=(d=t.item)==null?void 0:d.map(f=>s.find(m=>m.id===f.id)??f),c=l==null?void 0:l.concat(s.slice(1)),u={...t,item:c};r([u])}return e.checkForQuestionEnabled(e.item)?a.jsxs("div",{children:[e.item.text&&a.jsx(ce,{order:3,mb:"md",children:e.item.text}),a.jsx(Se,{children:(i=e.item.item)==null?void 0:i.map(s=>{var l,c,u;return s.type===ht.group?s.repeats?a.jsx(RP,{item:s,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===s.linkId))??[],checkForQuestionEnabled:n,onChange:o},s.linkId):a.jsx(DP,{item:s,checkForQuestionEnabled:n,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===s.linkId))??{linkId:s.linkId},onChange:o},s.linkId):a.jsx(kP,{item:s,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===s.linkId),onChange:o,checkForQuestionEnabled:n},s.linkId)})})]},e.item.linkId):null}function sB(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:i,prevStep:s,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,f=t.map(h=>{var y;const m=((y=n==null?void 0:n.item)==null?void 0:y.filter(C=>C.linkId===h.linkId))??[],g=h.type===ht.group?a.jsx(RP,{item:h,response:m,onChange:o,checkForQuestionEnabled:d},h.linkId):a.jsx(kP,{item:h,response:m==null?void 0:m[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?a.jsx(xa.Step,{label:h.text,children:g},h.linkId):g});return a.jsxs(a.Fragment,{children:[c&&a.jsx(xa,{active:r??0,allowNextStepsSelect:!1,p:6,children:f}),!c&&a.jsx(Se,{children:f}),a.jsx(aB,{activePage:r??0,numberOfPages:l,nextStep:i,prevStep:s,submitButtonText:u})]})}function aB(e){const t=e.activePage>0,n=e.activePage<e.numberOfPages-1,r=e.activePage===e.numberOfPages-1;return a.jsxs(X,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&a.jsx(ee,{onClick:e.prevStep,children:"Back"}),n&&a.jsx(ee,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),r&&a.jsx(ee,{type:"submit",children:e.submitButtonText??"Submit"})]})}function IP(e){const t=re(),n=t.getProfile(),[r,o]=p.useState(!1),i=st(e.questionnaire),[s,l]=p.useState(),[c,u]=p.useState(0);p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>{l(i?Pz(i):void 0)},[i]);function d(y){const C=(s==null?void 0:s.item)??[],x={resourceType:"QuestionnaireResponse",status:"in-progress",item:_P(C,Array.isArray(y)?y:[y])};l(x)}function f(y){return bz(y,(s==null?void 0:s.item)??[])}if(!r||!i)return null;const h=_z(i),m=()=>u(y=>y+1),g=()=>u(y=>y-1);return a.jsx(CP.Provider,{value:{subject:e.subject,encounter:e.encounter},children:a.jsxs(Be,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&s&&e.onSubmit({...s,questionnaire:pt(i),subject:e.subject,source:wt(n),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&a.jsx(ce,{children:i.title}),a.jsx(sB,{items:i.item??[],response:s,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:f,nextStep:m,prevStep:g})]})})}function lB(e,t){const n=_P(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 _P(e,t){const n=[],r=new Set;for(const o of e){const i=o.id,s=t.find(l=>l.id===i);s?(n.push(lB(o,s)),r.add(s.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}const cB="_section_4m5it_1",uB={section:cB},dB=["gender","age","gestationalAge","context","appliesTo","category"],fB={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function hB(e){e=Object.assign(fB,e);const t=e.definition,[n,r]=p.useState([]),[o,i]=p.useState(1),[s,l]=p.useState(1);return p.useEffect(()=>{const g=gB(t,l);r(yB(g.qualifiedInterval||[],i))},[t]),a.jsxs(Be,{testid:"reference-range-editor",onSubmit:c,children:[a.jsx(Se,{children:n.map(g=>{var y;return a.jsx(pB,{unit:xB((y=t.quantitativeDetails)==null?void 0:y.unit),onChange:f,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:g},`group-${g.id}`)})}),a.jsx(qt,{title:"Add Group",variant:"subtle",size:"sm",onClick:g=>{tt(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(y=>y+1)},children:a.jsx(wd,{})}),a.jsx(X,{justify:"flex-end",children:a.jsx(ee,{type:"submit",children:"Save"})})]});function c(){const g=n.flatMap(y=>y.intervals).filter(y=>!wB(y));e.onSubmit({...t,qualifiedInterval:g})}function u(g){r(y=>[...y,g])}function d(g){r(y=>y.filter(C=>C.id!==g.id))}function f(g,y){r(C=>{C=[...C];const v=C.find(w=>w.id===g),x=v==null?void 0:v.intervals.findIndex(w=>w.id===y.id);return x!==void 0&&(v!=null&&v.intervals[x])&&(v.intervals[x]=y),C})}function h(g,y){y.id===void 0&&(y.id=`id-${s}`,l(C=>C+1)),r(C=>{C=[...C];const v=C.findIndex(x=>x.id===g);if(v!==-1){const x={...C[v]};y={...y,...x.filters},x.intervals=[...x.intervals,y],C[v]=x}return C})}function m(g,y){r(C=>{C=[...C];const v=C.find(x=>x.id===g);return v&&(v.intervals=v.intervals.filter(x=>x.id!==y.id)),C})}}function pB(e){const{intervalGroup:t,unit:n}=e;return a.jsx(Pc,{"data-testid":t.id,className:uB.section,children:a.jsxs(Se,{gap:"lg",children:[a.jsx(X,{justify:"flex-end",children:a.jsx(qt,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{tt(r),e.onRemoveGroup(t)},children:a.jsx(xd,{})},`remove-group-button-${t.id}`)}),a.jsx(mB,{intervalGroup:t,onChange:e.onChange}),a.jsx(Rn,{}),t.intervals.map(r=>a.jsxs(Se,{gap:"xs",children:[a.jsxs(X,{children:[a.jsx(se,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{tt(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(qt,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{tt(o),e.onRemove(t.id,r)},children:a.jsx(xd,{})},`remove-interval-${r.id}`)]}),a.jsx(Ov,{onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(qt,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{tt(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(wd,{})})]})})}function mB(e){var r,o;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const i of["low","high"])(r=t.filters.age[i])!=null&&r.unit||(t.filters.age[i]={...t.filters.age[i],unit:"years",system:"http://unitsofmeasure.org"});return a.jsxs(Se,{style:{maxWidth:"50%"},children:[a.jsx(X,{children:a.jsx(yt,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const s of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),n(t.id,{...s,gender:l})}}})}),a.jsxs(X,{gap:"xs",children:[a.jsx(ue,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(Ov,{name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const s of t.intervals)n(t.id,{...s,age:i})}},`age-${t.id}`)})]}),a.jsx(yt,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const s of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,n(t.id,{...s,context:void 0})):n(t.id,{...s,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),a.jsx(yt,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const s of t.intervals){const l=i.currentTarget.value;l===""?n(t.id,{...s,category:void 0}):n(t.id,{...s,category:l})}}})]})}function gB(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{var s;const i=parseInt(((s=o.id)==null?void 0:s.substring(3))||"",10);return isNaN(i)?Number.NEGATIVE_INFINITY:i}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function yB(e,t){let n=1;const r={};for(const o of e){const i=vB(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(dB.map(s=>[s,o[s]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function vB(e){var n,r;return[`gender=${e.gender}`,`age=${Wl(e.age)}`,`gestationalAge=${Wl(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function xB(e){return e&&(kO(e,"http://unitsofmeasure.org")||e.text)}function wB(e){var t,n,r,o;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((o=(r=e.range)==null?void 0:r.high)==null?void 0:o.value)===void 0}function SB(e){var u;const t=re(),n=st(e.value),[r,o]=p.useState(!1),[i,s]=p.useState();if(p.useEffect(()=>{n&&!r&&(t.executeBatch(l(n)).then(s).catch(console.log),o(!0))},[t,n,r]),!n||!i)return null;return a.jsx(Hn,{children:(u=n.action)==null?void 0:u.map((d,f)=>{var y,C,v,x,w,S;const h=d.resource&&c(d.resource),m=(C=(y=h==null?void 0:h.input)==null?void 0:y[0])==null?void 0:C.valueReference,g=(x=(v=h==null?void 0:h.output)==null?void 0:v[0])==null?void 0:x.valueReference;return a.jsxs(p.Fragment,{children:[a.jsx(Hn.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?a.jsx(GL,{}):a.jsx(w7,{color:"gray"})}),a.jsxs(Hn.Col,{span:9,p:"xs",children:[a.jsx(ue,{fw:500,children:d.title}),d.description&&a.jsx("div",{children:d.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(kc,{value:(w=h==null?void 0:h.meta)==null?void 0:w.author})," on ",Fn((S=h==null?void 0:h.meta)==null?void 0:S.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(QT,{status:(h==null?void 0:h.status)||"unknown"})]})]}),a.jsxs(Hn.Col,{span:2,p:"md",children:[m&&!g&&a.jsx(ee,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&g&&a.jsx(ee,{onClick:()=>e.onEdit(h,m,g),children:"Edit"})]})]},`action-${f}`)})});function l(d){var h;const f=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&f.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:f}}function c(d){for(const f of i==null?void 0:i.entry)if(f.resource&&d.reference===pt(f.resource))return f.resource}}function AP(e,t){const n=bB(e,t);return CB(n,e,t)}function bB(e,t){const n=e.length,r=t.length,o=n+r+1,i=1+2*o,s=i/2|0,l=new Array(i);l[s+1]={i:0,j:-1,prev:void 0,snake:!0};for(let c=0;c<o;c++){for(let u=-c;u<=c;u+=2){const d=s+u,f=d+1,h=d-1,m=l[f],g=l[h];let y,C=0;u===-c||u!==c&&g.i<m.i?(C=m.i,y=m):(C=g.i+1,y=g),l[h]=void 0;let v=C-u,x={i:C,j:v,prev:EB(y),snake:!1};for(;C<n&&v<r&&e[C]===t[v];)C++,v++;if(C>x.i&&(x={i:C,j:v,prev:x,snake:!0}),l[d]=x,C>=n&&v>=r)return l[d]}l[s+c-1]=void 0}}function CB(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const i=o.i,s=o.j;o=o.prev;const l=o.i,c=o.j,u={position:l,lines:t.slice(l,i)},d={position:c,lines:n.slice(c,s)};let f;u.lines.length===0&&d.lines.length>0?f="insert":u.lines.length>0&&d.lines.length===0?f="delete":f="change",r.push({original:u,revised:d,type:f}),o.snake&&(o=o.prev)}return r}function EB(e){return e&&!e.snake&&e.prev?e.prev:e}function jB(e){const t=e.entry.filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:Ln(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.meta.lastUpdated)),n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return TB(n,t),PB(n),n}function TB(e,t){for(let n=1;n<t.length;n++){const r=AP(t[n-1].lines,t[n].lines);for(const o of r){const i=o.original.position,s=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,s.length),o.type==="insert"||o.type==="change")for(let c=0;c<o.revised.lines.length;c++)e.splice(i+c,0,{id:t[n].meta.versionId,meta:t[n].meta,value:l[c],span:1})}}}function PB(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 kB="_container_n4i51_1",RB="_root_n4i51_5",DB="_startRow_n4i51_20",IB="_normalRow_n4i51_24",_B="_author_n4i51_28",AB="_dateTime_n4i51_32",NB="_lineNumber_n4i51_37",OB="_line_n4i51_37",MB="_pre_n4i51_52",ro={container:kB,root:RB,startRow:DB,normalRow:IB,author:_B,dateTime:AB,lineNumber:NB,line:OB,pre:MB};function $B(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function LB(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return _s(n,"year");const r=Math.floor(t/2592e3);if(r>0)return _s(r,"month");const o=Math.floor(t/86400);if(o>0)return _s(o,"day");const i=Math.floor(t/3600);if(i>0)return _s(i,"hour");const s=Math.floor(t/60);return s>0?_s(s,"minute"):_s(t,"second")}function _s(e,t){return`${e} ${e===1?t:t+"s"} ago`}function FB(e){var s,l;const t=re(),[n,r]=p.useState(e.history);if(p.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return a.jsx("div",{children:"Loading..."});const o=(l=(s=n.entry)==null?void 0:s[0])==null?void 0:l.resource;if(!o)return null;const i=jB(n);return a.jsx("div",{className:ro.container,children:a.jsx("table",{className:ro.root,children:a.jsx("tbody",{children:i.map((c,u)=>a.jsxs("tr",{className:c.span>0?ro.startRow:ro.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:ro.author,rowSpan:c.span,children:a.jsx(oa,{value:c.meta.author,link:!0})}),a.jsx("td",{className:ro.dateTime,rowSpan:c.span,children:a.jsx(Me,{to:$B(o,c.meta.versionId),children:LB(c.meta.lastUpdated)})})]}),a.jsx("td",{className:ro.lineNumber,children:u+1}),a.jsx("td",{className:ro.line,children:a.jsx("pre",{className:ro.pre,children:c.value})})]},"row-"+u))})})})}const zB="_removed_mgz0k_2",BB="_added_mgz0k_7",uw={removed:zB,added:BB};function UB(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Ln(t,!0).match(/[^\r\n]+/g),o=Ln(n,!0).match(/[^\r\n]+/g),i=AP(r,o);return a.jsx("pre",{style:{color:"gray"},children:i.map((s,l)=>a.jsx(VB,{delta:s},"delta"+l))})}function VB(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:uw.removed,children:e.delta.original.lines.join(`
195
+ `)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:uw.added,children:e.delta.revised.lines.join(`
196
+ `)}),"...",a.jsx("br",{})]})}function Zv(e){const{outcome:t}=e,n=re(),r=st(e.defaultValue),[o,i]=p.useState(),[s,l]=p.useState();return p.useEffect(()=>{if(r)if(l(vi(r)),e.profileUrl){const c=e.profileUrl;n.requestProfileSchema(e.profileUrl).then(()=>{const u=_f(c);u?i(u.name):console.log(`Schema not found for ${c}`)}).catch(console.log)}else{const c=e.schemaName??(r==null?void 0:r.resourceType);n.requestSchema(c).then(()=>i(c)).catch(console.log)}},[n,r,e.schemaName,e.profileUrl]),!o||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:c=>{c.preventDefault(),e.onSubmit&&e.onSubmit(s)},children:[a.jsxs(Se,{mb:"xl",children:[a.jsx(it,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(se,{name:"resourceType",defaultValue:s.resourceType,disabled:!0})}),a.jsx(it,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(se,{name:"id",defaultValue:s.id,disabled:!0})})]}),a.jsx($v,{typeName:o,defaultValue:s,outcome:t,onChange:l,profileUrl:e.profileUrl}),a.jsxs(X,{justify:"flex-end",mt:"xl",children:[a.jsx(ee,{type:"submit",children:"OK"}),e.onDelete&&a.jsx(ee,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(s)},children:"Delete"})]})]})}function HB(e){var o;const t=re(),[n,r]=p.useState(e.history);return p.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?a.jsxs(me,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(me.Thead,{children:a.jsxs(me.Tr,{children:[a.jsx(me.Th,{children:"Author"}),a.jsx(me.Th,{children:"Date"}),a.jsx(me.Th,{children:"Version"})]})}),a.jsx(me.Tbody,{children:(o=n.entry)==null?void 0:o.map((i,s)=>a.jsx(WB,{entry:i},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function WB(e){var r,o,i;const{response:t,resource:n}=e.entry;return n?a.jsxs(me.Tr,{children:[a.jsx(me.Td,{children:a.jsx(oa,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),a.jsx(me.Td,{children:Fn((o=n.meta)==null?void 0:o.lastUpdated)}),a.jsx(me.Td,{children:a.jsx(Me,{to:qB(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):a.jsx(me.Tr,{children:a.jsx(me.Td,{colSpan:3,children:Re(t==null?void 0:t.outcome)})})}function qB(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function GB(e){return a.jsx(Bf,{value:e.serviceRequest,loadTimelineResources:async(t,n,r)=>{const o=`${n}/${r}`,i=100;return Promise.allSettled([t.readHistory("ServiceRequest",r),t.search("Communication",{"based-on":o,_count:i}),t.search("DiagnosticReport",{"based-on":o,_count:i}),t.search("Media",{"based-on":o,_count:i}),t.search("DocumentReference",{related:o,_count:i}),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:i})])},createCommunication:(t,n,r)=>({resourceType:"Communication",status:"completed",basedOn:[wt(t)],subject:t.subject,sender:wt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",basedOn:[wt(t)],subject:t.subject,operator:wt(n),issued:new Date().toISOString(),content:r})})}function QB(e){const t=re(),{client:n,patient:r,encounter:o,children:i,...s}=e;function l(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(c=>{const u=new URL(n.launchUri);u.searchParams.set("iss",t.getBaseUrl()+"fhir/R4"),u.searchParams.set("launch",c.id),window.location.assign(u.toString())}).catch(c=>de({color:"red",message:Re(c),autoClose:!1}))}return a.jsx(Ue,{onClick:()=>l(),...s,children:i})}function NP(e){const t=re(),[n,r]=p.useState();return a.jsxs(Be,{style:{maxWidth:400},onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){r(ct(i))}},children:[a.jsxs(Vt,{style:{flexDirection:"column"},children:[a.jsx(Nr,{size:32}),a.jsx(ce,{children:"Create project"})]}),a.jsxs(Se,{gap:"xl",children:[a.jsx(se,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Le(n,"firstName")}),a.jsxs(ue,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Ue,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Ue,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(X,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ee,{type:"submit",children:"Create project"})})]})}function OP(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 MP(e){const t=re(),{googleClientId:n,handleGoogleCredential:r}=e,o=p.useRef(null),[i,s]=p.useState(typeof google<"u"),[l,c]=p.useState(!1),[u,d]=p.useState(!1);return p.useEffect(()=>{if(typeof google>"u"){OP("https://accounts.google.com/gsi/client",()=>s(!0));return}l||(google.accounts.id.initialize({client_id:n,callback:r}),c(!0)),o.current&&!u&&(google.accounts.id.renderButton(o.current,{}),d(!0))},[t,n,l,i,o,u,r]),n?a.jsx("div",{ref:o}):null}var KB={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.0.2-4de37800",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function $P(e){var t;if(e)return e;if(typeof window<"u"){const n=window.location.protocol+"//"+window.location.host;if((((t=KB.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(n))return"__GOOGLE_CLIENT_ID__"}}function LP(e){typeof grecaptcha>"u"&&OP("https://www.google.com/recaptcha/api.js?render="+e)}function FP(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function YB(e){const t=$P(e.googleClientId),n=e.recaptchaSiteKey,r=re(),[o,i]=p.useState(),s=Lf(o,void 0);return p.useEffect(()=>{n&&LP(n)},[n]),a.jsxs(Be,{style:{maxWidth:400},onSubmit:async l=>{try{let c="";n&&(c=await FP(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:l.firstName,lastName:l.lastName,email:l.email,password:l.password,remember:l.remember==="true",recaptchaSiteKey:n,recaptchaToken:c}))}catch(c){i(ct(c))}},children:[a.jsx(Vt,{style:{flexDirection:"column"},children:e.children}),a.jsx(to,{issues:s}),t&&a.jsxs(a.Fragment,{children:[a.jsx(X,{justify:"center",p:"xl",style:{height:70},children:a.jsx(MP,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,createUser:!0}))}catch(c){i(ct(c))}}})}),a.jsx(Rn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Se,{gap:"xl",children:[a.jsx(se,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Le(o,"firstName")}),a.jsx(se,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Le(o,"lastName")}),a.jsx(se,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Le(o,"email")}),a.jsx(Tr,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Le(o,"password")}),a.jsxs(ue,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Ue,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Ue,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(ue,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Ue,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Ue,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(X,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(cr,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(ee,{type:"submit",children:"Create account"})]})]})}function XB(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:s}=e,l=re(),[c,u]=p.useState(),[d,f]=p.useState();p.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:n}).then(m=>l.processCode(m.code)).then(()=>s()).catch(m=>f(ct(m)))},[l,t,n,c,s]);function h(m){m.code?l.processCode(m.code).then(()=>s()).catch(console.log):m.login&&u(m.login)}return a.jsxs(we,{width:450,children:[d&&a.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&a.jsx(YB,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&a.jsx(NP,{login:c,handleAuthResponse:h})]})}function JB(e){const[t,n]=p.useState();return t?a.jsx(eU,{email:t,...e}):a.jsx(ZB,{setEmail:n,...e})}function ZB(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...s}=e,l=re(),c=!e.disableGoogleAuth&&$P(e.googleClientId),u=p.useCallback(async h=>{if(!h.authorizeUrl)return!1;const m=JSON.stringify({...await l.ensureCodeChallenge(s),domain:h.domain}),g=new URL(h.authorizeUrl);return g.searchParams.set("state",m),window.location.assign(g.toString()),!0},[l,s]),d=p.useCallback(async h=>{const m=await l.post("auth/method",{email:h.email});await u(m)||t(h.email)},[l,u,t]),f=p.useCallback(async h=>{const m=await l.startGoogleLogin({...s,googleCredential:h.credential});await u(m)||r(m)},[l,s,u,r]);return a.jsxs(Be,{style:{maxWidth:400},onSubmit:d,children:[a.jsx(Vt,{style:{flexDirection:"column"},children:o}),c&&a.jsxs(a.Fragment,{children:[a.jsx(X,{justify:"center",p:"xl",style:{height:70},children:a.jsx(MP,{googleClientId:c,handleGoogleCredential:f})}),!i&&a.jsx(Rn,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&a.jsx(se,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0}),a.jsxs(X,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.jsx(Ue,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&a.jsx(ee,{type:"submit",children:"Next"})]})]})}function eU(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=re(),[s,l]=p.useState(),c=Lf(s,void 0),u=p.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(n).catch(f=>l(ct(f)))},[i,o,n]);return a.jsxs(Be,{style:{maxWidth:400},onSubmit:u,children:[a.jsx(Vt,{style:{flexDirection:"column"},children:r}),a.jsx(to,{issues:c}),a.jsx(Se,{gap:"xl",children:a.jsx(Tr,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Le(s,"password")})}),a.jsxs(X,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(Ue,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),a.jsx(cr,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(ee,{type:"submit",children:"Sign in"})]})]})}function tU(e){const t=re(),[n,r]=p.useState();return a.jsxs(Se,{children:[a.jsxs(Vt,{style:{flexDirection:"column"},children:[a.jsx(Nr,{size:32}),a.jsx(ce,{order:3,children:"Choose profile"})]}),a.jsx(to,{outcome:n}),e.memberships.map(o=>{var i,s;return a.jsx(Qn,{onClick:()=>{t.post("auth/profile",{login:e.login,profile:o.id}).then(e.handleAuthResponse).catch(l=>r(ct(l)))},children:a.jsxs(X,{children:[a.jsx(Qi,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(ue,{size:"sm",fw:500,children:(i=o.profile)==null?void 0:i.display}),a.jsx(ue,{c:"dimmed",size:"xs",children:(s=o.project)==null?void 0:s.display})]})]})},o.id)})]})}function nU(e){const t=re();return a.jsx(Be,{style:{maxWidth:400},onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Se,{children:[a.jsxs(Vt,{style:{flexDirection:"column"},children:[a.jsx(Nr,{size:32}),a.jsx(ce,{children:"Choose scope"})]}),a.jsx(Se,{children:(e.scope??"openid").split(" ").map(n=>a.jsx(cr,{id:n,name:n,label:n,defaultChecked:!0},n))}),a.jsx(X,{justify:"flex-end",mt:"xl",children:a.jsx(ee,{type:"submit",children:"Set scope"})})]})})}function rU(e){const t=re(),[n,r]=p.useState();return a.jsx(Be,{style:{maxWidth:400},onSubmit:o=>{r(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>r(Re(i)))},children:a.jsxs(Se,{children:[a.jsxs(Vt,{style:{flexDirection:"column"},children:[a.jsx(Nr,{size:32}),a.jsx(ce,{children:"Enter MFA code"})]}),n&&a.jsx(us,{icon:a.jsx(Cc,{size:16}),title:"Error",color:"red",children:n}),a.jsx(Se,{children:a.jsx(se,{name:"token",label:"MFA code",required:!0})}),a.jsx(X,{justify:"flex-end",mt:"xl",children:a.jsx(ee,{type:"submit",children:"Submit code"})})]})})}function zP(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:s,...l}=e,c=re(),[u,d]=p.useState(),[f,h]=p.useState(!1),[m,g]=p.useState(),y=p.useCallback(x=>{s?s(x):c.processCode(x).then(()=>{r&&r()}).catch(w=>de({color:"red",message:Re(w)}))},[c,s,r]),C=p.useCallback(x=>{h(!!x.mfaRequired),x.login&&d(x.login),x.memberships&&g(x.memberships),x.code&&(n?g(void 0):y(x.code))},[n,y]),v=p.useCallback(x=>{y(x.code)},[y]);return p.useEffect(()=>{t&&!u&&c.get("auth/login/"+t).then(C).catch(x=>de({color:"red",message:Re(x)}))},[c,t,u,C]),a.jsx(we,{width:450,children:u?f?a.jsx(rU,{login:u,handleAuthResponse:C}):m?a.jsx(tU,{login:u,memberships:m,handleAuthResponse:C}):e.projectId==="new"?a.jsx(NP,{login:u,handleAuthResponse:C}):e.chooseScopes?a.jsx(nU,{login:u,scope:e.scope,handleAuthResponse:v}):a.jsx("div",{children:"Success"}):a.jsx(JB,{onForgotPassword:o,onRegister:i,handleAuthResponse:C,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var BP,dw=sc;BP=dw.createRoot,dw.hydrateRoot;/**
197
+ * @remix-run/router v1.14.2
198
+ *
199
+ * Copyright (c) Remix Software Inc.
200
+ *
201
+ * This source code is licensed under the MIT license found in the
202
+ * LICENSE.md file in the root directory of this source tree.
203
+ *
204
+ * @license MIT
205
+ */function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kt.apply(this,arguments)}var Nt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Nt||(Nt={}));const fw="popstate";function oU(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:s,hash:l}=r.location;return Yl("",{pathname:i,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:_c(o)}return sU(t,n,null,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function es(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function iU(){return Math.random().toString(36).substr(2,8)}function hw(e,t){return{usr:e.state,key:e.key,idx:t}}function Yl(e,t,n,r){return n===void 0&&(n=null),kt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?_o(t):t,{state:n,key:t&&t.key||r||iU()})}function _c(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function _o(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function sU(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,l=Nt.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(kt({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){l=Nt.Pop;let C=d(),v=C==null?null:C-u;u=C,c&&c({action:l,location:y.location,delta:v})}function h(C,v){l=Nt.Push;let x=Yl(y.location,C,v);n&&n(x,C),u=d()+1;let w=hw(x,u),S=y.createHref(x);try{s.pushState(w,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;o.location.assign(S)}i&&c&&c({action:l,location:y.location,delta:1})}function m(C,v){l=Nt.Replace;let x=Yl(y.location,C,v);n&&n(x,C),u=d();let w=hw(x,u),S=y.createHref(x);s.replaceState(w,"",S),i&&c&&c({action:l,location:y.location,delta:0})}function g(C){let v=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof C=="string"?C:_c(C);return Oe(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let y={get action(){return l},get location(){return e(o,s)},listen(C){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(fw,f),c=C,()=>{o.removeEventListener(fw,f),c=null}},createHref(C){return t(o,C)},createURL:g,encodeLocation(C){let v=g(C);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:m,go(C){return s.go(C)}};return y}var jt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(jt||(jt={}));const aU=new Set(["lazy","caseSensitive","path","id","index","children"]);function lU(e){return e.index===!0}function Cm(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let s=[...n,i],l=typeof o.id=="string"?o.id:s.join("-");if(Oe(o.index!==!0||!o.children,"Cannot specify children on an index route"),Oe(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),lU(o)){let c=kt({},o,t(o),{id:l});return r[l]=c,c}else{let c=kt({},o,t(o),{id:l,children:void 0});return r[l]=c,o.children&&(c.children=Cm(o.children,t,s,r)),c}})}function Qs(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?_o(t):t,o=Ac(r.pathname||"/",n);if(o==null)return null;let i=UP(e);uU(i);let s=null;for(let l=0;s==null&&l<i.length;++l)s=xU(i[l],bU(o));return s}function cU(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function UP(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,s,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};c.relativePath.startsWith("/")&&(Oe(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=si([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Oe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),UP(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:yU(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,s);else for(let c of VP(i.path))o(i,s,c)}),t}function VP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=VP(r.join("/")),l=[];return l.push(...s.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function uU(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vU(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const dU=/^:[\w-]+$/,fU=3,hU=2,pU=1,mU=10,gU=-2,pw=e=>e==="*";function yU(e,t){let n=e.split("/"),r=n.length;return n.some(pw)&&(r+=gU),t&&(r+=hU),n.filter(o=>!pw(o)).reduce((o,i)=>o+(dU.test(i)?fU:i===""?pU:mU),r)}function vU(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function xU(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let s=0;s<n.length;++s){let l=n[s],c=s===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=wU({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u);if(!d)return null;Object.assign(r,d.params);let f=l.route;i.push({params:r,pathname:si([o,d.pathname]),pathnameBase:TU(si([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=si([o,d.pathnameBase]))}return i}function wU(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=SU(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let y=l[f]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=l[f];return m&&!g?u[h]=void 0:u[h]=CU(g||"",h),u},{}),pathname:i,pathnameBase:s,pattern:e}}function SU(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),es(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function bU(e){try{return decodeURI(e)}catch(t){return es(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function CU(e,t){try{return decodeURIComponent(e)}catch(n){return es(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Ac(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 EU(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?_o(e):e;return{pathname:n?n.startsWith("/")?n:jU(n,t):t,search:PU(r),hash:kU(o)}}function jU(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Xh(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 HP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function WP(e,t){let n=HP(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function qP(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=_o(e):(o=kt({},e),Oe(!o.pathname||!o.pathname.includes("?"),Xh("?","pathname","search",o)),Oe(!o.pathname||!o.pathname.includes("#"),Xh("#","pathname","hash",o)),Oe(!o.search||!o.search.includes("#"),Xh("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=EU(o,l),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const si=e=>e.join("/").replace(/\/\/+/g,"/"),TU=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),PU=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kU=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class e0{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function GP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const QP=["post","put","patch","delete"],RU=new Set(QP),DU=["get",...QP],IU=new Set(DU),_U=new Set([301,302,303,307,308]),AU=new Set([307,308]),Jh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},NU={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},el={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},KP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,OU=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),YP="remix-router-transitions";function MU(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",r=!n;Oe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let A=e.detectErrorBoundary;o=L=>({hasErrorBoundary:A(L)})}else o=OU;let i={},s=Cm(e.routes,o,void 0,i),l,c=e.basename||"/",u=kt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),d=null,f=new Set,h=null,m=null,g=null,y=e.hydrationData!=null,C=Qs(s,e.history.location,c),v=null;if(C==null){let A=er(404,{pathname:e.history.location.pathname}),{matches:L,route:H}=bw(s);C=L,v={[H.id]:A}}let x,w=C.some(A=>A.route.lazy),S=C.some(A=>A.route.loader);if(w)x=!1;else if(!S)x=!0;else if(u.v7_partialHydration){let A=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null;x=C.every(H=>H.route.loader&&H.route.loader.hydrate!==!0&&(A&&A[H.route.id]!==void 0||L&&L[H.route.id]!==void 0))}else x=e.hydrationData!=null;let j,E={historyAction:e.history.action,location:e.history.location,matches:C,initialized:x,navigation:Jh,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||v,fetchers:new Map,blockers:new Map},T=Nt.Pop,P=!1,k,D=!1,M=new Map,R=null,O=!1,N=!1,B=[],I=[],$=new Map,_=0,F=-1,q=new Map,G=new Set,oe=new Map,Te=new Map,Ee=new Set,_e=new Map,Pe=new Map,De=!1;function Qe(){if(d=e.history.listen(A=>{let{action:L,location:H,delta:Z}=A;if(De){De=!1;return}es(Pe.size===0||Z!=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 ae=xs({currentLocation:E.location,nextLocation:H,historyAction:L});if(ae&&Z!=null){De=!0,e.history.go(Z*-1),vs(ae,{state:"blocked",location:H,proceed(){vs(ae,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),e.history.go(Z)},reset(){let Ie=new Map(E.blockers);Ie.set(ae,el),Y({blockers:Ie})}});return}return Ge(L,H)}),n){GU(t,M);let A=()=>QU(t,M);t.addEventListener("pagehide",A),R=()=>t.removeEventListener("pagehide",A)}return E.initialized||Ge(Nt.Pop,E.location,{initialHydration:!0}),j}function qe(){d&&d(),R&&R(),f.clear(),k&&k.abort(),E.fetchers.forEach((A,L)=>Xn(L)),E.blockers.forEach((A,L)=>Mc(L))}function dt(A){return f.add(A),()=>f.delete(A)}function Y(A,L){L===void 0&&(L={}),E=kt({},E,A);let H=[],Z=[];u.v7_fetcherPersist&&E.fetchers.forEach((ae,Ie)=>{ae.state==="idle"&&(Ee.has(Ie)?Z.push(Ie):H.push(Ie))}),[...f].forEach(ae=>ae(E,{deletedFetchers:Z,unstable_viewTransitionOpts:L.viewTransitionOpts,unstable_flushSync:L.flushSync===!0})),u.v7_fetcherPersist&&(H.forEach(ae=>E.fetchers.delete(ae)),Z.forEach(ae=>Xn(ae)))}function je(A,L,H){var Z,ae;let{flushSync:Ie}=H===void 0?{}:H,xe=E.actionData!=null&&E.navigation.formMethod!=null&&Sr(E.navigation.formMethod)&&E.navigation.state==="loading"&&((Z=A.state)==null?void 0:Z._isRedirect)!==!0,ve;L.actionData?Object.keys(L.actionData).length>0?ve=L.actionData:ve=null:xe?ve=E.actionData:ve=null;let ge=L.loaderData?Sw(E.loaderData,L.loaderData,L.matches||[],L.errors):E.loaderData,Ne=E.blockers;Ne.size>0&&(Ne=new Map(Ne),Ne.forEach((Ke,$t)=>Ne.set($t,el)));let At=P===!0||E.navigation.formMethod!=null&&Sr(E.navigation.formMethod)&&((ae=A.state)==null?void 0:ae._isRedirect)!==!0;l&&(s=l,l=void 0),O||T===Nt.Pop||(T===Nt.Push?e.history.push(A,A.state):T===Nt.Replace&&e.history.replace(A,A.state));let fe;if(T===Nt.Pop){let Ke=M.get(E.location.pathname);Ke&&Ke.has(A.pathname)?fe={currentLocation:E.location,nextLocation:A}:M.has(A.pathname)&&(fe={currentLocation:A,nextLocation:E.location})}else if(D){let Ke=M.get(E.location.pathname);Ke?Ke.add(A.pathname):(Ke=new Set([A.pathname]),M.set(E.location.pathname,Ke)),fe={currentLocation:E.location,nextLocation:A}}Y(kt({},L,{actionData:ve,loaderData:ge,historyAction:T,location:A,initialized:!0,navigation:Jh,revalidation:"idle",restoreScrollPosition:Xf(A,L.matches||E.matches),preventScrollReset:At,blockers:Ne}),{viewTransitionOpts:fe,flushSync:Ie===!0}),T=Nt.Pop,P=!1,D=!1,O=!1,N=!1,B=[],I=[]}async function Ae(A,L){if(typeof A=="number"){e.history.go(A);return}let H=Em(E.location,E.matches,c,u.v7_prependBasename,A,u.v7_relativeSplatPath,L==null?void 0:L.fromRouteId,L==null?void 0:L.relative),{path:Z,submission:ae,error:Ie}=mw(u.v7_normalizeFormMethod,!1,H,L),xe=E.location,ve=Yl(E.location,Z,L&&L.state);ve=kt({},ve,e.history.encodeLocation(ve));let ge=L&&L.replace!=null?L.replace:void 0,Ne=Nt.Push;ge===!0?Ne=Nt.Replace:ge===!1||ae!=null&&Sr(ae.formMethod)&&ae.formAction===E.location.pathname+E.location.search&&(Ne=Nt.Replace);let At=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,fe=(L&&L.unstable_flushSync)===!0,Ke=xs({currentLocation:xe,nextLocation:ve,historyAction:Ne});if(Ke){vs(Ke,{state:"blocked",location:ve,proceed(){vs(Ke,{state:"proceeding",proceed:void 0,reset:void 0,location:ve}),Ae(A,L)},reset(){let $t=new Map(E.blockers);$t.set(Ke,el),Y({blockers:$t})}});return}return await Ge(Ne,ve,{submission:ae,pendingError:Ie,preventScrollReset:At,replace:L&&L.replace,enableViewTransition:L&&L.unstable_viewTransition,flushSync:fe})}function nt(){if(rt(),Y({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){Ge(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}Ge(T||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function Ge(A,L,H){k&&k.abort(),k=null,T=A,O=(H&&H.startUninterruptedRevalidation)===!0,Yf(E.location,E.matches),P=(H&&H.preventScrollReset)===!0,D=(H&&H.enableViewTransition)===!0;let Z=l||s,ae=H&&H.overrideNavigation,Ie=Qs(Z,L,c),xe=(H&&H.flushSync)===!0;if(!Ie){let $t=er(404,{pathname:L.pathname}),{matches:Pn,route:Bt}=bw(Z);Ei(),je(L,{matches:Pn,loaderData:{},errors:{[Bt.id]:$t}},{flushSync:xe});return}if(E.initialized&&!N&&BU(E.location,L)&&!(H&&H.submission&&Sr(H.submission.formMethod))){je(L,{matches:Ie},{flushSync:xe});return}k=new AbortController;let ve=nl(e.history,L,k.signal,H&&H.submission),ge,Ne;if(H&&H.pendingError)Ne={[Cl(Ie).route.id]:H.pendingError};else if(H&&H.submission&&Sr(H.submission.formMethod)){let $t=await It(ve,L,H.submission,Ie,{replace:H.replace,flushSync:xe});if($t.shortCircuited)return;ge=$t.pendingActionData,Ne=$t.pendingActionError,ae=Zh(L,H.submission),xe=!1,ve=new Request(ve.url,{signal:ve.signal})}let{shortCircuited:At,loaderData:fe,errors:Ke}=await jn(ve,L,Ie,ae,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,xe,ge,Ne);At||(k=null,je(L,kt({matches:Ie},ge?{actionData:ge}:{},{loaderData:fe,errors:Ke})))}async function It(A,L,H,Z,ae){ae===void 0&&(ae={}),rt();let Ie=WU(L,H);Y({navigation:Ie},{flushSync:ae.flushSync===!0});let xe,ve=Tm(Z,L);if(!ve.route.action&&!ve.route.lazy)xe={type:jt.error,error:er(405,{method:A.method,pathname:L.pathname,routeId:ve.route.id})};else if(xe=await tl("action",A,ve,Z,i,o,c,u.v7_relativeSplatPath),A.signal.aborted)return{shortCircuited:!0};if(Li(xe)){let ge;return ae&&ae.replace!=null?ge=ae.replace:ge=xe.location===E.location.pathname+E.location.search,await te(E,xe,{submission:H,replace:ge}),{shortCircuited:!0}}if(Ks(xe)){let ge=Cl(Z,ve.route.id);return(ae&&ae.replace)!==!0&&(T=Nt.Push),{pendingActionData:{},pendingActionError:{[ge.route.id]:xe.error}}}if($i(xe))throw er(400,{type:"defer-action"});return{pendingActionData:{[ve.route.id]:xe.data}}}async function jn(A,L,H,Z,ae,Ie,xe,ve,ge,Ne,At){let fe=Z||Zh(L,ae),Ke=ae||Ie||jw(fe),$t=l||s,[Pn,Bt]=gw(e.history,E,H,Ke,L,u.v7_partialHydration&&ve===!0,N,B,I,Ee,oe,G,$t,c,Ne,At);if(Ei(ot=>!(H&&H.some(vt=>vt.route.id===ot))||Pn&&Pn.some(vt=>vt.route.id===ot)),F=++_,Pn.length===0&&Bt.length===0){let ot=mr();return je(L,kt({matches:H,loaderData:{},errors:At||null},Ne?{actionData:Ne}:{},ot?{fetchers:new Map(E.fetchers)}:{}),{flushSync:ge}),{shortCircuited:!0}}if(!O&&(!u.v7_partialHydration||!ve)){Bt.forEach(vt=>{let Lr=E.fetchers.get(vt.key),Lc=rl(void 0,Lr?Lr.data:void 0);E.fetchers.set(vt.key,Lc)});let ot=Ne||E.actionData;Y(kt({navigation:fe},ot?Object.keys(ot).length===0?{actionData:null}:{actionData:ot}:{},Bt.length>0?{fetchers:new Map(E.fetchers)}:{}),{flushSync:ge})}Bt.forEach(ot=>{$.has(ot.key)&&Tn(ot.key),ot.controller&&$.set(ot.key,ot.controller)});let Ss=()=>Bt.forEach(ot=>Tn(ot.key));k&&k.signal.addEventListener("abort",Ss);let{results:Zf,loaderResults:bs,fetcherResults:No}=await be(E.matches,H,Pn,Bt,A);if(A.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",Ss),Bt.forEach(ot=>$.delete(ot.key));let ji=Cw(Zf);if(ji){if(ji.idx>=Pn.length){let ot=Bt[ji.idx-Pn.length].key;G.add(ot)}return await te(E,ji.result,{replace:xe}),{shortCircuited:!0}}let{loaderData:eh,errors:th}=ww(E,H,Pn,bs,At,Bt,No,_e);_e.forEach((ot,vt)=>{ot.subscribe(Lr=>{(Lr||ot.done)&&_e.delete(vt)})});let nh=mr(),Cs=Ao(F),$c=nh||Cs||Bt.length>0;return kt({loaderData:eh,errors:th},$c?{fetchers:new Map(E.fetchers)}:{})}function Or(A,L,H,Z){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");$.has(A)&&Tn(A);let ae=(Z&&Z.unstable_flushSync)===!0,Ie=l||s,xe=Em(E.location,E.matches,c,u.v7_prependBasename,H,u.v7_relativeSplatPath,L,Z==null?void 0:Z.relative),ve=Qs(Ie,xe,c);if(!ve){_t(A,L,er(404,{pathname:xe}),{flushSync:ae});return}let{path:ge,submission:Ne,error:At}=mw(u.v7_normalizeFormMethod,!0,xe,Z);if(At){_t(A,L,At,{flushSync:ae});return}let fe=Tm(ve,ge);if(P=(Z&&Z.preventScrollReset)===!0,Ne&&Sr(Ne.formMethod)){Qt(A,L,ge,fe,ve,ae,Ne);return}oe.set(A,{routeId:L,path:ge}),no(A,L,ge,fe,ve,ae,Ne)}async function Qt(A,L,H,Z,ae,Ie,xe){if(rt(),oe.delete(A),!Z.route.action&&!Z.route.lazy){let vt=er(405,{method:xe.formMethod,pathname:H,routeId:L});_t(A,L,vt,{flushSync:Ie});return}let ve=E.fetchers.get(A);et(A,qU(xe,ve),{flushSync:Ie});let ge=new AbortController,Ne=nl(e.history,H,ge.signal,xe);$.set(A,ge);let At=_,fe=await tl("action",Ne,Z,ae,i,o,c,u.v7_relativeSplatPath);if(Ne.signal.aborted){$.get(A)===ge&&$.delete(A);return}if(u.v7_fetcherPersist&&Ee.has(A)){if(Li(fe)||Ks(fe)){et(A,$o(void 0));return}}else{if(Li(fe))if($.delete(A),F>At){et(A,$o(void 0));return}else return G.add(A),et(A,rl(xe)),te(E,fe,{fetcherSubmission:xe});if(Ks(fe)){_t(A,L,fe.error);return}}if($i(fe))throw er(400,{type:"defer-action"});let Ke=E.navigation.location||E.location,$t=nl(e.history,Ke,ge.signal),Pn=l||s,Bt=E.navigation.state!=="idle"?Qs(Pn,E.navigation.location,c):E.matches;Oe(Bt,"Didn't find any matches after fetcher action");let Ss=++_;q.set(A,Ss);let Zf=rl(xe,fe.data);E.fetchers.set(A,Zf);let[bs,No]=gw(e.history,E,Bt,xe,Ke,!1,N,B,I,Ee,oe,G,Pn,c,{[Z.route.id]:fe.data},void 0);No.filter(vt=>vt.key!==A).forEach(vt=>{let Lr=vt.key,Lc=E.fetchers.get(Lr),Ek=rl(void 0,Lc?Lc.data:void 0);E.fetchers.set(Lr,Ek),$.has(Lr)&&Tn(Lr),vt.controller&&$.set(Lr,vt.controller)}),Y({fetchers:new Map(E.fetchers)});let ji=()=>No.forEach(vt=>Tn(vt.key));ge.signal.addEventListener("abort",ji);let{results:eh,loaderResults:th,fetcherResults:nh}=await be(E.matches,Bt,bs,No,$t);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",ji),q.delete(A),$.delete(A),No.forEach(vt=>$.delete(vt.key));let Cs=Cw(eh);if(Cs){if(Cs.idx>=bs.length){let vt=No[Cs.idx-bs.length].key;G.add(vt)}return te(E,Cs.result)}let{loaderData:$c,errors:ot}=ww(E,E.matches,bs,th,void 0,No,nh,_e);if(E.fetchers.has(A)){let vt=$o(fe.data);E.fetchers.set(A,vt)}Ao(Ss),E.navigation.state==="loading"&&Ss>F?(Oe(T,"Expected pending action"),k&&k.abort(),je(E.navigation.location,{matches:Bt,loaderData:$c,errors:ot,fetchers:new Map(E.fetchers)})):(Y({errors:ot,loaderData:Sw(E.loaderData,$c,Bt,ot),fetchers:new Map(E.fetchers)}),N=!1)}async function no(A,L,H,Z,ae,Ie,xe){let ve=E.fetchers.get(A);et(A,rl(xe,ve?ve.data:void 0),{flushSync:Ie});let ge=new AbortController,Ne=nl(e.history,H,ge.signal);$.set(A,ge);let At=_,fe=await tl("loader",Ne,Z,ae,i,o,c,u.v7_relativeSplatPath);if($i(fe)&&(fe=await ZP(fe,Ne.signal,!0)||fe),$.get(A)===ge&&$.delete(A),!Ne.signal.aborted){if(Ee.has(A)){et(A,$o(void 0));return}if(Li(fe))if(F>At){et(A,$o(void 0));return}else{G.add(A),await te(E,fe);return}if(Ks(fe)){_t(A,L,fe.error);return}Oe(!$i(fe),"Unhandled fetcher deferred data"),et(A,$o(fe.data))}}async function te(A,L,H){let{submission:Z,fetcherSubmission:ae,replace:Ie}=H===void 0?{}:H;L.revalidate&&(N=!0);let xe=Yl(A.location,L.location,{_isRedirect:!0});if(Oe(xe,"Expected a location on the redirect navigation"),n){let Ke=!1;if(L.reloadDocument)Ke=!0;else if(KP.test(L.location)){const $t=e.history.createURL(L.location);Ke=$t.origin!==t.location.origin||Ac($t.pathname,c)==null}if(Ke){Ie?t.location.replace(L.location):t.location.assign(L.location);return}}k=null;let ve=Ie===!0?Nt.Replace:Nt.Push,{formMethod:ge,formAction:Ne,formEncType:At}=A.navigation;!Z&&!ae&&ge&&Ne&&At&&(Z=jw(A.navigation));let fe=Z||ae;if(AU.has(L.status)&&fe&&Sr(fe.formMethod))await Ge(ve,xe,{submission:kt({},fe,{formAction:L.location}),preventScrollReset:P});else{let Ke=Zh(xe,Z);await Ge(ve,xe,{overrideNavigation:Ke,fetcherSubmission:ae,preventScrollReset:P})}}async function be(A,L,H,Z,ae){let Ie=await Promise.all([...H.map(ge=>tl("loader",ae,ge,L,i,o,c,u.v7_relativeSplatPath)),...Z.map(ge=>ge.matches&&ge.match&&ge.controller?tl("loader",nl(e.history,ge.path,ge.controller.signal),ge.match,ge.matches,i,o,c,u.v7_relativeSplatPath):{type:jt.error,error:er(404,{pathname:ge.path})})]),xe=Ie.slice(0,H.length),ve=Ie.slice(H.length);return await Promise.all([Ew(A,H,xe,xe.map(()=>ae.signal),!1,E.loaderData),Ew(A,Z.map(ge=>ge.match),ve,Z.map(ge=>ge.controller?ge.controller.signal:null),!0)]),{results:Ie,loaderResults:xe,fetcherResults:ve}}function rt(){N=!0,B.push(...Ei()),oe.forEach((A,L)=>{$.has(L)&&(I.push(L),Tn(L))})}function et(A,L,H){H===void 0&&(H={}),E.fetchers.set(A,L),Y({fetchers:new Map(E.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function _t(A,L,H,Z){Z===void 0&&(Z={});let ae=Cl(E.matches,L);Xn(A),Y({errors:{[ae.route.id]:H},fetchers:new Map(E.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function Mr(A){return u.v7_fetcherPersist&&(Te.set(A,(Te.get(A)||0)+1),Ee.has(A)&&Ee.delete(A)),E.fetchers.get(A)||NU}function Xn(A){let L=E.fetchers.get(A);$.has(A)&&!(L&&L.state==="loading"&&q.has(A))&&Tn(A),oe.delete(A),q.delete(A),G.delete(A),Ee.delete(A),E.fetchers.delete(A)}function Ci(A){if(u.v7_fetcherPersist){let L=(Te.get(A)||0)-1;L<=0?(Te.delete(A),Ee.add(A)):Te.set(A,L)}else Xn(A);Y({fetchers:new Map(E.fetchers)})}function Tn(A){let L=$.get(A);Oe(L,"Expected fetch controller: "+A),L.abort(),$.delete(A)}function $r(A){for(let L of A){let H=Mr(L),Z=$o(H.data);E.fetchers.set(L,Z)}}function mr(){let A=[],L=!1;for(let H of G){let Z=E.fetchers.get(H);Oe(Z,"Expected fetcher: "+H),Z.state==="loading"&&(G.delete(H),A.push(H),L=!0)}return $r(A),L}function Ao(A){let L=[];for(let[H,Z]of q)if(Z<A){let ae=E.fetchers.get(H);Oe(ae,"Expected fetcher: "+H),ae.state==="loading"&&(Tn(H),q.delete(H),L.push(H))}return $r(L),L.length>0}function za(A,L){let H=E.blockers.get(A)||el;return Pe.get(A)!==L&&Pe.set(A,L),H}function Mc(A){E.blockers.delete(A),Pe.delete(A)}function vs(A,L){let H=E.blockers.get(A)||el;Oe(H.state==="unblocked"&&L.state==="blocked"||H.state==="blocked"&&L.state==="blocked"||H.state==="blocked"&&L.state==="proceeding"||H.state==="blocked"&&L.state==="unblocked"||H.state==="proceeding"&&L.state==="unblocked","Invalid blocker state transition: "+H.state+" -> "+L.state);let Z=new Map(E.blockers);Z.set(A,L),Y({blockers:Z})}function xs(A){let{currentLocation:L,nextLocation:H,historyAction:Z}=A;if(Pe.size===0)return;Pe.size>1&&es(!1,"A router only supports one blocker at a time");let ae=Array.from(Pe.entries()),[Ie,xe]=ae[ae.length-1],ve=E.blockers.get(Ie);if(!(ve&&ve.state==="proceeding")&&xe({currentLocation:L,nextLocation:H,historyAction:Z}))return Ie}function Ei(A){let L=[];return _e.forEach((H,Z)=>{(!A||A(Z))&&(H.cancel(),L.push(Z),_e.delete(Z))}),L}function ws(A,L,H){if(h=A,g=L,m=H||null,!y&&E.navigation===Jh){y=!0;let Z=Xf(E.location,E.matches);Z!=null&&Y({restoreScrollPosition:Z})}return()=>{h=null,g=null,m=null}}function dn(A,L){return m&&m(A,L.map(Z=>cU(Z,E.loaderData)))||A.key}function Yf(A,L){if(h&&g){let H=dn(A,L);h[H]=g()}}function Xf(A,L){if(h){let H=dn(A,L),Z=h[H];if(typeof Z=="number")return Z}return null}function Jf(A){i={},l=Cm(A,o,void 0,i)}return j={get basename(){return c},get future(){return u},get state(){return E},get routes(){return s},get window(){return t},initialize:Qe,subscribe:dt,enableScrollRestoration:ws,navigate:Ae,fetch:Or,revalidate:nt,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Mr,deleteFetcher:Ci,dispose:qe,getBlocker:za,deleteBlocker:Mc,_internalFetchControllers:$,_internalActiveDeferreds:_e,_internalSetRoutes:Jf},j}function $U(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Em(e,t,n,r,o,i,s,l){let c,u;if(s){c=[];for(let f of t)if(c.push(f),f.route.id===s){u=f;break}}else c=t,u=t[t.length-1];let d=qP(o||".",WP(c,i),Ac(e.pathname,n)||e.pathname,l==="path");return o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!t0(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:si([n,d.pathname])),_c(d)}function mw(e,t,n,r){if(!r||!$U(r))return{path:n};if(r.formMethod&&!HU(r.formMethod))return{path:n,error:er(405,{method:r.formMethod})};let o=()=>({path:n,error:er(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),l=JP(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Sr(s))return o();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,g)=>{let[y,C]=g;return""+m+y+"="+C+`
206
+ `},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Sr(s))return o();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=jm(r.formData),u=r.formData;else if(r.body instanceof FormData)c=jm(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=xw(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=xw(c)}catch{return o()}let d={formMethod:s,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Sr(d.formMethod))return{path:n,submission:d};let f=_o(n);return t&&f.search&&t0(f.search)&&c.append("index",""),f.search="?"+c,{path:_c(f),submission:d}}function LU(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function gw(e,t,n,r,o,i,s,l,c,u,d,f,h,m,g,y){let C=y?Object.values(y)[0]:g?Object.values(g)[0]:void 0,v=e.createURL(t.location),x=e.createURL(o),w=y?Object.keys(y)[0]:void 0,j=LU(n,w).filter((T,P)=>{let{route:k}=T;if(k.lazy)return!0;if(k.loader==null)return!1;if(i)return k.loader.hydrate?!0:t.loaderData[k.id]===void 0&&(!t.errors||t.errors[k.id]===void 0);if(FU(t.loaderData,t.matches[P],T)||l.some(R=>R===T.route.id))return!0;let D=t.matches[P],M=T;return yw(T,kt({currentUrl:v,currentParams:D.params,nextUrl:x,nextParams:M.params},r,{actionResult:C,defaultShouldRevalidate:s||v.pathname+v.search===x.pathname+x.search||v.search!==x.search||XP(D,M)}))}),E=[];return d.forEach((T,P)=>{if(i||!n.some(O=>O.route.id===T.routeId)||u.has(P))return;let k=Qs(h,T.path,m);if(!k){E.push({key:P,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let D=t.fetchers.get(P),M=Tm(k,T.path),R=!1;f.has(P)?R=!1:c.includes(P)?R=!0:D&&D.state!=="idle"&&D.data===void 0?R=s:R=yw(M,kt({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:C,defaultShouldRevalidate:s})),R&&E.push({key:P,routeId:T.routeId,path:T.path,matches:k,match:M,controller:new AbortController})}),[j,E]}function FU(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function XP(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function yw(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function vw(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Oe(o,"No route found in manifest");let i={};for(let s in r){let c=o[s]!==void 0&&s!=="hasErrorBoundary";es(!c,'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.')),!c&&!aU.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,kt({},t(o),{lazy:void 0}))}async function tl(e,t,n,r,o,i,s,l,c){c===void 0&&(c={});let u,d,f,h=y=>{let C,v=new Promise((x,w)=>C=w);return f=()=>C(),t.signal.addEventListener("abort",f),Promise.race([y({request:t,params:n.params,context:c.requestContext}),v])};try{let y=n.route[e];if(n.route.lazy)if(y){let C,v=await Promise.all([h(y).catch(x=>{C=x}),vw(n.route,i,o)]);if(C)throw C;d=v[0]}else if(await vw(n.route,i,o),y=n.route[e],y)d=await h(y);else if(e==="action"){let C=new URL(t.url),v=C.pathname+C.search;throw er(405,{method:t.method,pathname:v,routeId:n.route.id})}else return{type:jt.data,data:void 0};else if(y)d=await h(y);else{let C=new URL(t.url),v=C.pathname+C.search;throw er(404,{pathname:v})}Oe(d!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(y){u=jt.error,d=y}finally{f&&t.signal.removeEventListener("abort",f)}if(VU(d)){let y=d.status;if(_U.has(y)){let v=d.headers.get("Location");if(Oe(v,"Redirects returned/thrown from loaders/actions must have a Location header"),!KP.test(v))v=Em(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,v,l);else if(!c.isStaticRequest){let x=new URL(t.url),w=v.startsWith("//")?new URL(x.protocol+v):new URL(v),S=Ac(w.pathname,s)!=null;w.origin===x.origin&&S&&(v=w.pathname+w.search+w.hash)}if(c.isStaticRequest)throw d.headers.set("Location",v),d;return{type:jt.redirect,status:y,location:v,revalidate:d.headers.get("X-Remix-Revalidate")!==null,reloadDocument:d.headers.get("X-Remix-Reload-Document")!==null}}if(c.isRouteRequest)throw{type:u===jt.error?jt.error:jt.data,response:d};let C;try{let v=d.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?d.body==null?C=null:C=await d.json():C=await d.text()}catch(v){return{type:jt.error,error:v}}return u===jt.error?{type:u,error:new e0(y,d.statusText,C),headers:d.headers}:{type:jt.data,data:C,statusCode:d.status,headers:d.headers}}if(u===jt.error)return{type:u,error:d};if(UU(d)){var m,g;return{type:jt.deferred,deferredData:d,statusCode:(m=d.init)==null?void 0:m.status,headers:((g=d.init)==null?void 0:g.headers)&&new Headers(d.init.headers)}}return{type:jt.data,data:d}}function nl(e,t,n,r){let o=e.createURL(JP(t)).toString(),i={signal:n};if(r&&Sr(r.formMethod)){let{formMethod:s,formEncType:l}=r;i.method=s.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(r.json)):l==="text/plain"?i.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?i.body=jm(r.formData):i.body=r.formData}return new Request(o,i)}function jm(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function xw(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function zU(e,t,n,r,o){let i={},s=null,l,c=!1,u={};return n.forEach((d,f)=>{let h=t[f].route.id;if(Oe(!Li(d),"Cannot handle redirect results in processLoaderData"),Ks(d)){let m=Cl(e,h),g=d.error;r&&(g=Object.values(r)[0],r=void 0),s=s||{},s[m.route.id]==null&&(s[m.route.id]=g),i[h]=void 0,c||(c=!0,l=GP(d.error)?d.error.status:500),d.headers&&(u[h]=d.headers)}else $i(d)?(o.set(h,d.deferredData),i[h]=d.deferredData.data):i[h]=d.data,d.statusCode!=null&&d.statusCode!==200&&!c&&(l=d.statusCode),d.headers&&(u[h]=d.headers)}),r&&(s=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:s,statusCode:l||200,loaderHeaders:u}}function ww(e,t,n,r,o,i,s,l){let{loaderData:c,errors:u}=zU(t,n,r,o,l);for(let d=0;d<i.length;d++){let{key:f,match:h,controller:m}=i[d];Oe(s!==void 0&&s[d]!==void 0,"Did not find corresponding fetcher result");let g=s[d];if(!(m&&m.signal.aborted))if(Ks(g)){let y=Cl(e.matches,h==null?void 0:h.route.id);u&&u[y.route.id]||(u=kt({},u,{[y.route.id]:g.error})),e.fetchers.delete(f)}else if(Li(g))Oe(!1,"Unhandled fetcher revalidation redirect");else if($i(g))Oe(!1,"Unhandled fetcher deferred data");else{let y=$o(g.data);e.fetchers.set(f,y)}}return{loaderData:c,errors:u}}function Sw(e,t,n,r){let o=kt({},t);for(let i of n){let s=i.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(o[s]=t[s]):e[s]!==void 0&&i.route.loader&&(o[s]=e[s]),r&&r.hasOwnProperty(s))break}return o}function Cl(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 bw(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 er(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",o&&n&&r?l="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",o&&n&&r?l="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new e0(e||500,s,new Error(l),!0)}function Cw(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Li(n))return{result:n,idx:t}}}function JP(e){let t=typeof e=="string"?_o(e):e;return _c(kt({},t,{hash:""}))}function BU(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function $i(e){return e.type===jt.deferred}function Ks(e){return e.type===jt.error}function Li(e){return(e&&e.type)===jt.redirect}function UU(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function VU(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function HU(e){return IU.has(e.toLowerCase())}function Sr(e){return RU.has(e.toLowerCase())}async function Ew(e,t,n,r,o,i){for(let s=0;s<n.length;s++){let l=n[s],c=t[s];if(!c)continue;let u=e.find(f=>f.route.id===c.route.id),d=u!=null&&!XP(u,c)&&(i&&i[c.route.id])!==void 0;if($i(l)&&(o||d)){let f=r[s];Oe(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await ZP(l,f,o).then(h=>{h&&(n[s]=h||n[s])})}}}async function ZP(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:jt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:jt.error,error:o}}return{type:jt.data,data:e.deferredData.data}}}function t0(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Tm(e,t){let n=typeof t=="string"?_o(t).search:t.search;if(e[e.length-1].route.index&&t0(n||""))return e[e.length-1];let r=HP(e);return r[r.length-1]}function jw(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function Zh(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 WU(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 rl(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 qU(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 $o(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 GU(e,t){try{let n=e.sessionStorage.getItem(YP);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function QU(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(YP,JSON.stringify(n))}catch(r){es(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
207
+ * React Router v6.21.3
208
+ *
209
+ * Copyright (c) Remix Software Inc.
210
+ *
211
+ * This source code is licensed under the MIT license found in the
212
+ * LICENSE.md file in the root directory of this source tree.
213
+ *
214
+ * @license MIT
215
+ */function Xl(){return Xl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xl.apply(this,arguments)}const Vf=p.createContext(null),ek=p.createContext(null),Hf=p.createContext(null),Wf=p.createContext(null),xi=p.createContext({outlet:null,matches:[],isDataRoute:!1}),tk=p.createContext(null);function qf(){return p.useContext(Wf)!=null}function wi(){return qf()||Oe(!1),p.useContext(Wf).location}function nk(e){p.useContext(Hf).static||p.useLayoutEffect(e)}function Dt(){let{isDataRoute:e}=p.useContext(xi);return e?lV():KU()}function KU(){qf()||Oe(!1);let e=p.useContext(Vf),{basename:t,future:n,navigator:r}=p.useContext(Hf),{matches:o}=p.useContext(xi),{pathname:i}=wi(),s=JSON.stringify(WP(o,n.v7_relativeSplatPath)),l=p.useRef(!1);return nk(()=>{l.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=qP(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:si([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,s,i,e])}const YU=p.createContext(null);function XU(e){let t=p.useContext(xi).outlet;return t&&p.createElement(YU.Provider,{value:e},t)}function Ze(){let{matches:e}=p.useContext(xi),t=e[e.length-1];return t?t.params:{}}function JU(e,t){return rk(e,t)}function rk(e,t,n,r){qf()||Oe(!1);let{navigator:o}=p.useContext(Hf),{matches:i}=p.useContext(xi),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=wi(),d;if(t){var f;let C=typeof t=="string"?_o(t):t;c==="/"||(f=C.pathname)!=null&&f.startsWith(c)||Oe(!1),d=C}else d=u;let h=d.pathname||"/",m=c==="/"?h:h.slice(c.length)||"/",g=Qs(e,{pathname:m}),y=rV(g&&g.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:si([c,o.encodeLocation?o.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?c:si([c,o.encodeLocation?o.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),i,n,r);return t&&y?p.createElement(Wf.Provider,{value:{location:Xl({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Nt.Pop}},y):y}function ZU(){let e=aV(),t=GP(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:o},n):null,null)}const eV=p.createElement(ZU,null);class tV extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(xi.Provider,{value:this.props.routeContext},p.createElement(tk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nV(e){let{routeContext:t,match:n,children:r}=e,o=p.useContext(Vf);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(xi.Provider,{value:t},r)}function rV(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let s=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let d=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id]));d>=0||Oe(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<s.length;d++){let f=s[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:m}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let m,g=!1,y=null,C=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,y=f.route.errorElement||eV,c&&(u<0&&h===0?(cV("route-fallback",!1),g=!0,C=null):u===h&&(g=!0,C=f.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,h+1)),x=()=>{let w;return m?w=y:g?w=C:f.route.Component?w=p.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,p.createElement(nV,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(tV,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var ok=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ok||{}),Ed=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ed||{});function oV(e){let t=p.useContext(Vf);return t||Oe(!1),t}function iV(e){let t=p.useContext(ek);return t||Oe(!1),t}function sV(e){let t=p.useContext(xi);return t||Oe(!1),t}function ik(e){let t=sV(),n=t.matches[t.matches.length-1];return n.route.id||Oe(!1),n.route.id}function aV(){var e;let t=p.useContext(tk),n=iV(Ed.UseRouteError),r=ik(Ed.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function lV(){let{router:e}=oV(ok.UseNavigateStable),t=ik(Ed.UseNavigateStable),n=p.useRef(!1);return nk(()=>{n.current=!0}),p.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Xl({fromRouteId:t},i)))},[e,t])}const Tw={};function cV(e,t,n){!t&&!Tw[e]&&(Tw[e]=!0)}function n0(e){return XU(e.context)}function he(e){Oe(!1)}function uV(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Nt.Pop,navigator:i,static:s=!1,future:l}=e;qf()&&Oe(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:i,static:s,future:Xl({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof r=="string"&&(r=_o(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:g="default"}=r,y=p.useMemo(()=>{let C=Ac(d,c);return C==null?null:{location:{pathname:C,search:f,hash:h,state:m,key:g},navigationType:o}},[c,d,f,h,m,g,o]);return y==null?null:p.createElement(Hf.Provider,{value:u},p.createElement(Wf.Provider,{children:n,value:y}))}function dV(e){let{children:t,location:n}=e;return JU(Pm(t),n)}new Promise(()=>{});function Pm(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,o)=>{if(!p.isValidElement(r))return;let i=[...t,o];if(r.type===p.Fragment){n.push.apply(n,Pm(r.props.children,i));return}r.type!==he&&Oe(!1),!r.props.index||!r.props.children||Oe(!1);let s={id:r.props.id||i.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,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Pm(r.props.children,i)),n.push(s)}),n}function fV(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
216
+ * React Router DOM v6.21.3
217
+ *
218
+ * Copyright (c) Remix Software Inc.
219
+ *
220
+ * This source code is licensed under the MIT license found in the
221
+ * LICENSE.md file in the root directory of this source tree.
222
+ *
223
+ * @license MIT
224
+ */function jd(){return jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jd.apply(this,arguments)}function km(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function hV(e,t){let n=km(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}function pV(e,t){return MU({basename:t==null?void 0:t.basename,future:jd({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:oU({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||mV(),routes:e,mapRouteProperties:fV,window:t==null?void 0:t.window}).initialize()}function mV(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=jd({},t,{errors:gV(t.errors)})),t}function gV(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new e0(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const yV=p.createContext({isTransitioning:!1}),vV=p.createContext(new Map),xV="startTransition",Pw=Lm[xV],wV="flushSync",kw=c_[wV];function SV(e){Pw?Pw(e):e()}function ol(e){kw?kw(e):e()}class bV{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function CV(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=p.useState(n.state),[s,l]=p.useState(),[c,u]=p.useState({isTransitioning:!1}),[d,f]=p.useState(),[h,m]=p.useState(),[g,y]=p.useState(),C=p.useRef(new Map),{v7_startTransition:v}=r||{},x=p.useCallback(T=>{v?SV(T):T()},[v]),w=p.useCallback((T,P)=>{let{deletedFetchers:k,unstable_flushSync:D,unstable_viewTransitionOpts:M}=P;k.forEach(O=>C.current.delete(O)),T.fetchers.forEach((O,N)=>{O.data!==void 0&&C.current.set(N,O.data)});let R=n.window==null||typeof n.window.document.startViewTransition!="function";if(!M||R){D?ol(()=>i(T)):x(()=>i(T));return}if(D){ol(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let O=n.window.document.startViewTransition(()=>{ol(()=>i(T))});O.finished.finally(()=>{ol(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})})}),ol(()=>m(O));return}h?(d&&d.resolve(),h.skipTransition(),y({state:T,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(l(T),u({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[n.window,h,d,C,x]);p.useLayoutEffect(()=>n.subscribe(w),[n,w]),p.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new bV)},[c]),p.useEffect(()=>{if(d&&s&&n.window){let T=s,P=d.promise,k=n.window.document.startViewTransition(async()=>{x(()=>i(T)),await P});k.finished.finally(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})}),m(k)}},[x,s,d,n.window]),p.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,h,o.location,s]),p.useEffect(()=>{!c.isTransitioning&&g&&(l(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[c.isTransitioning,g]),p.useEffect(()=>{},[]);let S=p.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,P,k)=>n.navigate(T,{state:P,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(T,P,k)=>n.navigate(T,{replace:!0,state:P,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[n]),j=n.basename||"/",E=p.useMemo(()=>({router:n,navigator:S,static:!1,basename:j}),[n,S,j]);return p.createElement(p.Fragment,null,p.createElement(Vf.Provider,{value:E},p.createElement(ek.Provider,{value:o},p.createElement(vV.Provider,{value:C.current},p.createElement(yV.Provider,{value:c},p.createElement(uV,{basename:j,location:o.location,navigationType:o.historyAction,navigator:S,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?p.createElement(EV,{routes:n.routes,future:n.future,state:o}):t))))),null)}function EV(e){let{routes:t,future:n,state:r}=e;return rk(t,void 0,r,n)}var Rw;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Rw||(Rw={}));var Dw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Dw||(Dw={}));function r0(e){let t=p.useRef(km(e)),n=p.useRef(!1),r=wi(),o=p.useMemo(()=>hV(r.search,n.current?null:t.current),[r.search]),i=Dt(),s=p.useCallback((l,c)=>{const u=km(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,c)},[i,o]);return[o,s]}const jV=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Nc(e,t){const n=TV(e);if(typeof n.path!="string"){const{webkitRelativePath:r}=e;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function TV(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=jV.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var La=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(u){o(u)}},s=c=>{try{l(n.throw(c))}catch(u){o(u)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((n=n.apply(e,t)).next())});const PV=[".DS_Store","Thumbs.db"];function kV(e){return La(this,null,function*(){return Td(e)&&RV(e.dataTransfer)?AV(e.dataTransfer,e.type):DV(e)?IV(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?_V(e):[]})}function RV(e){return Td(e)}function DV(e){return Td(e)&&Td(e.target)}function Td(e){return typeof e=="object"&&e!==null}function IV(e){return Rm(e.target.files).map(t=>Nc(t))}function _V(e){return La(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Nc(n))})}function AV(e,t){return La(this,null,function*(){if(e.items){const n=Rm(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(NV));return Iw(sk(r))}return Iw(Rm(e.files).map(n=>Nc(n)))})}function Iw(e){return e.filter(t=>PV.indexOf(t.name)===-1)}function Rm(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 NV(e){if(typeof e.webkitGetAsEntry!="function")return _w(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?ak(t):_w(e)}function sk(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?sk(n):[n]],[])}function _w(e){const t=e.getAsFile();if(!t)return Promise.reject(`${e} is not a File`);const n=Nc(t);return Promise.resolve(n)}function OV(e){return La(this,null,function*(){return e.isDirectory?ak(e):MV(e)})}function ak(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(s=>La(this,null,function*(){if(s.length){const l=Promise.all(s.map(OV));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),s=>{r(s)})}i()})}function MV(e){return La(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Nc(r,e.fullPath);t(o)},r=>{n(r)})})})}function $V(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(s=>{const l=s.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):o===l})}return!0}var LV=Object.defineProperty,FV=Object.defineProperties,zV=Object.getOwnPropertyDescriptors,Aw=Object.getOwnPropertySymbols,BV=Object.prototype.hasOwnProperty,UV=Object.prototype.propertyIsEnumerable,Nw=(e,t,n)=>t in e?LV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VV=(e,t)=>{for(var n in t||(t={}))BV.call(t,n)&&Nw(e,n,t[n]);if(Aw)for(var n of Aw(t))UV.call(t,n)&&Nw(e,n,t[n]);return e},HV=(e,t)=>FV(e,zV(t));const WV="file-invalid-type",qV="file-too-large",GV="file-too-small",QV="too-many-files",KV=e=>{e=Array.isArray(e)&&e.length===1?e[0]:e;const t=Array.isArray(e)?`one of ${e.join(", ")}`:e;return{code:WV,message:`File type must be ${t}`}},Ow=e=>({code:qV,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),Mw=e=>({code:GV,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),YV={code:QV,message:"Too many files"};function lk(e,t){const n=e.type==="application/x-moz-file"||$V(e,t);return[n,n?null:KV(t)]}function ck(e,t,n){if(_i(e.size))if(_i(t)&&_i(n)){if(e.size>n)return[!1,Ow(n)];if(e.size<t)return[!1,Mw(t)]}else{if(_i(t)&&e.size<t)return[!1,Mw(t)];if(_i(n)&&e.size>n)return[!1,Ow(n)]}return[!0,null]}function _i(e){return e!=null}function XV({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:i,validator:s}){return!o&&e.length>1||o&&i>=1&&e.length>i?!1:e.every(l=>{const[c]=lk(l,t),[u]=ck(l,n,r),d=s?s(l):null;return c&&u&&!d})}function Pd(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function hu(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 $w(e){e.preventDefault()}function JV(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function ZV(e){return e.indexOf("Edge/")!==-1}function eH(e=window.navigator.userAgent){return JV(e)||ZV(e)}function Br(...e){return(t,...n)=>e.some(r=>(!Pd(t)&&r&&r(t,...n),Pd(t)))}function tH(){return"showOpenFilePicker"in window}function nH(e){return _i(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return uk(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.`),o=!1),(!Array.isArray(r)||!r.every(dk))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>HV(VV({},n),{[r]:o}),{})}]:e}function rH(e){if(_i(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>uk(t)||dk(t)).join(",")}function oH(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function iH(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function uk(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function dk(e){return/^.*\.[\w]+$/.test(e)}var sH=Object.defineProperty,aH=Object.defineProperties,lH=Object.getOwnPropertyDescriptors,kd=Object.getOwnPropertySymbols,fk=Object.prototype.hasOwnProperty,hk=Object.prototype.propertyIsEnumerable,Lw=(e,t,n)=>t in e?sH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pn=(e,t)=>{for(var n in t||(t={}))fk.call(t,n)&&Lw(e,n,t[n]);if(kd)for(var n of kd(t))hk.call(t,n)&&Lw(e,n,t[n]);return e},Uo=(e,t)=>aH(e,lH(t)),Rd=(e,t)=>{var n={};for(var r in e)fk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kd)for(var r of kd(e))t.indexOf(r)<0&&hk.call(e,r)&&(n[r]=e[r]);return n};const o0=p.forwardRef((e,t)=>{var n=e,{children:r}=n,o=Rd(n,["children"]);const i=mk(o),{open:s}=i,l=Rd(i,["open"]);return p.useImperativeHandle(t,()=>({open:s}),[s]),b.createElement(p.Fragment,null,r(Uo(pn({},l),{open:s})))});o0.displayName="Dropzone";const pk={disabled:!1,getFilesFromEvent:kV,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};o0.defaultProps=pk;o0.propTypes={children:ze.func,accept:ze.objectOf(ze.arrayOf(ze.string)),multiple:ze.bool,preventDropOnDocument:ze.bool,noClick:ze.bool,noKeyboard:ze.bool,noDrag:ze.bool,noDragEventsBubbling:ze.bool,minSize:ze.number,maxSize:ze.number,maxFiles:ze.number,disabled:ze.bool,getFilesFromEvent:ze.func,onFileDialogCancel:ze.func,onFileDialogOpen:ze.func,useFsAccessApi:ze.bool,autoFocus:ze.bool,onDragEnter:ze.func,onDragLeave:ze.func,onDragOver:ze.func,onDrop:ze.func,onDropAccepted:ze.func,onDropRejected:ze.func,onError:ze.func,validator:ze.func};const Dm={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function mk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:i,multiple:s,maxFiles:l,onDragEnter:c,onDragLeave:u,onDragOver:d,onDrop:f,onDropAccepted:h,onDropRejected:m,onFileDialogCancel:g,onFileDialogOpen:y,useFsAccessApi:C,autoFocus:v,preventDropOnDocument:x,noClick:w,noKeyboard:S,noDrag:j,noDragEventsBubbling:E,onError:T,validator:P}=pn(pn({},pk),e),k=p.useMemo(()=>rH(t),[t]),D=p.useMemo(()=>nH(t),[t]),M=p.useMemo(()=>typeof y=="function"?y:Fw,[y]),R=p.useMemo(()=>typeof g=="function"?g:Fw,[g]),O=p.useRef(null),N=p.useRef(null),[B,I]=p.useReducer(cH,Dm),{isFocused:$,isFileDialogActive:_}=B,F=p.useRef(typeof window<"u"&&window.isSecureContext&&C&&tH()),q=()=>{!F.current&&_&&setTimeout(()=>{if(N.current){const{files:te}=N.current;te.length||(I({type:"closeDialog"}),R())}},300)};p.useEffect(()=>(window.addEventListener("focus",q,!1),()=>{window.removeEventListener("focus",q,!1)}),[N,_,R,F]);const G=p.useRef([]),oe=te=>{O.current&&O.current.contains(te.target)||(te.preventDefault(),G.current=[])};p.useEffect(()=>(x&&(document.addEventListener("dragover",$w,!1),document.addEventListener("drop",oe,!1)),()=>{x&&(document.removeEventListener("dragover",$w),document.removeEventListener("drop",oe))}),[O,x]),p.useEffect(()=>(!n&&v&&O.current&&O.current.focus(),()=>{}),[O,v,n]);const Te=p.useCallback(te=>{T?T(te):console.error(te)},[T]),Ee=p.useCallback(te=>{te.preventDefault(),te.persist(),jn(te),G.current=[...G.current,te.target],hu(te)&&Promise.resolve(r(te)).then(be=>{if(Pd(te)&&!E)return;const rt=be.length,et=rt>0&&XV({files:be,accept:k,minSize:i,maxSize:o,multiple:s,maxFiles:l,validator:P}),_t=rt>0&&!et;I({isDragAccept:et,isDragReject:_t,isDragActive:!0,type:"setDraggedFiles"}),c&&c(te)}).catch(be=>Te(be))},[r,c,Te,E,k,i,o,s,l,P]),_e=p.useCallback(te=>{te.preventDefault(),te.persist(),jn(te);const be=hu(te);if(be&&te.dataTransfer)try{te.dataTransfer.dropEffect="copy"}catch{}return be&&d&&d(te),!1},[d,E]),Pe=p.useCallback(te=>{te.preventDefault(),te.persist(),jn(te);const be=G.current.filter(et=>O.current&&O.current.contains(et)),rt=be.indexOf(te.target);rt!==-1&&be.splice(rt,1),G.current=be,!(be.length>0)&&(I({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),hu(te)&&u&&u(te))},[O,u,E]),De=p.useCallback((te,be)=>{const rt=[],et=[];te.forEach(_t=>{const[Mr,Xn]=lk(_t,k),[Ci,Tn]=ck(_t,i,o),$r=P?P(_t):null;if(Mr&&Ci&&!$r)rt.push(_t);else{let mr=[Xn,Tn];$r&&(mr=mr.concat($r)),et.push({file:_t,errors:mr.filter(Ao=>Ao)})}}),(!s&&rt.length>1||s&&l>=1&&rt.length>l)&&(rt.forEach(_t=>{et.push({file:_t,errors:[YV]})}),rt.splice(0)),I({acceptedFiles:rt,fileRejections:et,type:"setFiles"}),f&&f(rt,et,be),et.length>0&&m&&m(et,be),rt.length>0&&h&&h(rt,be)},[I,s,k,i,o,l,f,h,m,P]),Qe=p.useCallback(te=>{te.preventDefault(),te.persist(),jn(te),G.current=[],hu(te)&&Promise.resolve(r(te)).then(be=>{Pd(te)&&!E||De(be,te)}).catch(be=>Te(be)),I({type:"reset"})},[r,De,Te,E]),qe=p.useCallback(()=>{if(F.current){I({type:"openDialog"}),M();const te={multiple:s,types:D};window.showOpenFilePicker(te).then(be=>r(be)).then(be=>{De(be,null),I({type:"closeDialog"})}).catch(be=>{oH(be)?(R(be),I({type:"closeDialog"})):iH(be)?(F.current=!1,N.current?(N.current.value=null,N.current.click()):Te(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."))):Te(be)});return}N.current&&(I({type:"openDialog"}),M(),N.current.value=null,N.current.click())},[I,M,R,C,De,Te,D,s]),dt=p.useCallback(te=>{!O.current||!O.current.isEqualNode(te.target)||(te.key===" "||te.key==="Enter"||te.keyCode===32||te.keyCode===13)&&(te.preventDefault(),qe())},[O,qe]),Y=p.useCallback(()=>{I({type:"focus"})},[]),je=p.useCallback(()=>{I({type:"blur"})},[]),Ae=p.useCallback(()=>{w||(eH()?setTimeout(qe,0):qe())},[w,qe]),nt=te=>n?null:te,Ge=te=>S?null:nt(te),It=te=>j?null:nt(te),jn=te=>{E&&te.stopPropagation()},Or=p.useMemo(()=>(te={})=>{var be=te,{refKey:rt="ref",role:et,onKeyDown:_t,onFocus:Mr,onBlur:Xn,onClick:Ci,onDragEnter:Tn,onDragOver:$r,onDragLeave:mr,onDrop:Ao}=be,za=Rd(be,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return pn(pn({onKeyDown:Ge(Br(_t,dt)),onFocus:Ge(Br(Mr,Y)),onBlur:Ge(Br(Xn,je)),onClick:nt(Br(Ci,Ae)),onDragEnter:It(Br(Tn,Ee)),onDragOver:It(Br($r,_e)),onDragLeave:It(Br(mr,Pe)),onDrop:It(Br(Ao,Qe)),role:typeof et=="string"&&et!==""?et:"presentation",[rt]:O},!n&&!S?{tabIndex:0}:{}),za)},[O,dt,Y,je,Ae,Ee,_e,Pe,Qe,S,j,n]),Qt=p.useCallback(te=>{te.stopPropagation()},[]),no=p.useMemo(()=>(te={})=>{var be=te,{refKey:rt="ref",onChange:et,onClick:_t}=be,Mr=Rd(be,["refKey","onChange","onClick"]);const Xn={accept:k,multiple:s,type:"file",style:{display:"none"},onChange:nt(Br(et,Qe)),onClick:nt(Br(_t,Qt)),tabIndex:-1,[rt]:N};return pn(pn({},Xn),Mr)},[N,t,s,Qe,n]);return Uo(pn({},B),{isFocused:$&&!n,getRootProps:Or,getInputProps:no,rootRef:O,inputRef:N,open:nt(qe)})}function cH(e,t){switch(t.type){case"focus":return Uo(pn({},e),{isFocused:!0});case"blur":return Uo(pn({},e),{isFocused:!1});case"openDialog":return Uo(pn({},Dm),{isFileDialogActive:!0});case"closeDialog":return Uo(pn({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Uo(pn({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Uo(pn({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return pn({},Dm);default:return e}}function Fw(){}const[uH,dH]=Sn("Dropzone component was not found in tree");function i0(e){const t=n=>{const{children:r,...o}=U(`Dropzone${v0(e)}`,{},n),i=dH(),s=Co(r)?r:b.createElement("span",null,r);return i[e]?p.cloneElement(s,o):null};return t.displayName=`@mantine/dropzone/${v0(e)}`,t}const fH=i0("accept"),hH=i0("reject"),pH=i0("idle");var Jl={root:"m-d46a4834",inner:"m-b85f7144",fullScreen:"m-96f6e9ad",dropzone:"m-7946116d"};const mH={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},gH=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const i=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),s=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":ut(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":s.color,"--dropzone-reject-bg":s.background}}},Si=Q((e,t)=>{const n=U("Dropzone",mH,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,disabled:d,loading:f,multiple:h,maxSize:m,accept:g,children:y,onDropAny:C,onDrop:v,onReject:x,openRef:w,name:S,maxFiles:j,autoFocus:E,activateOnClick:T,activateOnDrag:P,dragEventsBubbling:k,activateOnKeyboard:D,onDragEnter:M,onDragLeave:R,onDragOver:O,onFileDialogCancel:N,onFileDialogOpen:B,preventDropOnDocument:I,useFsAccessApi:$,getFilesFromEvent:_,validator:F,rejectColor:q,acceptColor:G,enablePointerEvents:oe,loaderProps:Te,mod:Ee,..._e}=n,Pe=le({name:"Dropzone",classes:Jl,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:gH}),{getRootProps:De,getInputProps:Qe,isDragAccept:qe,isDragReject:dt,open:Y}=mk({onDrop:C,onDropAccepted:v,onDropRejected:x,disabled:d||f,accept:Array.isArray(g)?g.reduce((Ae,nt)=>({...Ae,[nt]:[]}),{}):g,multiple:h,maxSize:m,maxFiles:j,autoFocus:E,noClick:!T,noDrag:!P,noDragEventsBubbling:!k,noKeyboard:!D,onDragEnter:M,onDragLeave:R,onDragOver:O,onFileDialogCancel:N,onFileDialogOpen:B,preventDropOnDocument:I,useFsAccessApi:$,validator:F,..._?{getFilesFromEvent:_}:null});Vm(w,Y);const je=!qe&&!dt;return b.createElement(uH,{value:{accept:qe,reject:dt,idle:je}},b.createElement(W,{...De({ref:t}),...Pe("root",{focusable:!0}),..._e,mod:[{accept:qe,reject:dt,idle:je,loading:f,"activate-on-click":T},Ee]},b.createElement(Ay,{visible:f,overlayProps:{radius:u},unstyled:l,loaderProps:Te}),b.createElement("input",{...Qe(),name:S}),b.createElement("div",{...Pe("inner"),"data-enable-pointer-events":oe||void 0},y)))});Si.classes=Jl;Si.displayName="@mantine/dropzone/Dropzone";Si.Accept=fH;Si.Idle=pH;Si.Reject=hH;const yH={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Ir("max"),withinPortal:!0},s0=Q((e,t)=>{const n=U("DropzoneFullScreen",yH,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,active:u,onDrop:d,onReject:f,zIndex:h,withinPortal:m,portalProps:g,...y}=n,C=le({name:"DropzoneFullScreen",classes:Jl,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"fullScreen"}),{resolvedClassNames:v,resolvedStyles:x}=Md({classNames:r,styles:s,props:n}),[w,S]=p.useState(0),[j,{open:E,close:T}]=oR(!1),P=D=>{var M;(M=D.dataTransfer)!=null&&M.types.includes("Files")&&(S(R=>R+1),E())},k=()=>{S(D=>D-1)};return p.useEffect(()=>{w===0&&T()},[w]),p.useEffect(()=>{if(u)return document.addEventListener("dragenter",P,!1),document.addEventListener("dragleave",k,!1),()=>{document.removeEventListener("dragenter",P,!1),document.removeEventListener("dragleave",k,!1)}},[u]),b.createElement(as,{...g,withinPortal:m},b.createElement(W,{...C("fullScreen",{style:{opacity:j?1:0,pointerEvents:j?"all":"none",zIndex:h}}),ref:t},b.createElement(Si,{...y,classNames:v,styles:x,unstyled:l,className:Jl.dropzone,onDrop:D=>{d==null||d(D),T(),S(0)},onReject:D=>{f==null||f(D),T(),S(0)}})))});s0.classes=Jl;s0.displayName="@mantine/dropzone/DropzoneFullScreen";Si.FullScreen=s0;const pu=Si,vH='{"resourceType": "Bundle"}';function ep({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:s="show",loading:l}){Kr[s]({id:e,loading:l,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function xH(){const e=Rt(),t=re(),[n,r]=p.useState({}),o=p.useCallback(async(l,c)=>{const u="batch-upload";ep({id:u,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let d=JSON.parse(l);d.type!=="batch"&&d.type!=="transaction"&&(d=gT(d));const f=await t.executeBatch(d);r(h=>({...h,[c]:f})),ep({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(Mf,{size:"1rem"}),withCloseButton:!0})}catch(d){ep({id:u,title:"Batch Upload Failed",color:"red",message:Re(d),method:"update",icon:a.jsx(Sd,{size:"1rem"}),withCloseButton:!0})}},[t]),i=p.useCallback(async l=>{for(const c of l){const u=new FileReader;u.onload=d=>{var f;return o((f=d.target)==null?void 0:f.result,c.name)},u.readAsText(c)}},[o]),s=p.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return a.jsxs(we,{children:[a.jsx(ce,{children:"Batch Create"}),a.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",a.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Input"}),a.jsxs(He,{defaultValue:"upload",children:[a.jsxs(He.List,{children:[a.jsx(He.Tab,{value:"upload",children:"File Upload"}),a.jsx(He.Tab,{value:"json",children:"JSON"})]}),a.jsx(He.Panel,{value:"upload",pt:"xs",children:a.jsx(pu,{onDrop:i,accept:["application/json"],children:a.jsxs(X,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(pu.Accept,{children:a.jsx(q1,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(pu.Reject,{children:a.jsx(Sd,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(pu.Idle,{children:a.jsx(q1,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(ue,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(ue,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(He.Panel,{value:"json",pt:"xs",children:a.jsxs(Be,{onSubmit:s,children:[a.jsx(fs,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:vH,deserialize:JSON.parse}),a.jsx(X,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ee,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(He,{defaultValue:Object.keys(n)[0],children:[a.jsx(He.List,{children:Object.keys(n).map(l=>a.jsx(He.Tab,{value:l,children:l},l))}),Object.keys(n).map(l=>a.jsx(He.Panel,{value:l,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[l],void 0,2)})},l))]}),a.jsx(X,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ee,{onClick:()=>r({}),children:"Start over"})})]})]})}function wH(){const{resourceType:e}=Ze(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Sa("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(we,{children:[a.jsxs(ce,{children:["No apps for ",e]}),a.jsx(Me,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(we,{children:a.jsx("div",{children:r.map(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(Me,{to:`/forms/${o.id}?subject=`+n.map(i=>`${e}/${i}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(Dr,{})}function SH(){const e=re(),[t,n]=p.useState(),[r,o]=p.useState(!1);return a.jsx(we,{width:450,children:a.jsxs(Be,{style:{maxWidth:400},onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(s=>n(ct(s)))},children:[a.jsxs(Vt,{style:{flexDirection:"column"},children:[a.jsx(Nr,{size:32}),a.jsx(ce,{children:"Change password"})]}),!r&&a.jsxs(Se,{gap:"xl",mt:"xl",children:[a.jsx(Tr,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Le(t,"oldPassword")}),a.jsx(Tr,{name:"newPassword",label:"New password",required:!0,error:Le(t,"newPassword")}),a.jsx(Tr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Le(t,"confirmPassword")}),a.jsx(X,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ee,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const gk=["Form","JSON"],tp=gk[0].toLowerCase();function bH(){const e=Dt(),{resourceType:t}=Ze(),n=window.location.pathname.split("/").pop(),[r,o]=p.useState(n??tp);function i(s){s||(s=tp),o(s),e(`/${t}/new/${s}`)}return a.jsxs(a.Fragment,{children:[a.jsxs(On,{children:[a.jsxs(ue,{p:"md",fw:500,children:["New ",t]}),a.jsx(dr,{children:a.jsx(He,{defaultValue:tp,value:r,onChange:i,children:a.jsx(He.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:gk.map(s=>a.jsx(He.Tab,{value:s.toLowerCase(),px:"md",children:s},s))})})})]}),a.jsx(n0,{})]})}function CH(){return a.jsx(we,{children:a.jsxs(Se,{children:[a.jsx(ce,{order:1,children:"Unexpected Error"}),a.jsx(ue,{children:"We're sorry, something went wrong."}),a.jsxs(ue,{children:["Please contact ",a.jsx(Ue,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const EH="_root_1fbwr_1",jH="_entry_1fbwr_8",TH="_key_1fbwr_13",PH="_value_1fbwr_20",Gf={root:EH,entry:jH,key:TH,value:PH};function ke(e){return a.jsx(dr,{children:a.jsx("div",{className:Gf.root,children:e.children})})}ke.Entry=function(t){return a.jsx("div",{className:Gf.entry,children:t.children})};ke.Key=function(t){return a.jsx("div",{className:Gf.key,children:t.children})};ke.Value=function(t){return a.jsx("div",{className:Gf.value,children:t.children})};function kH(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function yk(e){var n,r;const t=st(e.patient);return t?a.jsxs(ke,{children:[a.jsx(fi,{value:t,size:"lg",color:kH(t)}),a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"Name"}),a.jsx(ke.Value,{children:a.jsx(Me,{to:t,fw:500,children:t.name?a.jsx(kv,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"DoB"}),a.jsx(ke.Value,{children:t.birthDate})]}),a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"Age"}),a.jsx(ke.Value,{children:xO(t.birthDate)})]})]}),t.gender&&a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"Gender"}),a.jsx(ke.Value,{children:t.gender})]}),t.address&&a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"State"}),a.jsx(ke.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:o==null?void 0:o.system}),a.jsx(ke.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function vk(e){const t=st(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(Me,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(l,c){l&&c&&n.push({key:l,value:c})}function o(l){l&&r(l.system,l.value)}function i(l,c){Array.isArray(c)?c.forEach(u=>i(l,u)):typeof c=="string"?r(l,c):c&&(Array.isArray(c.coding)?r(l,c.coding.map(u=>u.display||u.code).join(", ")):r(l,c.text))}const s=xo(t);return s!==pt(t)&&r("Name",s),"category"in t&&i("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&i("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(o):o(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),a.jsx(ke,{children:n.map(l=>a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:l.key}),a.jsx(ke.Value,{children:l.value})]},`${l.key}-${l.value}`))})}function a0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function RH(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 Ou(e,t){return new Promise((n,r)=>{var i;const o=new MessageChannel;o.port1.onmessage=({data:s})=>{o.port1.close(),s.error?r(s.error):n(s.result)},(i=e.contentWindow)==null||i.postMessage(t,"https://codeeditor.medplum.com",[o.port2])})}function bi(e){var t;return sv((t=e.getActiveLogin())==null?void 0:t.project)}function DH(e,t){const n=new Blob([e],{type:Yt.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const i=t??new Date().toISOString().replace(/\D/g,"");o.download=`${i}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function IH(){const{id:e}=Ze(),t=wi(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=re(),[i,s]=p.useState(!0),[l,c]=p.useState(),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[y,C]=p.useState();if(p.useEffect(()=>{const w={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const S=r.split(",").filter(j=>!!j);S.length===1&&w.entry.push({request:{method:"GET",url:S[0]}}),d(S)}o.executeBatch(w).then(S=>{var j,E,T,P,k,D,M,R;((T=(E=(j=S.entry)==null?void 0:j[0])==null?void 0:E.response)==null?void 0:T.status)!=="200"?g((D=(k=(P=S.entry)==null?void 0:P[0])==null?void 0:k.response)==null?void 0:D.outcome):(c((M=S.entry[0])==null?void 0:M.resource),h((R=S.entry[1])==null?void 0:R.resource)),s(!1)}).catch(S=>{g(S),s(!1)})},[o,e,r]),m)return a.jsx(we,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(y)return a.jsxs(we,{children:[a.jsx(ce,{children:l==null?void 0:l.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[y.length===1&&a.jsx("li",{children:a.jsx(Me,{to:y[0],children:"Review your answers"})}),y.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:y.map(w=>a.jsx("li",{children:a.jsx(Me,{to:w,children:pt(w)})},w.id))})]}),f&&a.jsx("li",{children:a.jsxs(Me,{to:f,children:["Back to ",xo(f)]})}),a.jsx("li",{children:a.jsx(Me,{to:"/",children:"Go back home"})})]})]});if(i||!l)return a.jsx(Dr,{});const v=f&&a0(f);return a.jsxs(a.Fragment,{children:[a.jsxs(On,{shadow:"xs",radius:0,children:[v&&a.jsx(yk,{patient:v}),f&&f.resourceType!=="Patient"&&a.jsx(vk,{resource:f}),a.jsx(W,{px:"xl",py:"md",children:a.jsxs(ue,{children:[xo(l),u&&u.length>1&&a.jsxs(a.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),a.jsx(we,{children:a.jsx(IP,{questionnaire:l,subject:f&&wt(f),onSubmit:x})})]});async function x(w){const S=[];if(!u||u.length===0)S.push(await o.createResource(w));else for(const j of u)S.push(await o.createResource({...w,subject:{reference:j}}));C(S)}}const _H="_paper_unw9o_1",AH={paper:_H},NH={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function xk(e,t){const n=e.resourceType||OH(t),r=e.fields??MH(n),o=e.filters??(e.resourceType?void 0:$H(n)),i=e.sortRules??LH(n),s=e.offset??0,l=e.count??bc;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:s,count:l}}function OH(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 MH(e){const t=l0(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");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 $H(e){var t;return(t=l0(e))==null?void 0:t.filters}function LH(e){const t=l0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function l0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function FH(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function zH(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=xk(n,t.getUserConfiguration()),o=await t.search(r.resourceType,qs({...r,total:"accurate",fields:void 0}));return gT(o)}function zw(){const e=re(),t=Dt(),n=wi(),[r,o]=p.useState();return p.useEffect(()=>{const i=M$(n.pathname+n.search),s=xk(i,e.getUserConfiguration());n.pathname===`/${s.resourceType}`&&n.search===qs(s)?(FH(s),o(s)):t(`/${s.resourceType}${qs(s)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?a.jsx(Dr,{}):a.jsx(On,{shadow:"xs",m:"md",p:"xs",className:AH.paper,children:a.jsx(Ic,{checkboxesEnabled:!0,search:r,onClick:i=>t(`/${i.resource.resourceType}/${i.resource.id}`),onAuxClick:i=>window.open(`/${i.resource.resourceType}/${i.resource.id}`,"_blank"),onChange:i=>{t(`/${r.resourceType}${qs(i.definition)}`)},onNew:()=>{t(NH[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+qs(r);e.download(i).then(s=>{window.open(window.URL.createObjectURL(s),"_blank")}).catch(s=>de({color:"red",message:Re(s),autoClose:!1}))},onExportTransactionBundle:async()=>{zH(r,e).then(i=>DH(JSON.stringify(i,void 0,2))).catch(i=>de({color:"red",message:Re(i),autoClose:!1}))},onDelete:i=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:i.map(s=>({request:{method:"DELETE",url:`${r.resourceType}/${s}`}}))}).then(()=>o({...r})).catch(s=>de({color:"red",message:Re(s),autoClose:!1})))},onBulk:i=>{t(`/bulk/${r.resourceType}?ids=${i.join(",")}`)}})})}function BH(){const e=re(),[t,n]=p.useState(),[r,o]=p.useState(void 0);p.useEffect(()=>{e.get("auth/mfa/status").then(l=>{const c=new URL("https://chart.googleapis.com/chart");c.searchParams.set("chs","300x300"),c.searchParams.set("cht","qr"),c.searchParams.set("chl",l.enrollUri),c.searchParams.set("choe","UTF-8"),n(c.toString()),o(l.enrolled)}).catch(l=>de({color:"red",message:Re(l),autoClose:!1}))},[e]);const i=p.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),de({color:"green",message:"Success"})}).catch(c=>de({color:"red",message:Re(c),autoClose:!1}))},[e]),s=p.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return r===void 0?null:r?a.jsx(we,{children:a.jsxs(X,{children:[a.jsx(ce,{children:"MFA is enabled"}),a.jsx(ee,{onClick:s,children:"Disable MFA"})]})}):a.jsx(we,{width:400,children:a.jsxs(Be,{onSubmit:i,children:[a.jsx(ce,{children:"Multi Factor Auth Setup"}),a.jsx(Vt,{children:a.jsx("img",{src:t})}),a.jsx(se,{name:"token",label:"Code"}),a.jsx(X,{justify:"flex-end",mt:"xl",children:a.jsx(ee,{type:"submit",children:"Enroll"})})]})})}const Im={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function Oc(){return Im}function wk(){try{return Im.registerEnabled!==!1&&Im.registerEnabled!=="false"}catch{return!0}}function UH(){const e=Dt(),[t]=r0(),n=t.get("client_id");if(!n)return null;const r=t.get("scope")||"openid";function o(i){const s=new URL(t.get("redirect_uri"));for(const l of["scope","state","nonce"])t.has(l)&&s.searchParams.set(l,t.get(l));s.searchParams.set("code",i),window.location.assign(s.toString())}return a.jsxs(zP,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Oc().googleClientId,clientId:n||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",children:[a.jsx(Nr,{size:32}),a.jsx(ce,{children:"Sign in to Medplum"})]})}function VH(){const e=re(),t=Dt(),n=Oc();return p.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),wk()?a.jsxs(XB,{type:"project",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Nr,{size:32}),a.jsx(ce,{children:"Create a new account"})]}):a.jsx(we,{width:450,children:a.jsx(us,{icon:a.jsx(Cc,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function HH(){const e=Dt(),t=re(),[n,r]=p.useState(),[o,i]=p.useState(!1),s=Oc().recaptchaSiteKey;return p.useEffect(()=>{LP(s)},[s]),a.jsx(we,{width:450,children:a.jsxs(Be,{style:{maxWidth:400},onSubmit:async l=>{let c="";c=await FP(s),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>r(ct(u)))},children:[a.jsxs(Se,{gap:"lg",mb:"xl",align:"center",children:[a.jsx(Nr,{size:32}),a.jsx(ce,{children:"Medplum Password Reset"})]}),a.jsxs(Se,{gap:"xl",children:[a.jsx(to,{issues:Lf(n,void 0)}),!o&&a.jsxs(a.Fragment,{children:[a.jsx(se,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Le(n,"email")}),a.jsxs(X,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Ue,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),a.jsx(ee,{type:"submit",children:"Reset password"})]})]}),o&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function WH(){var i;const e=Dt(),t=re(),[n,r]=p.useState();p.useEffect(()=>{t.get("auth/me").then(r).catch(s=>de({color:"red",message:Re(s),autoClose:!1}))},[t]);function o(s){t.post("auth/revoke",{loginId:s}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>de({color:"green",message:"Login revoked"})).catch(l=>de({color:"red",message:Re(l),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(we,{children:[a.jsx(ce,{children:"Security"}),a.jsxs(Av,{children:[a.jsx(ra,{term:"ID",children:a.jsx(Ue,{href:`/${pt(n.profile)}`,children:n.profile.id})}),a.jsx(ra,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(ra,{term:"Name",children:Sc((i=n.profile.name)==null?void 0:i[0])})]})]}),a.jsxs(we,{children:[a.jsx(ce,{children:"Sessions"}),a.jsxs(me,{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"OS"}),a.jsx("th",{children:"Browser"}),a.jsx("th",{children:"IP Address"}),a.jsx("th",{children:"Auth Method"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.security.sessions.map(s=>a.jsxs("tr",{children:[a.jsx("td",{children:s.os}),a.jsx("td",{children:s.browser}),a.jsx("td",{children:s.remoteAddress}),a.jsx("td",{children:s.authMethod}),a.jsx("td",{children:Fn(s.lastUpdated)}),a.jsx("td",{children:a.jsx(Ue,{href:"#",onClick:()=>o(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(we,{children:[a.jsx(ce,{children:"Password"}),a.jsx(ee,{onClick:()=>e("/changepassword"),children:"Change password"})]}),a.jsxs(we,{children:[a.jsx(ce,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(ee,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function qH(){const{id:e,secret:t}=Ze(),n=re(),[r,o]=p.useState(),[i,s]=p.useState(!1),l=Lf(r,void 0);return a.jsxs(we,{width:450,children:[a.jsx(to,{issues:l}),a.jsxs(Be,{style:{maxWidth:400},onSubmit:c=>{if(c.password!==c.confirmPassword){o(ii("Passwords do not match","confirmPassword"));return}o(void 0);const u={id:e,secret:t,password:c.password};n.post("auth/setpassword",u).then(()=>s(!0)).catch(d=>o(ct(d)))},children:[a.jsxs(Vt,{style:{flexDirection:"column"},children:[a.jsx(Nr,{size:32}),a.jsx(ce,{children:"Set password"})]}),!i&&a.jsxs(Se,{children:[a.jsx(Tr,{name:"password",label:"New password",required:!0,error:Le(r,"password")}),a.jsx(Tr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Le(r,"confirmPassword")}),a.jsx(X,{justify:"flex-end",mt:"xl",children:a.jsx(ee,{type:"submit",children:"Set password"})})]}),i&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(Me,{to:"/signin",children:"sign in"}),"."]})]})]})}function GH(){const e=Ev(),t=Dt(),[n]=r0(),r=Oc(),o=p.useCallback(()=>{const i=n.get("next");t(i!=null&&i.startsWith("/")?i:"/")},[n,t]);return p.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),a.jsxs(zP,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:wk()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[a.jsx(Nr,{size:32}),a.jsx(ce,{children:"Sign in to Medplum"}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function QH(){const e=Dt(),t=wi(),[n,r]=p.useState(),[o,i]=p.useState(),[s,l]=p.useState();return p.useEffect(()=>{const c=Object.fromEntries(new URLSearchParams(t.search).entries());r(c.resourceType),i(c.query),l(JSON.parse(c.fields))},[t]),!n||!o||!s?null:a.jsx(nz,{resourceType:n,checkboxesEnabled:!0,query:o,fields:s,onClick:c=>e(`/${n}/${c.resource.id}`),onAuxClick:c=>window.open(`/${n}/${c.resource.id}`,"_blank"),onBulk:c=>{e(`/bulk/${n}?ids=${c.join(",")}`)}})}function Qf(e){const t=re(),n=bi(t),r=Dt(),[o,i]=p.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ne.EQUALS,value:"Project/"+n},{code:"profile-type",operator:ne.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(Ic,{search:o,onClick:s=>r(`/admin/members/${s.resource.id}`),onChange:s=>i(s.definition),hideFilters:!0,hideToolbar:!0})}function KH(){return a.jsxs(a.Fragment,{children:[a.jsx(ce,{children:"Bots"}),a.jsx(Qf,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(X,{justify:"flex-end",children:a.jsx(Me,{to:"/admin/bots/new",children:"Create new bot"})})]})}function YH(){return a.jsxs(a.Fragment,{children:[a.jsx(ce,{children:"Clients"}),a.jsx(Qf,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(X,{justify:"flex-end",children:a.jsx(Me,{to:"/admin/clients/new",children:"Create new client"})})]})}function Kf(e){return a.jsx(Ma,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Io(t)?e.onChange(wt(t)):e.onChange(void 0)}})}function XH(){const e=re(),t=bi(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[s,l]=p.useState(),[c,u]=p.useState(),[d,f]=p.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(ce,{children:"Create new Bot"}),a.jsxs(Be,{onSubmit:()=>{const h={name:n,description:o,accessPolicy:s};e.post("admin/projects/"+t+"/bot",h).then(m=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),f(m),de({color:"green",message:"Bot created"})}).catch(m=>{de({color:"red",message:Re(m),autoClose:!1}),u(ct(m))})},children:[!d&&a.jsxs(Se,{children:[a.jsx(it,{title:"Name",htmlFor:"name",outcome:c,children:a.jsx(se,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>r(h.currentTarget.value),error:Le(c,"name")})}),a.jsx(it,{title:"Description",htmlFor:"description",outcome:c,children:a.jsx(se,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:Le(c,"description")})}),a.jsx(it,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:a.jsx(Kf,{name:"accessPolicy",onChange:l})}),a.jsx(X,{justify:"flex-end",children:a.jsx(ee,{type:"submit",children:"Create Bot"})})]}),d&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(ue,{children:"Bot created"}),a.jsxs(gn,{children:[a.jsx(gn.Item,{children:a.jsx(Me,{to:d,children:"Go to new bot"})}),a.jsx(gn.Item,{children:a.jsx(Me,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function JH(){const e=re(),t=bi(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[s,l]=p.useState(""),[c,u]=p.useState(),[d,f]=p.useState(),[h,m]=p.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(ce,{children:"Create new Client"}),a.jsxs(Be,{onSubmit:()=>{const g={name:n,description:o,redirectUri:s,accessPolicy:c};e.post("admin/projects/"+t+"/client",g).then(y=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),m(y),de({color:"green",message:"Client created"})}).catch(y=>{de({color:"red",message:Re(y),autoClose:!1}),f(ct(y))})},children:[!h&&a.jsxs(Se,{children:[a.jsx(it,{title:"Name",htmlFor:"name",outcome:d,children:a.jsx(se,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>r(g.currentTarget.value),error:Le(d,"name")})}),a.jsx(it,{title:"Description",htmlFor:"description",outcome:d,children:a.jsx(se,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:Le(d,"description")})}),a.jsx(it,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:a.jsx(se,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:Le(d,"redirectUri")})}),a.jsx(it,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:a.jsx(Kf,{name:"accessPolicy",onChange:u})}),a.jsx(X,{justify:"flex-end",children:a.jsx(ee,{type:"submit",children:"Create Client"})})]}),h&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(ue,{children:"Client created"}),a.jsxs(gn,{children:[a.jsx(gn.Item,{children:a.jsx(Me,{to:h,children:"Go to new client"})}),a.jsx(gn.Item,{children:a.jsx(Me,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function ZH(e){return a.jsx(Ma,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Io(t)?e.onChange(wt(t)):e.onChange(void 0)}})}function eW(){const{membershipId:e}=Ze(),t=re(),n=bi(t),r=Dt(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[i,s]=p.useState(o.accessPolicy),[l,c]=p.useState(o.userConfiguration),[u,d]=p.useState(o.admin),[f,h]=p.useState(),[m,g]=p.useState(!1);function y(){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=>h(ct(C)))}return a.jsxs(a.Fragment,{children:[a.jsx(ce,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(oa,{value:o.profile,link:!0})}),a.jsxs(Be,{onSubmit:()=>{const C={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>g(!0)).catch(v=>h(ct(v)))},children:[!m&&a.jsxs(Se,{children:[a.jsx(it,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(Kf,{name:"accessPolicy",defaultValue:i,onChange:s})}),a.jsx(it,{title:"User Configuration",htmlFor:"userConfiguration",outcome:f,children:a.jsx(ZH,{name:"userConfiguration",defaultValue:l,onChange:c})}),a.jsx(it,{title:"Admin",htmlFor:"admin",outcome:f,children:a.jsx(cr,{id:"admin",name:"admin",defaultChecked:u,onChange:C=>d(C.currentTarget.checked)})}),a.jsxs(X,{justify:"flex-end",mt:"xl",children:[a.jsx(ee,{type:"submit",children:"Save"}),a.jsx(ee,{type:"button",color:"red",variant:"outline",onClick:y,children:"Remove user"})]})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User updated"}),a.jsx("pre",{children:JSON.stringify(f,void 0,2)}),a.jsxs("p",{children:["Click ",a.jsx(Me,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function tW(){const e=re(),[t,n]=p.useState(e.getProject()),[r,o]=p.useState(),[i,s]=p.useState(),[l,c]=p.useState(!1),[u,d]=p.useState(void 0),f=p.useCallback(h=>{const m={resourceType:h.resourceType,firstName:h.firstName,lastName:h.lastName,email:h.email,sendEmail:h.sendEmail==="on",accessPolicy:r,admin:h.isAdmin==="on"};e.invite(t==null?void 0:t.id,m).then(g=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Rf(g)?s(g):d(g),c(m.sendEmail??!1),de({color:"green",message:"Invite success"})}).catch(g=>{de({color:"red",message:Re(g),autoClose:!1}),s(ct(g))})},[e,t,r]);return a.jsxs(Be,{onSubmit:f,children:[!u&&!i&&a.jsxs(Se,{children:[a.jsx(ce,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(it,{title:"Project",htmlFor:"project",outcome:i,children:a.jsx(Ma,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(yt,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Le(i,"resourceType")}),a.jsx(se,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Le(i,"firstName")}),a.jsx(se,{name:"lastName",label:"Last Name",required:!0,error:Le(i,"lastName")}),a.jsx(se,{name:"email",type:"email",label:"Email",required:!0,error:Le(i,"email")}),a.jsx(it,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:a.jsx(Kf,{name:"accessPolicy",onChange:o})}),a.jsx(cr,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(cr,{name:"isAdmin",label:"Admin"}),a.jsx(X,{justify:"flex-end",children:a.jsx(ee,{type:"submit",children:"Invite"})})]}),i&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User created, email couldn't be sent"}),a.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),a.jsxs("p",{children:["Click ",a.jsx(Me,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(ue,{children:"User created"}),l&&a.jsx(ue,{children:"Email sent"}),a.jsxs(gn,{children:[a.jsx(gn.Item,{children:a.jsx(Me,{to:u,children:"Go to new membership"})}),a.jsx(gn.Item,{children:a.jsx(Me,{to:u.profile,children:"Go to new profile"})}),a.jsx(gn.Item,{children:a.jsx(Me,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function nW(){return a.jsxs(a.Fragment,{children:[a.jsx(ce,{children:"Patients"}),a.jsx(Qf,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(X,{justify:"flex-end",children:a.jsx(Me,{to:"/admin/invite",children:"Invite new patient"})})]})}function Bw(){const e=re(),t=bi(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(ce,{children:"Details"}),a.jsxs(Av,{children:[a.jsx(ra,{term:"ID",children:n.project.id}),a.jsx(ra,{term:"Name",children:n.project.name})]})]})}const Uw=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function rW(){const e=Dt(),n=wi().pathname.replace("/admin/","")||Uw[0],r=re(),o=bi(r),i=p.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function s(l){e(`/admin/${l}`)}return a.jsxs(a.Fragment,{children:[a.jsxs(On,{children:[a.jsx(ke,{children:a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"Project"}),a.jsx(ke.Value,{children:i.project.name})]})}),a.jsx(dr,{children:a.jsx(He,{value:n.toLowerCase(),onChange:s,children:a.jsx(He.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Uw.map(l=>a.jsx(He.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),a.jsx(we,{children:a.jsx(n0,{})})]})}function oW(){const e=re(),t=bi(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,s]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&s(vi(n.project.secret||[]))},[e,n]),!r||!i?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/secrets`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>de({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(ce,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx($a,{property:gs("Project","secret"),name:"secret",defaultValue:i,onChange:s,outcome:void 0}),a.jsx(ee,{type:"submit",children:"Save"})]})}function iW(){const e=re(),t=bi(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,s]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&s(vi(n.project.site||[]))},[e,n]),!r||!i?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/sites`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>de({color:"green",message:"Saved"})).catch(c=>{var d,f,h,m;const u=ct(c);de({color:"red",message:`Error ${(f=(d=u.issue)==null?void 0:d[0].details)==null?void 0:f.text} ${(m=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:m[0]}`,autoClose:!1})})},children:[a.jsx(ce,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx($a,{property:gs("Project","site"),name:"site",defaultValue:i,onChange:s,outcome:void 0}),a.jsx(ee,{type:"submit",children:"Save"})]})}function sW(){const e=re();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(to,{outcome:Uj});function t(){il(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function n(){il(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function r(){il(e,"Rebuilding Value Sets","admin/super/valuesets")}function o(u){il(e,"Reindexing Resources","admin/super/reindex",u)}function i(u){il(e,"Rebuilding Compartments","admin/super/compartments",u)}function s(u){e.post("admin/super/removebotidjobsfromqueue",u).then(()=>de({color:"green",message:"Done"})).catch(d=>de({color:"red",message:Re(d),autoClose:!1}))}function l(u){e.post("admin/super/purge",{...u,before:UT(u.before)}).then(()=>de({color:"green",message:"Done"})).catch(d=>de({color:"red",message:Re(d),autoClose:!1}))}function c(u){e.post("admin/super/setpassword",u).then(()=>de({color:"green",message:"Done"})).catch(d=>de({color:"red",message:Re(d),autoClose:!1}))}return a.jsxs(we,{width:600,children:[a.jsx(ce,{order:1,children:"Super Admin"}),a.jsx(Rn,{my:"lg"}),a.jsx(ce,{order:2,children:"Structure Definitions"}),a.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),a.jsx(Be,{children:a.jsx(ee,{onClick:t,children:"Rebuild StructureDefinitions"})}),a.jsx(Rn,{my:"lg"}),a.jsx(ce,{order:2,children:"Search Parameters"}),a.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),a.jsx(Be,{children:a.jsx(ee,{onClick:n,children:"Rebuild SearchParameters"})}),a.jsx(Rn,{my:"lg"}),a.jsx(ce,{order:2,children:"Value Sets"}),a.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),a.jsx(Be,{children:a.jsx(ee,{onClick:r,children:"Rebuild ValueSets"})}),a.jsx(Rn,{my:"lg"}),a.jsx(ce,{order:2,children:"Reindex Resources"}),a.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),a.jsx(Be,{onSubmit:o,children:a.jsxs(Se,{children:[a.jsx(it,{title:"Resource Type",children:a.jsx(se,{name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(ee,{type:"submit",children:"Reindex"})]})}),a.jsx(Rn,{my:"lg"}),a.jsx(ce,{order:2,children:"Rebuild Compartments"}),a.jsx("p",{children:"When Medplum changes how resource compartments are derived, the system may require a rebuild for old resources to take effect."}),a.jsx(Be,{onSubmit:i,children:a.jsxs(Se,{children:[a.jsx(it,{title:"Resource Type",children:a.jsx(se,{name:"resourceType",placeholder:"Compartments Resource Type"})}),a.jsx(ee,{type:"submit",children:"Rebuild Compartments"})]})}),a.jsx(Rn,{my:"lg"}),a.jsx(ce,{order:2,children:"Purge Resources"}),a.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),a.jsx(Be,{onSubmit:l,children:a.jsxs(Se,{children:[a.jsx(it,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(yt,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(it,{title:"Purge Before",htmlFor:"before",children:a.jsx(Yi,{name:"before",placeholder:"Before Date"})}),a.jsx(ee,{type:"submit",children:"Purge"})]})}),a.jsx(Rn,{my:"lg"}),a.jsx(ce,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(Be,{onSubmit:s,children:a.jsxs(Se,{children:[a.jsx(it,{title:"Bot ID",children:a.jsx(se,{name:"botId",placeholder:"Bot Id"})}),a.jsx(ee,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(Rn,{my:"lg"}),a.jsx(ce,{order:2,children:"Force Set Password"}),a.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),a.jsx(Be,{onSubmit:c,children:a.jsxs(Se,{children:[a.jsx(se,{name:"email",label:"Email",required:!0}),a.jsx(Tr,{name:"password",label:"Password",required:!0}),a.jsx(se,{name:"projectId",label:"Project ID"}),a.jsx(ee,{type:"submit",children:"Force Set Password"})]})})]})}function il(e,t,n,r){Kr.show({id:n,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST"};r&&(o.body=JSON.stringify(r)),e.startAsyncRequest(n,o).then(()=>{Kr.update({id:n,color:"green",title:t,message:"Done",icon:a.jsx(Mf,{size:"1rem"}),autoClose:!1,withCloseButton:!0})}).catch(i=>{Kr.update({id:n,color:"red",title:t,message:Re(i),icon:a.jsx(Sd,{size:"1rem"}),autoClose:!1,withCloseButton:!0})})}function aW(){const e=re();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(to,{outcome:Uj});function t(n){e.post("admin/projects/setpassword",n).then(()=>de({color:"green",message:"Done"})).catch(r=>de({color:"red",message:Re(r),autoClose:!1}))}return a.jsxs(we,{width:600,children:[a.jsx(ce,{order:1,children:"Project Admin"}),a.jsx(Rn,{my:"lg"}),a.jsx(ce,{order:2,children:"Force Set Password"}),a.jsx(ue,{children:"Sets the password for the specified user in this project."}),a.jsx(ue,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(Be,{onSubmit:t,children:a.jsxs(Se,{children:[a.jsx(se,{name:"email",label:"Email",required:!0}),a.jsx(Tr,{name:"password",label:"Password",required:!0}),a.jsx(ee,{type:"submit",children:"Force Set Password"})]})})]})}function lW(){return a.jsxs(a.Fragment,{children:[a.jsx(ce,{children:"Users"}),a.jsx(Qf,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(X,{justify:"flex-end",children:a.jsx(Me,{to:"/admin/invite",children:"Invite new user"})})]})}function cW(){const[e]=Sa("ObservationDefinition","_count=100");return e?a.jsxs(me,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Method"}),a.jsx("th",{children:"Unit"}),a.jsx("th",{children:"Precision"}),a.jsx("th",{children:"Ranges"})]})}),a.jsx("tbody",{children:e.map(t=>{var n,r,o,i;return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Yr,{value:(n=t.category)==null?void 0:n[0]})}),a.jsx("td",{children:a.jsx(Yr,{value:t.code})}),a.jsx("td",{children:a.jsx(Yr,{value:t.method})}),a.jsx("td",{children:(o=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:o.text}),a.jsx("td",{children:(i=t.quantitativeDetails)==null?void 0:i.decimalPrecision}),a.jsx("td",{children:a.jsx(_m,{ranges:t.qualifiedInterval})})]},t.id)})})]}):a.jsx(Dr,{})}function _m(e){const{ranges:t}=e;if(!t)return null;const n=Vw(t.map(o=>o.gender));if(n.length>1)return n.sort((o,i)=>o.localeCompare(i)),a.jsx(a.Fragment,{children:n.map(o=>{var i;return a.jsxs(p.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:nn(o)})}),a.jsx(_m,{ranges:(i=e.ranges)==null?void 0:i.filter(s=>s.gender===o)})]},o)})});const r=Vw(t.map(o=>o.age&&Wl(o.age)));return r.length>1?(r.sort((o,i)=>o.localeCompare(i)),a.jsx(a.Fragment,{children:r.map(o=>{var i;return a.jsxs(p.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:nn(o)})}),a.jsx(_m,{ranges:(i=e.ranges)==null?void 0:i.filter(s=>Wl(s.age)===o)})]},o)})})):a.jsx(a.Fragment,{children:t.map(o=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:o.condition}),a.jsx("td",{children:a.jsx(Nv,{value:o.range})})]})})},`range-${o.condition}`))})}function Vw(e){return[...new Set(e.filter(t=>!!t))]}function uW(){const[e]=Sa("ActivityDefinition","_count=100"),[t]=Sa("ObservationDefinition","_count=100");return!e||!t?a.jsx(Dr,{}):a.jsxs(me,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Assay"}),e.map(n=>a.jsx("th",{children:n.name},n.id))]})}),a.jsx("tbody",{children:t.map(n=>{var r;return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Yr,{value:(r=n.category)==null?void 0:r[0]})}),a.jsx("td",{children:a.jsx(Yr,{value:n.code})}),e.map(o=>{var i;return a.jsx("td",{children:(i=o.observationResultRequirement)!=null&&i.find(s=>{var l;return(l=s.reference)==null?void 0:l.includes(n.id)})?"✅":""},o.id)})]},n.id)})})]})}function dW(e){var s;const t=re(),[n,r]=p.useState(),[o,i]=p.useState();return o?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"Request group created successfully."}),a.jsxs("ul",{children:[a.jsxs("li",{children:["Go to the"," ",a.jsx(Me,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(Me,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(Be,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueReference:n}]}).then(i).catch(console.log)},children:a.jsxs(Se,{children:[a.jsxs(ce,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(ue,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(ue,{children:"The following tasks will be created:"}),a.jsx("ul",{children:(s=e.planDefinition.action)==null?void 0:s.map((l,c)=>{var u;return a.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&a.jsx(a.Fragment,{children:l.title}),l.code&&a.jsx(Yr,{value:l.code[0]})]},`action-${c}`)})}),a.jsx(it,{title:"Subject",children:a.jsx(Ff,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(X,{justify:"flex-end",mt:"xl",children:a.jsx(ee,{type:"submit",children:"Go"})})]})})}function fW(){const{resourceType:e,id:t}=Ze(),n=st({reference:e+"/"+t});return n?a.jsx(we,{children:a.jsx(dW,{planDefinition:n})}):null}function hW(){const{resourceType:e,id:t}=Ze(),n=st({reference:e+"/"+t}),[r,o]=Sa("Questionnaire","subject-type="+e),[i,s]=Sa("ClientApplication",{_count:1e3});if(!n||o||s)return a.jsx(Dr,{});const l=i==null?void 0:i.filter(d=>pW(e)&&!!d.launchUri);if((!r||r.length===0)&&(!l||l.length===0))return a.jsxs(we,{children:[a.jsx(ce,{children:"Apps"}),a.jsxs("p",{children:["No apps found. Contact your administrator or ",a.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let c,u;return n.resourceType==="Patient"?c=wt(n):n.resourceType==="Encounter"&&(c=n.subject,u=wt(n)),a.jsxs(we,{children:[r==null?void 0:r.map(d=>a.jsxs("div",{children:[a.jsx(ce,{order:3,children:a.jsx(Me,{to:`/forms/${d.id}?subject=${pt(n)}`,children:d.title||d.name})}),a.jsx(ue,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>a.jsxs("div",{children:[a.jsx(ce,{order:3,children:a.jsx(QB,{client:d,patient:c,encounter:u,children:d.name})}),a.jsx(ue,{children:d.description})]},d.id))]})}function pW(e){return e==="Patient"||e==="Encounter"}function mW(){const{resourceType:e,id:t}=Ze(),n=Dt(),[r,o]=p.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ne.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(we,{children:a.jsx(Ic,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function gW(){const e=re(),{resourceType:t,id:n}=Ze(),r=e.readHistory(t,n).read();return a.jsx(we,{children:a.jsx(FB,{history:r})})}const yW="_hl7Input_k5xm3_1",vW={hl7Input:yW};function xW(e){return a.jsx("iframe",{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 wW(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),a.jsx("iframe",{frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Ou(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const SW=`{
225
+ "resourceType": "Patient",
226
+ "name": [
227
+ {
228
+ "given": [
229
+ "Alice"
230
+ ],
231
+ "family": "Smith"
232
+ }
233
+ ]
234
+ }`,bW="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 CW(){const e=re(),{id:t}=Ze(),[n,r]=p.useState(),[o,i]=p.useState(),[s,l]=p.useState(SW),[c,u]=p.useState(bW),[d,f]=p.useState(Yt.FHIR_JSON),h=p.useRef(null),m=p.useRef(null),[g,y]=p.useState(!1);p.useEffect(()=>{e.readResource("Bot",t).then(async E=>{r(E),i(await EW(e,E))}).catch(E=>de({color:"red",message:Re(E),autoClose:!1}))},[e,t]);const C=p.useCallback(()=>Ou(h.current,{command:"getValue"}),[]),v=p.useCallback(()=>Ou(h.current,{command:"getOutput"}),[]),x=p.useCallback(async()=>d===Yt.FHIR_JSON?JSON.parse(s):c,[d,s,c]),w=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),y(!0);try{const T=await C(),P=await e.createAttachment(T,"index.ts","text/typescript"),k=[];n!=null&&n.sourceCode?k.push({op:"replace",path:"/sourceCode",value:P}):k.push({op:"add",path:"/sourceCode",value:P}),await e.patchResource("Bot",t,k),de({color:"green",message:"Saved"})}catch(T){de({color:"red",message:Re(T),autoClose:!1})}finally{y(!1)}},[e,t,n,C]),S=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),y(!0);try{const T=await v();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:T}),de({color:"green",message:"Deployed"})}catch(T){de({color:"red",message:Re(T),autoClose:!1})}finally{y(!1)}},[e,t,v]),j=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),y(!0);try{const T=await x(),P=await e.post(e.fhirUrl("Bot",t,"$execute"),T,d);await Ou(m.current,{command:"setValue",value:P}),de({color:"green",message:"Success"})}catch(T){de({color:"red",message:Re(T),autoClose:!1})}finally{y(!1)}},[e,t,x,d]);return!n||o===void 0?null:a.jsxs(Hn,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(Hn.Col,{span:8,children:a.jsxs(On,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(wW,{iframeRef:h,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),a.jsxs(X,{justify:"flex-end",gap:"xs",children:[a.jsx(ee,{type:"button",onClick:w,loading:g,leftSection:a.jsx(JL,{size:"1rem"}),children:"Save"}),a.jsx(ee,{type:"button",onClick:S,loading:g,leftSection:a.jsx(jv,{size:"1rem"}),children:"Deploy"}),a.jsx(ee,{type:"button",onClick:j,loading:g,leftSection:a.jsx(p7,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(Hn.Col,{span:4,children:[a.jsxs(On,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(yt,{data:[{label:"FHIR",value:Yt.FHIR_JSON},{label:"HL7",value:Yt.HL7_V2}],onChange:E=>f(E.currentTarget.value)}),d===Yt.FHIR_JSON?a.jsx(fs,{value:s,onChange:E=>l(E),autosize:!0,minRows:15}):a.jsx("textarea",{className:vW.hl7Input,value:c,onChange:E=>u(E.currentTarget.value),rows:15})]}),a.jsx(On,{m:2,p:"xs",shadow:"md",children:a.jsx(xW,{iframeRef:m,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function EW(e,t){var n,r,o;if((n=t.sourceCode)!=null&&n.url){const i=(o=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:o.find(Gj);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Fa(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function jW(e,t){var n,r;(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))}function TW(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const o=e.meta.profile.indexOf(t);e.meta.profile.splice(o,1)}}function PW(){const e=re(),{resourceType:t,id:n}=Ze(),r={reference:t+"/"+n},o=p.useCallback(i=>{e.updateResource(Fa(i)).then(()=>{de({color:"green",message:"Success"})}).catch(s=>{de({color:"red",message:Re(s),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(we,{children:a.jsx(pz,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(we,{children:a.jsx(Xz,{questionnaire:r,onSubmit:o})});default:return null}}function kW(){const{resourceType:e,id:t}=Ze(),n=st({reference:e+"/"+t}),r=Dt();return n?a.jsx(we,{children:a.jsx(SB,{value:n,onStart:(o,i)=>r(`/forms/${sv(i)}`),onEdit:(o,i,s)=>r(`/${s.reference}}`)})}):null}function RW(){const e=re(),{resourceType:t,id:n}=Ze(),r=Dt();return a.jsxs(we,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(ee,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(o=>de({color:"red",message:Re(o),autoClose:!1}))},children:"Delete"})]})}function DW(){const{resourceType:e,id:t}=Ze(),n=st({reference:e+"/"+t});return n?a.jsx(we,{children:a.jsx(Hv,{value:n})}):null}function IW(){const e=re(),{resourceType:t,id:n}=Ze(),[r,o]=p.useState(),i=Dt(),[s,l]=p.useState();p.useEffect(()=>{e.readResource(t,n).then(d=>o(vi(d))).catch(d=>{l(ct(d)),de({color:"red",message:Re(d),autoClose:!1})})},[e,t,n]);const c=p.useCallback(d=>{l(void 0),e.updateResource(Fa(d)).then(()=>{i(`/${t}/${n}/details`),de({color:"green",message:"Success"})}).catch(f=>{l(ct(f)),de({color:"red",message:Re(f),autoClose:!1})})},[e,t,n,i]),u=p.useCallback(()=>i(`/${t}/${n}/delete`),[i,t,n]);return r?a.jsx(we,{children:a.jsx(Zv,{defaultValue:r,onSubmit:c,onDelete:u,outcome:s})}):null}function _W(){const e=re(),{resourceType:t,id:n}=Ze(),r=e.readHistory(t,n).read();return a.jsx(we,{children:a.jsx(HB,{history:r})})}function AW(){const e=re(),{resourceType:t,id:n}=Ze(),r=st({reference:t+"/"+n}),o=Dt(),[i,s]=p.useState(),l=p.useCallback(c=>{e.updateResource(Fa(JSON.parse(c.resource))).then(()=>{s(void 0),o(`/${t}/${n}/details`),de({color:"green",message:"Success"})}).catch(u=>{de({color:"red",message:Re(u),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(we,{children:[i&&a.jsx(to,{outcome:i}),a.jsxs(Be,{onSubmit:l,children:[a.jsx(fs,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Ln(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(X,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ee,{type:"submit",children:"OK"})})]})]}):null}function NW(){const{resourceType:e,id:t}=Ze();return st({reference:e+"/"+t})?a.jsxs(we,{children:[a.jsxs(us,{icon:a.jsx(Cc,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Ue,{href:`/forms/${t}`,children:`/forms/${t}`})]}),a.jsx(IP,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function OW(){const e=re(),{id:t}=Ze(),[n,r]=p.useState(),[o,i]=p.useState(0),s=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>MW(c,t));function l(){n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${n.name} to questionnaire responses`,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:pt(n)}}).then(()=>{r(void 0),i(Date.now()),e.invalidateSearches("Subscription"),de({color:"green",message:"Success"})}).catch(c=>de({color:"red",message:Re(c),autoClose:!1}))}return a.jsxs(we,{children:[a.jsx(ce,{children:"Bots"}),s.length===0&&a.jsx("p",{children:"No bots found."}),s.map(c=>{var u;return a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(kc,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),a.jsx("hr",{}),a.jsx(ce,{children:"Connect to bot"}),a.jsxs(X,{children:[a.jsx(Ma,{name:"bot",resourceType:"Bot",onChange:c=>r(c)}),a.jsx(ee,{onClick:l,children:"Connect"})]}),a.jsx("div",{style:{display:"none"},children:o})]})}function MW(e,t){var o;const n=e.criteria||"",r=((o=e.channel)==null?void 0:o.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&n.includes(t)&&r.startsWith("Bot/")}function $W(){const{id:e}=Ze(),t=Dt(),[n,r]=p.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ne.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return a.jsx(we,{children:a.jsx(Ic,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function LW(){const e=re(),{resourceType:t,id:n}=Ze(),r=st({reference:t+"/"+n}),o=p.useCallback(i=>{e.updateResource(Fa(i)).then(()=>{de({color:"green",message:"Success"})}).catch(s=>{de({color:"red",message:Re(s),autoClose:!1})})},[e]);return r?a.jsx(we,{children:a.jsx(hB,{onSubmit:o,definition:r})}):null}function FW(){const{resourceType:e,id:t}=Ze(),n=st({reference:e+"/"+t});return n?a.jsx(we,{children:e==="MeasureReport"?a.jsx(lz,{measureReport:n}):a.jsx(Lv,{value:n})}):null}const zW="_container_1ue98_1",BW="_entry_1ue98_14",UW="_active_1ue98_21",np={container:zW,entry:BW,active:UW};function VW(e){const t=re(),n=st(e.value),[r,o]=p.useState();return p.useEffect(()=>{if(!n)return;const i=a0(n);if(!i)return;const s="reference"in i?i.reference:pt(i);t.search("ServiceRequest","subject="+s).then(l=>{const u=l.entry.map(d=>d.resource);uP(u),u.reverse(),o(u)}).catch(l=>de({color:"red",message:Re(l),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:np.container,children:r.map(i=>{var s,l,c,u,d,f,h;return a.jsxs("div",{className:Je(np.entry,{[np.active]:i.id===(n==null?void 0:n.id)}),children:[a.jsx("p",{children:a.jsx(Me,{to:i,children:HW(i)})}),((l=(s=i.category)==null?void 0:s[0])==null?void 0:l.text)&&a.jsx("p",{children:(c=i.category[0])==null?void 0:c.text}),((f=(d=(u=i.code)==null?void 0:u.coding)==null?void 0:d[0])==null?void 0:f.code)&&a.jsx("p",{children:(h=i.code.coding[0])==null?void 0:h.code}),a.jsx("p",{children:WW(i)})]},i.id)})}):null}function HW(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function WW(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const qW="_container_1l2dh_1",GW={container:qW};function QW(e){var o,i,s,l;const t=st(e.valueSet);if(!t)return null;const n=[""],r=(l=(s=(i=(o=t.compose)==null?void 0:o.include)==null?void 0:i[0])==null?void 0:s.concept)==null?void 0:l.map(c=>c.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:GW.container,children:a.jsx(yt,{defaultValue:e.defaultValue,onChange:c=>e.onChange(c.currentTarget.value),data:n})})}function KW(e){var n,r;const t=st(e.specimen);return t?a.jsxs(ke,{children:[a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"Type"}),a.jsx(ke.Value,{children:"Specimen"})]}),a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"Collected"}),a.jsx(ke.Value,{children:Fn((n=t.collection)==null?void 0:n.collectedDateTime)})]}),a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"Specimen Age"}),a.jsx(ke.Value,{children:YW(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?a.jsxs(ke.Entry,{children:[a.jsx(ke.Key,{children:"Specimen Stability"}),a.jsx(ke.Value,{children:XW(t)})]}):a.jsx(a.Fragment,{})]}):null}function YW(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return Sk(bk(n,new Date))}function XW(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 Sk(bk(t,n))}function Sk(e){return e.toString().padStart(3,"0")+"D"}function bk(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function JW(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"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),t}const ZW=["Profiles"];function eq(){var w,S,j,E,T,P,k;const e=re(),{resourceType:t,id:n}=Ze(),r={reference:t+"/"+n},o=Dt(),[i,s]=p.useState(),l=st(r,s),c=JW(t),[u,d]=p.useState(()=>{const D=window.location.pathname.split("/").pop();return D&&c.map(M=>M.toLowerCase()).includes(D)?D:c[0].toLowerCase()}),f=Rt();async function h(){var R,O;const M=(O=(R=(await e.readHistory(t,n)).entry)==null?void 0:R.find(N=>!!N.resource))==null?void 0:O.resource;M?m(M):de({color:"red",message:"No history to restore",autoClose:!1})}function m(D){e.updateResource(Fa(D)).then(()=>{s(void 0),de({color:"green",message:"Success"})}).catch(M=>{de({color:"red",message:Re(M),autoClose:!1})})}if(i)return pO(i)?a.jsxs(we,{children:[a.jsx(ce,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(ee,{color:"red",onClick:h,children:"Restore"})]}):a.jsx(to,{outcome:i});function g(D){D||(D=c[0].toLowerCase()),d(D),o(`/${t}/${n}/${D}`)}function y(D){const M=l,R=M.orderDetail||[];R.length===0&&R.push({}),R[0].text!==D&&(R[0].text=D,m({...M,orderDetail:R}))}const C=l&&a0(l),v=l&&RH(l),x=(j=(S=(w=e.getUserConfiguration())==null?void 0:w.option)==null?void 0:S.find(D=>D.id==="statusValueSet"))==null?void 0:j.valueString;return a.jsxs(a.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&x&&a.jsx(QW,{valueSet:{reference:x},defaultValue:(T=(E=l.orderDetail)==null?void 0:E[0])==null?void 0:T.text,onChange:y},pt(l)+"-"+((k=(P=l.orderDetail)==null?void 0:P[0])==null?void 0:k.text)),l&&a.jsx(VW,{value:l}),l&&a.jsxs(On,{children:[C&&a.jsx(yk,{patient:C}),v&&a.jsx(KW,{specimen:v}),t!=="Patient"&&a.jsx(vk,{resource:r}),a.jsx(dr,{children:a.jsx(He,{value:u.toLowerCase(),onChange:g,children:a.jsx(He.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(D=>a.jsx(He.Tab,{value:D.toLowerCase(),children:ZW.includes(D)?a.jsxs(X,{gap:"xs",wrap:"nowrap",children:[D,a.jsx(df,{color:f.primaryColor,size:"sm",children:"Beta"})]}):D},D))})})})]}),a.jsx(n0,{})]})}function Hw(){var v,x,w,S;const e=Dt(),{resourceType:t,id:n,versionId:r,tab:o}=Ze(),i=re(),[s,l]=p.useState(!0),[c,u]=p.useState(),[d,f]=p.useState();if(p.useEffect(()=>{f(void 0),l(!0),i.readHistory(t,n).then(j=>u(j)).then(()=>l(!1)).catch(j=>{f(j),l(!1)})},[i,t,n]),s)return a.jsx(Dr,{});if(!c)return a.jsxs(we,{children:[a.jsx(ce,{children:"Resource not found"}),a.jsx(Me,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(j=>{var E,T;return((T=(E=j.resource)==null?void 0:E.meta)==null?void 0:T.versionId)===r});if(m===-1)return a.jsxs(we,{children:[a.jsx(ce,{children:"Version not found"}),a.jsx(Me,{to:`/${t}/${n}`,children:"Return to resource"})]});const g=h[m].resource,y=m<h.length-1?h[m+1].resource:void 0,C="diff";return a.jsx(a.Fragment,{children:a.jsxs(He,{value:o||C,onChange:j=>e(`/${t}/${n}/_history/${r}/${j||C}`),children:[a.jsxs(On,{children:[a.jsx(Pc,{fluid:!0,p:"md",children:a.jsx(ue,{children:`${t} ${n}`})}),a.jsxs(He.List,{children:[a.jsx(He.Tab,{value:"diff",children:"Diff"}),a.jsx(He.Tab,{value:"raw",children:"Raw"})]})]}),a.jsxs(we,{children:[d&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),a.jsx(He.Panel,{value:"diff",children:y?a.jsxs(a.Fragment,{children:[a.jsxs("ul",{children:[a.jsxs("li",{children:["Current: ",(v=g.meta)==null?void 0:v.versionId]}),a.jsxs("li",{children:["Previous:"," ",a.jsx(Me,{to:`/${t}/${n}/_history/${(x=y.meta)==null?void 0:x.versionId}`,children:(w=y.meta)==null?void 0:w.versionId})]})]}),a.jsx(UB,{original:y,revised:g})]}):a.jsxs(a.Fragment,{children:[a.jsxs("ul",{children:[a.jsxs("li",{children:["Current: ",(S=g.meta)==null?void 0:S.versionId]}),a.jsx("li",{children:"Previous: (none)"})]}),a.jsx("pre",{children:JSON.stringify(g,void 0,2)})]})}),a.jsx(He.Panel,{value:"raw",children:a.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})})}function tq(){const{resourceType:e,id:t}=Ze(),n=Dt(),[r,o]=p.useState({resourceType:"Subscription",filters:[{code:"url",operator:ne.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(we,{children:a.jsx(Ic,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function Ww(){const{resourceType:e,id:t}=Ze(),n={reference:e+"/"+t};switch(e){case"Encounter":return a.jsx(oF,{encounter:n});case"Patient":return a.jsx(cz,{patient:n});case"ServiceRequest":return a.jsx(GB,{serviceRequest:n});default:return a.jsx(rF,{resource:n})}}function Ck(e,t){const n=re(),r=Dt();return{defaultValue:{resourceType:e},handleSubmit:s=>{t&&t(void 0),n.createResource(s).then(l=>r("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(ct(l))})}}}function qw(){const{resourceType:e}=Ze(),[t,n]=p.useState(),{defaultValue:r,handleSubmit:o}=Ck(e,n);return a.jsx(we,{children:a.jsx(Zv,{defaultValue:r,onSubmit:o,outcome:t})})}function nq(){const{resourceType:e}=Ze(),[t,n]=p.useState(),{defaultValue:r,handleSubmit:o}=Ck(e,n),i=p.useCallback(s=>{o(JSON.parse(s["new-resource"]))},[o]);return a.jsxs(we,{children:[t&&a.jsx(to,{outcome:t}),a.jsxs(Be,{onSubmit:i,children:[a.jsx(fs,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Ln(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(X,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ee,{type:"submit",children:"OK"})})]})]})}function rq(){const e=re(),{resourceType:t,id:n}=Ze(),[r,o]=p.useState(),[i,s]=p.useState(),[l,c]=p.useState();return p.useEffect(()=>{e.readResource(t,n).then(u=>o(vi(u))).catch(u=>{de({color:"red",message:Re(u)})})},[e,t,n]),p.useEffect(()=>{e.searchResources("StructureDefinition",{type:t,derivation:"constraint",_count:50}).then(u=>{c(u.filter(T6))}).catch(console.error)},[e,t]),r?a.jsxs(we,{children:[a.jsxs(ce,{order:2,children:["Available ",t," profiles"]}),a.jsx(Se,{children:a.jsxs(a.Fragment,{children:[a.jsx(He,{value:i==null?void 0:i.url,onChange:u=>s(l==null?void 0:l.find(d=>d.url===u)),children:a.jsx(He.List,{children:l==null?void 0:l.map(u=>{var h,m;const d=(m=(h=r.meta)==null?void 0:h.profile)==null?void 0:m.includes(u.url),f=d?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return a.jsx(He.Tab,{value:u.url,title:f,rightSection:d&&a.jsx(rv,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(KL,{size:"90%"})}),children:u.title||u.name},u.url)})})}),i?a.jsx(oq,{profile:i,resource:r,onResourceUpdated:u=>o(u)},i.url):a.jsx(ue,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const oq=({profile:e,resource:t,onResourceUpdated:n})=>{const r=re(),[o,i]=p.useState(),[s,l]=p.useState(()=>{var u,d;return(d=(u=t.meta)==null?void 0:u.profile)==null?void 0:d.includes(e.url)}),c=p.useCallback(u=>{i(void 0);const d=Fa(u);s?jW(d,e.url):TW(d,e.url),r.updateResource(d).then(f=>{n(f),de({color:"green",message:"Success"})}).catch(f=>{i(ct(f)),de({color:"red",message:Re(f)})})},[r,e.url,n,s]);return a.jsxs(Se,{children:[a.jsx(mc,{size:"md",checked:s,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),s?a.jsx(Zv,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:a.jsx(X,{justify:"flex-end",mt:"xl",children:a.jsx(ee,{type:"submit",children:"OK"})})})]})};function iq(){return a.jsx(dV,{children:a.jsxs(he,{errorElement:a.jsx(CH,{}),children:[a.jsx(he,{path:"/signin",element:a.jsx(GH,{})}),a.jsx(he,{path:"/oauth",element:a.jsx(UH,{})}),a.jsx(he,{path:"/resetpassword",element:a.jsx(HH,{})}),a.jsx(he,{path:"/setpassword/:id/:secret",element:a.jsx(qH,{})}),a.jsx(he,{path:"/register",element:a.jsx(VH,{})}),a.jsx(he,{path:"/changepassword",element:a.jsx(SH,{})}),a.jsx(he,{path:"/security",element:a.jsx(WH,{})}),a.jsx(he,{path:"/mfa",element:a.jsx(BH,{})}),a.jsx(he,{path:"/batch",element:a.jsx(xH,{})}),a.jsx(he,{path:"/bulk/:resourceType",element:a.jsx(wH,{})}),a.jsx(he,{path:"/smart",element:a.jsx(QH,{})}),a.jsx(he,{path:"/forms/:id",element:a.jsx(IH,{})}),a.jsx(he,{path:"/admin/super",element:a.jsx(sW,{})}),a.jsx(he,{path:"/admin/config",element:a.jsx(aW,{})}),a.jsxs(he,{path:"/admin",element:a.jsx(rW,{}),children:[a.jsx(he,{path:"patients",element:a.jsx(nW,{})}),a.jsx(he,{path:"bots/new",element:a.jsx(XH,{})}),a.jsx(he,{path:"bots",element:a.jsx(KH,{})}),a.jsx(he,{path:"clients/new",element:a.jsx(JH,{})}),a.jsx(he,{path:"clients",element:a.jsx(YH,{})}),a.jsx(he,{path:"details",element:a.jsx(Bw,{})}),a.jsx(he,{path:"invite",element:a.jsx(tW,{})}),a.jsx(he,{path:"users",element:a.jsx(lW,{})}),a.jsx(he,{path:"project",element:a.jsx(Bw,{})}),a.jsx(he,{path:"secrets",element:a.jsx(oW,{})}),a.jsx(he,{path:"sites",element:a.jsx(iW,{})}),a.jsx(he,{path:"members/:membershipId",element:a.jsx(eW,{})})]}),a.jsx(he,{path:"/lab/assays",element:a.jsx(cW,{})}),a.jsx(he,{path:"/lab/panels",element:a.jsx(uW,{})}),a.jsx(he,{path:"/:resourceType/:id/_history/:versionId/:tab",element:a.jsx(Hw,{})}),a.jsx(he,{path:"/:resourceType/:id/_history/:versionId",element:a.jsx(Hw,{})}),a.jsxs(he,{path:"/:resourceType/new",element:a.jsx(bH,{}),children:[a.jsx(he,{index:!0,element:a.jsx(qw,{})}),a.jsx(he,{path:"form",element:a.jsx(qw,{})}),a.jsx(he,{path:"json",element:a.jsx(nq,{})})]}),a.jsxs(he,{path:"/:resourceType/:id",element:a.jsx(eq,{}),children:[a.jsx(he,{index:!0,element:a.jsx(Ww,{})}),a.jsx(he,{path:"apply",element:a.jsx(fW,{})}),a.jsx(he,{path:"apps",element:a.jsx(hW,{})}),a.jsx(he,{path:"event",element:a.jsx(mW,{})}),a.jsx(he,{path:"blame",element:a.jsx(gW,{})}),a.jsx(he,{path:"bots",element:a.jsx(OW,{})}),a.jsx(he,{path:"builder",element:a.jsx(PW,{})}),a.jsx(he,{path:"checklist",element:a.jsx(kW,{})}),a.jsx(he,{path:"delete",element:a.jsx(RW,{})}),a.jsx(he,{path:"details",element:a.jsx(DW,{})}),a.jsx(he,{path:"edit",element:a.jsx(IW,{})}),a.jsx(he,{path:"editor",element:a.jsx(CW,{})}),a.jsx(he,{path:"history",element:a.jsx(_W,{})}),a.jsx(he,{path:"json",element:a.jsx(AW,{})}),a.jsx(he,{path:"preview",element:a.jsx(NW,{})}),a.jsx(he,{path:"responses",element:a.jsx($W,{})}),a.jsx(he,{path:"report",element:a.jsx(FW,{})}),a.jsx(he,{path:"ranges",element:a.jsx(LW,{})}),a.jsx(he,{path:"subscriptions",element:a.jsx(tq,{})}),a.jsx(he,{path:"timeline",element:a.jsx(Ww,{})}),a.jsx(he,{path:"profiles",element:a.jsx(rq,{})})]}),a.jsx(he,{path:"/:resourceType",element:a.jsx(zw,{})}),a.jsx(he,{path:"/",element:a.jsx(zw,{})})]})})}function sq(){const e=re(),t=e.getUserConfiguration(),n=wi(),[r]=r0();return e.isLoading()?a.jsx(Dr,{}):a.jsx(d6,{logo:a.jsx(Nr,{size:24}),pathname:n.pathname,searchParams:r,version:gL,menus:aq(t),displayAddBookmark:!!(t!=null&&t.id),children:a.jsx(p.Suspense,{fallback:a.jsx(Dr,{}),children:a.jsx(iq,{})})})}function aq(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var o;return{title:r.title,links:((o=r.link)==null?void 0:o.map(i=>({label:i.name,href:i.target,icon:lq(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(a7,{})}]}),t}const Gw={Patient:S7,Practitioner:o7,Organization:qL,ServiceRequest:g7,DiagnosticReport:v7,Questionnaire:r7,admin:VL,AccessPolicy:s7,Subscription:E7,batch:d7,Observation:u7};function lq(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in Gw){const n=Gw[t];return a.jsx(n,{})}}catch{}return a.jsx(kf,{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 cq(){const e=Oc(),t=new bL({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=pV([{path:"*",element:a.jsx(sq,{})}]),o=s=>r.navigate(s);BP(document.getElementById("root")).render(a.jsx(p.StrictMode,{children:a.jsx(EL,{medplum:t,navigate:o,children:a.jsxs(kS,{theme:n,children:[a.jsx(Do,{position:"bottom-right"}),a.jsx(CV,{router:r})]})})}))}cq().catch(console.error);
235
+ //# sourceMappingURL=index-5N7saXiy.js.map