diff --git a/app.md b/app.md index 8a113d6..e5a7727 100644 --- a/app.md +++ b/app.md @@ -2,8 +2,8 @@ name: kanban lang: go domain: tools -version: 0.2.0 -description: "Kanban board con persistencia SQLite, drag-and-drop entre columnas (dnd-kit), tracking del tiempo por columna y adjuntos de archivos por card (drag&drop en descripcion y chat). Frontend Vite + React + Mantine v9 embebido en el binario Go." +version: 0.5.0 +description: "Kanban board con persistencia SQLite, drag-and-drop entre columnas (dnd-kit), tracking del tiempo por columna, adjuntos de archivos por card, notificaciones realtime (SSE) y modulos externos (Jira). Frontend Vite + React + Mantine v9 embebido en el binario Go. Endpoint MCP Streamable HTTP en /mcp." tags: [service, kanban, web, dnd-kit, mantine, sqlite, time-tracking] uses_functions: - random_hex_id_go_core @@ -38,6 +38,7 @@ uses_functions: - fetch_json_ts_infra - claude_stream_go_core - mcp_server_stdio_go_infra + - mcp_server_http_go_infra - ws_upgrader_go_infra uses_types: - DurationStats_go_datascience @@ -192,3 +193,6 @@ Una linea por bump SemVer. Bump-type segun `.claude/commands/version.md`: - v0.1.0 (2026-05-18) — baseline. - v0.2.0 (2026-05-27) — adjuntos de archivos por card (issue 0128): tabla `card_files` con soft-delete, endpoints REST (`POST/GET/DELETE /api/cards/{id}/files`, `GET/DELETE /api/files/{id}`), tres vias de upload (drag&drop en descripcion y chat, boton en tab Archivos), render inline de imagenes via `MessageBody`. Limite 10 MB. +- v0.3.1 (2026-05-21) — patch: debounce board.invalidated (300ms trailing) + autoClose 4s en toasts de notification.created. Fix de blow-up de memoria en navegador por ráfagas de SSE. +- v0.4.0 (2026-05-22) — minor: endpoint MCP Streamable HTTP `/mcp` con per-user bearer tokens (tabla `mcp_tokens`, migration 017). Modal "MCP tokens" en avatar menu para generar/listar/revocar. Vite proxy enruta `/mcp` a WSL. Usa nueva funcion `mcp_server_http_go_infra`. Doc en `docs/MCP.md`. +- v0.5.0 (2026-05-27) — minor: merge ramas notifications-realtime + modules con master post-files. Trae notificaciones SSE (tabla `notifications`, migration 015), modulos externos para sincronizacion bidireccional (Jira, etc., tabla `modules`, migration 016), tokens MCP per-user (migration 017). Conserva files attachments del 0128. Renumeradas migrations notif 014/015/016 -> 015/016/017. diff --git a/backend/dist/assets/index-UVzY_37O.js b/backend/dist/assets/index-UVzY_37O.js new file mode 100644 index 0000000..7844e5e --- /dev/null +++ b/backend/dist/assets/index-UVzY_37O.js @@ -0,0 +1,1280 @@ +function gK(e,n){for(var t=0;ti[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=t(r);fetch(r.href,a)}})();var Nv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ok={exports:{}},ih={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var g5;function yK(){if(g5)return ih;g5=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(i,r,a){var o=null;if(a!==void 0&&(o=""+a),r.key!==void 0&&(o=""+r.key),"key"in r){a={};for(var l in r)l!=="key"&&(a[l]=r[l])}else a=r;return r=a.ref,{$$typeof:e,type:i,key:o,ref:r!==void 0?r:null,props:a}}return ih.Fragment=n,ih.jsx=t,ih.jsxs=t,ih}var y5;function bK(){return y5||(y5=1,ok.exports=yK()),ok.exports}var g=bK();function Pt(e){return Object.keys(e)}function sk(e){return e&&typeof e=="object"&&!Array.isArray(e)}function P6(e,n){const t={...e},i=n;return sk(e)&&sk(n)&&Object.keys(n).forEach(r=>{sk(i[r])&&r in e?t[r]=P6(t[r],i[r]):t[r]=i[r]}),t}function wK(e){return e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function kK(e){var n;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(n=e.match(/^calc\((.*?)\)$/))==null?void 0:n[1].split("*")[0].trim()}function Yh(e){const n=kK(e);return typeof n=="number"?n:typeof n=="string"?n.includes("calc")||n.includes("var")?n:n.includes("px")?Number(n.replace("px","")):n.includes("rem")?Number(n.replace("rem",""))*16:n.includes("em")?Number(n.replace("em",""))*16:Number(n):NaN}function b5(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function vz(e,{shouldScale:n=!1}={}){function t(i){if(i===0||i==="0")return`0${e}`;if(typeof i=="number"){const r=`${i/16}${e}`;return n?b5(r):r}if(typeof i=="string"){if(i===""||i.startsWith("calc(")||i.startsWith("clamp(")||i.includes("rgba("))return i;if(i.includes(","))return i.split(",").map(a=>t(a)).join(",");if(i.includes(" "))return i.split(" ").map(a=>t(a)).join(" ");const r=i.replace("px","");if(!Number.isNaN(Number(r))){const a=`${Number(r)/16}${e}`;return n?b5(a):a}}return i}return t}const me=vz("rem",{shouldScale:!0}),Tg=vz("em");function Tu(e){return Object.keys(e).reduce((n,t)=>(e[t]!==void 0&&(n[t]=e[t]),n),{})}function gz(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const n=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(t=>n.test(t))}return!1}var lk={exports:{}},Nn={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var w5;function _K(){if(w5)return Nn;w5=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function v(W){return W===null||typeof W!="object"?null:(W=p&&W[p]||W["@@iterator"],typeof W=="function"?W:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,k={};function _(W,G,z){this.props=W,this.context=G,this.refs=k,this.updater=z||b}_.prototype.isReactComponent={},_.prototype.setState=function(W,G){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,G,"setState")},_.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function C(){}C.prototype=_.prototype;function x(W,G,z){this.props=W,this.context=G,this.refs=k,this.updater=z||b}var E=x.prototype=new C;E.constructor=x,w(E,_.prototype),E.isPureReactComponent=!0;var j=Array.isArray;function O(){}var M={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function q(W,G,z){var X=z.ref;return{$$typeof:e,type:W,key:G,ref:X!==void 0?X:null,props:z}}function R(W,G){return q(W.type,G,W.props)}function L(W){return typeof W=="object"&&W!==null&&W.$$typeof===e}function F(W){var G={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(z){return G[z]})}var Y=/\/+/g;function V(W,G){return typeof W=="object"&&W!==null&&W.key!=null?F(""+W.key):G.toString(36)}function $(W){switch(W.status){case"fulfilled":return W.value;case"rejected":throw W.reason;default:switch(typeof W.status=="string"?W.then(O,O):(W.status="pending",W.then(function(G){W.status==="pending"&&(W.status="fulfilled",W.value=G)},function(G){W.status==="pending"&&(W.status="rejected",W.reason=G)})),W.status){case"fulfilled":return W.value;case"rejected":throw W.reason}}throw W}function P(W,G,z,X,ee){var re=typeof W;(re==="undefined"||re==="boolean")&&(W=null);var le=!1;if(W===null)le=!0;else switch(re){case"bigint":case"string":case"number":le=!0;break;case"object":switch(W.$$typeof){case e:case n:le=!0;break;case h:return le=W._init,P(le(W._payload),G,z,X,ee)}}if(le)return ee=ee(W),le=X===""?"."+V(W,0):X,j(ee)?(z="",le!=null&&(z=le.replace(Y,"$&/")+"/"),P(ee,G,z,"",function(ue){return ue})):ee!=null&&(L(ee)&&(ee=R(ee,z+(ee.key==null||W&&W.key===ee.key?"":(""+ee.key).replace(Y,"$&/")+"/")+le)),G.push(ee)),1;le=0;var ye=X===""?".":X+":";if(j(W))for(var ae=0;ae{const i=A.use(n);if(i===null)throw new Error(e);return i}]}function _5(e,n){return t=>{if(typeof t!="string"||t.trim().length===0)throw new Error(n);return`${e}-${t}`}}function Mg(e,n){let t=e;for(;(t=t.parentElement)&&!t.matches(n););return t}function xK(e,n,t){for(let i=e-1;i>=0;i-=1)if(!n[i].disabled)return i;if(t){for(let i=n.length-1;i>-1;i-=1)if(!n[i].disabled)return i}return e}function SK(e,n,t){for(let i=e+1;i{var b;t==null||t(l);const c=Array.from(((b=Mg(l.currentTarget,e))==null?void 0:b.querySelectorAll(n))||[]).filter(w=>CK(l.currentTarget,w,e)),f=c.findIndex(w=>l.currentTarget===w),h=SK(f,c,i),d=xK(f,c,i),p=a==="rtl"?d:h,v=a==="rtl"?h:d;switch(l.key){case"ArrowRight":o==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[p].focus(),r&&c[p].click());break;case"ArrowLeft":o==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[v].focus(),r&&c[v].click());break;case"ArrowUp":o==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[d].focus(),r&&c[d].click());break;case"ArrowDown":o==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[h].focus(),r&&c[h].click());break;case"Home":l.stopPropagation(),l.preventDefault(),!c[0].disabled&&c[0].focus();break;case"End":{l.stopPropagation(),l.preventDefault();const w=c.length-1;!c[w].disabled&&c[w].focus();break}}}}const AK={app:100,modal:200,popover:300,overlay:400,max:9999};function Sa(e){return AK[e]}const mS=()=>{};function jK(e,n={active:!0}){return typeof e!="function"||!n.active?n.onKeyDown||mS:t=>{var i;t.key==="Escape"&&(e(t),(i=n.onTrigger)==null||i.call(n))}}function Bn(e,n="size",t=!0){if(e!==void 0)return gz(e)?t?me(e):e:`var(--${n}-${e})`}function Vt(e){return Bn(e,"mantine-spacing")}function Yt(e){return e===void 0?"var(--mantine-radius-default)":Bn(e,"mantine-radius")}function ri(e){return Bn(e,"mantine-font-size")}function OK(e){return Bn(e,"mantine-line-height",!1)}function L6(e){if(e)return Bn(e,"mantine-shadow",!1)}function Sr(e,n){return t=>{e==null||e(t),n==null||n(t)}}function I6(e,n){return e in n?Yh(n[e]):Yh(e)}function Kh(e,n){const t=e.map(i=>({value:i,px:I6(i,n)}));return t.sort((i,r)=>i.px-r.px),t}function Wr(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function EK(e,n,t){var i;return t?Array.from(((i=Mg(t,n))==null?void 0:i.querySelectorAll(e))||[]).findIndex(r=>r===t):null}function ns(e,n,t){return n===void 0&&t===void 0?e:n!==void 0&&t===void 0?Math.max(e,n):Math.min(n===void 0&&t!==void 0?e:Math.max(e,n),t)}function cl(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function xh(e){const n=A.useRef(e);return A.useEffect(()=>{n.current=e}),A.useMemo(()=>((...t)=>{var i;return(i=n.current)==null?void 0:i.call(n,...t)}),[])}function ly(e,n){const{delay:t,flushOnUnmount:i,leading:r,maxWait:a}=typeof n=="number"?{delay:n,flushOnUnmount:!1,leading:!1,maxWait:void 0}:n,o=xh(e),l=A.useRef(0),c=A.useRef(0),f=A.useRef(null),h=A.useMemo(()=>{const d=Object.assign((...p)=>{window.clearTimeout(l.current),f.current=p;const v=d._isFirstCall;d._isFirstCall=!1;function b(){window.clearTimeout(l.current),window.clearTimeout(c.current),l.current=0,c.current=0,d._isFirstCall=!0,d._hasPendingCallback=!1}function w(){a!==void 0&&c.current===0&&(c.current=window.setTimeout(()=>{if(l.current!==0){const C=f.current;b(),o(...C)}},a))}if(r&&v){o(...p);const C=()=>{b()},x=()=>{l.current!==0&&(b(),o(...p))},E=()=>{b()};d.flush=x,d.cancel=E,l.current=window.setTimeout(C,t),w();return}if(r&&!v){d._hasPendingCallback=!0;const C=()=>{l.current!==0&&(b(),o(...p))},x=()=>{b()};d.flush=C,d.cancel=x;const E=()=>{b()};l.current=window.setTimeout(E,t),w();return}d._hasPendingCallback=!0;const k=()=>{l.current!==0&&(b(),o(...p))},_=()=>{b()};d.flush=k,d.cancel=_,l.current=window.setTimeout(k,t),w()},{flush:()=>{},cancel:()=>{},isPending:()=>d._hasPendingCallback,_isFirstCall:!0,_hasPendingCallback:!1});return d},[o,t,r,a]);return A.useEffect(()=>()=>{i?h.flush():h.cancel()},[h,i]),h}const TK=["mousedown","touchstart"];function MK(e,n,t,i=!0){const r=A.useRef(null),a=n||TK,o=A.useEffectEvent(c=>{const{target:f}=c??{};if(!document.body.contains(f)&&(f==null?void 0:f.tagName)!=="HTML")return;const h=c.composedPath();Array.isArray(t)?t.every(d=>!!d&&!h.includes(d))&&e(c):r.current&&!h.includes(r.current)&&e(c)}),l=a.join(",");return A.useEffect(()=>{if(!i)return;const c=l.split(",");return c.forEach(f=>document.addEventListener(f,o)),()=>{c.forEach(f=>document.removeEventListener(f,o))}},[l,i]),r}function DK(e,n){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function RK(e,n,{getInitialValueInEffect:t}={getInitialValueInEffect:!0}){const[i,r]=A.useState(t?n:DK(e));return A.useEffect(()=>{try{if("matchMedia"in window){const a=window.matchMedia(e);r(a.matches);const o=l=>r(l.matches);return a.addEventListener("change",o),()=>{a.removeEventListener("change",o)}}}catch{return}},[e]),i||!1}const ps=typeof document<"u"?A.useLayoutEffect:A.useEffect;function ls(e,n){const t=A.useRef(!1);A.useEffect(()=>()=>{t.current=!1},[]),A.useEffect(()=>{if(t.current)return e();t.current=!0},n)}function bz({opened:e,shouldReturnFocus:n=!0}){const t=A.useRef(null),i=()=>{var r;t.current&&"focus"in t.current&&typeof t.current.focus=="function"&&((r=t.current)==null||r.focus({preventScroll:!0}))};return ls(()=>{let r=-1;const a=o=>{o.key==="Tab"&&window.clearTimeout(r)};if(document.addEventListener("keydown",a),e)t.current=document.activeElement;else if(n){const o=document.activeElement;r=window.setTimeout(()=>{const l=document.activeElement;(l===null||l===document.body||l===o)&&i()},10)}return()=>{window.clearTimeout(r),document.removeEventListener("keydown",a)}},[e,n]),i}const PK=/input|select|textarea|button|object/,wz="a, input, select, textarea, button, object, [tabindex]";function NK(e){return e.style.display==="none"}function $K(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(NK(n))return!1;n=n.parentNode}return!0}function kz(e){let n=e.getAttribute("tabindex");return n===null&&(n=void 0),parseInt(n,10)}function pS(e){const n=e.nodeName.toLowerCase(),t=!Number.isNaN(kz(e));return(PK.test(n)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||t)&&$K(e)}function _z(e){const n=kz(e);return(Number.isNaN(n)||n>=0)&&pS(e)}function zK(e){return Array.from(e.querySelectorAll(wz)).filter(_z)}function LK(e,n){const t=zK(e);if(!t.length){n.preventDefault();return}const i=t[n.shiftKey?0:t.length-1],r=e.getRootNode();let a=i===r.activeElement||e===r.activeElement;const o=r.activeElement;if(o.tagName==="INPUT"&&o.getAttribute("type")==="radio"&&(a=t.filter(c=>c.getAttribute("type")==="radio"&&c.getAttribute("name")===o.getAttribute("name")).includes(i)),!a)return;n.preventDefault();const l=t[n.shiftKey?t.length-1:0];l&&l.focus()}function IK(e=!0){const n=A.useRef(null),t=r=>{let a=r.querySelector("[data-autofocus]");if(!a){const o=Array.from(r.querySelectorAll(wz));a=o.find(_z)||o.find(pS)||null,!a&&pS(r)&&(a=r)}a?a.focus({preventScroll:!0}):console.warn("[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node",r)},i=A.useCallback(r=>{if(e){if(r===null){n.current=null;return}n.current!==r&&(setTimeout(()=>{r.getRootNode()?t(r):console.warn("[@mantine/hooks/use-focus-trap] Ref node is not part of the dom",r)}),n.current=r)}},[e]);return A.useEffect(()=>{if(!e)return;n.current&&setTimeout(()=>{n.current&&t(n.current)});const r=a=>{a.key==="Tab"&&n.current&&LK(n.current,a)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),i}const BK=e=>(e+1)%1e6;function FK(){const[,e]=A.useReducer(BK,0);return e}function Vi(e){const[n,t]=A.useState(`mantine-${A.useId().replace(/:/g,"")}`);return ps(()=>{t(cl())},[]),typeof e=="string"?e:n}function xz(e,n,t){const i=A.useEffectEvent(n);A.useEffect(()=>(window.addEventListener(e,i,t),()=>window.removeEventListener(e,i,t)),[e])}function Dg(e,n){if(typeof e=="function")return e(n);typeof e=="object"&&e!==null&&"current"in e&&(e.current=n)}function qK(...e){const n=new Map;return t=>{if(e.forEach(i=>{const r=Dg(i,t);r&&n.set(i,r)}),n.size>0)return()=>{e.forEach(i=>{const r=n.get(i);r&&typeof r=="function"?r():Dg(i,null)}),n.clear()}}}function Kt(...e){return A.useCallback(qK(...e),e)}function Sz(e){return{x:ns(e.x,0,1),y:ns(e.y,0,1)}}function Cz(e,n,t="ltr"){const i=A.useRef(!1),r=A.useRef(!1),a=A.useRef(0),o=A.useRef(null),[l,c]=A.useState(!1);return A.useEffect(()=>(i.current=!0,()=>{var f;(f=o.current)==null||f.call(o)}),[]),{ref:A.useCallback(f=>{const h=({x,y:E})=>{cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{if(i.current&&f){f.style.userSelect="none";const j=f.getBoundingClientRect();if(j.width&&j.height){const O=ns((x-j.left)/j.width,0,1);e({x:t==="ltr"?O:1-O,y:ns((E-j.top)/j.height,0,1)})}}})},d=()=>{document.addEventListener("mousemove",k),document.addEventListener("mouseup",b),document.addEventListener("touchmove",C,{passive:!1}),document.addEventListener("touchend",b)},p=()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",b),document.removeEventListener("touchmove",C),document.removeEventListener("touchend",b)},v=()=>{!r.current&&i.current&&(r.current=!0,typeof(n==null?void 0:n.onScrubStart)=="function"&&n.onScrubStart(),c(!0),d())},b=()=>{r.current&&i.current&&(r.current=!1,c(!1),p(),setTimeout(()=>{typeof(n==null?void 0:n.onScrubEnd)=="function"&&n.onScrubEnd()},0))},w=x=>{v(),x.preventDefault(),k(x)},k=x=>h({x:x.clientX,y:x.clientY}),_=x=>{x.cancelable&&x.preventDefault(),v(),C(x)},C=x=>{x.cancelable&&x.preventDefault(),h({x:x.changedTouches[0].clientX,y:x.changedTouches[0].clientY})};return f==null||f.addEventListener("mousedown",w),f==null||f.addEventListener("touchstart",_,{passive:!1}),o.current=()=>{p(),cancelAnimationFrame(a.current)},()=>{f&&(f.removeEventListener("mousedown",w),f.removeEventListener("touchstart",_))}},[t,e]),active:l}}function Ci({value:e,defaultValue:n,finalValue:t,onChange:i=()=>{}}){const[r,a]=A.useState(n!==void 0?n:t),o=(l,...c)=>{a(l),i==null||i(l,...c)};return e!==void 0?[e,i,!0]:[r,o,!1]}function B6(e,n){return RK("(prefers-reduced-motion: reduce)",e,n)}function Az(e=!1,n={}){const[t,i]=A.useState(e),r=A.useCallback(()=>{i(o=>{var l;return o||((l=n.onOpen)==null||l.call(n),!0)})},[n.onOpen]),a=A.useCallback(()=>{i(o=>{var l;return o&&((l=n.onClose)==null||l.call(n),!1)})},[n.onClose]);return[t,{open:r,close:a,toggle:A.useCallback(()=>{t?a():r()},[a,r,t]),set:i}]}function HK(e){const n=A.useRef(void 0);return A.useEffect(()=>{n.current=e},[e]),n.current}var uk={exports:{}},Yi={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var x5;function UK(){if(x5)return Yi;x5=1;var e=N6();function n(c){var f="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),uk.exports=UK(),uk.exports}var il=jz();const Sh=yt(il);function VK(e,n){window.dispatchEvent(new CustomEvent(e,{detail:n}))}function WK(e){function n(i){const r=Object.keys(i).reduce((a,o)=>(a[`${e}:${o}`]=l=>i[o](l.detail),a),{});ps(()=>(Object.keys(r).forEach(a=>{window.removeEventListener(a,r[a]),window.addEventListener(a,r[a])}),()=>Object.keys(r).forEach(a=>{window.removeEventListener(a,r[a])})),[r])}function t(i){return(...r)=>VK(`${e}:${String(i)}`,r[0])}return[n,t]}var GK={};function YK(){return"development"}function uy(e){var t;const n=Q.version;return typeof Q.version!="string"||n.startsWith("18.")?e==null?void 0:e.ref:(t=e==null?void 0:e.props)==null?void 0:t.ref}function pg(e,n=document){const t=n.querySelector(e);if(t)return t;const i=n.querySelectorAll("*");for(let r=0;r{Object.entries(t).forEach(([i,r])=>{n[i]?n[i]=pn(n[i],r):n[i]=r})}),n}function Xh({theme:e,classNames:n,props:t,stylesCtx:i}){return XK((Array.isArray(n)?n:[n]).map(r=>typeof r=="function"?r(e,t,i):r||KK))}function Rg({theme:e,styles:n,props:t,stylesCtx:i}){const r=Array.isArray(n)?n:[n],a={};for(const o of r)typeof o=="function"?Object.assign(a,o(e,t,i)):o&&Object.assign(a,o);return a}function C5(e){return e==="auto"||e==="dark"||e==="light"}function ZK({key:e="mantine-color-scheme-value"}={}){let n;return{get:t=>{if(typeof window>"u")return t;try{const i=window.localStorage.getItem(e);return C5(i)?i:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(i){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",i)}},subscribe:t=>{n=i=>{i.storageArea===window.localStorage&&i.key===e&&C5(i.newValue)&&t(i.newValue)},window.addEventListener("storage",n)},unsubscribe:()=>{window.removeEventListener("storage",n)},clear:()=>{window.localStorage.removeItem(e)}}}function Zh(e,n){return typeof e.primaryShade=="number"?e.primaryShade:n==="dark"?e.primaryShade.dark:e.primaryShade.light}function QK(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function JK(e){let n=e.replace("#","");if(n.length===3){const i=n.split("");n=[i[0],i[0],i[1],i[1],i[2],i[2]].join("")}if(n.length===8){const i=parseInt(n.slice(6,8),16)/255;return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:i}}const t=parseInt(n,16);return{r:t>>16&255,g:t>>8&255,b:t&255,a:1}}function eX(e){const[n,t,i,r]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:n,g:t,b:i,a:r===void 0?1:r}}function nX(e){const n=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!n)return{r:0,g:0,b:0,a:1};const t=parseInt(n[1],10),i=parseInt(n[2],10)/100,r=parseInt(n[3],10)/100,a=n[5]?parseFloat(n[5]):void 0,o=(1-Math.abs(2*r-1))*i,l=t/60,c=o*(1-Math.abs(l%2-1)),f=r-o/2;let h,d,p;return l>=0&&l<1?(h=o,d=c,p=0):l>=1&&l<2?(h=c,d=o,p=0):l>=2&&l<3?(h=0,d=o,p=c):l>=3&&l<4?(h=0,d=c,p=o):l>=4&&l<5?(h=c,d=0,p=o):(h=o,d=0,p=c),{r:Math.round((h+f)*255),g:Math.round((d+f)*255),b:Math.round((p+f)*255),a:a||1}}function F6(e){return QK(e)?JK(e):e.startsWith("rgb")?eX(e):e.startsWith("hsl")?nX(e):{r:0,g:0,b:0,a:1}}function ck(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function tX(e){const n=e.match(/oklch\((.*?)%\s/);return n?parseFloat(n[1]):null}function Ez(e){if(e.startsWith("oklch("))return(tX(e)||0)/100;const{r:n,g:t,b:i}=F6(e),r=n/255,a=t/255,o=i/255,l=ck(r),c=ck(a),f=ck(o);return .2126*l+.7152*c+.0722*f}function rh(e,n=.179){return e.startsWith("var(")?!1:Ez(e)>n}function vs({color:e,theme:n,colorScheme:t}){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:t==="dark"?n.white:n.black,shade:void 0,isThemeColor:!1,isLight:rh(t==="dark"?n.white:n.black,n.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:t==="dark"?n.colors.dark[2]:n.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:rh(t==="dark"?n.colors.dark[2]:n.colors.gray[6],n.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?n.white:n.black,shade:void 0,isThemeColor:!1,isLight:rh(e==="white"?n.white:n.black,n.luminanceThreshold),variable:`--mantine-color-${e}`};const[i,r]=e.split("."),a=r?Number(r):void 0,o=i in n.colors;if(o){const l=a!==void 0?n.colors[i][a]:n.colors[i][Zh(n,t||"light")];return{color:i,value:l,shade:a,isThemeColor:o,isLight:rh(l,n.luminanceThreshold),variable:r?`--mantine-color-${i}-${a}`:`--mantine-color-${i}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:rh(e,n.luminanceThreshold),shade:a,variable:void 0}}function lt(e,n){const t=vs({color:e||n.primaryColor,theme:n});return t.variable?`var(${t.variable})`:e}function au(e,n){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${n*100}%)`;const{r:t,g:i,b:r,a}=F6(e),o=1-n,l=c=>Math.round(c*o);return`rgba(${l(t)}, ${l(i)}, ${l(r)}, ${a})`}function vS(e,n){const t={from:(e==null?void 0:e.from)||n.defaultGradient.from,to:(e==null?void 0:e.to)||n.defaultGradient.to,deg:(e==null?void 0:e.deg)??n.defaultGradient.deg??0},i=lt(t.from,n),r=lt(t.to,n);return`linear-gradient(${t.deg}deg, ${i} 0%, ${r} 100%)`}function Zs(e,n){if(typeof e!="string"||n>1||n<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var("))return`color-mix(in srgb, ${e}, transparent ${(1-n)*100}%)`;if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${n})`):e.replace(")",` / ${n})`);const{r:t,g:i,b:r}=F6(e);return`rgba(${t}, ${i}, ${r}, ${n})`}const A5=Zs,iX=({color:e,theme:n,variant:t,gradient:i,autoContrast:r})=>{const a=vs({color:e,theme:n}),o=typeof r=="boolean"?r:n.autoContrast;if(t==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(t==="filled"){const l=o&&a.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:l,border:`${me(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:l,border:`${me(1)} solid transparent`}:{background:e,hover:au(e,.1),color:l,border:`${me(1)} solid transparent`}}if(t==="light"){if(a.isThemeColor){if(a.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:`${me(1)} solid transparent`};const l=n.colors[a.color][a.shade];return{background:l,hover:au(l,.1),color:`var(--mantine-color-${a.color}-light-color)`,border:`${me(1)} solid transparent`}}return{background:Zs(e,.1),hover:Zs(e,.12),color:e,border:`${me(1)} solid transparent`}}if(t==="outline")return a.isThemeColor?a.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${me(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Zs(n.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${me(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:"transparent",hover:Zs(e,.05),color:e,border:`${me(1)} solid ${e}`};if(t==="subtle"){if(a.isThemeColor){if(a.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${me(1)} solid transparent`};const l=n.colors[a.color][a.shade];return{background:"transparent",hover:Zs(l,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${me(1)} solid transparent`}}return{background:"transparent",hover:Zs(e,.12),color:e,border:`${me(1)} solid transparent`}}return t==="transparent"?a.isThemeColor?a.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${me(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${me(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${me(1)} solid transparent`}:t==="white"?a.isThemeColor?a.shade===void 0?{background:"var(--mantine-color-white)",hover:au(n.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${me(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:au(n.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${me(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:au(n.white,.01),color:e,border:`${me(1)} solid transparent`}:t==="gradient"?{background:vS(i,n),hover:vS(i,n),color:"var(--mantine-color-white)",border:"none"}:t==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${me(1)} solid var(--mantine-color-default-border)`}:{}};function Pf({color:e,theme:n,autoContrast:t}){return(typeof t=="boolean"?t:n.autoContrast)&&vs({color:e||n.primaryColor,theme:n}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function j5(e,n){return Pf({color:e.colors[e.primaryColor][Zh(e,n)],theme:e,autoContrast:null})}function Gm(e,n){return typeof e=="boolean"?e:n.autoContrast}const Tz=A.createContext(null);function _o(){const e=A.use(Tz);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function rX(){return _o().cssVariablesResolver}function aX(){return _o().classNamesPrefix}function q6(){return _o().getStyleNonce}function oX(){return _o().withStaticClasses}function sX(){return _o().headless}function lX(){var e;return(e=_o().stylesTransform)==null?void 0:e.sx}function uX(){var e;return(e=_o().stylesTransform)==null?void 0:e.styles}function Ym(){return _o().env||"default"}function cX(){return _o().deduplicateInlineStyles}function jc(e,n){var r,a;const t=typeof window<"u"&&"matchMedia"in window&&((r=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:r.matches),i=e!=="auto"?e:t?"dark":"light";(a=n())==null||a.setAttribute("data-mantine-color-scheme",i)}function fX({manager:e,defaultColorScheme:n,getRootElement:t,forceColorScheme:i}){const r=A.useRef(null),[a,o]=A.useState(()=>e.get(n)),l=i||a,c=A.useCallback(h=>{i||(jc(h,t),o(h),e.set(h))},[e.set,l,i]),f=A.useCallback(()=>{o(n),jc(n,t),e.clear()},[e.clear,n]);return A.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),ps(()=>{jc(e.get(n),t)},[]),A.useEffect(()=>{var d;if(i)return jc(i,t),()=>{};i===void 0&&jc(a,t),typeof window<"u"&&"matchMedia"in window&&(r.current=window.matchMedia("(prefers-color-scheme: dark)"));const h=p=>{a==="auto"&&jc(p.matches?"dark":"light",t)};return(d=r.current)==null||d.addEventListener("change",h),()=>{var p;return(p=r.current)==null?void 0:p.removeEventListener("change",h)}},[a,i]),{colorScheme:l,setColorScheme:c,clearColorScheme:f}}const dX={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"]},O5="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",H6={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:dX,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:iX,autoContrast:!1,luminanceThreshold:.3,fontFamily:O5,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:"md",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:O5,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:me(34),lineHeight:"1.3"},h2:{fontSize:me(26),lineHeight:"1.35"},h3:{fontSize:me(22),lineHeight:"1.4"},h4:{fontSize:me(18),lineHeight:"1.45"},h5:{fontSize:me(16),lineHeight:"1.5"},h6:{fontSize:me(14),lineHeight:"1.5"}}},fontSizes:{xs:me(12),sm:me(14),md:me(16),lg:me(18),xl:me(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},fontWeights:{regular:"400",medium:"600",bold:"700"},radius:{xs:me(2),sm:me(4),md:me(8),lg:me(16),xl:me(32)},spacing:{xs:me(10),sm:me(12),md:me(16),lg:me(20),xl:me(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), 0 ${me(1)} ${me(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${me(10)} ${me(15)} ${me(-5)}, rgba(0, 0, 0, 0.04) 0 ${me(7)} ${me(7)} ${me(-5)}`,md:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${me(20)} ${me(25)} ${me(-5)}, rgba(0, 0, 0, 0.04) 0 ${me(10)} ${me(10)} ${me(-5)}`,lg:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${me(28)} ${me(23)} ${me(-7)}, rgba(0, 0, 0, 0.04) 0 ${me(12)} ${me(12)} ${me(-7)}`,xl:`0 ${me(1)} ${me(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${me(36)} ${me(28)} ${me(-7)}, rgba(0, 0, 0, 0.04) 0 ${me(17)} ${me(17)} ${me(-7)}`},other:{},components:{}},hX="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",E5="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function fk(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function T5(e){if(!(e.primaryColor in e.colors))throw new Error(hX);if(typeof e.primaryShade=="object"&&(!fk(e.primaryShade.dark)||!fk(e.primaryShade.light)))throw new Error(E5);if(typeof e.primaryShade=="number"&&!fk(e.primaryShade))throw new Error(E5)}function mX(e,n){var i;if(!n)return T5(e),e;const t=P6(e,n);return n.fontFamily&&!((i=n.headings)!=null&&i.fontFamily)&&(t.headings.fontFamily=n.fontFamily),T5(t),t}const U6=A.createContext(null),pX=()=>A.use(U6)||H6;function ui(){const e=A.use(U6);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 Mz({theme:e,children:n,inherit:t=!0}){const i=pX();return g.jsx(U6,{value:A.useMemo(()=>mX(t?i:H6,e),[e,i,t]),children:n})}Mz.displayName="@mantine/core/MantineThemeProvider";function dk(e){return Object.entries(e).map(([n,t])=>`${n}: ${t};`).join("")}function Dz(e,n){const t=n?[n]:[":root",":host"],i=dk(e.variables),r=i?`${t.join(", ")}{${i}}`:"",a=dk(e.dark),o=dk(e.light),l=c=>t.map(f=>f===":host"?`${f}([data-mantine-color-scheme="${c}"])`:`${f}[data-mantine-color-scheme="${c}"]`).join(", ");return`${r} + +${a?`${l("dark")}{${a}}`:""} + +${o?`${l("light")}{${o}}`:""}`}function $v({theme:e,color:n,colorScheme:t,name:i=n,withColorValues:r=!0}){if(!e.colors[n])return{};if(t==="light"){const l=Zh(e,"light"),c={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-filled)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${l})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${l===9?8:l+1})`,[`--mantine-color-${i}-light`]:`var(--mantine-color-${i}-1)`,[`--mantine-color-${i}-light-hover`]:`var(--mantine-color-${i}-2)`,[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-9)`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${l})`,[`--mantine-color-${i}-outline-hover`]:A5(e.colors[n][l],.05)};return r?{[`--mantine-color-${i}-0`]:e.colors[n][0],[`--mantine-color-${i}-1`]:e.colors[n][1],[`--mantine-color-${i}-2`]:e.colors[n][2],[`--mantine-color-${i}-3`]:e.colors[n][3],[`--mantine-color-${i}-4`]:e.colors[n][4],[`--mantine-color-${i}-5`]:e.colors[n][5],[`--mantine-color-${i}-6`]:e.colors[n][6],[`--mantine-color-${i}-7`]:e.colors[n][7],[`--mantine-color-${i}-8`]:e.colors[n][8],[`--mantine-color-${i}-9`]:e.colors[n][9],...c}:c}const a=Zh(e,"dark"),o={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-4)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${a})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${a===9?8:a+1})`,[`--mantine-color-${i}-light`]:au(e.colors[n][9],.5),[`--mantine-color-${i}-light-hover`]:au(e.colors[n][9],.3),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-0)`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${Math.max(a-4,0)})`,[`--mantine-color-${i}-outline-hover`]:A5(e.colors[n][Math.max(a-4,0)],.05)};return r?{[`--mantine-color-${i}-0`]:e.colors[n][0],[`--mantine-color-${i}-1`]:e.colors[n][1],[`--mantine-color-${i}-2`]:e.colors[n][2],[`--mantine-color-${i}-3`]:e.colors[n][3],[`--mantine-color-${i}-4`]:e.colors[n][4],[`--mantine-color-${i}-5`]:e.colors[n][5],[`--mantine-color-${i}-6`]:e.colors[n][6],[`--mantine-color-${i}-7`]:e.colors[n][7],[`--mantine-color-${i}-8`]:e.colors[n][8],[`--mantine-color-${i}-9`]:e.colors[n][9],...o}:o}function vX(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Xl(e,n,t){Pt(n).forEach(i=>Object.assign(e,{[`--mantine-${t}-${i}`]:n[i]}))}const Rz=e=>{const n=Zh(e,"light"),t=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:me(e.defaultRadius),i={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":t,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":"light","--mantine-primary-color-contrast":j5(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)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":j5(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};Xl(i.variables,e.breakpoints,"breakpoint"),Xl(i.variables,e.spacing,"spacing"),Xl(i.variables,e.fontSizes,"font-size"),Xl(i.variables,e.lineHeights,"line-height"),Xl(i.variables,e.shadows,"shadow"),Xl(i.variables,e.radius,"radius"),Xl(i.variables,e.fontWeights,"font-weight"),e.colors[e.primaryColor].forEach((a,o)=>{i.variables[`--mantine-primary-color-${o}`]=`var(--mantine-color-${e.primaryColor}-${o})`}),Pt(e.colors).forEach(a=>{const o=e.colors[a];if(vX(o)){Object.assign(i.light,$v({theme:e,name:o.name,color:o.light,colorScheme:"light",withColorValues:!0})),Object.assign(i.dark,$v({theme:e,name:o.name,color:o.dark,colorScheme:"dark",withColorValues:!0}));return}o.forEach((l,c)=>{i.variables[`--mantine-color-${a}-${c}`]=l}),Object.assign(i.light,$v({theme:e,color:a,colorScheme:"light",withColorValues:!1})),Object.assign(i.dark,$v({theme:e,color:a,colorScheme:"dark",withColorValues:!1}))});const r=e.headings.sizes;return Pt(r).forEach(a=>{i.variables[`--mantine-${a}-font-size`]=r[a].fontSize,i.variables[`--mantine-${a}-line-height`]=r[a].lineHeight,i.variables[`--mantine-${a}-font-weight`]=r[a].fontWeight||e.headings.fontWeight}),i};function gX(){const e=ui(),n=q6(),t=Pt(e.breakpoints).reduce((i,r)=>{const a=e.breakpoints[r].includes("px"),o=Yh(e.breakpoints[r]);return`${i}@media (max-width: ${a?`${o-.1}px`:Tg(o-.1)}) {.mantine-visible-from-${r} {display: none !important;}}@media (min-width: ${a?`${o}px`:Tg(o)}) {.mantine-hidden-from-${r} {display: none !important;}}`},"");return g.jsx("style",{"data-mantine-styles":"classes",nonce:n==null?void 0:n(),dangerouslySetInnerHTML:{__html:t}})}function yX({theme:e,generator:n}){const t=Rz(e),i=n==null?void 0:n(e);return i?P6(t,i):t}const hk=Rz(H6);function bX(e){const n={variables:{},light:{},dark:{}};return Pt(e.variables).forEach(t=>{hk.variables[t]!==e.variables[t]&&(n.variables[t]=e.variables[t])}),Pt(e.light).forEach(t=>{hk.light[t]!==e.light[t]&&(n.light[t]=e.light[t])}),Pt(e.dark).forEach(t=>{hk.dark[t]!==e.dark[t]&&(n.dark[t]=e.dark[t])}),n}function wX(e){return Dz({variables:{},dark:{"--mantine-color-scheme":"dark"},light:{"--mantine-color-scheme":"light"}},e)}function Pz({cssVariablesSelector:e,deduplicateCssVariables:n}){const t=ui(),i=q6(),r=yX({theme:t,generator:rX()}),a=(e===void 0||e===":root"||e===":host")&&n,o=Dz(a?bX(r):r,e);return o?g.jsx("style",{"data-mantine-styles":!0,nonce:i==null?void 0:i(),dangerouslySetInnerHTML:{__html:`${o}${a?"":wX(e)}`}}):null}Pz.displayName="@mantine/CssVariables";function kX({respectReducedMotion:e,getRootElement:n}){ps(()=>{var t;e&&((t=n())==null||t.setAttribute("data-respect-reduced-motion","true"))},[e])}function Nz({theme:e,children:n,getStyleNonce:t,withStaticClasses:i=!0,withGlobalClasses:r=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:l,classNamesPrefix:c="mantine",colorSchemeManager:f=ZK(),defaultColorScheme:h="light",getRootElement:d=()=>document.documentElement,cssVariablesResolver:p,forceColorScheme:v,stylesTransform:b,env:w,deduplicateInlineStyles:k=!1}){const{colorScheme:_,setColorScheme:C,clearColorScheme:x}=fX({defaultColorScheme:h,forceColorScheme:v,manager:f,getRootElement:d});return kX({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:d}),g.jsx(Tz,{value:{colorScheme:_,setColorScheme:C,clearColorScheme:x,getRootElement:d,classNamesPrefix:c,getStyleNonce:t,cssVariablesResolver:p,cssVariablesSelector:l??":root",withStaticClasses:i,stylesTransform:b,env:w,deduplicateInlineStyles:k},children:g.jsxs(Mz,{theme:e,children:[o&&g.jsx(Pz,{cssVariablesSelector:l,deduplicateCssVariables:a}),r&&g.jsx(gX,{}),n]})})}Nz.displayName="@mantine/core/MantineProvider";function be(e,n,t){var o;const i=ui(),r=(o=i.components[e])==null?void 0:o.defaultProps,a=typeof r=="function"?r(i):r;return{...n,...a,...Tu(t)}}function Wi({classNames:e,styles:n,props:t,stylesCtx:i}){const r=ui();return{resolvedClassNames:e===void 0?void 0:Xh({theme:r,classNames:e,props:t,stylesCtx:i||void 0}),resolvedStyles:n===void 0?void 0:Rg({theme:r,styles:n,props:t,stylesCtx:i||void 0})}}const _X={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function xX({theme:e,options:n,unstyled:t}){return pn((n==null?void 0:n.focusable)&&!t&&(e.focusClassName||_X[e.focusRing]),(n==null?void 0:n.active)&&!t&&e.activeClassName)}function SX({selector:e,stylesCtx:n,options:t,props:i,theme:r}){return Xh({theme:r,classNames:t==null?void 0:t.classNames,props:(t==null?void 0:t.props)||i,stylesCtx:n})[e]}function CX({selector:e,stylesCtx:n,theme:t,classNames:i,props:r}){return Xh({theme:t,classNames:i,props:r,stylesCtx:n})[e]}function AX({rootSelector:e,selector:n,className:t}){return e===n?t:void 0}function jX({selector:e,classes:n,unstyled:t}){return t?void 0:n[e]}function OX({themeName:e,classNamesPrefix:n,selector:t,withStaticClass:i}){return i===!1?[]:e.map(r=>`${n}-${r}-${t}`)}function EX({options:e,classes:n,selector:t,unstyled:i}){return e!=null&&e.variant&&!i?n[`${t}--${e.variant}`]:void 0}function TX({theme:e,options:n,themeName:t,selector:i,classNamesPrefix:r,resolvedClassNames:a,resolvedThemeClassNames:o,classes:l,unstyled:c,className:f,rootSelector:h,props:d,stylesCtx:p,withStaticClasses:v,headless:b,transformedStyles:w}){return pn(xX({theme:e,options:n,unstyled:c||b}),o.map(k=>k[i]),EX({options:n,classes:l,selector:i,unstyled:c||b}),a[i],CX({selector:i,stylesCtx:p,theme:e,classNames:w,props:d}),SX({selector:i,stylesCtx:p,options:n,props:d,theme:e}),AX({rootSelector:h,selector:i,className:f}),jX({selector:i,classes:l,unstyled:c||b}),v&&!b&&OX({themeName:t,classNamesPrefix:r,selector:i,withStaticClass:n==null?void 0:n.withStaticClass}),n==null?void 0:n.className)}function V6({style:e,theme:n}){return Array.isArray(e)?e.reduce((t,i)=>({...t,...V6({style:i,theme:n})}),{}):typeof e=="function"?e(n):e??{}}function MX({theme:e,selector:n,options:t,props:i,stylesCtx:r,rootSelector:a,withStylesTransform:o,resolvedStyles:l,resolvedThemeStyles:c,resolvedVars:f,resolvedRootStyle:h}){return{...c[n],...l[n],...!o&&Rg({theme:e,styles:t==null?void 0:t.styles,props:(t==null?void 0:t.props)||i,stylesCtx:r})[n],...f[n],...a===n?h:null,...V6({style:t==null?void 0:t.style,theme:e})}}function DX(e){return e.reduce((n,t)=>(t&&Object.keys(t).forEach(i=>{n[i]={...n[i],...Tu(t[i])}}),n),{})}function RX({props:e,stylesCtx:n,themeName:t,theme:i}){var o;const r=(o=uX())==null?void 0:o();return{getTransformedStyles:l=>r?[...l.map(c=>r(c,{props:e,theme:i,ctx:n})),...t.map(c=>{var f;return r((f=i.components[c])==null?void 0:f.styles,{props:e,theme:i,ctx:n})})].filter(Boolean):[],withStylesTransform:!!r}}function Xe({name:e,classes:n,props:t,stylesCtx:i,className:r,style:a,rootSelector:o="root",unstyled:l,classNames:c,styles:f,vars:h,varsResolver:d,attributes:p}){var R;const v=ui(),b=aX(),w=oX(),k=sX(),_=(Array.isArray(e)?e:[e]).filter(L=>L),{withStylesTransform:C,getTransformedStyles:x}=RX({props:t,stylesCtx:i,themeName:_,theme:v}),E=Xh({theme:v,classNames:c,props:t,stylesCtx:i}),j=_.map(L=>{var F;return Xh({theme:v,classNames:(F=v.components[L])==null?void 0:F.classNames,props:t,stylesCtx:i})}),O=C?{}:Rg({theme:v,styles:f,props:t,stylesCtx:i}),M={};if(!C)for(const L of _){const F=Rg({theme:v,styles:(R=v.components[L])==null?void 0:R.styles,props:t,stylesCtx:i});for(const Y of Object.keys(F))M[Y]={...M[Y],...F[Y]}}const N=DX([k?{}:d==null?void 0:d(v,t,i),..._.map(L=>{var F,Y,V;return(V=(Y=(F=v.components)==null?void 0:F[L])==null?void 0:Y.vars)==null?void 0:V.call(Y,v,t,i)}),h==null?void 0:h(v,t,i)]),q=V6({style:a,theme:v});return(L,F)=>({...p==null?void 0:p[L],className:TX({theme:v,options:F,themeName:_,selector:L,classNamesPrefix:b,resolvedClassNames:E,resolvedThemeClassNames:j,classes:n,unstyled:l,className:r,rootSelector:o,props:t,stylesCtx:i,withStaticClasses:w,headless:k,transformedStyles:x([F==null?void 0:F.styles,f])}),style:MX({theme:v,selector:L,options:F,props:t,stylesCtx:i,rootSelector:o,withStylesTransform:C,resolvedStyles:O,resolvedThemeStyles:M,resolvedVars:N,resolvedRootStyle:q})})}function Ph(e){return Pt(e).reduce((n,t)=>e[t]!==void 0?`${n}${wK(t)}:${e[t]};`:n,"").trim()}function PX({selector:e,styles:n,media:t,container:i}){const r=n?Ph(n):"",a=Array.isArray(t)?t.map(l=>`@media${l.query}{${e}{${Ph(l.styles)}}}`):[],o=Array.isArray(i)?i.map(l=>`@container ${l.query}{${e}{${Ph(l.styles)}}}`):[];return`${r?`${e}{${r}}`:""}${a.join("")}${o.join("")}`.trim()}function NX(e){let n=5381;for(let t=0;t>>0).toString(36)}function Nf({deduplicate:e,...n}){const t=q6(),i=PX(n);return e?g.jsx("style",{href:`mantine-${NX(i)}`,precedence:"mantine",nonce:t==null?void 0:t(),children:i}):g.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:i}})}function $X(e){let n=5381;for(let t=0;t>>0).toString(36)}function zX(e,n){return`__mdi__-${$X(`${e?Ph(e):""}|${Array.isArray(n)?n.map(t=>`${t.query}:${Ph(t.styles)}`).join("|"):""}`)}`}function Du(e){const{m:n,mx:t,my:i,mt:r,mb:a,ml:o,mr:l,me:c,ms:f,mis:h,mie:d,p,px:v,py:b,pt:w,pb:k,pl:_,pr:C,pe:x,ps:E,pis:j,pie:O,bd:M,bdrs:N,bg:q,c:R,opacity:L,ff:F,fz:Y,fw:V,lts:$,ta:P,lh:I,fs:H,tt:U,td:D,w:W,miw:G,maw:z,h:X,mih:ee,mah:re,bgsz:le,bgp:ye,bgr:ae,bga:ue,pos:Se,top:ne,left:Le,bottom:ke,right:je,inset:Ne,display:ge,flex:Ce,hiddenFrom:Pe,visibleFrom:ce,lightHidden:qe,darkHidden:Ye,sx:We,...Ze}=e;return{styleProps:Tu({m:n,mx:t,my:i,mt:r,mb:a,ml:o,mr:l,me:c,ms:f,mis:h,mie:d,p,px:v,py:b,pt:w,pb:k,pl:_,pr:C,pis:j,pie:O,pe:x,ps:E,bd:M,bg:q,c:R,opacity:L,ff:F,fz:Y,fw:V,lts:$,ta:P,lh:I,fs:H,tt:U,td:D,w:W,miw:G,maw:z,h:X,mih:ee,mah:re,bgsz:le,bgp:ye,bgr:ae,bga:ue,pos:Se,top:ne,left:Le,bottom:ke,right:je,inset:Ne,display:ge,flex:Ce,bdrs:N,hiddenFrom:Pe,visibleFrom:ce,lightHidden:qe,darkHidden:Ye,sx:We}),rest:Ze}}const LX={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mis:{type:"spacing",property:"marginInlineStart"},mie:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},pis:{type:"spacing",property:"paddingInlineStart"},pie:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bdrs:{type:"radius",property:"borderRadius"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function W6(e,n){const t=vs({color:e,theme:n});return t.color==="dimmed"?"var(--mantine-color-dimmed)":t.color==="bright"?"var(--mantine-color-bright)":t.variable?`var(${t.variable})`:t.color}function IX(e,n){const t=vs({color:e,theme:n});return t.isThemeColor&&t.shade===void 0?`var(--mantine-color-${t.color}-text)`:W6(e,n)}function BX(e,n){if(typeof e=="number")return me(e);if(typeof e=="string"){const[t,i,...r]=e.split(" ").filter(o=>o.trim()!=="");let a=`${me(t)}`;return i&&(a+=` ${i}`),r.length>0&&(a+=` ${W6(r.join(" "),n)}`),a.trim()}return e}const M5={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function FX(e){return typeof e=="string"&&e in M5?M5[e]:e}const qX=["h1","h2","h3","h4","h5","h6"];function HX(e,n){return typeof e=="string"&&e in n.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&qX.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?me(e):e}function UX(e){return e}const VX=["h1","h2","h3","h4","h5","h6"];function WX(e,n){return typeof e=="string"&&e in n.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&VX.includes(e)?`var(--mantine-${e}-line-height)`:e}function GX(e,n){return typeof e=="string"&&e in n.radius?`var(--mantine-radius-${e})`:typeof e=="number"||typeof e=="string"?me(e):e}function YX(e){return typeof e=="number"?me(e):e}function KX(e,n){if(typeof e=="number")return me(e);if(typeof e=="string"){const t=e.replace("-","");if(!(t in n.spacing))return me(e);const i=`--mantine-spacing-${t}`;return e.startsWith("-")?`calc(var(${i}) * -1)`:`var(${i})`}return e}const mk={color:W6,textColor:IX,fontSize:HX,spacing:KX,radius:GX,identity:UX,size:YX,lineHeight:WX,fontFamily:FX,border:BX};function D5(e){return e.replace("(min-width: ","").replace("em)","")}function XX({media:e,...n}){const t=Object.keys(e).sort((i,r)=>Number(D5(i))-Number(D5(r))).map(i=>({query:i,styles:e[i]}));return{...n,media:t}}function ZX(e){if(typeof e!="object"||e===null)return!1;const n=Object.keys(e);return!(n.length===1&&n[0]==="base")}function QX(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function JX(e){return typeof e=="object"&&e!==null?Pt(e).filter(n=>n!=="base"):[]}function eZ(e,n){return typeof e=="object"&&e!==null&&n in e?e[n]:e}function nZ({styleProps:e,data:n,theme:t}){return XX(Pt(e).reduce((i,r)=>{if(r==="hiddenFrom"||r==="visibleFrom"||r==="sx")return i;const a=n[r],o=Array.isArray(a.property)?a.property:[a.property],l=QX(e[r]);if(!ZX(e[r]))return o.forEach(f=>{i.inlineStyles[f]=mk[a.type](l,t)}),i;i.hasResponsiveStyles=!0;const c=JX(e[r]);return o.forEach(f=>{l!=null&&(i.styles[f]=mk[a.type](l,t)),c.forEach(h=>{const d=`(min-width: ${t.breakpoints[h]})`;i.media[d]={...i.media[d],[f]:mk[a.type](eZ(e[r],h),t)}})}),i},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function cy(){return`__m__-${A.useId().replace(/[:«»]/g,"")}`}function $z(e,n){return Array.isArray(e)?[...e].reduce((t,i)=>({...t,...$z(i,n)}),{}):typeof e=="function"?e(n):e??{}}function tZ(e){return e}const iZ=tZ;function zz(e){return e}function De(e){const n=e;return n.extend=zz,n.withProps=t=>{const i=r=>g.jsx(n,{...t,...r});return i.extend=n.extend,i.displayName=`WithProps(${n.displayName})`,i},n}function fy(e){return De(e)}function Ai(e){const n=e;return n.withProps=t=>{const i=r=>g.jsx(n,{...t,...r});return i.extend=n.extend,i.displayName=`WithProps(${n.displayName})`,i},n.extend=zz,n}function Lz(e){return`data-${(e.startsWith("data-")?e.slice(5):e).replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`}function rZ(e){return Object.keys(e).reduce((n,t)=>{const i=e[t];return i===void 0||i===""||i===!1||i===null||(n[Lz(t)]=e[t]),n},{})}function Iz(e){return e?typeof e=="string"?{[Lz(e)]:!0}:Array.isArray(e)?[...e].reduce((n,t)=>({...n,...Iz(t)}),{}):rZ(e):null}function gS(e,n){return Array.isArray(e)?[...e].reduce((t,i)=>({...t,...gS(i,n)}),{}):typeof e=="function"?e(n):e??{}}function aZ({theme:e,style:n,vars:t,styleProps:i}){const r=gS(n,e),a=gS(t,e);return{...r,...a,...i}}function Bz({component:e,style:n,__vars:t,className:i,variant:r,mod:a,size:o,hiddenFrom:l,visibleFrom:c,lightHidden:f,darkHidden:h,renderRoot:d,__size:p,ref:v,...b}){var q,R;const w=ui(),k=e||"div",{styleProps:_,rest:C}=Du(b),x=(R=(q=lX())==null?void 0:q())==null?void 0:R(_.sx),E=cy(),j=nZ({styleProps:_,theme:w,data:LX}),O=cX(),M=O&&j.hasResponsiveStyles?zX(j.styles,j.media):E,N={ref:v,style:aZ({theme:w,style:n,vars:t,styleProps:j.inlineStyles}),className:pn(i,x,{[M]:j.hasResponsiveStyles,"mantine-light-hidden":f,"mantine-dark-hidden":h,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${c}`]:c}),"data-variant":r,"data-size":gz(o)?void 0:o||void 0,size:p,...Iz(a),...C};return g.jsxs(g.Fragment,{children:[j.hasResponsiveStyles&&g.jsx(Nf,{selector:`.${M}`,styles:j.styles,media:j.media,deduplicate:O}),typeof d=="function"?d(N):g.jsx(k,{...N})]})}Bz.displayName="@mantine/core/Box";const he=iZ(Bz),oZ=A.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Ru(){return A.use(oZ)}const[sZ,Ca]=Xr("ScrollArea.Root component was not found in tree");function hl(e,n){const t=A.useEffectEvent(n);ps(()=>{let i=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(t)});return r.observe(e),()=>{window.cancelAnimationFrame(i),r.unobserve(e)}}},[e])}function lZ(e){const{style:n,...t}=e,i=Ca(),[r,a]=A.useState(0),[o,l]=A.useState(0),c=!!(r&&o);return hl(i.scrollbarX,()=>{var h;const f=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(f),l(f)}),hl(i.scrollbarY,()=>{var h;const f=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(f),a(f)}),c?g.jsx("div",{...t,style:{...n,width:r,height:o}}):null}function uZ(e){const n=Ca(),t=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&t?g.jsx(lZ,{...e}):null}const cZ={scrollHideDelay:1e3,type:"hover"};function Fz(e){const{type:n,scrollHideDelay:t,scrollbars:i,getStyles:r,ref:a,...o}=be("ScrollAreaRoot",cZ,e),[l,c]=A.useState(null),[f,h]=A.useState(null),[d,p]=A.useState(null),[v,b]=A.useState(null),[w,k]=A.useState(null),[_,C]=A.useState(0),[x,E]=A.useState(0),[j,O]=A.useState(!1),[M,N]=A.useState(!1),q=Kt(a,R=>c(R));return g.jsx(sZ,{value:{type:n,scrollHideDelay:t,scrollArea:l,viewport:f,onViewportChange:h,content:d,onContentChange:p,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:j,onScrollbarXEnabledChange:O,scrollbarY:w,onScrollbarYChange:k,scrollbarYEnabled:M,onScrollbarYEnabledChange:N,onCornerWidthChange:C,onCornerHeightChange:E,getStyles:r},children:g.jsx(he,{...o,ref:q,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${_}px`,"--sa-corner-height":i!=="xy"?"0px":`${x}px`}})})}Fz.displayName="@mantine/core/ScrollAreaRoot";function qz(e,n){const t=e/n;return Number.isNaN(t)?0:t}function dy(e){const n=qz(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-t)*n;return Math.max(i,18)}function Hz(e,n){return t=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const i=(n[1]-n[0])/(e[1]-e[0]);return n[0]+i*(t-e[0])}}function fZ(e,[n,t]){return Math.min(t,Math.max(n,e))}function R5(e,n,t="ltr"){const i=dy(n),r=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,a=n.scrollbar.size-r,o=n.content-n.viewport,l=a-i,c=fZ(e,t==="ltr"?[0,o]:[o*-1,0]);return Hz([0,o],[0,l])(c)}function dZ(e,n,t,i="ltr"){const r=dy(t),a=r/2,o=n||a,l=r-o,c=t.scrollbar.paddingStart+o,f=t.scrollbar.size-t.scrollbar.paddingEnd-l,h=t.content-t.viewport,d=i==="ltr"?[0,h]:[h*-1,0];return Hz([c,f],d)(e)}function Uz(e,n){return e>0&&e{e==null||e(i),(t===!1||!i.defaultPrevented)&&(n==null||n(i))}}const[hZ,Vz]=Xr("ScrollAreaScrollbar was not found in tree");function Wz(e){const{sizes:n,hasThumb:t,onThumbChange:i,onThumbPointerUp:r,onThumbPointerDown:a,onThumbPositionChange:o,onDragScroll:l,onWheelScroll:c,onResize:f,ref:h,...d}=e,p=Ca(),[v,b]=A.useState(null),w=Kt(h,N=>b(N)),k=A.useRef(null),_=A.useRef(""),{viewport:C}=p,x=n.content-n.viewport,E=A.useEffectEvent(c),j=xh(o),O=ly(f,10),M=N=>{k.current&&l({x:N.clientX-k.current.left,y:N.clientY-k.current.top})};return A.useEffect(()=>{const N=q=>{const R=q.target;v!=null&&v.contains(R)&&E(q,x)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[C,v,x]),A.useEffect(j,[n,j]),hl(v,O),hl(p.content,O),g.jsx(hZ,{value:{scrollbar:v,hasThumb:t,onThumbChange:xh(i),onThumbPointerUp:xh(r),onThumbPositionChange:j,onThumbPointerDown:xh(a)},children:g.jsx("div",{...d,ref:w,"data-mantine-scrollbar":!0,style:{position:"absolute",...d.style},onPointerDown:mu(e.onPointerDown,N=>{N.preventDefault(),N.button===0&&(N.target.setPointerCapture(N.pointerId),k.current=v.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(N))}),onPointerMove:mu(e.onPointerMove,M),onPointerUp:mu(e.onPointerUp,N=>{const q=N.target;q.hasPointerCapture(N.pointerId)&&(N.preventDefault(),q.releasePointerCapture(N.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=_.current,k.current=null}})})}const Gz=e=>{const{sizes:n,onSizesChange:t,style:i,ref:r,...a}=e,o=Ca(),[l,c]=A.useState(),f=A.useRef(null),h=Kt(r,f,o.onScrollbarXChange);return A.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),g.jsx(Wz,{"data-orientation":"horizontal",...a,ref:h,sizes:n,style:{...i,"--sa-thumb-width":`${dy(n)}px`},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(o.viewport){const v=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(v),Uz(v,p)&&d.preventDefault()}},onResize:()=>{f.current&&o.viewport&&l&&t({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Pg(l.paddingLeft),paddingEnd:Pg(l.paddingRight)}})}})};Gz.displayName="@mantine/core/ScrollAreaScrollbarX";function Yz(e){const{sizes:n,onSizesChange:t,style:i,ref:r,...a}=e,o=Ca(),[l,c]=A.useState(),f=A.useRef(null),h=Kt(r,f,o.onScrollbarYChange);return A.useEffect(()=>{f.current&&c(window.getComputedStyle(f.current))},[]),g.jsx(Wz,{...a,"data-orientation":"vertical",ref:h,sizes:n,style:{"--sa-thumb-height":`${dy(n)}px`,...i},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(o.viewport){const v=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(v),Uz(v,p)&&d.preventDefault()}},onResize:()=>{f.current&&o.viewport&&l&&t({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Pg(l.paddingTop),paddingEnd:Pg(l.paddingBottom)}})}})}Yz.displayName="@mantine/core/ScrollAreaScrollbarY";function hy(e){const{orientation:n="vertical",...t}=e,{dir:i}=Ru(),r=Ca(),a=A.useRef(null),o=A.useRef(0),[l,c]=A.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=qz(l.viewport,l.content),h={...t,sizes:l,onSizesChange:c,hasThumb:f>0&&f<1,onThumbChange:p=>{a.current=p},onThumbPointerUp:()=>{o.current=0},onThumbPointerDown:p=>{o.current=p}},d=(p,v)=>dZ(p,o.current,l,v);return n==="horizontal"?g.jsx(Gz,{...h,onThumbPositionChange:()=>{if(r.viewport&&a.current){const p=r.viewport.scrollLeft,v=R5(p,l,i);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollLeft=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollLeft=d(p,i))}}):n==="vertical"?g.jsx(Yz,{...h,onThumbPositionChange:()=>{if(r.viewport&&a.current){const p=r.viewport.scrollTop,v=R5(p,l);l.scrollbar.size===0?a.current.style.setProperty("--thumb-opacity","0"):a.current.style.setProperty("--thumb-opacity","1"),a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollTop=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollTop=d(p))}}):null}hy.displayName="@mantine/core/ScrollAreaScrollbarVisible";function G6(e){const n=Ca(),{forceMount:t,...i}=e,[r,a]=A.useState(!1),o=e.orientation==="horizontal",l=ly(()=>{if(n.viewport){const c=n.viewport.offsetWidth{const{scrollArea:o}=i;let l=0;if(o){const c=()=>{window.clearTimeout(l),a(!0)},f=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",c),o.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",c),o.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),n||r?g.jsx(G6,{"data-state":r?"visible":"hidden",...t}):null}Kz.displayName="@mantine/core/ScrollAreaScrollbarHover";function mZ(e){const{forceMount:n,...t}=e,i=Ca(),r=e.orientation==="horizontal",[a,o]=A.useState("hidden"),l=ly(()=>o("idle"),100);return A.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>o("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay]),A.useEffect(()=>{const{viewport:c}=i,f=r?"scrollLeft":"scrollTop";if(c){let h=c[f];const d=()=>{const p=c[f];h!==p&&(o("scrolling"),l()),h=p};return c.addEventListener("scroll",d),()=>c.removeEventListener("scroll",d)}},[i.viewport,r,l]),n||a!=="hidden"?g.jsx(hy,{"data-state":a==="hidden"?"hidden":"visible",...t,onPointerEnter:mu(e.onPointerEnter,()=>o("interacting")),onPointerLeave:mu(e.onPointerLeave,()=>o("idle"))}):null}function yS(e){const{forceMount:n,...t}=e,i=Ca(),{onScrollbarXEnabledChange:r,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return A.useEffect(()=>(o?r(!0):a(!0),()=>{o?r(!1):a(!1)}),[o,r,a]),i.type==="hover"?g.jsx(Kz,{...t,forceMount:n}):i.type==="scroll"?g.jsx(mZ,{...t,forceMount:n}):i.type==="auto"?g.jsx(G6,{...t,forceMount:n}):i.type==="always"?g.jsx(hy,{...t}):null}yS.displayName="@mantine/core/ScrollAreaScrollbar";function pZ(e,n=()=>{}){let t={left:e.scrollLeft,top:e.scrollTop},i=0;return(function r(){const a={left:e.scrollLeft,top:e.scrollTop},o=t.left!==a.left,l=t.top!==a.top;(o||l)&&n(),t=a,i=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(i)}function Xz(e){const{style:n,ref:t,...i}=e,r=Ca(),a=Vz(),{onThumbPositionChange:o}=a,l=Kt(t,h=>a.onThumbChange(h)),c=A.useRef(void 0),f=ly(()=>{c.current&&(c.current(),c.current=void 0)},100);return A.useEffect(()=>{const{viewport:h}=r;if(h){const d=()=>{f(),c.current||(c.current=pZ(h,o),o())};return o(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[r.viewport,f,o]),g.jsx("div",{"data-state":a.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:mu(e.onPointerDownCapture,h=>{const d=h.target.getBoundingClientRect(),p=h.clientX-d.left,v=h.clientY-d.top;a.onThumbPointerDown({x:p,y:v})}),onPointerUp:mu(e.onPointerUp,a.onThumbPointerUp)})}Xz.displayName="@mantine/core/ScrollAreaThumb";function bS(e){const{forceMount:n,...t}=e,i=Vz();return n||i.hasThumb?g.jsx(Xz,{...t}):null}bS.displayName="@mantine/core/ScrollAreaThumb";function Zz({children:e,style:n,ref:t,onWheel:i,...r}){const a=Ca(),o=Kt(t,a.onViewportChange),l=c=>{if(i==null||i(c),a.scrollbarXEnabled&&a.viewport&&c.shiftKey){const{scrollTop:f,scrollHeight:h,clientHeight:d,scrollWidth:p,clientWidth:v}=a.viewport,b=f<1,w=f>=h-d-1;p>v&&(b||w)&&c.stopPropagation()}};return g.jsx(he,{...r,ref:o,onWheel:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...n},children:g.jsx("div",{...a.getStyles("content"),ref:a.onContentChange,children:e})})}Zz.displayName="@mantine/core/ScrollAreaViewport";var Y6={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};function my(){return typeof window<"u"}function $f(e){return Qz(e)?(e.nodeName||"").toLowerCase():"#document"}function Ar(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function xo(e){var n;return(n=(Qz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Qz(e){return my()?e instanceof Node||e instanceof Ar(e).Node:!1}function Wt(e){return my()?e instanceof Element||e instanceof Ar(e).Element:!1}function Aa(e){return my()?e instanceof HTMLElement||e instanceof Ar(e).HTMLElement:!1}function wS(e){return!my()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ar(e).ShadowRoot}function Km(e){const{overflow:n,overflowX:t,overflowY:i,display:r}=_a(e);return/auto|scroll|overlay|hidden|clip/.test(n+i+t)&&r!=="inline"&&r!=="contents"}function vZ(e){return/^(table|td|th)$/.test($f(e))}function py(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const gZ=/transform|translate|scale|rotate|perspective|filter/,yZ=/paint|layout|strict|content/,Zl=e=>!!e&&e!=="none";let pk;function K6(e){const n=Wt(e)?_a(e):e;return Zl(n.transform)||Zl(n.translate)||Zl(n.scale)||Zl(n.rotate)||Zl(n.perspective)||!vy()&&(Zl(n.backdropFilter)||Zl(n.filter))||gZ.test(n.willChange||"")||yZ.test(n.contain||"")}function bZ(e){let n=us(e);for(;Aa(n)&&!ts(n);){if(K6(n))return n;if(py(n))return null;n=us(n)}return null}function vy(){return pk==null&&(pk=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pk}function ts(e){return/^(html|body|#document)$/.test($f(e))}function _a(e){return Ar(e).getComputedStyle(e)}function gy(e){return Wt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function us(e){if($f(e)==="html")return e;const n=e.assignedSlot||e.parentNode||wS(e)&&e.host||xo(e);return wS(n)?n.host:n}function Jz(e){const n=us(e);return ts(n)?e.ownerDocument?e.ownerDocument.body:e.body:Aa(n)&&Km(n)?n:Jz(n)}function is(e,n,t){var i;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=Jz(e),a=r===((i=e.ownerDocument)==null?void 0:i.body),o=Ar(r);if(a){const l=kS(o);return n.concat(o,o.visualViewport||[],Km(r)?r:[],l&&t?is(l):[])}else return n.concat(r,is(r,[],t))}function kS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const wZ=["top","right","bottom","left"],Ua=Math.min,Zi=Math.max,Ng=Math.round,zv=Math.floor,lo=e=>({x:e,y:e}),kZ={left:"right",right:"left",bottom:"top",top:"bottom"};function _S(e,n,t){return Zi(e,Ua(n,t))}function po(e,n){return typeof e=="function"?e(n):e}function Va(e){return e.split("-")[0]}function zf(e){return e.split("-")[1]}function X6(e){return e==="x"?"y":"x"}function Z6(e){return e==="y"?"height":"width"}function Ba(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function Q6(e){return X6(Ba(e))}function _Z(e,n,t){t===void 0&&(t=!1);const i=zf(e),r=Q6(e),a=Z6(r);let o=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[a]>n.floating[a]&&(o=$g(o)),[o,$g(o)]}function xZ(e){const n=$g(e);return[xS(e),n,xS(n)]}function xS(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const P5=["left","right"],N5=["right","left"],SZ=["top","bottom"],CZ=["bottom","top"];function AZ(e,n,t){switch(e){case"top":case"bottom":return t?n?N5:P5:n?P5:N5;case"left":case"right":return n?SZ:CZ;default:return[]}}function jZ(e,n,t,i){const r=zf(e);let a=AZ(Va(e),t==="start",i);return r&&(a=a.map(o=>o+"-"+r),n&&(a=a.concat(a.map(xS)))),a}function $g(e){const n=Va(e);return kZ[n]+e.slice(n.length)}function OZ(e){return{top:0,right:0,bottom:0,left:0,...e}}function J6(e){return typeof e!="number"?OZ(e):{top:e,right:e,bottom:e,left:e}}function nf(e){const{x:n,y:t,width:i,height:r}=e;return{width:i,height:r,top:t,left:n,right:n+i,bottom:t+r,x:n,y:t}}function EZ(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function TZ(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(n=>{let{brand:t,version:i}=n;return t+"/"+i}).join(" "):navigator.userAgent}function MZ(){return/apple/i.test(navigator.vendor)}function DZ(){return EZ().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function RZ(){return TZ().includes("jsdom/")}const $5="data-floating-ui-focusable",PZ="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function z5(e){let n=e.activeElement;for(;((t=n)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;n=n.shadowRoot.activeElement}return n}function Qh(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&wS(t)){let i=n;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function Ic(e){return"composedPath"in e?e.composedPath()[0]:e.target}function vk(e,n){if(n==null)return!1;if("composedPath"in e)return e.composedPath().includes(n);const t=e;return t.target!=null&&n.contains(t.target)}function NZ(e){return e.matches("html,body")}function su(e){return(e==null?void 0:e.ownerDocument)||document}function $Z(e){return Aa(e)&&e.matches(PZ)}function zZ(e){if(!e||RZ())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function LZ(e){return e?e.hasAttribute($5)?e:e.querySelector("["+$5+"]")||e:null}function vg(e,n,t){return t===void 0&&(t=!0),e.filter(r=>{var a;return r.parentId===n&&(!t||((a=r.context)==null?void 0:a.open))}).flatMap(r=>[r,...vg(e,r.id,t)])}function IZ(e){return"nativeEvent"in e}function SS(e,n){const t=["mouse","pen"];return t.push("",void 0),t.includes(e)}var BZ=typeof document<"u",FZ=function(){},uo=BZ?A.useLayoutEffect:FZ;const qZ={...yz};function Lv(e){const n=A.useRef(e);return uo(()=>{n.current=e}),n}const HZ=qZ.useInsertionEffect,UZ=HZ||(e=>e());function ro(e){const n=A.useRef(()=>{});return UZ(()=>{n.current=e}),A.useCallback(function(){for(var t=arguments.length,i=new Array(t),r=0;r{const{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:o}=t,l=o.detectOverflow?o:{...o,detectOverflow:VZ},c=await(o.isRTL==null?void 0:o.isRTL(n));let f=await o.getElementRects({reference:e,floating:n,strategy:r}),{x:h,y:d}=L5(f,i,c),p=i,v=0;const b={};for(let w=0;w({name:"arrow",options:e,async fn(n){const{x:t,y:i,placement:r,rects:a,platform:o,elements:l,middlewareData:c}=n,{element:f,padding:h=0}=po(e,n)||{};if(f==null)return{};const d=J6(h),p={x:t,y:i},v=Q6(r),b=Z6(v),w=await o.getDimensions(f),k=v==="y",_=k?"top":"left",C=k?"bottom":"right",x=k?"clientHeight":"clientWidth",E=a.reference[b]+a.reference[v]-p[v]-a.floating[b],j=p[v]-a.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let M=O?O[x]:0;(!M||!await(o.isElement==null?void 0:o.isElement(O)))&&(M=l.floating[x]||a.floating[b]);const N=E/2-j/2,q=M/2-w[b]/2-1,R=Ua(d[_],q),L=Ua(d[C],q),F=R,Y=M-w[b]-L,V=M/2-w[b]/2+N,$=_S(F,V,Y),P=!c.arrow&&zf(r)!=null&&V!==$&&a.reference[b]/2-(VV<=0)){var L,F;const V=(((L=a.flip)==null?void 0:L.index)||0)+1,$=M[V];if($&&(!(d==="alignment"?C!==Ba($):!1)||R.every(H=>Ba(H.placement)===C?H.overflows[0]>0:!0)))return{data:{index:V,overflows:R},reset:{placement:$}};let P=(F=R.filter(I=>I.overflows[0]<=0).sort((I,H)=>I.overflows[1]-H.overflows[1])[0])==null?void 0:F.placement;if(!P)switch(v){case"bestFit":{var Y;const I=(Y=R.filter(H=>{if(O){const U=Ba(H.placement);return U===C||U==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(U=>U>0).reduce((U,D)=>U+D,0)]).sort((H,U)=>H[1]-U[1])[0])==null?void 0:Y[0];I&&(P=I);break}case"initialPlacement":P=l;break}if(r!==P)return{reset:{placement:P}}}return{}}}};function I5(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function B5(e){return wZ.some(n=>e[n]>=0)}const XZ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:t,platform:i}=n,{strategy:r="referenceHidden",...a}=po(e,n);switch(r){case"referenceHidden":{const o=await i.detectOverflow(n,{...a,elementContext:"reference"}),l=I5(o,t.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:B5(l)}}}case"escaped":{const o=await i.detectOverflow(n,{...a,altBoundary:!0}),l=I5(o,t.floating);return{data:{escapedOffsets:l,escaped:B5(l)}}}default:return{}}}}};function eL(e){const n=Ua(...e.map(a=>a.left)),t=Ua(...e.map(a=>a.top)),i=Zi(...e.map(a=>a.right)),r=Zi(...e.map(a=>a.bottom));return{x:n,y:t,width:i-n,height:r-t}}function ZZ(e){const n=e.slice().sort((r,a)=>r.y-a.y),t=[];let i=null;for(let r=0;ri.height/2?t.push([a]):t[t.length-1].push(a),i=a}return t.map(r=>nf(eL(r)))}const QZ=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(n){const{placement:t,elements:i,rects:r,platform:a,strategy:o}=n,{padding:l=2,x:c,y:f}=po(e,n),h=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(i.reference))||[]),d=ZZ(h),p=nf(eL(h)),v=J6(l);function b(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&f!=null)return d.find(k=>c>k.left-v.left&&ck.top-v.top&&f=2){if(Ba(t)==="y"){const R=d[0],L=d[d.length-1],F=Va(t)==="top",Y=R.top,V=L.bottom,$=F?R.left:L.left,P=F?R.right:L.right,I=P-$,H=V-Y;return{top:Y,bottom:V,left:$,right:P,width:I,height:H,x:$,y:Y}}const k=Va(t)==="left",_=Zi(...d.map(R=>R.right)),C=Ua(...d.map(R=>R.left)),x=d.filter(R=>k?R.left===C:R.right===_),E=x[0].top,j=x[x.length-1].bottom,O=C,M=_,N=M-O,q=j-E;return{top:E,bottom:j,left:O,right:M,width:N,height:q,x:O,y:E}}return p}const w=await a.getElementRects({reference:{getBoundingClientRect:b},floating:i.floating,strategy:o});return r.reference.x!==w.reference.x||r.reference.y!==w.reference.y||r.reference.width!==w.reference.width||r.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},nL=new Set(["left","top"]);async function JZ(e,n){const{placement:t,platform:i,elements:r}=e,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=Va(t),l=zf(t),c=Ba(t)==="y",f=nL.has(o)?-1:1,h=a&&c?-1:1,d=po(n,e);let{mainAxis:p,crossAxis:v,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),c?{x:v*h,y:p*f}:{x:p*f,y:v*h}}const eQ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var t,i;const{x:r,y:a,placement:o,middlewareData:l}=n,c=await JZ(n,e);return o===((t=l.offset)==null?void 0:t.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:a+c.y,data:{...c,placement:o}}}}},nQ=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:i,placement:r,platform:a}=n,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:_=>{let{x:C,y:x}=_;return{x:C,y:x}}},...f}=po(e,n),h={x:t,y:i},d=await a.detectOverflow(n,f),p=Ba(Va(r)),v=X6(p);let b=h[v],w=h[p];if(o){const _=v==="y"?"top":"left",C=v==="y"?"bottom":"right",x=b+d[_],E=b-d[C];b=_S(x,b,E)}if(l){const _=p==="y"?"top":"left",C=p==="y"?"bottom":"right",x=w+d[_],E=w-d[C];w=_S(x,w,E)}const k=c.fn({...n,[v]:b,[p]:w});return{...k,data:{x:k.x-t,y:k.y-i,enabled:{[v]:o,[p]:l}}}}}},tQ=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:t,y:i,placement:r,rects:a,middlewareData:o}=n,{offset:l=0,mainAxis:c=!0,crossAxis:f=!0}=po(e,n),h={x:t,y:i},d=Ba(r),p=X6(d);let v=h[p],b=h[d];const w=po(l,n),k=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const x=p==="y"?"height":"width",E=a.reference[p]-a.floating[x]+k.mainAxis,j=a.reference[p]+a.reference[x]-k.mainAxis;vj&&(v=j)}if(f){var _,C;const x=p==="y"?"width":"height",E=nL.has(Va(r)),j=a.reference[d]-a.floating[x]+(E&&((_=o.offset)==null?void 0:_[d])||0)+(E?0:k.crossAxis),O=a.reference[d]+a.reference[x]+(E?0:((C=o.offset)==null?void 0:C[d])||0)-(E?k.crossAxis:0);bO&&(b=O)}return{[p]:v,[d]:b}}}},iQ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var t,i;const{placement:r,rects:a,platform:o,elements:l}=n,{apply:c=()=>{},...f}=po(e,n),h=await o.detectOverflow(n,f),d=Va(r),p=zf(r),v=Ba(r)==="y",{width:b,height:w}=a.floating;let k,_;d==="top"||d==="bottom"?(k=d,_=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(_=d,k=p==="end"?"top":"bottom");const C=w-h.top-h.bottom,x=b-h.left-h.right,E=Ua(w-h[k],C),j=Ua(b-h[_],x),O=!n.middlewareData.shift;let M=E,N=j;if((t=n.middlewareData.shift)!=null&&t.enabled.x&&(N=x),(i=n.middlewareData.shift)!=null&&i.enabled.y&&(M=C),O&&!p){const R=Zi(h.left,0),L=Zi(h.right,0),F=Zi(h.top,0),Y=Zi(h.bottom,0);v?N=b-2*(R!==0||L!==0?R+L:Zi(h.left,h.right)):M=w-2*(F!==0||Y!==0?F+Y:Zi(h.top,h.bottom))}await c({...n,availableWidth:N,availableHeight:M});const q=await o.getDimensions(l.floating);return b!==q.width||w!==q.height?{reset:{rects:!0}}:{}}}};function tL(e){const n=_a(e);let t=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const r=Aa(e),a=r?e.offsetWidth:t,o=r?e.offsetHeight:i,l=Ng(t)!==a||Ng(i)!==o;return l&&(t=a,i=o),{width:t,height:i,$:l}}function eC(e){return Wt(e)?e:e.contextElement}function Wc(e){const n=eC(e);if(!Aa(n))return lo(1);const t=n.getBoundingClientRect(),{width:i,height:r,$:a}=tL(n);let o=(a?Ng(t.width):t.width)/i,l=(a?Ng(t.height):t.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const rQ=lo(0);function iL(e){const n=Ar(e);return!vy()||!n.visualViewport?rQ:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function aQ(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==Ar(e)?!1:n}function gu(e,n,t,i){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),a=eC(e);let o=lo(1);n&&(i?Wt(i)&&(o=Wc(i)):o=Wc(e));const l=aQ(a,t,i)?iL(a):lo(0);let c=(r.left+l.x)/o.x,f=(r.top+l.y)/o.y,h=r.width/o.x,d=r.height/o.y;if(a){const p=Ar(a),v=i&&Wt(i)?Ar(i):i;let b=p,w=kS(b);for(;w&&i&&v!==b;){const k=Wc(w),_=w.getBoundingClientRect(),C=_a(w),x=_.left+(w.clientLeft+parseFloat(C.paddingLeft))*k.x,E=_.top+(w.clientTop+parseFloat(C.paddingTop))*k.y;c*=k.x,f*=k.y,h*=k.x,d*=k.y,c+=x,f+=E,b=Ar(w),w=kS(b)}}return nf({width:h,height:d,x:c,y:f})}function yy(e,n){const t=gy(e).scrollLeft;return n?n.left+t:gu(xo(e)).left+t}function rL(e,n){const t=e.getBoundingClientRect(),i=t.left+n.scrollLeft-yy(e,t),r=t.top+n.scrollTop;return{x:i,y:r}}function oQ(e){let{elements:n,rect:t,offsetParent:i,strategy:r}=e;const a=r==="fixed",o=xo(i),l=n?py(n.floating):!1;if(i===o||l&&a)return t;let c={scrollLeft:0,scrollTop:0},f=lo(1);const h=lo(0),d=Aa(i);if((d||!d&&!a)&&(($f(i)!=="body"||Km(o))&&(c=gy(i)),d)){const v=gu(i);f=Wc(i),h.x=v.x+i.clientLeft,h.y=v.y+i.clientTop}const p=o&&!d&&!a?rL(o,c):lo(0);return{width:t.width*f.x,height:t.height*f.y,x:t.x*f.x-c.scrollLeft*f.x+h.x+p.x,y:t.y*f.y-c.scrollTop*f.y+h.y+p.y}}function sQ(e){return Array.from(e.getClientRects())}function lQ(e){const n=xo(e),t=gy(e),i=e.ownerDocument.body,r=Zi(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=Zi(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let o=-t.scrollLeft+yy(e);const l=-t.scrollTop;return _a(i).direction==="rtl"&&(o+=Zi(n.clientWidth,i.clientWidth)-r),{width:r,height:a,x:o,y:l}}const F5=25;function uQ(e,n){const t=Ar(e),i=xo(e),r=t.visualViewport;let a=i.clientWidth,o=i.clientHeight,l=0,c=0;if(r){a=r.width,o=r.height;const h=vy();(!h||h&&n==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const f=yy(i);if(f<=0){const h=i.ownerDocument,d=h.body,p=getComputedStyle(d),v=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,b=Math.abs(i.clientWidth-d.clientWidth-v);b<=F5&&(a-=b)}else f<=F5&&(a+=f);return{width:a,height:o,x:l,y:c}}function cQ(e,n){const t=gu(e,!0,n==="fixed"),i=t.top+e.clientTop,r=t.left+e.clientLeft,a=Aa(e)?Wc(e):lo(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=r*a.x,f=i*a.y;return{width:o,height:l,x:c,y:f}}function q5(e,n,t){let i;if(n==="viewport")i=uQ(e,t);else if(n==="document")i=lQ(xo(e));else if(Wt(n))i=cQ(n,t);else{const r=iL(e);i={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return nf(i)}function aL(e,n){const t=us(e);return t===n||!Wt(t)||ts(t)?!1:_a(t).position==="fixed"||aL(t,n)}function fQ(e,n){const t=n.get(e);if(t)return t;let i=is(e,[],!1).filter(l=>Wt(l)&&$f(l)!=="body"),r=null;const a=_a(e).position==="fixed";let o=a?us(e):e;for(;Wt(o)&&!ts(o);){const l=_a(o),c=K6(o);!c&&l.position==="fixed"&&(r=null),(a?!c&&!r:!c&&l.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Km(o)&&!c&&aL(e,o))?i=i.filter(h=>h!==o):r=l,o=us(o)}return n.set(e,i),i}function dQ(e){let{element:n,boundary:t,rootBoundary:i,strategy:r}=e;const o=[...t==="clippingAncestors"?py(n)?[]:fQ(n,this._c):[].concat(t),i],l=q5(n,o[0],r);let c=l.top,f=l.right,h=l.bottom,d=l.left;for(let p=1;p{o(!1,1e-7)},1e3)}M===1&&!sL(f,e.getBoundingClientRect())&&o(),E=!1}try{t=new IntersectionObserver(j,{...x,root:r.ownerDocument})}catch{t=new IntersectionObserver(j,x)}t.observe(e)}return o(!0),a}function CS(e,n,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,f=eC(e),h=r||a?[...f?is(f):[],...n?is(n):[]]:[];h.forEach(_=>{r&&_.addEventListener("scroll",t,{passive:!0}),a&&_.addEventListener("resize",t)});const d=f&&l?yQ(f,t):null;let p=-1,v=null;o&&(v=new ResizeObserver(_=>{let[C]=_;C&&C.target===f&&v&&n&&(v.unobserve(n),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=v)==null||x.observe(n)})),t()}),f&&!c&&v.observe(f),n&&v.observe(n));let b,w=c?gu(e):null;c&&k();function k(){const _=gu(e);w&&!sL(w,_)&&t(),w=_,b=requestAnimationFrame(k)}return t(),()=>{var _;h.forEach(C=>{r&&C.removeEventListener("scroll",t),a&&C.removeEventListener("resize",t)}),d==null||d(),(_=v)==null||_.disconnect(),v=null,c&&cancelAnimationFrame(b)}}const bQ=eQ,wQ=nQ,kQ=KZ,_Q=iQ,xQ=XZ,U5=YZ,SQ=QZ,CQ=tQ,AQ=(e,n,t)=>{const i=new Map,r={platform:gQ,...t},a={...r.platform,_c:i};return GZ(e,n,{...r,platform:a})};var jQ=typeof document<"u",OQ=function(){},gg=jQ?A.useLayoutEffect:OQ;function zg(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,i,r;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==n.length)return!1;for(i=t;i--!==0;)if(!zg(e[i],n[i]))return!1;return!0}if(r=Object.keys(e),t=r.length,t!==Object.keys(n).length)return!1;for(i=t;i--!==0;)if(!{}.hasOwnProperty.call(n,r[i]))return!1;for(i=t;i--!==0;){const a=r[i];if(!(a==="_owner"&&e.$$typeof)&&!zg(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}function lL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function V5(e,n){const t=lL(e);return Math.round(n*t)/t}function yk(e){const n=A.useRef(e);return gg(()=>{n.current=e}),n}function EQ(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:i=[],platform:r,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:f}=e,[h,d]=A.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[p,v]=A.useState(i);zg(p,i)||v(i);const[b,w]=A.useState(null),[k,_]=A.useState(null),C=A.useCallback(H=>{H!==O.current&&(O.current=H,w(H))},[]),x=A.useCallback(H=>{H!==M.current&&(M.current=H,_(H))},[]),E=a||b,j=o||k,O=A.useRef(null),M=A.useRef(null),N=A.useRef(h),q=c!=null,R=yk(c),L=yk(r),F=yk(f),Y=A.useCallback(()=>{if(!O.current||!M.current)return;const H={placement:n,strategy:t,middleware:p};L.current&&(H.platform=L.current),AQ(O.current,M.current,H).then(U=>{const D={...U,isPositioned:F.current!==!1};V.current&&!zg(N.current,D)&&(N.current=D,il.flushSync(()=>{d(D)}))})},[p,n,t,L,F]);gg(()=>{f===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d(H=>({...H,isPositioned:!1})))},[f]);const V=A.useRef(!1);gg(()=>(V.current=!0,()=>{V.current=!1}),[]),gg(()=>{if(E&&(O.current=E),j&&(M.current=j),E&&j){if(R.current)return R.current(E,j,Y);Y()}},[E,j,Y,R,q]);const $=A.useMemo(()=>({reference:O,floating:M,setReference:C,setFloating:x}),[C,x]),P=A.useMemo(()=>({reference:E,floating:j}),[E,j]),I=A.useMemo(()=>{const H={position:t,left:0,top:0};if(!P.floating)return H;const U=V5(P.floating,h.x),D=V5(P.floating,h.y);return l?{...H,transform:"translate("+U+"px, "+D+"px)",...lL(P.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:U,top:D}},[t,l,P.floating,h.x,h.y]);return A.useMemo(()=>({...h,update:Y,refs:$,elements:P,floatingStyles:I}),[h,Y,$,P,I])}const TQ=e=>{function n(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:e,fn(t){const{element:i,padding:r}=typeof e=="function"?e(t):e;return i&&n(i)?i.current!=null?U5({element:i.current,padding:r}).fn(t):{}:i?U5({element:i,padding:r}).fn(t):{}}}},uL=(e,n)=>{const t=bQ(e);return{name:t.name,fn:t.fn,options:[e,n]}},nC=(e,n)=>{const t=wQ(e);return{name:t.name,fn:t.fn,options:[e,n]}},W5=(e,n)=>({fn:CQ(e).fn,options:[e,n]}),Lg=(e,n)=>{const t=kQ(e);return{name:t.name,fn:t.fn,options:[e,n]}},MQ=(e,n)=>{const t=_Q(e);return{name:t.name,fn:t.fn,options:[e,n]}},DQ=(e,n)=>{const t=xQ(e);return{name:t.name,fn:t.fn,options:[e,n]}},Nh=(e,n)=>{const t=SQ(e);return{name:t.name,fn:t.fn,options:[e,n]}},cL=(e,n)=>{const t=TQ(e);return{name:t.name,fn:t.fn,options:[e,n]}};function fL(e){const n=A.useRef(void 0),t=A.useCallback(i=>{const r=e.map(a=>{if(a!=null){if(typeof a=="function"){const o=a,l=o(i);return typeof l=="function"?l:()=>{o(null)}}return a.current=i,()=>{a.current=null}}});return()=>{r.forEach(a=>a==null?void 0:a())}},e);return A.useMemo(()=>e.every(i=>i==null)?null:i=>{n.current&&(n.current(),n.current=void 0),i!=null&&(n.current=t(i))},e)}const RQ="data-floating-ui-focusable",G5="active",Y5="selected",PQ={...yz};let K5=!1,NQ=0;const X5=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+NQ++;function $Q(){const[e,n]=A.useState(()=>K5?X5():void 0);return uo(()=>{e==null&&n(X5())},[]),A.useEffect(()=>{K5=!0},[]),e}const zQ=PQ.useId,dL=zQ||$Q;function LQ(){const e=new Map;return{emit(n,t){var i;(i=e.get(n))==null||i.forEach(r=>r(t))},on(n,t){e.has(n)||e.set(n,new Set),e.get(n).add(t)},off(n,t){var i;(i=e.get(n))==null||i.delete(t)}}}const IQ=A.createContext(null),BQ=A.createContext(null),tC=()=>{var e;return((e=A.useContext(IQ))==null?void 0:e.id)||null},iC=()=>A.useContext(BQ);function rC(e){return"data-floating-ui-"+e}function ha(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Z5=rC("safe-polygon");function yg(e,n,t){if(t&&!SS(t))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const i=e();return typeof i=="number"?i:i==null?void 0:i[n]}return e==null?void 0:e[n]}function bk(e){return typeof e=="function"?e():e}function FQ(e,n){n===void 0&&(n={});const{open:t,onOpenChange:i,dataRef:r,events:a,elements:o}=e,{enabled:l=!0,delay:c=0,handleClose:f=null,mouseOnly:h=!1,restMs:d=0,move:p=!0}=n,v=iC(),b=tC(),w=Lv(f),k=Lv(c),_=Lv(t),C=Lv(d),x=A.useRef(),E=A.useRef(-1),j=A.useRef(),O=A.useRef(-1),M=A.useRef(!0),N=A.useRef(!1),q=A.useRef(()=>{}),R=A.useRef(!1),L=ro(()=>{var I;const H=(I=r.current.openEvent)==null?void 0:I.type;return(H==null?void 0:H.includes("mouse"))&&H!=="mousedown"});A.useEffect(()=>{if(!l)return;function I(H){let{open:U}=H;U||(ha(E),ha(O),M.current=!0,R.current=!1)}return a.on("openchange",I),()=>{a.off("openchange",I)}},[l,a]),A.useEffect(()=>{if(!l||!w.current||!t)return;function I(U){L()&&i(!1,U,"hover")}const H=su(o.floating).documentElement;return H.addEventListener("mouseleave",I),()=>{H.removeEventListener("mouseleave",I)}},[o.floating,t,i,l,w,L]);const F=A.useCallback(function(I,H,U){H===void 0&&(H=!0),U===void 0&&(U="hover");const D=yg(k.current,"close",x.current);D&&!j.current?(ha(E),E.current=window.setTimeout(()=>i(!1,I,U),D)):H&&(ha(E),i(!1,I,U))},[k,i]),Y=ro(()=>{q.current(),j.current=void 0}),V=ro(()=>{if(N.current){const I=su(o.floating).body;I.style.pointerEvents="",I.removeAttribute(Z5),N.current=!1}}),$=ro(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);A.useEffect(()=>{if(!l)return;function I(G){if(ha(E),M.current=!1,h&&!SS(x.current)||bk(C.current)>0&&!yg(k.current,"open"))return;const z=yg(k.current,"open",x.current);z?E.current=window.setTimeout(()=>{_.current||i(!0,G,"hover")},z):t||i(!0,G,"hover")}function H(G){if($()){V();return}q.current();const z=su(o.floating);if(ha(O),R.current=!1,w.current&&r.current.floatingContext){t||ha(E),j.current=w.current({...r.current.floatingContext,tree:v,x:G.clientX,y:G.clientY,onClose(){V(),Y(),$()||F(G,!0,"safe-polygon")}});const ee=j.current;z.addEventListener("mousemove",ee),q.current=()=>{z.removeEventListener("mousemove",ee)};return}(x.current==="touch"?!Qh(o.floating,G.relatedTarget):!0)&&F(G)}function U(G){$()||r.current.floatingContext&&(w.current==null||w.current({...r.current.floatingContext,tree:v,x:G.clientX,y:G.clientY,onClose(){V(),Y(),$()||F(G)}})(G))}function D(){ha(E)}function W(G){$()||F(G,!1)}if(Wt(o.domReference)){const G=o.domReference,z=o.floating;return t&&G.addEventListener("mouseleave",U),p&&G.addEventListener("mousemove",I,{once:!0}),G.addEventListener("mouseenter",I),G.addEventListener("mouseleave",H),z&&(z.addEventListener("mouseleave",U),z.addEventListener("mouseenter",D),z.addEventListener("mouseleave",W)),()=>{t&&G.removeEventListener("mouseleave",U),p&&G.removeEventListener("mousemove",I),G.removeEventListener("mouseenter",I),G.removeEventListener("mouseleave",H),z&&(z.removeEventListener("mouseleave",U),z.removeEventListener("mouseenter",D),z.removeEventListener("mouseleave",W))}}},[o,l,e,h,p,F,Y,V,i,t,_,v,k,w,r,$,C]),uo(()=>{var I;if(l&&t&&(I=w.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&L()){N.current=!0;const U=o.floating;if(Wt(o.domReference)&&U){var H;const D=su(o.floating).body;D.setAttribute(Z5,"");const W=o.domReference,G=v==null||(H=v.nodesRef.current.find(z=>z.id===b))==null||(H=H.context)==null?void 0:H.elements.floating;return G&&(G.style.pointerEvents=""),D.style.pointerEvents="none",W.style.pointerEvents="auto",U.style.pointerEvents="auto",()=>{D.style.pointerEvents="",W.style.pointerEvents="",U.style.pointerEvents=""}}}},[l,t,b,o,v,w,L]),uo(()=>{t||(x.current=void 0,R.current=!1,Y(),V())},[t,Y,V]),A.useEffect(()=>()=>{Y(),ha(E),ha(O),V()},[l,o.domReference,Y,V]);const P=A.useMemo(()=>{function I(H){x.current=H.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(H){const{nativeEvent:U}=H;function D(){!M.current&&!_.current&&i(!0,U,"hover")}h&&!SS(x.current)||t||bk(C.current)===0||R.current&&H.movementX**2+H.movementY**2<2||(ha(O),x.current==="touch"?D():(R.current=!0,O.current=window.setTimeout(D,bk(C.current))))}}},[h,i,t,_,C]);return A.useMemo(()=>l?{reference:P}:{},[l,P])}const AS=()=>{},hL=A.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:AS,setState:AS,isInstantPhase:!1}),qQ=()=>A.useContext(hL);function HQ(e){const{children:n,delay:t,timeoutMs:i=0}=e,[r,a]=A.useReducer((c,f)=>({...c,...f}),{delay:t,timeoutMs:i,initialDelay:t,currentId:null,isInstantPhase:!1}),o=A.useRef(null),l=A.useCallback(c=>{a({currentId:c})},[]);return uo(()=>{r.currentId?o.current===null?o.current=r.currentId:r.isInstantPhase||a({isInstantPhase:!0}):(r.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[r.currentId,r.isInstantPhase]),g.jsx(hL.Provider,{value:A.useMemo(()=>({...r,setState:a,setCurrentId:l}),[r,l]),children:n})}function UQ(e,n){n===void 0&&(n={});const{open:t,onOpenChange:i,floatingId:r}=e,{id:a,enabled:o=!0}=n,l=a??r,c=qQ(),{currentId:f,setCurrentId:h,initialDelay:d,setState:p,timeoutMs:v}=c;return uo(()=>{o&&f&&(p({delay:{open:1,close:yg(d,"close")}}),f!==l&&i(!1))},[o,l,i,p,f,d]),uo(()=>{function b(){i(!1),p({delay:d,currentId:null})}if(o&&f&&!t&&f===l){if(v){const w=window.setTimeout(b,v);return()=>{clearTimeout(w)}}b()}},[o,t,p,f,l,i,d,v]),uo(()=>{o&&(h===AS||!t||h(l))},[o,t,h,l]),c}const VQ={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},WQ={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Q5=e=>{var n,t;return{escapeKey:typeof e=="boolean"?e:(n=e==null?void 0:e.escapeKey)!=null?n:!1,outsidePress:typeof e=="boolean"?e:(t=e==null?void 0:e.outsidePress)!=null?t:!0}};function GQ(e,n){n===void 0&&(n={});const{open:t,onOpenChange:i,elements:r,dataRef:a}=e,{enabled:o=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:f="pointerdown",referencePress:h=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:v,capture:b}=n,w=iC(),k=ro(typeof c=="function"?c:()=>!1),_=typeof c=="function"?k:c,C=A.useRef(!1),{escapeKey:x,outsidePress:E}=Q5(v),{escapeKey:j,outsidePress:O}=Q5(b),M=A.useRef(!1),N=ro(V=>{var $;if(!t||!o||!l||V.key!=="Escape"||M.current)return;const P=($=a.current.floatingContext)==null?void 0:$.nodeId,I=w?vg(w.nodesRef.current,P):[];if(!x&&(V.stopPropagation(),I.length>0)){let H=!0;if(I.forEach(U=>{var D;if((D=U.context)!=null&&D.open&&!U.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}i(!1,IZ(V)?V.nativeEvent:V,"escape-key")}),q=ro(V=>{var $;const P=()=>{var I;N(V),(I=Ic(V))==null||I.removeEventListener("keydown",P)};($=Ic(V))==null||$.addEventListener("keydown",P)}),R=ro(V=>{var $;const P=a.current.insideReactTree;a.current.insideReactTree=!1;const I=C.current;if(C.current=!1,f==="click"&&I||P||typeof _=="function"&&!_(V))return;const H=Ic(V),U="["+rC("inert")+"]",D=su(r.floating).querySelectorAll(U);let W=Wt(H)?H:null;for(;W&&!ts(W);){const ee=us(W);if(ts(ee)||!Wt(ee))break;W=ee}if(D.length&&Wt(H)&&!NZ(H)&&!Qh(H,r.floating)&&Array.from(D).every(ee=>!Qh(W,ee)))return;if(Aa(H)&&Y){const ee=ts(H),re=_a(H),le=/auto|scroll/,ye=ee||le.test(re.overflowX),ae=ee||le.test(re.overflowY),ue=ye&&H.clientWidth>0&&H.scrollWidth>H.clientWidth,Se=ae&&H.clientHeight>0&&H.scrollHeight>H.clientHeight,ne=re.direction==="rtl",Le=Se&&(ne?V.offsetX<=H.offsetWidth-H.clientWidth:V.offsetX>H.clientWidth),ke=ue&&V.offsetY>H.clientHeight;if(Le||ke)return}const G=($=a.current.floatingContext)==null?void 0:$.nodeId,z=w&&vg(w.nodesRef.current,G).some(ee=>{var re;return vk(V,(re=ee.context)==null?void 0:re.elements.floating)});if(vk(V,r.floating)||vk(V,r.domReference)||z)return;const X=w?vg(w.nodesRef.current,G):[];if(X.length>0){let ee=!0;if(X.forEach(re=>{var le;if((le=re.context)!=null&&le.open&&!re.context.dataRef.current.__outsidePressBubbles){ee=!1;return}}),!ee)return}i(!1,V,"outside-press")}),L=ro(V=>{var $;const P=()=>{var I;R(V),(I=Ic(V))==null||I.removeEventListener(f,P)};($=Ic(V))==null||$.addEventListener(f,P)});A.useEffect(()=>{if(!t||!o)return;a.current.__escapeKeyBubbles=x,a.current.__outsidePressBubbles=E;let V=-1;function $(D){i(!1,D,"ancestor-scroll")}function P(){window.clearTimeout(V),M.current=!0}function I(){V=window.setTimeout(()=>{M.current=!1},vy()?5:0)}const H=su(r.floating);l&&(H.addEventListener("keydown",j?q:N,j),H.addEventListener("compositionstart",P),H.addEventListener("compositionend",I)),_&&H.addEventListener(f,O?L:R,O);let U=[];return p&&(Wt(r.domReference)&&(U=is(r.domReference)),Wt(r.floating)&&(U=U.concat(is(r.floating))),!Wt(r.reference)&&r.reference&&r.reference.contextElement&&(U=U.concat(is(r.reference.contextElement)))),U=U.filter(D=>{var W;return D!==((W=H.defaultView)==null?void 0:W.visualViewport)}),U.forEach(D=>{D.addEventListener("scroll",$,{passive:!0})}),()=>{l&&(H.removeEventListener("keydown",j?q:N,j),H.removeEventListener("compositionstart",P),H.removeEventListener("compositionend",I)),_&&H.removeEventListener(f,O?L:R,O),U.forEach(D=>{D.removeEventListener("scroll",$)}),window.clearTimeout(V)}},[a,r,l,_,f,t,i,p,o,x,E,N,j,q,R,O,L]),A.useEffect(()=>{a.current.insideReactTree=!1},[a,_,f]);const F=A.useMemo(()=>({onKeyDown:N,...h&&{[VQ[d]]:V=>{i(!1,V.nativeEvent,"reference-press")},...d!=="click"&&{onClick(V){i(!1,V.nativeEvent,"reference-press")}}}}),[N,i,h,d]),Y=A.useMemo(()=>{function V($){$.button===0&&(C.current=!0)}return{onKeyDown:N,onMouseDown:V,onMouseUp:V,[WQ[f]]:()=>{a.current.insideReactTree=!0}}},[N,f,a]);return A.useMemo(()=>o?{reference:F,floating:Y}:{},[o,F,Y])}function YQ(e){const{open:n=!1,onOpenChange:t,elements:i}=e,r=dL(),a=A.useRef({}),[o]=A.useState(()=>LQ()),l=tC()!=null,[c,f]=A.useState(i.reference),h=ro((v,b,w)=>{a.current.openEvent=v?b:void 0,o.emit("openchange",{open:v,event:b,reason:w,nested:l}),t==null||t(v,b,w)}),d=A.useMemo(()=>({setPositionReference:f}),[]),p=A.useMemo(()=>({reference:c||i.reference||null,floating:i.floating||null,domReference:i.reference}),[c,i.reference,i.floating]);return A.useMemo(()=>({dataRef:a,open:n,onOpenChange:h,elements:p,events:o,floatingId:r,refs:d}),[n,h,p,o,r,d])}function aC(e){e===void 0&&(e={});const{nodeId:n}=e,t=YQ({...e,elements:{reference:null,floating:null,...e.elements}}),i=e.rootContext||t,r=i.elements,[a,o]=A.useState(null),[l,c]=A.useState(null),h=(r==null?void 0:r.domReference)||a,d=A.useRef(null),p=iC();uo(()=>{h&&(d.current=h)},[h]);const v=EQ({...e,elements:{...r,...l&&{reference:l}}}),b=A.useCallback(x=>{const E=Wt(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;c(E),v.refs.setReference(E)},[v.refs]),w=A.useCallback(x=>{(Wt(x)||x===null)&&(d.current=x,o(x)),(Wt(v.refs.reference.current)||v.refs.reference.current===null||x!==null&&!Wt(x))&&v.refs.setReference(x)},[v.refs]),k=A.useMemo(()=>({...v.refs,setReference:w,setPositionReference:b,domReference:d}),[v.refs,w,b]),_=A.useMemo(()=>({...v.elements,domReference:h}),[v.elements,h]),C=A.useMemo(()=>({...v,...i,refs:k,elements:_,nodeId:n}),[v,k,_,n,i]);return uo(()=>{i.dataRef.current.floatingContext=C;const x=p==null?void 0:p.nodesRef.current.find(E=>E.id===n);x&&(x.context=C)}),A.useMemo(()=>({...v,context:C,refs:k,elements:_}),[v,k,_,C])}function wk(){return DZ()&&MZ()}function KQ(e,n){n===void 0&&(n={});const{open:t,onOpenChange:i,events:r,dataRef:a,elements:o}=e,{enabled:l=!0,visibleOnly:c=!0}=n,f=A.useRef(!1),h=A.useRef(-1),d=A.useRef(!0);A.useEffect(()=>{if(!l)return;const v=Ar(o.domReference);function b(){!t&&Aa(o.domReference)&&o.domReference===z5(su(o.domReference))&&(f.current=!0)}function w(){d.current=!0}function k(){d.current=!1}return v.addEventListener("blur",b),wk()&&(v.addEventListener("keydown",w,!0),v.addEventListener("pointerdown",k,!0)),()=>{v.removeEventListener("blur",b),wk()&&(v.removeEventListener("keydown",w,!0),v.removeEventListener("pointerdown",k,!0))}},[o.domReference,t,l]),A.useEffect(()=>{if(!l)return;function v(b){let{reason:w}=b;(w==="reference-press"||w==="escape-key")&&(f.current=!0)}return r.on("openchange",v),()=>{r.off("openchange",v)}},[r,l]),A.useEffect(()=>()=>{ha(h)},[]);const p=A.useMemo(()=>({onMouseLeave(){f.current=!1},onFocus(v){if(f.current)return;const b=Ic(v.nativeEvent);if(c&&Wt(b)){if(wk()&&!v.relatedTarget){if(!d.current&&!$Z(b))return}else if(!zZ(b))return}i(!0,v.nativeEvent,"focus")},onBlur(v){f.current=!1;const b=v.relatedTarget,w=v.nativeEvent,k=Wt(b)&&b.hasAttribute(rC("focus-guard"))&&b.getAttribute("data-type")==="outside";h.current=window.setTimeout(()=>{var _;const C=z5(o.domReference?o.domReference.ownerDocument:document);!b&&C===o.domReference||Qh((_=a.current.floatingContext)==null?void 0:_.refs.floating.current,C)||Qh(o.domReference,C)||k||i(!1,w,"focus")})}}),[a,o.domReference,i,c]);return A.useMemo(()=>l?{reference:p}:{},[l,p])}function kk(e,n,t){const i=new Map,r=t==="item";let a=e;if(r&&e){const{[G5]:o,[Y5]:l,...c}=e;a=c}return{...t==="floating"&&{tabIndex:-1,[RQ]:""},...a,...n.map(o=>{const l=o?o[t]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((o,l)=>(l&&Object.entries(l).forEach(c=>{let[f,h]=c;if(!(r&&[G5,Y5].includes(f)))if(f.indexOf("on")===0){if(i.has(f)||i.set(f,[]),typeof h=="function"){var d;(d=i.get(f))==null||d.push(h),o[f]=function(){for(var p,v=arguments.length,b=new Array(v),w=0;wk(...b)).find(k=>k!==void 0)}}}else o[f]=h}),o),{})}}function XQ(e){e===void 0&&(e=[]);const n=e.map(l=>l==null?void 0:l.reference),t=e.map(l=>l==null?void 0:l.floating),i=e.map(l=>l==null?void 0:l.item),r=A.useCallback(l=>kk(l,e,"reference"),n),a=A.useCallback(l=>kk(l,e,"floating"),t),o=A.useCallback(l=>kk(l,e,"item"),i);return A.useMemo(()=>({getReferenceProps:r,getFloatingProps:a,getItemProps:o}),[r,a,o])}const ZQ=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function QQ(e,n){var t,i;n===void 0&&(n={});const{open:r,elements:a,floatingId:o}=e,{enabled:l=!0,role:c="dialog"}=n,f=dL(),h=((t=a.domReference)==null?void 0:t.id)||f,d=A.useMemo(()=>{var C;return((C=LZ(a.floating))==null?void 0:C.id)||o},[a.floating,o]),p=(i=ZQ.get(c))!=null?i:c,b=tC()!=null,w=A.useMemo(()=>p==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?d:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":r?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:h},...p==="menu"&&b&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,d,b,r,h,c]),k=A.useMemo(()=>{const C={id:d,...p&&{role:p}};return p==="tooltip"||c==="label"?C:{...C,...p==="menu"&&{"aria-labelledby":h}}},[p,d,h,c]),_=A.useCallback(C=>{let{active:x,selected:E}=C;const j={role:"option",...x&&{id:d+"-fui-option"}};switch(c){case"select":case"combobox":return{...j,"aria-selected":E}}return{}},[d,c]);return A.useMemo(()=>l?{reference:w,floating:k,item:_}:{},[l,w,k,_])}const mL={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},pL=(e,{scrollbarSize:n,overscrollBehavior:t,scrollbars:i})=>{let r=t;return t&&i&&(i==="x"?r=`${t} auto`:i==="y"&&(r=`auto ${t}`)),{root:{"--scrollarea-scrollbar-size":me(n),"--scrollarea-over-scroll-behavior":r}}},fr=De(e=>{const n=be("ScrollArea",mL,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,scrollbarSize:l,vars:c,type:f,scrollHideDelay:h,viewportProps:d,viewportRef:p,onScrollPositionChange:v,children:b,offsetScrollbars:w,scrollbars:k,onBottomReached:_,onTopReached:C,onLeftReached:x,onRightReached:E,overscrollBehavior:j,startScrollPosition:O,attributes:M,...N}=n,[q,R]=A.useState(!1),[L,F]=A.useState(!1),[Y,V]=A.useState(!1),$=A.useRef(!0),P=A.useRef(!1),I=A.useRef(!0),H=A.useRef(!1),U=Xe({name:"ScrollArea",props:n,classes:Y6,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:M,vars:c,varsResolver:pL}),D=A.useRef(null),[W,G]=A.useState(null),z=fL([p,D,A.useCallback(X=>{G(ee=>ee===X?ee:X)},[])]);return hl(w==="present"?W:null,()=>{const X=D.current;X&&(F(X.scrollHeight>X.clientHeight),V(X.scrollWidth>X.clientWidth))}),ps(()=>{O&&D.current&&D.current.scrollTo({left:O.x??0,top:O.y??0})},[]),g.jsxs(Fz,{getStyles:U,type:f==="never"?"always":f,scrollHideDelay:h,scrollbars:k,...U("root"),...N,children:[g.jsx(Zz,{...d,...U("viewport",{style:d==null?void 0:d.style}),ref:z,"data-offset-scrollbars":w===!0?"xy":w||void 0,"data-scrollbars":k||void 0,"data-horizontal-hidden":w==="present"&&!Y?"true":void 0,"data-vertical-hidden":w==="present"&&!L?"true":void 0,onScroll:X=>{var je;(je=d==null?void 0:d.onScroll)==null||je.call(d,X),v==null||v({x:X.currentTarget.scrollLeft,y:X.currentTarget.scrollTop});const{scrollTop:ee,scrollHeight:re,clientHeight:le,scrollLeft:ye,scrollWidth:ae,clientWidth:ue}=X.currentTarget,Se=ee-(re-le)>=-.8,ne=ee===0;Se&&!P.current&&(_==null||_()),ne&&!$.current&&(C==null||C()),P.current=Se,$.current=ne;const Le=ye-(ae-ue)>=-.8,ke=ye===0;Le&&!H.current&&(E==null||E()),ke&&!I.current&&(x==null||x()),H.current=Le,I.current=ke},children:b}),(k==="xy"||k==="x")&&g.jsx(yS,{...U("scrollbar"),orientation:"horizontal","data-hidden":f==="never"||w==="present"&&!Y?!0:void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:g.jsx(bS,{...U("thumb")})}),(k==="xy"||k==="y")&&g.jsx(yS,{...U("scrollbar"),orientation:"vertical","data-hidden":f==="never"||w==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:g.jsx(bS,{...U("thumb")})}),g.jsx(uZ,{...U("corner"),"data-hovered":q||void 0,"data-hidden":f==="never"||void 0})]})});fr.displayName="@mantine/core/ScrollArea";const oC=De(e=>{const{children:n,classNames:t,styles:i,scrollbarSize:r,scrollHideDelay:a,type:o,dir:l,offsetScrollbars:c,overscrollBehavior:f,viewportRef:h,onScrollPositionChange:d,unstyled:p,variant:v,viewportProps:b,scrollbars:w,style:k,vars:_,onBottomReached:C,onTopReached:x,startScrollPosition:E,onOverflowChange:j,...O}=be("ScrollAreaAutosize",mL,e),M=A.useRef(null),[N,q]=A.useState(null),R=fL([h,M,A.useCallback(V=>{q($=>$===V?$:V)},[])]),L=A.useRef(!1),F=A.useRef(!1),Y=A.useEffectEvent(()=>{const V=M.current;if(!V||!j)return;const $=V.scrollHeight>V.clientHeight;$!==L.current&&(F.current?j($):(F.current=!0,$&&j(!0)),L.current=$)});return hl(j?N:null,Y),g.jsx(he,{...O,variant:v,style:[{display:"flex",overflow:"hidden"},k],children:g.jsx(he,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...w==="y"&&{minWidth:0},...w==="x"&&{minHeight:0},...w==="xy"&&{minWidth:0,minHeight:0},...w===!1&&{minWidth:0,minHeight:0}},children:g.jsx(fr,{classNames:t,styles:i,scrollHideDelay:a,scrollbarSize:r,type:o,dir:l,offsetScrollbars:c,overscrollBehavior:f,viewportRef:R,onScrollPositionChange:d,unstyled:p,variant:v,viewportProps:b,vars:_,scrollbars:w,onBottomReached:C,onTopReached:x,startScrollPosition:E,"data-autosize":"true",children:n})})})});fr.classes=Y6;fr.varsResolver=pL;oC.displayName="@mantine/core/ScrollAreaAutosize";oC.classes=Y6;fr.Autosize=oC;var vL={root:"m_87cf2631"};const JQ={__staticSelector:"UnstyledButton"},Et=Ai(e=>{const n=be("UnstyledButton",JQ,e),{className:t,component:i="button",__staticSelector:r,unstyled:a,classNames:o,styles:l,style:c,attributes:f,...h}=n;return g.jsx(he,{...Xe({name:r,props:n,classes:vL,className:t,style:c,classNames:o,styles:l,unstyled:a,attributes:f})("root",{focusable:!0}),component:i,type:i==="button"?"button":void 0,...h})});Et.classes=vL;Et.displayName="@mantine/core/UnstyledButton";var gL={root:"m_515a97f8"};const sC=De(e=>{const n=be("VisuallyHidden",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,attributes:c,...f}=n;return g.jsx(he,{component:"span",...Xe({name:"VisuallyHidden",classes:gL,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:c})("root"),...f})});sC.classes=gL;sC.displayName="@mantine/core/VisuallyHidden";var yL={root:"m_1b7284a3"};const bL=(e,{radius:n,shadow:t})=>({root:{"--paper-radius":n===void 0?void 0:Yt(n),"--paper-shadow":L6(t)}}),Dt=Ai(e=>{const n=be("Paper",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,withBorder:l,vars:c,radius:f,shadow:h,variant:d,mod:p,attributes:v,...b}=n,w=Xe({name:"Paper",props:n,classes:yL,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:v,vars:c,varsResolver:bL});return g.jsx(he,{mod:[{"data-with-border":l},p],...w("root"),variant:d,...b})});Dt.classes=yL;Dt.varsResolver=bL;Dt.displayName="@mantine/core/Paper";function J5(e,n,t,i){return e==="center"||i==="center"?{top:n}:e==="end"?{bottom:t}:e==="start"?{top:t}:{}}function eT(e,n,t,i,r){return e==="center"||i==="center"?{left:n}:e==="end"?{[r==="ltr"?"right":"left"]:t}:e==="start"?{[r==="ltr"?"left":"right"]:t}:{}}const eJ={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function nJ({position:e,arrowSize:n,arrowOffset:t,arrowRadius:i,arrowPosition:r,arrowX:a,arrowY:o,dir:l}){const[c,f="center"]=e.split("-"),h={width:n,height:n,transform:"rotate(45deg)",position:"absolute",[eJ[c]]:i},d=-n/2;return c==="left"?{...h,...J5(f,o,t,r),right:d,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:c==="right"?{...h,...J5(f,o,t,r),left:d,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:c==="top"?{...h,...eT(f,a,t,r,l),bottom:d,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:c==="bottom"?{...h,...eT(f,a,t,r,l),top:d,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}function Ig({position:e,arrowSize:n,arrowOffset:t,arrowRadius:i,arrowPosition:r,visible:a,arrowX:o,arrowY:l,style:c,...f}){const{dir:h}=Ru();return a?g.jsx("div",{...f,style:{...c,...nJ({position:e,arrowSize:n,arrowOffset:t,arrowRadius:i,arrowPosition:r,dir:h,arrowX:o,arrowY:l})}}):null}Ig.displayName="@mantine/core/FloatingArrow";function wL(e,n){if(e==="rtl"&&(n.includes("right")||n.includes("left"))){const[t,i]=n.split("-"),r=t==="right"?"left":"right";return i===void 0?r:`${r}-${i}`}return n}function kL({open:e,close:n,openDelay:t,closeDelay:i}){const r=A.useRef(-1),a=A.useRef(-1),o=()=>{window.clearTimeout(r.current),window.clearTimeout(a.current)},l=()=>{o(),t===0||t===void 0?e():r.current=window.setTimeout(e,t)},c=()=>{o(),i===0||i===void 0?n():a.current=window.setTimeout(n,i)};return A.useEffect(()=>o,[]),{openDropdown:l,closeDropdown:c}}var _L={root:"m_9814e45f"};const tJ={zIndex:Sa("modal")},xL=(e,{gradient:n,color:t,backgroundOpacity:i,blur:r,radius:a,zIndex:o})=>({root:{"--overlay-bg":n||(t!==void 0||i!==void 0)&&Zs(t||"#000",i??.6)||void 0,"--overlay-filter":r?`blur(${me(r)})`:void 0,"--overlay-radius":a===void 0?void 0:Yt(a),"--overlay-z-index":o==null?void 0:o.toString()}}),Xm=Ai(e=>{const n=be("Overlay",tJ,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,fixed:c,center:f,children:h,radius:d,zIndex:p,gradient:v,blur:b,color:w,backgroundOpacity:k,mod:_,attributes:C,...x}=n;return g.jsx(he,{...Xe({name:"Overlay",props:n,classes:_L,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:C,vars:l,varsResolver:xL})("root"),mod:[{center:f,fixed:c},_],...x,children:h})});Xm.classes=_L;Xm.varsResolver=xL;Xm.displayName="@mantine/core/Overlay";function _k(e){const n=document.createElement("div");return n.setAttribute("data-portal","true"),typeof e.className=="string"&&n.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(n.style,e.style),typeof e.id=="string"&&n.setAttribute("id",e.id),n}function iJ({target:e,reuseTargetNode:n,...t}){if(e)return typeof e=="string"?document.querySelector(e)||_k(t):e;if(n){const i=document.querySelector("[data-mantine-shared-portal-node]");if(i)return i;const r=_k(t);return r.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(r),r}return _k(t)}const rJ={reuseTargetNode:!0},SL=De(e=>{const{children:n,target:t,reuseTargetNode:i,ref:r,...a}=be("Portal",rJ,e),[o,l]=A.useState(!1),c=A.useRef(null);return ps(()=>(l(!0),c.current=iJ({target:t,reuseTargetNode:i,...a}),Dg(r,c.current),!t&&!i&&c.current&&document.body.appendChild(c.current),()=>{!t&&!i&&c.current&&document.body.removeChild(c.current)}),[t]),!o||!c.current?null:il.createPortal(g.jsx(g.Fragment,{children:n}),c.current)});SL.displayName="@mantine/core/Portal";const ml=De(({withinPortal:e=!0,children:n,...t})=>Ym()==="test"||!e?g.jsx(g.Fragment,{children:n}):g.jsx(SL,{...t,children:n}));ml.displayName="@mantine/core/OptionalPortal";const ah=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Iv={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...ah("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...ah("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...ah("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...ah("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...ah("top"),common:{transformOrigin:"top right"}}},nT={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function tT({transition:e,state:n,duration:t,timingFunction:i}){const r={WebkitBackfaceVisibility:"hidden",transitionDuration:`${t}ms`,transitionTimingFunction:i};return typeof e=="string"?e in Iv?{transitionProperty:Iv[e].transitionProperty,...r,...Iv[e].common,...Iv[e][nT[n]]}:{}:{transitionProperty:e.transitionProperty,...r,...e.common,...e[nT[n]]}}function aJ({duration:e,exitDuration:n,timingFunction:t,mounted:i,onEnter:r,onExit:a,onEntered:o,onExited:l,enterDelay:c,exitDelay:f}){const h=ui(),d=B6(),p=h.respectReducedMotion?d:!1,[v,b]=A.useState(p?0:e),[w,k]=A.useState(i?"entered":"exited"),_=A.useRef(-1),C=A.useRef(-1),x=A.useRef(-1);function E(){window.clearTimeout(_.current),window.clearTimeout(C.current),cancelAnimationFrame(x.current)}const j=M=>{E();const N=M?r:a,q=M?o:l,R=p?0:M?e:n;b(R),R===0?(typeof N=="function"&&N(),typeof q=="function"&&q(),k(M?"entered":"exited")):x.current=requestAnimationFrame(()=>{Sh.flushSync(()=>{k(M?"pre-entering":"pre-exiting")}),x.current=requestAnimationFrame(()=>{typeof N=="function"&&N(),k(M?"entering":"exiting"),_.current=window.setTimeout(()=>{typeof q=="function"&&q(),k(M?"entered":"exited")},R)})})},O=M=>{if(E(),typeof(M?c:f)!="number"){j(M);return}C.current=window.setTimeout(()=>{j(M)},M?c:f)};return ls(()=>{O(i)},[i]),A.useEffect(()=>()=>{E()},[]),{transitionDuration:v,transitionStatus:w,transitionTimingFunction:t||"ease"}}function cs({keepMounted:e,transition:n="fade",duration:t=250,exitDuration:i=t,mounted:r,children:a,timingFunction:o="ease",onExit:l,onEntered:c,onEnter:f,onExited:h,enterDelay:d,exitDelay:p}){const v=Ym(),{transitionDuration:b,transitionStatus:w,transitionTimingFunction:k}=aJ({mounted:r,exitDuration:i,duration:t,timingFunction:o,onExit:l,onEntered:c,onEnter:f,onExited:h,enterDelay:d,exitDelay:p});if(v==="test")return r?g.jsx(g.Fragment,{children:a({})}):e?a({display:"none"}):null;if(b===0)return e?g.jsx(A.Activity,{mode:r?"visible":"hidden",children:a({})}):r?g.jsx(g.Fragment,{children:a({})}):null;const _=w==="exited";return e?g.jsx(A.Activity,{mode:_?"hidden":"visible",children:a(_?{}:tT({transition:n,duration:b,state:w,timingFunction:k}))}):_?null:g.jsx(g.Fragment,{children:a(tT({transition:n,duration:b,state:w,timingFunction:k}))})}cs.displayName="@mantine/core/Transition";const oJ={duration:100,transition:"fade"};function iT(e,n){return{...oJ,...n,...e}}const[sJ,CL]=Xr("Popover component was not found in the tree");function by({children:e,active:n=!0,refProp:t="ref",innerRef:i}){const r=Kt(IK(n),i),a=Mu(e);return a?A.cloneElement(a,{[t]:r}):e}function AL(e){return g.jsx(sC,{tabIndex:-1,"data-autofocus":!0,...e})}by.displayName="@mantine/core/FocusTrap";AL.displayName="@mantine/core/FocusTrapInitialFocus";by.InitialFocus=AL;var jL={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const lC=De(e=>{var k,_,C,x;const n=be("PopoverDropdown",null,e),{className:t,style:i,vars:r,children:a,onKeyDownCapture:o,variant:l,classNames:c,styles:f,ref:h,...d}=n,p=CL(),v=bz({opened:p.opened,shouldReturnFocus:p.returnFocus}),b=p.withRoles?{"aria-labelledby":p.getTargetId(),id:p.getDropdownId(),role:"dialog",tabIndex:-1}:{},w=Kt(h,p.floating);return p.disabled?null:g.jsx(ml,{...p.portalProps,withinPortal:p.withinPortal,children:g.jsx(cs,{mounted:p.opened,...p.transitionProps,transition:((k=p.transitionProps)==null?void 0:k.transition)||"fade",duration:((_=p.transitionProps)==null?void 0:_.duration)??150,keepMounted:p.keepMounted,exitDuration:typeof((C=p.transitionProps)==null?void 0:C.exitDuration)=="number"?p.transitionProps.exitDuration:(x=p.transitionProps)==null?void 0:x.duration,children:E=>{var j;return g.jsx(by,{active:p.trapFocus&&p.opened,innerRef:w,children:g.jsxs(he,{...b,...d,variant:l,onKeyDownCapture:jK(()=>{var O,M;(O=p.onClose)==null||O.call(p),(M=p.onDismiss)==null||M.call(p)},{active:p.closeOnEscape,onTrigger:v,onKeyDown:o}),"data-position":p.placement,"data-fixed":p.floatingStrategy==="fixed"||void 0,...p.getStyles("dropdown",{className:t,props:n,classNames:c,styles:f,style:[{...E,zIndex:p.zIndex,top:p.y??0,left:p.x??0,width:p.width==="target"?void 0:me(p.width),...p.referenceHidden?{display:"none"}:null},(j=p.resolvedStyles)==null?void 0:j.dropdown,f==null?void 0:f.dropdown,i]}),children:[a,g.jsx(Ig,{ref:p.arrowRef,arrowX:p.arrowX,arrowY:p.arrowY,visible:p.withArrow,position:p.placement,arrowSize:p.arrowSize,arrowRadius:p.arrowRadius,arrowOffset:p.arrowOffset,arrowPosition:p.arrowPosition,...p.getStyles("arrow",{props:n,classNames:c,styles:f})})]})})}})})});lC.classes=jL;lC.displayName="@mantine/core/PopoverDropdown";const lJ={refProp:"ref",popupType:"dialog"},OL=De(e=>{const{children:n,refProp:t,popupType:i,ref:r,...a}=be("PopoverTarget",lJ,e),o=Mu(n);if(!o)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 l=a,c=CL(),f=Kt(c.reference,uy(o),r),h=c.withRoles?{"aria-haspopup":i,"aria-expanded":c.opened,"aria-controls":c.opened?c.getDropdownId():void 0,id:c.getTargetId()}:{},d=o.props;return A.cloneElement(o,{...l,...h,...c.targetProps,className:pn(c.targetProps.className,l.className,d.className),[t]:f,...c.controlled?null:{onClick:p=>{var v;c.onToggle(),(v=d.onClick)==null||v.call(d,p)}}})});OL.displayName="@mantine/core/PopoverTarget";function uJ(e){if(e===void 0)return{shift:!0,flip:!0};const n={...e};return e.shift===void 0&&(n.shift=!0),e.flip===void 0&&(n.flip=!0),n}function cJ(e,n,t){const i=uJ(e.middlewares),r=[uL(e.offset),DQ()];return e.dropdownVisible&&t!=="test"&&e.preventPositionChangeWhenVisible&&(i.flip=!1),i.flip&&r.push(typeof i.flip=="boolean"?Lg():Lg(i.flip)),i.shift&&r.push(nC(typeof i.shift=="boolean"?{limiter:W5(),padding:5}:{limiter:W5(),padding:5,...i.shift})),i.inline&&r.push(typeof i.inline=="boolean"?Nh():Nh(i.inline)),r.push(cL({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width==="target")&&r.push(MQ({...typeof i.size=="boolean"?{}:i.size,apply({rects:a,availableWidth:o,availableHeight:l,...c}){var h;const f=((h=n().refs.floating.current)==null?void 0:h.style)??{};i.size&&(typeof i.size=="object"&&i.size.apply?i.size.apply({rects:a,availableWidth:o,availableHeight:l,...c}):Object.assign(f,{maxWidth:`${o}px`,maxHeight:`${l}px`})),e.width==="target"&&Object.assign(f,{width:`${a.reference.width}px`})}})),r}function fJ(e){const n=Ym(),[t,i]=Ci({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=A.useRef(t),a=()=>{t&&!e.disabled&&i(!1)},o=()=>{e.disabled||i(!t)},l=aC({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:cJ(e,()=>l,n),whileElementsMounted:e.keepMounted?void 0:CS});return A.useEffect(()=>{if(!(!l.refs.reference.current||!l.refs.floating.current)&&t)return CS(l.refs.reference.current,l.refs.floating.current,l.update)},[t,l.update]),ls(()=>{var c;(c=e.onPositionChange)==null||c.call(e,l.placement),e.positionRef.current=l.placement},[l.placement,e.preventPositionChangeWhenVisible]),ls(()=>{var c,f;t!==r.current&&(t?(f=e.onOpen)==null||f.call(e):(c=e.onClose)==null||c.call(e)),r.current=t},[t,e.onClose,e.onOpen]),ps(()=>{let c=-1;return t&&(c=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(c)}},[t,e.position]),{floating:l,controlled:typeof e.opened=="boolean",opened:t,onClose:a,onToggle:o}}const dJ={position:"bottom",offset:8,transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:Sa("popover"),__staticSelector:"Popover",width:"max-content"},EL=(e,{radius:n,shadow:t})=>({dropdown:{"--popover-radius":n===void 0?void 0:Yt(n),"--popover-shadow":L6(t)}});function On(e){var an,mn,En,vn,sn,en,zn;const n=be("Popover",dJ,e),{children:t,position:i,offset:r,onPositionChange:a,opened:o,transitionProps:l,onExitTransitionEnd:c,onEnterTransitionEnd:f,width:h,middlewares:d,withArrow:p,arrowSize:v,arrowOffset:b,arrowRadius:w,arrowPosition:k,unstyled:_,classNames:C,styles:x,closeOnClickOutside:E,withinPortal:j,portalProps:O,closeOnEscape:M,clickOutsideEvents:N,trapFocus:q,onClose:R,onDismiss:L,onOpen:F,onChange:Y,zIndex:V,radius:$,shadow:P,id:I,defaultOpened:H,__staticSelector:U,withRoles:D,disabled:W,returnFocus:G,variant:z,keepMounted:X,vars:ee,floatingStrategy:re,withOverlay:le,overlayProps:ye,hideDetached:ae,attributes:ue,preventPositionChangeWhenVisible:Se,...ne}=n,Le=Xe({name:U,props:n,classes:jL,classNames:C,styles:x,unstyled:_,attributes:ue,rootSelector:"dropdown",vars:ee,varsResolver:EL}),{resolvedStyles:ke}=Wi({classNames:C,styles:x,props:n}),[je,Ne]=A.useState(o??H??!1),ge=A.useRef(i),Ce=A.useRef(null),[Pe,ce]=A.useState(null),[qe,Ye]=A.useState(null),{dir:We}=Ru(),Ze=Ym(),Qe=Vi(I),ie=fJ({middlewares:d,width:h,position:wL(We,i),offset:typeof r=="number"?r+(p?v/2:0):r,arrowRef:Ce,arrowOffset:b,onPositionChange:a,opened:o,defaultOpened:H,onChange:Y,onOpen:F,onClose:R,onDismiss:L,strategy:re,dropdownVisible:je,setDropdownVisible:Ne,positionRef:ge,disabled:W,preventPositionChangeWhenVisible:Se,keepMounted:X});MK(()=>{E&&(ie.onClose(),L==null||L())},N,[Pe,qe]);const ve=A.useCallback(Re=>{ce(Re),ie.floating.refs.setReference(Re)},[ie.floating.refs.setReference]),Ke=A.useCallback(Re=>{Ye(Re),ie.floating.refs.setFloating(Re)},[ie.floating.refs.setFloating]),Je=A.useCallback(()=>{var Re;(Re=l==null?void 0:l.onExited)==null||Re.call(l),c==null||c(),Ne(!1),Se||(ge.current=i)},[l==null?void 0:l.onExited,c,Se,i]),Ae=A.useCallback(()=>{var Re;(Re=l==null?void 0:l.onEntered)==null||Re.call(l),f==null||f()},[l==null?void 0:l.onEntered,f]);return g.jsxs(sJ,{value:{returnFocus:G,disabled:W,controlled:ie.controlled,reference:ve,floating:Ke,x:ie.floating.x,y:ie.floating.y,arrowX:(En=(mn=(an=ie.floating)==null?void 0:an.middlewareData)==null?void 0:mn.arrow)==null?void 0:En.x,arrowY:(en=(sn=(vn=ie.floating)==null?void 0:vn.middlewareData)==null?void 0:sn.arrow)==null?void 0:en.y,opened:ie.opened,arrowRef:Ce,transitionProps:{...l,onExited:Je,onEntered:Ae},width:h,withArrow:p,arrowSize:v,arrowOffset:b,arrowRadius:w,arrowPosition:k,placement:ie.floating.placement,trapFocus:q,withinPortal:j,portalProps:O,zIndex:V,radius:$,shadow:P,closeOnEscape:M,onDismiss:L,onClose:ie.onClose,onToggle:ie.onToggle,getTargetId:()=>Qe,getDropdownId:()=>`${Qe}-dropdown`,withRoles:D,targetProps:ne,__staticSelector:U,classNames:C,styles:x,unstyled:_,variant:z,keepMounted:X,getStyles:Le,resolvedStyles:ke,floatingStrategy:re,referenceHidden:ae&&Ze!=="test"?(zn=ie.floating.middlewareData.hide)==null?void 0:zn.referenceHidden:!1},children:[t,le&&g.jsx(cs,{transition:"fade",mounted:ie.opened,duration:(l==null?void 0:l.duration)||250,exitDuration:(l==null?void 0:l.exitDuration)||250,children:Re=>g.jsx(ml,{withinPortal:j,children:g.jsx(Xm,{...ye,...Le("overlay",{className:ye==null?void 0:ye.className,style:[Re,ye==null?void 0:ye.style]})})})})]})}On.Target=OL;On.Dropdown=lC;On.varsResolver=EL;On.displayName="@mantine/core/Popover";On.extend=e=>e;On.withProps=e=>{const n=t=>g.jsx(On,{...e,...t});return n.extend=On.extend,n.displayName=`WithProps(${On.displayName})`,n};var Fa={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 TL=({className:e,...n})=>g.jsxs(he,{component:"span",className:pn(Fa.barsLoader,e),...n,children:[g.jsx("span",{className:Fa.bar}),g.jsx("span",{className:Fa.bar}),g.jsx("span",{className:Fa.bar})]});TL.displayName="@mantine/core/Bars";const ML=({className:e,...n})=>g.jsxs(he,{component:"span",className:pn(Fa.dotsLoader,e),...n,children:[g.jsx("span",{className:Fa.dot}),g.jsx("span",{className:Fa.dot}),g.jsx("span",{className:Fa.dot})]});ML.displayName="@mantine/core/Dots";const DL=({className:e,...n})=>g.jsx(he,{component:"span",className:pn(Fa.ovalLoader,e),...n});DL.displayName="@mantine/core/Oval";const RL={bars:TL,oval:DL,dots:ML},hJ={loaders:RL,type:"oval"},PL=(e,{size:n,color:t})=>({root:{"--loader-size":Bn(n,"loader-size"),"--loader-color":t?lt(t,e):void 0}}),ai=De(e=>{const n=be("Loader",hJ,e),{size:t,color:i,type:r,vars:a,className:o,style:l,classNames:c,styles:f,unstyled:h,loaders:d,variant:p,children:v,attributes:b,...w}=n,k=Xe({name:"Loader",props:n,classes:Fa,className:o,style:l,classNames:c,styles:f,unstyled:h,attributes:b,vars:a,varsResolver:PL});return v?g.jsx(he,{...k("root"),...w,children:v}):g.jsx(he,{...k("root"),component:d[r],variant:p,size:t,...w})});ai.defaultLoaders=RL;ai.classes=Fa;ai.varsResolver=PL;ai.displayName="@mantine/core/Loader";var Lf={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const rT={orientation:"horizontal"},NL=(e,{borderWidth:n})=>({group:{"--ai-border-width":me(n)}}),wy=De(e=>{const n=be("ActionIconGroup",rT,e),{className:t,style:i,classNames:r,styles:a,unstyled:o,orientation:l,vars:c,borderWidth:f,variant:h,mod:d,attributes:p,...v}=be("ActionIconGroup",rT,e);return g.jsx(he,{...Xe({name:"ActionIconGroup",props:n,classes:Lf,className:t,style:i,classNames:r,styles:a,unstyled:o,attributes:p,vars:c,varsResolver:NL,rootSelector:"group"})("group"),variant:h,mod:[{"data-orientation":l},d],role:"group",...v})});wy.classes=Lf;wy.varsResolver=NL;wy.displayName="@mantine/core/ActionIconGroup";const $L=(e,{radius:n,color:t,gradient:i,variant:r,autoContrast:a,size:o})=>{const l=e.variantColorResolver({color:t||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:a});return{groupSection:{"--section-height":Bn(o,"section-height"),"--section-padding-x":Bn(o,"section-padding-x"),"--section-fz":ri(o),"--section-radius":n===void 0?void 0:Yt(n),"--section-bg":t||r?l.background:void 0,"--section-color":l.color,"--section-bd":t||r?l.border:void 0}}},ky=De(e=>{const n=be("ActionIconGroupSection",null,e),{className:t,style:i,classNames:r,styles:a,unstyled:o,vars:l,variant:c,gradient:f,radius:h,autoContrast:d,attributes:p,...v}=n;return g.jsx(he,{...Xe({name:"ActionIconGroupSection",props:n,classes:Lf,className:t,style:i,classNames:r,styles:a,unstyled:o,attributes:p,vars:l,varsResolver:$L,rootSelector:"groupSection"})("groupSection"),variant:c,...v})});ky.classes=Lf;ky.varsResolver=$L;ky.displayName="@mantine/core/ActionIconGroupSection";const zL=(e,{size:n,radius:t,variant:i,gradient:r,color:a,autoContrast:o})=>{const l=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:o});return{root:{"--ai-size":Bn(n,"ai-size"),"--ai-radius":t===void 0?void 0:Yt(t),"--ai-bg":a||i?l.background:void 0,"--ai-hover":a||i?l.hover:void 0,"--ai-hover-color":a||i?l.hoverColor:void 0,"--ai-color":l.color,"--ai-bd":a||i?l.border:void 0}}},vt=Ai(e=>{const n=be("ActionIcon",null,e),{className:t,unstyled:i,variant:r,classNames:a,styles:o,style:l,loading:c,loaderProps:f,size:h,color:d,radius:p,__staticSelector:v,gradient:b,vars:w,children:k,disabled:_,"data-disabled":C,autoContrast:x,mod:E,attributes:j,...O}=n,M=Xe({name:["ActionIcon",v],props:n,className:t,style:l,classes:Lf,classNames:a,styles:o,unstyled:i,attributes:j,vars:w,varsResolver:zL});return g.jsxs(Et,{...M("root",{active:!_&&!c&&!C}),...O,unstyled:i,variant:r,size:h,disabled:_||c,mod:[{loading:c,disabled:_||C},E],children:[typeof c=="boolean"&&g.jsx(cs,{mounted:c,transition:"slide-down",duration:150,children:N=>g.jsx(he,{component:"span",...M("loader",{style:N}),"aria-hidden":!0,children:g.jsx(ai,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...f})})}),g.jsx(he,{component:"span",mod:{loading:c},...M("icon"),children:k})]})});vt.classes=Lf;vt.varsResolver=zL;vt.displayName="@mantine/core/ActionIcon";vt.Group=wy;vt.GroupSection=ky;function LL({size:e="var(--cb-icon-size, 70%)",style:n,...t}){return g.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...n,width:e,height:e},...t,children:g.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}LL.displayName="@mantine/core/CloseIcon";var IL={root:"m_86a44da5","root--subtle":"m_220c80f2"};const mJ={variant:"subtle"},BL=(e,{size:n,radius:t,iconSize:i})=>({root:{"--cb-size":Bn(n,"cb-size"),"--cb-radius":t===void 0?void 0:Yt(t),"--cb-icon-size":me(i)}}),bl=Ai(e=>{const n=be("CloseButton",mJ,e),{iconSize:t,children:i,vars:r,radius:a,className:o,classNames:l,style:c,styles:f,unstyled:h,"data-disabled":d,disabled:p,variant:v,icon:b,mod:w,attributes:k,__staticSelector:_,...C}=n,x=Xe({name:_||"CloseButton",props:n,className:o,style:c,classes:IL,classNames:l,styles:f,unstyled:h,attributes:k,vars:r,varsResolver:BL});return g.jsxs(Et,{...C,unstyled:h,variant:v,disabled:p,mod:[{disabled:p||d},w],...x("root",{variant:v,active:!p&&!d}),children:[b||g.jsx(LL,{}),i]})});bl.classes=IL;bl.varsResolver=BL;bl.displayName="@mantine/core/CloseButton";function pJ(e){return A.Children.toArray(e).filter(Boolean)}var FL={root:"m_4081bf90"};const vJ={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},qL=(e,{grow:n,preventGrowOverflow:t,gap:i,align:r,justify:a,wrap:o},{childWidth:l})=>({root:{"--group-child-width":n&&t?l:void 0,"--group-gap":Vt(i),"--group-align":r,"--group-justify":a,"--group-wrap":o}}),ze=De(e=>{const n=be("Group",vJ,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,children:l,gap:c,align:f,justify:h,wrap:d,grow:p,preventGrowOverflow:v,vars:b,variant:w,__size:k,mod:_,attributes:C,...x}=n,E=pJ(l),j=E.length,O=Vt(c??"md");return g.jsx(he,{...Xe({name:"Group",props:n,stylesCtx:{childWidth:`calc(${100/j}% - (${O} - ${O} / ${j}))`},className:i,style:r,classes:FL,classNames:t,styles:a,unstyled:o,attributes:C,vars:b,varsResolver:qL})("root"),variant:w,mod:[{grow:p},_],size:k,...x,children:E})});ze.classes=FL;ze.varsResolver=qL;ze.displayName="@mantine/core/Group";const[gJ,gs]=Xr("ModalBase component was not found in tree");function yJ({opened:e,transitionDuration:n}){const[t,i]=A.useState(e),r=A.useRef(-1),a=B6()?0:n;return A.useEffect(()=>(e?(i(!0),window.clearTimeout(r.current)):a===0?i(!1):r.current=window.setTimeout(()=>i(!1),a),()=>window.clearTimeout(r.current)),[e,a]),t}function bJ({id:e,transitionProps:n,opened:t,trapFocus:i,closeOnEscape:r,onClose:a,returnFocus:o}){const l=Vi(e),[c,f]=A.useState(!1),[h,d]=A.useState(!1),p=yJ({opened:t,transitionDuration:typeof(n==null?void 0:n.duration)=="number"?n==null?void 0:n.duration:200});return xz("keydown",v=>{var b;v.key==="Escape"&&r&&!v.isComposing&&t&&((b=v.target)==null?void 0:b.getAttribute("data-mantine-stop-propagation"))!=="true"&&a()},{capture:!0}),bz({opened:t,shouldReturnFocus:i&&o}),{_id:l,titleMounted:c,bodyMounted:h,shouldLockScroll:p,setTitleMounted:f,setBodyMounted:d}}var ao=function(){return ao=Object.assign||function(n){for(var t,i=1,r=arguments.length;i"u")return $J;var n=zJ(e),t=document.documentElement.clientWidth,i=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,i-t+n[2]-n[0])}},IJ=WL(),Gc="data-scroll-locked",BJ=function(e,n,t,i){var r=e.left,a=e.top,o=e.right,l=e.gap;return t===void 0&&(t="margin"),` + .`.concat(kJ,` { + overflow: hidden `).concat(i,`; + padding-right: `).concat(l,"px ").concat(i,`; + } + body[`).concat(Gc,`] { + overflow: hidden `).concat(i,`; + overscroll-behavior: contain; + `).concat([n&&"position: relative ".concat(i,";"),t==="margin"&&` + padding-left: `.concat(r,`px; + padding-top: `).concat(a,`px; + padding-right: `).concat(o,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(l,"px ").concat(i,`; + `),t==="padding"&&"padding-right: ".concat(l,"px ").concat(i,";")].filter(Boolean).join(""),` + } + + .`).concat(bg,` { + right: `).concat(l,"px ").concat(i,`; + } + + .`).concat(wg,` { + margin-right: `).concat(l,"px ").concat(i,`; + } + + .`).concat(bg," .").concat(bg,` { + right: 0 `).concat(i,`; + } + + .`).concat(wg," .").concat(wg,` { + margin-right: 0 `).concat(i,`; + } + + body[`).concat(Gc,`] { + `).concat(_J,": ").concat(l,`px; + } +`)},oT=function(){var e=parseInt(document.body.getAttribute(Gc)||"0",10);return isFinite(e)?e:0},FJ=function(){A.useEffect(function(){return document.body.setAttribute(Gc,(oT()+1).toString()),function(){var e=oT()-1;e<=0?document.body.removeAttribute(Gc):document.body.setAttribute(Gc,e.toString())}},[])},qJ=function(e){var n=e.noRelative,t=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;FJ();var a=A.useMemo(function(){return LJ(r)},[r]);return A.createElement(IJ,{styles:BJ(a,!n,r,t?"":"!important")})},jS=!1;if(typeof window<"u")try{var Bv=Object.defineProperty({},"passive",{get:function(){return jS=!0,!0}});window.addEventListener("test",Bv,Bv),window.removeEventListener("test",Bv,Bv)}catch{jS=!1}var Oc=jS?{passive:!1}:!1,HJ=function(e){return e.tagName==="TEXTAREA"},GL=function(e,n){if(!(e instanceof Element))return!1;var t=window.getComputedStyle(e);return t[n]!=="hidden"&&!(t.overflowY===t.overflowX&&!HJ(e)&&t[n]==="visible")},UJ=function(e){return GL(e,"overflowY")},VJ=function(e){return GL(e,"overflowX")},sT=function(e,n){var t=n.ownerDocument,i=n;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=YL(e,i);if(r){var a=KL(e,i),o=a[1],l=a[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==t.body);return!1},WJ=function(e){var n=e.scrollTop,t=e.scrollHeight,i=e.clientHeight;return[n,t,i]},GJ=function(e){var n=e.scrollLeft,t=e.scrollWidth,i=e.clientWidth;return[n,t,i]},YL=function(e,n){return e==="v"?UJ(n):VJ(n)},KL=function(e,n){return e==="v"?WJ(n):GJ(n)},YJ=function(e,n){return e==="h"&&n==="rtl"?-1:1},KJ=function(e,n,t,i,r){var a=YJ(e,window.getComputedStyle(n).direction),o=a*i,l=t.target,c=n.contains(l),f=!1,h=o>0,d=0,p=0;do{if(!l)break;var v=KL(e,l),b=v[0],w=v[1],k=v[2],_=w-k-a*b;(b||_)&&YL(e,l)&&(d+=_,p+=b);var C=l.parentNode;l=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!c&&l!==document.body||c&&(n.contains(l)||n===l));return(h&&Math.abs(d)<1||!h&&Math.abs(p)<1)&&(f=!0),f},Fv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lT=function(e){return[e.deltaX,e.deltaY]},uT=function(e){return e&&"current"in e?e.current:e},XJ=function(e,n){return e[0]===n[0]&&e[1]===n[1]},ZJ=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},QJ=0,Ec=[];function JJ(e){var n=A.useRef([]),t=A.useRef([0,0]),i=A.useRef(),r=A.useState(QJ++)[0],a=A.useState(WL)[0],o=A.useRef(e);A.useEffect(function(){o.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var w=wJ([e.lockRef.current],(e.shards||[]).map(uT),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=A.useCallback(function(w,k){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var _=Fv(w),C=t.current,x="deltaX"in w?w.deltaX:C[0]-_[0],E="deltaY"in w?w.deltaY:C[1]-_[1],j,O=w.target,M=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in w&&M==="h"&&O.type==="range")return!1;var N=window.getSelection(),q=N&&N.anchorNode,R=q?q===O||q.contains(O):!1;if(R)return!1;var L=sT(M,O);if(!L)return!0;if(L?j=M:(j=M==="v"?"h":"v",L=sT(M,O)),!L)return!1;if(!i.current&&"changedTouches"in w&&(x||E)&&(i.current=j),!j)return!0;var F=i.current||j;return KJ(F,k,w,F==="h"?x:E)},[]),c=A.useCallback(function(w){var k=w;if(!(!Ec.length||Ec[Ec.length-1]!==a)){var _="deltaY"in k?lT(k):Fv(k),C=n.current.filter(function(j){return j.name===k.type&&(j.target===k.target||k.target===j.shadowParent)&&XJ(j.delta,_)})[0];if(C&&C.should){k.cancelable&&k.preventDefault();return}if(!C){var x=(o.current.shards||[]).map(uT).filter(Boolean).filter(function(j){return j.contains(k.target)}),E=x.length>0?l(k,x[0]):!o.current.noIsolation;E&&k.cancelable&&k.preventDefault()}}},[]),f=A.useCallback(function(w,k,_,C){var x={name:w,delta:k,target:_,should:C,shadowParent:eee(_)};n.current.push(x),setTimeout(function(){n.current=n.current.filter(function(E){return E!==x})},1)},[]),h=A.useCallback(function(w){t.current=Fv(w),i.current=void 0},[]),d=A.useCallback(function(w){f(w.type,lT(w),w.target,l(w,e.lockRef.current))},[]),p=A.useCallback(function(w){f(w.type,Fv(w),w.target,l(w,e.lockRef.current))},[]);A.useEffect(function(){return Ec.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Oc),document.addEventListener("touchmove",c,Oc),document.addEventListener("touchstart",h,Oc),function(){Ec=Ec.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,Oc),document.removeEventListener("touchmove",c,Oc),document.removeEventListener("touchstart",h,Oc)}},[]);var v=e.removeScrollBar,b=e.inert;return A.createElement(A.Fragment,null,b?A.createElement(a,{styles:ZJ(r)}):null,v?A.createElement(qJ,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function eee(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const nee=EJ(VL,JJ);var yu=A.forwardRef(function(e,n){return A.createElement(_y,ao({},e,{ref:n,sideCar:nee}))});yu.classNames=_y.classNames;function XL({keepMounted:e,opened:n,onClose:t,id:i,transitionProps:r,onExitTransitionEnd:a,onEnterTransitionEnd:o,trapFocus:l,closeOnEscape:c,returnFocus:f,closeOnClickOutside:h,withinPortal:d,portalProps:p,lockScroll:v,children:b,zIndex:w,shadow:k,padding:_,__vars:C,unstyled:x,removeScrollProps:E,...j}){const{_id:O,titleMounted:M,bodyMounted:N,shouldLockScroll:q,setTitleMounted:R,setBodyMounted:L}=bJ({id:i,transitionProps:r,opened:n,trapFocus:l,closeOnEscape:c,onClose:t,returnFocus:f}),{key:F,...Y}=E||{};return g.jsx(ml,{...p,withinPortal:d,children:g.jsx(gJ,{value:{opened:n,onClose:t,closeOnClickOutside:h,onExitTransitionEnd:a,onEnterTransitionEnd:o,transitionProps:{...r,keepMounted:e},getTitleId:()=>`${O}-title`,getBodyId:()=>`${O}-body`,titleMounted:M,bodyMounted:N,setTitleMounted:R,setBodyMounted:L,trapFocus:l,closeOnEscape:c,zIndex:w,unstyled:x},children:g.jsx(yu,{enabled:q&&v,...Y,children:g.jsx(he,{...j,id:O,__vars:{...C,"--mb-z-index":(w||Sa("modal")).toString(),"--mb-shadow":L6(k),"--mb-padding":Vt(_)},children:b})},F)})})}XL.displayName="@mantine/core/ModalBase";function tee(){const e=gs();return A.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var tf={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};function ZL({className:e,...n}){const t=tee(),i=gs();return g.jsx(he,{id:t,className:pn({[tf.body]:!i.unstyled},e),...n})}ZL.displayName="@mantine/core/ModalBaseBody";function QL({className:e,onClick:n,...t}){const i=gs();return g.jsx(bl,{...t,onClick:r=>{i.onClose(),n==null||n(r)},className:pn({[tf.close]:!i.unstyled},e),unstyled:i.unstyled})}QL.displayName="@mantine/core/ModalBaseCloseButton";function JL({transitionProps:e,className:n,innerProps:t,onKeyDown:i,style:r,ref:a,...o}){const l=gs();return g.jsx(cs,{mounted:l.opened,transition:"pop",...l.transitionProps,onExited:()=>{var c,f,h;(c=l.onExitTransitionEnd)==null||c.call(l),(h=(f=l.transitionProps)==null?void 0:f.onExited)==null||h.call(f)},onEntered:()=>{var c,f,h;(c=l.onEnterTransitionEnd)==null||c.call(l),(h=(f=l.transitionProps)==null?void 0:f.onEntered)==null||h.call(f)},...e,children:c=>g.jsx("div",{...t,className:pn({[tf.inner]:!l.unstyled},t.className),children:g.jsx(by,{active:l.opened&&l.trapFocus,innerRef:a,children:g.jsx(Dt,{...o,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,style:[r,c],className:pn({[tf.content]:!l.unstyled},n),unstyled:l.unstyled,children:o.children})})})})}JL.displayName="@mantine/core/ModalBaseContent";function eI({className:e,...n}){const t=gs();return g.jsx(he,{component:"header",className:pn({[tf.header]:!t.unstyled},e),...n})}eI.displayName="@mantine/core/ModalBaseHeader";const iee={duration:200,timingFunction:"ease",transition:"fade"};function ree(e){const n=gs();return{...iee,...n.transitionProps,...e}}function nI({onClick:e,transitionProps:n,style:t,visible:i,...r}){const a=gs(),o=ree(n);return g.jsx(cs,{mounted:i!==void 0?i:a.opened,...o,transition:"fade",children:l=>g.jsx(Xm,{fixed:!0,style:[t,l],zIndex:a.zIndex,unstyled:a.unstyled,onClick:c=>{e==null||e(c),a.closeOnClickOutside&&a.onClose()},...r})})}nI.displayName="@mantine/core/ModalBaseOverlay";function aee(){const e=gs();return A.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}function tI({className:e,...n}){const t=aee(),i=gs();return g.jsx(he,{component:"h2",className:pn({[tf.title]:!i.unstyled},e),id:t,...n})}tI.displayName="@mantine/core/ModalBaseTitle";function oee({children:e}){return g.jsx(g.Fragment,{children:e})}const iI=A.createContext({size:"sm"}),rI=De(e=>{const n=be("InputClearButton",null,e),{size:t,variant:i,vars:r,classNames:a,styles:o,...l}=n,c=A.use(iI),{resolvedClassNames:f,resolvedStyles:h}=Wi({classNames:a,styles:o,props:n});return g.jsx(bl,{variant:i||"transparent",size:t||(c==null?void 0:c.size)||"sm",classNames:f,styles:h,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...l.style},...l})});rI.displayName="@mantine/core/InputClearButton";const see={xs:7,sm:8,md:10,lg:12,xl:15};function lee({__clearable:e,__clearSection:n,rightSection:t,__defaultRightSection:i,size:r="sm",__clearSectionMode:a="both"}){const o=e&&n;return a==="rightSection"?t===null?null:t||i:a==="clear"?t===null?null:o||i:o&&(t||i)?g.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:see[r]},children:[o,t||i]}):t===null?null:t||o||i}const Pu=A.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var ja={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 aI=(e,{size:n})=>({description:{"--input-description-size":n===void 0?void 0:`calc(${ri(n)} - ${me(2)})`}}),Zm=De(e=>{const n=be("InputDescription",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:c,__inheritStyles:f=!0,attributes:h,...d}=be("InputDescription",null,n),p=A.use(Pu),v=Xe({name:["InputWrapper",c],props:n,classes:ja,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:h,rootSelector:"description",vars:l,varsResolver:aI});return g.jsx(he,{component:"p",...(f&&(p==null?void 0:p.getStyles)||v)("description",p!=null&&p.getStyles?{className:i,style:r}:void 0),...d})});Zm.classes=ja;Zm.varsResolver=aI;Zm.displayName="@mantine/core/InputDescription";const oI=(e,{size:n})=>({error:{"--input-error-size":n===void 0?void 0:`calc(${ri(n)} - ${me(2)})`}}),Qm=De(e=>{const n=be("InputError",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,attributes:c,__staticSelector:f,__inheritStyles:h=!0,...d}=n,p=Xe({name:["InputWrapper",f],props:n,classes:ja,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:c,rootSelector:"error",vars:l,varsResolver:oI}),v=A.use(Pu);return g.jsx(he,{component:"p",...(h&&(v==null?void 0:v.getStyles)||p)("error",v!=null&&v.getStyles?{className:i,style:r}:void 0),...d})});Qm.classes=ja;Qm.varsResolver=oI;Qm.displayName="@mantine/core/InputError";const uee={labelElement:"label"},sI=(e,{size:n})=>({label:{"--input-label-size":ri(n),"--input-asterisk-color":void 0}}),Jm=De(e=>{const n=be("InputLabel",uee,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,labelElement:c,required:f,htmlFor:h,onMouseDown:d,children:p,__staticSelector:v,mod:b,attributes:w,...k}=n,_=Xe({name:["InputWrapper",v],props:n,classes:ja,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:w,rootSelector:"label",vars:l,varsResolver:sI}),C=A.use(Pu),x=(C==null?void 0:C.getStyles)||_;return g.jsxs(he,{...x("label",C!=null&&C.getStyles?{className:i,style:r}:void 0),component:c,htmlFor:c==="label"?h:void 0,mod:[{required:f},b],onMouseDown:E=>{d==null||d(E),!E.defaultPrevented&&E.detail>1&&E.preventDefault()},...k,children:[p,f&&g.jsx("span",{...x("required"),"aria-hidden":!0,children:" *"})]})});Jm.classes=ja;Jm.varsResolver=sI;Jm.displayName="@mantine/core/InputLabel";const uC=De(e=>{const n=be("InputPlaceholder",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:c,error:f,mod:h,attributes:d,...p}=n;return g.jsx(he,{...Xe({name:["InputPlaceholder",c],props:n,classes:ja,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:d,rootSelector:"placeholder"})("placeholder"),mod:[{error:!!f},h],component:"span",...p})});uC.classes=ja;uC.displayName="@mantine/core/InputPlaceholder";function cee(e,{hasDescription:n,hasError:t}){const i=e.findIndex(l=>l==="input"),r=e.slice(0,i),a=e.slice(i+1),o=n&&r.includes("description")||t&&r.includes("error");return{offsetBottom:n&&a.includes("description")||t&&a.includes("error"),offsetTop:o}}const fee={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},lI=(e,{size:n})=>({label:{"--input-label-size":ri(n),"--input-asterisk-color":void 0},error:{"--input-error-size":n===void 0?void 0:`calc(${ri(n)} - ${me(2)})`},description:{"--input-description-size":n===void 0?void 0:`calc(${ri(n)} - ${me(2)})`}}),xy=De(e=>{const n=be("InputWrapper",fee,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,size:c,variant:f,__staticSelector:h,inputContainer:d,inputWrapperOrder:p,label:v,error:b,description:w,labelProps:k,descriptionProps:_,errorProps:C,labelElement:x,children:E,withAsterisk:j,id:O,required:M,__stylesApiProps:N,mod:q,attributes:R,...L}=n,F=Xe({name:["InputWrapper",h],props:N||n,classes:ja,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:R,vars:l,varsResolver:lI}),Y={size:c,variant:f,__staticSelector:h},V=Vi(O),$=typeof j=="boolean"?j:M,P=(C==null?void 0:C.id)||`${V}-error`,I=(_==null?void 0:_.id)||`${V}-description`,H=V,U=!!b&&typeof b!="boolean",D=!!w,W=`${U?P:""} ${D?I:""}`,G=W.trim().length>0?W.trim():void 0,z=(k==null?void 0:k.id)||`${V}-label`,X=v&&g.jsx(Jm,{labelElement:x,id:z,htmlFor:H,required:$,...Y,...k,children:v},"label"),ee=D&&g.jsx(Zm,{..._,...Y,size:(_==null?void 0:_.size)||Y.size,id:(_==null?void 0:_.id)||I,children:w},"description"),re=g.jsx(A.Fragment,{children:d(E)},"input"),le=U&&A.createElement(Qm,{...C,...Y,size:(C==null?void 0:C.size)||Y.size,key:"error",id:(C==null?void 0:C.id)||P},b),ye=p.map(ae=>{switch(ae){case"label":return X;case"input":return re;case"description":return ee;case"error":return le;default:return null}});return g.jsx(Pu,{value:{getStyles:F,describedBy:G,inputId:H,labelId:z,...cee(p,{hasDescription:D,hasError:U})},children:g.jsx(he,{variant:f,size:c,mod:[{error:!!b},q],id:x==="label"?void 0:O,...F("root"),...L,children:ye})})});xy.classes=ja;xy.varsResolver=lI;xy.displayName="@mantine/core/InputWrapper";const dee={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm",loading:!1,loadingPosition:"right"},uI=(e,n,t)=>({wrapper:{"--input-margin-top":t.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":t.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":Bn(n.size,"input-height"),"--input-fz":ri(n.size),"--input-radius":n.radius===void 0?void 0:Yt(n.radius),"--input-left-section-width":n.leftSectionWidth!==void 0?me(n.leftSectionWidth):void 0,"--input-right-section-width":n.rightSectionWidth!==void 0?me(n.rightSectionWidth):void 0,"--input-padding-y":n.multiline?Bn(n.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":n.leftSectionPointerEvents,"--input-right-section-pointer-events":n.rightSectionPointerEvents}}),Gt=Ai(e=>{const n=be("Input",dee,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,required:l,__staticSelector:c,__stylesApiProps:f,size:h,wrapperProps:d,error:p,disabled:v,leftSection:b,leftSectionProps:w,leftSectionWidth:k,rightSection:_,rightSectionProps:C,rightSectionWidth:x,rightSectionPointerEvents:E,leftSectionPointerEvents:j,variant:O,vars:M,pointer:N,multiline:q,radius:R,id:L,withAria:F,withErrorStyles:Y,mod:V,inputSize:$,attributes:P,__clearSection:I,__clearable:H,__clearSectionMode:U,__defaultRightSection:D,loading:W,loadingPosition:G,rootRef:z,...X}=n,{styleProps:ee,rest:re}=Du(X),le=A.use(Pu),ye={offsetBottom:le==null?void 0:le.offsetBottom,offsetTop:le==null?void 0:le.offsetTop},ae=Xe({name:["Input",c],props:f||n,classes:ja,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:P,stylesCtx:ye,rootSelector:"wrapper",vars:M,varsResolver:uI}),ue=F?{required:l,disabled:v,"aria-invalid":p?!0:void 0,"aria-describedby":le==null?void 0:le.describedBy,id:(le==null?void 0:le.inputId)||L}:{},Se=W?g.jsx(ai,{size:G==="left"?"calc(var(--input-left-section-size) / 2)":"calc(var(--input-right-section-size) / 2)"}):null,ne=W&&G==="left"?Se:b,Le=lee({__clearable:H,__clearSection:I,rightSection:W&&G==="right"?Se:_,__defaultRightSection:D,size:h,__clearSectionMode:U});return g.jsx(iI,{value:{size:h||"sm"},children:g.jsxs(he,{ref:z,...ae("wrapper"),...ee,...d,mod:[{error:!!p&&Y,pointer:N,disabled:v,multiline:q,"data-with-right-section":!!Le,"data-with-left-section":!!ne},V],variant:O,size:h,children:[ne&&g.jsx("div",{...w,"data-position":"left",...ae("section",{className:w==null?void 0:w.className,style:w==null?void 0:w.style}),children:ne}),g.jsx(he,{component:"input",...re,...ue,required:l,mod:{disabled:v,error:!!p&&Y},variant:O,__size:$,...ae("input")}),Le&&g.jsx("div",{...C,"data-position":"right",...ae("section",{className:C==null?void 0:C.className,style:C==null?void 0:C.style}),children:Le})]})})});Gt.classes=ja;Gt.varsResolver=uI;Gt.Wrapper=xy;Gt.Label=Jm;Gt.Error=Qm;Gt.Description=Zm;Gt.Placeholder=uC;Gt.ClearButton=rI;Gt.displayName="@mantine/core/Input";function cI(e,n,t){const i=be(e,n,t),{label:r,description:a,error:o,required:l,classNames:c,styles:f,className:h,unstyled:d,__staticSelector:p,__stylesApiProps:v,errorProps:b,labelProps:w,descriptionProps:k,wrapperProps:_,id:C,size:x,style:E,inputContainer:j,inputWrapperOrder:O,withAsterisk:M,variant:N,vars:q,mod:R,attributes:L,...F}=i,{styleProps:Y,rest:V}=Du(F),$={label:r,description:a,error:o,required:l,classNames:c,className:h,__staticSelector:p,__stylesApiProps:v||i,errorProps:b,labelProps:w,descriptionProps:k,unstyled:d,styles:f,size:x,style:E,inputContainer:j,inputWrapperOrder:O,withAsterisk:M,variant:N,id:C,mod:R,attributes:L,..._};return{...V,classNames:c,styles:f,unstyled:d,wrapperProps:{...$,...Y},inputProps:{required:l,classNames:c,styles:f,unstyled:d,size:x,__staticSelector:p,__stylesApiProps:v||i,error:o,variant:N,id:C,attributes:L}}}const hee={__staticSelector:"InputBase",withAria:!0,size:"sm"},Ri=Ai(e=>{const{inputProps:n,wrapperProps:t,...i}=cI("InputBase",hee,e);return g.jsx(Gt.Wrapper,{...t,children:g.jsx(Gt,{...n,...i})})});Ri.classes={...Gt.classes,...Gt.Wrapper.classes};Ri.displayName="@mantine/core/InputBase";function Bg({style:e,size:n=16,...t}){return g.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:me(n),height:me(n),display:"block"},...t,children:g.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}Bg.displayName="@mantine/core/AccordionChevron";var fI={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 dI=(e,{radius:n,color:t,variant:i,autoContrast:r})=>{const a=e.variantColorResolver({color:t||e.primaryColor,theme:e,variant:i||"light",autoContrast:r});return{root:{"--alert-radius":n===void 0?void 0:Yt(n),"--alert-bg":t||i?a.background:void 0,"--alert-color":a.color,"--alert-bd":t||i?a.border:void 0}}},bu=De(e=>{const n=be("Alert",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,radius:c,color:f,title:h,children:d,id:p,icon:v,withCloseButton:b,onClose:w,closeButtonLabel:k,variant:_,autoContrast:C,role:x,attributes:E,...j}=n,O=Xe({name:"Alert",classes:fI,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:E,vars:l,varsResolver:dI}),M=Vi(p),N=h&&`${M}-title`||void 0,q=`${M}-body`;return g.jsx(he,{id:M,...O("root",{variant:_}),variant:_,...j,role:x||"alert","aria-describedby":d?q:void 0,"aria-labelledby":h?N:void 0,children:g.jsxs("div",{...O("wrapper"),children:[v&&g.jsx("div",{...O("icon"),children:v}),g.jsxs("div",{...O("body"),children:[h&&g.jsx("div",{...O("title"),"data-with-close-button":b||void 0,children:g.jsx("span",{id:N,...O("label"),children:h})}),d&&g.jsx("div",{id:q,...O("message"),"data-variant":_,children:d})]}),b&&g.jsx(bl,{...O("closeButton"),onClick:w,variant:"transparent",size:16,iconSize:16,"aria-label":k,unstyled:o})]})})});bu.classes=fI;bu.varsResolver=dI;bu.displayName="@mantine/core/Alert";var hI={root:"m_b6d8b162"};function mee(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const pee={inherit:!1},mI=(e,{variant:n,lineClamp:t,gradient:i,size:r})=>({root:{"--text-fz":ri(r),"--text-lh":OK(r),"--text-gradient":n==="gradient"?vS(i,e):void 0,"--text-line-clamp":typeof t=="number"?t.toString():void 0}}),xe=Ai(e=>{const n=be("Text",pee,e),{lineClamp:t,truncate:i,inline:r,inherit:a,gradient:o,span:l,__staticSelector:c,vars:f,className:h,style:d,classNames:p,styles:v,unstyled:b,variant:w,mod:k,size:_,attributes:C,...x}=n;return g.jsx(he,{...Xe({name:["Text",c],props:n,classes:hI,className:h,style:d,classNames:p,styles:v,unstyled:b,attributes:C,vars:f,varsResolver:mI})("root",{focusable:!0}),component:l?"span":"p",variant:w,mod:[{"data-truncate":mee(i),"data-line-clamp":typeof t=="number","data-inline":r,"data-inherit":a},k],size:_,...x})});xe.classes=hI;xe.varsResolver=mI;xe.displayName="@mantine/core/Text";var pI={root:"m_849cf0da"};const vee={underline:"hover"},Sy=Ai(e=>{const{underline:n,className:t,unstyled:i,mod:r,...a}=be("Anchor",vee,e);return g.jsx(xe,{component:"a",className:pn({[pI.root]:!i},t),...a,mod:[{underline:n},r],__staticSelector:"Anchor",unstyled:i})});Sy.classes=pI;Sy.displayName="@mantine/core/Anchor";const[gee,If]=Xr("AppShell was not found in tree");var wl={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const cC=De(e=>{const{classNames:n,className:t,style:i,styles:r,unstyled:a,vars:o,withBorder:l,zIndex:c,mod:f,...h}=be("AppShellAside",null,e),d=If();return d.disabled?null:g.jsx(he,{component:"aside",mod:[{"with-border":l??d.withBorder},f],...d.getStyles("aside",{className:pn({[yu.classNames.zeroRight]:d.offsetScrollbars},t),classNames:n,styles:r,style:i}),...h,__vars:{"--app-shell-aside-z-index":`calc(${c??d.zIndex} + 1)`}})});cC.classes=wl;cC.displayName="@mantine/core/AppShellAside";const fC=De(e=>{var p;const{classNames:n,className:t,style:i,styles:r,unstyled:a,vars:o,withBorder:l,zIndex:c,mod:f,...h}=be("AppShellFooter",null,e),d=If();return d.disabled?null:g.jsx(he,{component:"footer",mod:[{"with-border":l??d.withBorder},f],...d.getStyles("footer",{className:pn({[yu.classNames.zeroRight]:d.offsetScrollbars},t),classNames:n,styles:r,style:i}),...h,__vars:{"--app-shell-footer-z-index":(p=c??d.zIndex)==null?void 0:p.toString()}})});fC.classes=wl;fC.displayName="@mantine/core/AppShellFooter";const dC=De(e=>{var p;const{classNames:n,className:t,style:i,styles:r,unstyled:a,vars:o,withBorder:l,zIndex:c,mod:f,...h}=be("AppShellHeader",null,e),d=If();return d.disabled?null:g.jsx(he,{component:"header",mod:[{"with-border":l??d.withBorder},f],...d.getStyles("header",{className:pn({[yu.classNames.zeroRight]:d.offsetScrollbars},t),classNames:n,styles:r,style:i}),...h,__vars:{"--app-shell-header-z-index":(p=c??d.zIndex)==null?void 0:p.toString()}})});dC.classes=wl;dC.displayName="@mantine/core/AppShellHeader";const hC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("AppShellMain",null,e);return g.jsx(he,{component:"main",...If().getStyles("main",{className:t,style:i,classNames:n,styles:r}),...o})});hC.classes=wl;hC.displayName="@mantine/core/AppShellMain";const mC=De(e=>{const{classNames:n,className:t,style:i,styles:r,unstyled:a,vars:o,withBorder:l,zIndex:c,mod:f,...h}=be("AppShellNavbar",null,e),d=If();return d.disabled?null:g.jsx(he,{component:"nav",mod:[{"with-border":l??d.withBorder},f],...d.getStyles("navbar",{className:t,classNames:n,styles:r,style:i}),...h,__vars:{"--app-shell-navbar-z-index":`calc(${c??d.zIndex} + 1)`}})});mC.classes=wl;mC.displayName="@mantine/core/AppShellNavbar";const pC=Ai(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,grow:o,mod:l,...c}=be("AppShellSection",null,e),f=If();return g.jsx(he,{mod:[{grow:o},l],...f.getStyles("section",{className:t,style:i,classNames:n,styles:r}),...c})});pC.classes=wl;pC.displayName="@mantine/core/AppShellSection";function ep(e){return typeof e=="object"?e.base:e}function np(e){const n=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||n}function tp(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function yee({baseStyles:e,minMediaStyles:n,maxMediaStyles:t,aside:i,theme:r,mode:a}){var f,h,d;const o=i==null?void 0:i.width,l="translateX(var(--app-shell-aside-width))",c="translateX(calc(var(--app-shell-aside-width) * -1))";if(i!=null&&i.breakpoint&&!((f=i==null?void 0:i.collapsed)!=null&&f.mobile)&&(t[i==null?void 0:i.breakpoint]=t[i==null?void 0:i.breakpoint]||{},a==="fixed"?(t[i==null?void 0:i.breakpoint]["--app-shell-aside-width"]="100%",t[i==null?void 0:i.breakpoint]["--app-shell-aside-offset"]="0px"):(t[i==null?void 0:i.breakpoint]["--app-shell-aside-width"]="0px",t[i==null?void 0:i.breakpoint]["--app-shell-aside-offset"]="0px")),np(o)){const p=me(ep(o));e["--app-shell-aside-width"]=p,e["--app-shell-aside-offset"]=p}if(tp(o)&&(typeof o.base<"u"&&(e["--app-shell-aside-width"]=me(o.base),e["--app-shell-aside-offset"]=me(o.base)),Pt(o).forEach(p=>{p!=="base"&&(n[p]=n[p]||{},n[p]["--app-shell-aside-width"]=me(o[p]),n[p]["--app-shell-aside-offset"]=me(o[p]))})),i!=null&&i.breakpoint&&a==="static"&&(n[i.breakpoint]=n[i.breakpoint]||{},n[i.breakpoint]["--app-shell-aside-position"]="sticky",n[i.breakpoint]["--app-shell-aside-grid-row"]="2",n[i.breakpoint]["--app-shell-aside-grid-column"]="3",n[i.breakpoint]["--app-shell-main-column-end"]="3"),(h=i==null?void 0:i.collapsed)!=null&&h.desktop){const p=i.breakpoint;n[p]=n[p]||{},n[p]["--app-shell-aside-transform"]=l,n[p]["--app-shell-aside-transform-rtl"]=c,a==="fixed"?n[p]["--app-shell-aside-offset"]="0px !important":(n[p]["--app-shell-aside-width"]="0px",n[p]["--app-shell-aside-display"]="none",n[p]["--app-shell-main-column-end"]="-1"),n[p]["--app-shell-aside-scroll-locked-visibility"]="hidden"}if((d=i==null?void 0:i.collapsed)!=null&&d.mobile){const p=I6(i.breakpoint,r.breakpoints)-.1;t[p]=t[p]||{},a==="fixed"?(t[p]["--app-shell-aside-width"]="100%",t[p]["--app-shell-aside-offset"]="0px"):t[p]["--app-shell-aside-width"]="0px",t[p]["--app-shell-aside-transform"]=l,t[p]["--app-shell-aside-transform-rtl"]=c,t[p]["--app-shell-aside-scroll-locked-visibility"]="hidden"}}function bee({baseStyles:e,minMediaStyles:n,footer:t,mode:i}){const r=t==null?void 0:t.height,a="translateY(var(--app-shell-footer-height))",o=i==="static"?!0:(t==null?void 0:t.offset)??!0;if(i==="static"&&t&&(e["--app-shell-footer-position"]="sticky",e["--app-shell-footer-grid-column"]="1 / -1",e["--app-shell-footer-grid-row"]="3"),np(r)){const l=me(ep(r));e["--app-shell-footer-height"]=l,o&&(e["--app-shell-footer-offset"]=l)}tp(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=me(r.base),o&&(e["--app-shell-footer-offset"]=me(r.base))),Pt(r).forEach(l=>{l!=="base"&&(n[l]=n[l]||{},n[l]["--app-shell-footer-height"]=me(r[l]),o&&(n[l]["--app-shell-footer-offset"]=me(r[l])))})),t!=null&&t.collapsed&&(e["--app-shell-footer-transform"]=a,i==="fixed"&&(e["--app-shell-footer-offset"]="0px !important"))}function wee({baseStyles:e,minMediaStyles:n,header:t,mode:i}){const r=t==null?void 0:t.height,a="translateY(calc(var(--app-shell-header-height) * -1))",o=i==="static"?!0:(t==null?void 0:t.offset)??!0;if(i==="static"&&t&&(e["--app-shell-header-position"]="sticky",e["--app-shell-header-grid-column"]="1 / -1",e["--app-shell-header-grid-row"]="1"),np(r)){const l=me(ep(r));e["--app-shell-header-height"]=l,o&&(e["--app-shell-header-offset"]=l)}tp(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=me(r.base),o&&(e["--app-shell-header-offset"]=me(r.base))),Pt(r).forEach(l=>{l!=="base"&&(n[l]=n[l]||{},n[l]["--app-shell-header-height"]=me(r[l]),o&&(n[l]["--app-shell-header-offset"]=me(r[l])))})),t!=null&&t.collapsed&&(e["--app-shell-header-transform"]=a,i==="fixed"&&(e["--app-shell-header-offset"]="0px !important"))}function kee({baseStyles:e,minMediaStyles:n,maxMediaStyles:t,navbar:i,theme:r,mode:a}){var f,h,d;const o=i==null?void 0:i.width,l="translateX(calc(var(--app-shell-navbar-width) * -1))",c="translateX(var(--app-shell-navbar-width))";if(i!=null&&i.breakpoint&&!((f=i==null?void 0:i.collapsed)!=null&&f.mobile)&&(t[i==null?void 0:i.breakpoint]=t[i==null?void 0:i.breakpoint]||{},t[i==null?void 0:i.breakpoint]["--app-shell-navbar-offset"]="0px",t[i==null?void 0:i.breakpoint]["--app-shell-navbar-width"]="100%",a==="static"&&(t[i==null?void 0:i.breakpoint]["--app-shell-navbar-grid-width"]="0px")),np(o)){const p=me(ep(o));e["--app-shell-navbar-width"]=p,e["--app-shell-navbar-offset"]=p,a==="static"&&(e["--app-shell-navbar-grid-width"]=p)}if(tp(o)&&(typeof o.base<"u"&&(e["--app-shell-navbar-width"]=me(o.base),e["--app-shell-navbar-offset"]=me(o.base),a==="static"&&(e["--app-shell-navbar-grid-width"]=me(o.base))),Pt(o).forEach(p=>{p!=="base"&&(n[p]=n[p]||{},n[p]["--app-shell-navbar-width"]=me(o[p]),n[p]["--app-shell-navbar-offset"]=me(o[p]),a==="static"&&(n[p]["--app-shell-navbar-grid-width"]=me(o[p])))})),i!=null&&i.breakpoint&&a==="static"&&(n[i.breakpoint]=n[i.breakpoint]||{},n[i.breakpoint]["--app-shell-navbar-position"]="sticky",n[i.breakpoint]["--app-shell-navbar-grid-row"]="2",n[i.breakpoint]["--app-shell-navbar-grid-column"]="1",n[i.breakpoint]["--app-shell-main-column-start"]="2"),(h=i==null?void 0:i.collapsed)!=null&&h.desktop){const p=i.breakpoint;n[p]=n[p]||{},n[p]["--app-shell-navbar-transform"]=l,n[p]["--app-shell-navbar-transform-rtl"]=c,a==="fixed"?n[p]["--app-shell-navbar-offset"]="0px !important":(n[p]["--app-shell-navbar-width"]="0px",n[p]["--app-shell-navbar-display"]="none",n[p]["--app-shell-main-column-start"]="1")}if((d=i==null?void 0:i.collapsed)!=null&&d.mobile){const p=I6(i.breakpoint,r.breakpoints)-.1;t[p]=t[p]||{},t[p]["--app-shell-navbar-width"]="100%",t[p]["--app-shell-navbar-offset"]="0px",a==="static"&&(t[p]["--app-shell-navbar-grid-width"]="0px"),t[p]["--app-shell-navbar-transform"]=l,t[p]["--app-shell-navbar-transform-rtl"]=c}}function Ak(e){return Number(e)===0?"0px":Vt(e)}function _ee({padding:e,baseStyles:n,minMediaStyles:t}){np(e)&&(n["--app-shell-padding"]=Ak(ep(e))),tp(e)&&(e.base&&(n["--app-shell-padding"]=Ak(e.base)),Pt(e).forEach(i=>{i!=="base"&&(t[i]=t[i]||{},t[i]["--app-shell-padding"]=Ak(e[i]))}))}function xee({navbar:e,header:n,footer:t,aside:i,padding:r,theme:a,mode:o}){const l={},c={},f={};o==="static"&&(f["--app-shell-main-grid-column"]="1 / -1",f["--app-shell-main-grid-row"]="2"),kee({baseStyles:f,minMediaStyles:l,maxMediaStyles:c,navbar:e,theme:a,mode:o}),yee({baseStyles:f,minMediaStyles:l,maxMediaStyles:c,aside:i,theme:a,mode:o}),wee({baseStyles:f,minMediaStyles:l,header:n,mode:o}),bee({baseStyles:f,minMediaStyles:l,footer:t,mode:o}),_ee({baseStyles:f,minMediaStyles:l,padding:r});const h=Kh(Pt(l),a.breakpoints).map(p=>({query:`(min-width: ${Tg(p.px)})`,styles:l[p.value]})),d=Kh(Pt(c),a.breakpoints).map(p=>({query:`(max-width: ${Tg(p.px)})`,styles:c[p.value]}));return{baseStyles:f,media:[...h,...d]}}function See({navbar:e,header:n,aside:t,footer:i,padding:r,mode:a,selector:o}){const l=ui(),c=_o(),{media:f,baseStyles:h}=xee({navbar:e,header:n,footer:i,aside:t,padding:r,theme:l,mode:a});return g.jsx(Nf,{media:f,styles:h,selector:o||c.cssVariablesSelector})}function Cee({transitionDuration:e,disabled:n}){const[t,i]=A.useState(!0),r=A.useRef(-1),a=A.useRef(-1);return xz("resize",()=>{i(!0),clearTimeout(r.current),r.current=window.setTimeout(()=>A.startTransition(()=>{i(!1)}),200)}),ps(()=>{i(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>A.startTransition(()=>{i(!1)}),e||0)},[n,e]),t}const Aee={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Sa("app"),mode:"fixed"},vI=(e,{transitionDuration:n,transitionTimingFunction:t})=>({root:{"--app-shell-transition-duration":`${n}ms`,"--app-shell-transition-timing-function":t}}),xr=De(e=>{const n=be("AppShell",Aee,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,navbar:c,withBorder:f,padding:h,transitionDuration:d,transitionTimingFunction:p,header:v,zIndex:b,layout:w,disabled:k,aside:_,footer:C,offsetScrollbars:x=!0,mode:E,mod:j,attributes:O,id:M,...N}=n,q=Xe({name:"AppShell",classes:wl,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:O,vars:l,varsResolver:vI}),R=Cee({disabled:k,transitionDuration:d}),L=Vi(M);return g.jsxs(gee,{value:{getStyles:q,withBorder:f,zIndex:b,disabled:k,offsetScrollbars:x,mode:E},children:[g.jsx(See,{navbar:c,header:v,aside:_,footer:C,padding:h,mode:E,selector:E==="static"?`#${L}`:void 0}),g.jsx(he,{...q("root"),id:L,mod:[{resizing:R,layout:w,disabled:k,mode:E},j],...N})]})});xr.classes=wl;xr.varsResolver=vI;xr.displayName="@mantine/core/AppShell";xr.Navbar=mC;xr.Header=dC;xr.Main=hC;xr.Aside=cC;xr.Footer=fC;xr.Section=pC;function gI(e){return typeof e=="string"?{value:e,label:e}:typeof e=="object"&&"value"in e&&!("label"in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e=="object"&&"group"in e?{group:e.group,items:e.items.map(n=>gI(n))}:typeof e=="number"||typeof e=="bigint"||typeof e=="boolean"?{value:e,label:`${e}`}:e}function Cy(e){return e?e.map(n=>gI(n)):[]}function ip(e){return e.reduce((n,t)=>"group"in t?{...n,...ip(t.items)}:(n[`${t.value}`]=t,n),{})}var cr={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2",optionsDropdownCheckPlaceholder:"m_a530ee0a"};const jee={error:null},yI=(e,{size:n,color:t})=>({chevron:{"--combobox-chevron-size":Bn(n,"combobox-chevron-size"),"--combobox-chevron-color":t?lt(t,e):void 0}}),Ay=De(e=>{const n=be("ComboboxChevron",jee,e),{size:t,error:i,style:r,className:a,classNames:o,styles:l,unstyled:c,vars:f,attributes:h,mod:d,...p}=n,v=Xe({name:"ComboboxChevron",classes:cr,props:n,style:r,className:a,classNames:o,styles:l,unstyled:c,vars:f,varsResolver:yI,attributes:h,rootSelector:"chevron"});return g.jsx(he,{component:"svg",...p,...v("chevron"),size:t,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:i},d],children:g.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});Ay.classes=cr;Ay.varsResolver=yI;Ay.displayName="@mantine/core/ComboboxChevron";const[Oee,Oa]=Xr("Combobox component was not found in tree");function bI({onMouseDown:e,onClick:n,onClear:t,...i}){return g.jsx(Gt.ClearButton,{tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:r=>{r.preventDefault(),e==null||e(r)},onClick:r=>{t(),n==null||n(r)}})}bI.displayName="@mantine/core/ComboboxClearButton";const vC=De(e=>{const{classNames:n,styles:t,className:i,style:r,hidden:a,...o}=be("ComboboxDropdown",null,e),l=Oa();return g.jsx(On.Dropdown,{...o,role:"presentation","data-hidden":a||void 0,...l.getStyles("dropdown",{className:i,style:r,classNames:n,styles:t})})});vC.classes=cr;vC.displayName="@mantine/core/ComboboxDropdown";const Eee={refProp:"ref"},wI=De(e=>{const{children:n,refProp:t,ref:i}=be("ComboboxDropdownTarget",Eee,e);if(Oa(),!$6(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 g.jsx(On.Target,{ref:i,refProp:t,children:n})});wI.displayName="@mantine/core/ComboboxDropdownTarget";const gC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("ComboboxEmpty",null,e);return g.jsx(he,{...Oa().getStyles("empty",{className:t,classNames:n,styles:r,style:i}),...o})});gC.classes=cr;gC.displayName="@mantine/core/ComboboxEmpty";function yC({onKeyDown:e,onClick:n,withKeyboardNavigation:t,withAriaAttributes:i,withExpandedAttribute:r,targetType:a,autoComplete:o}){const l=Oa(),[c,f]=A.useState(null),h=v=>{if(e==null||e(v),!l.readOnly&&t){if(v.nativeEvent.isComposing)return;if(v.nativeEvent.code==="ArrowDown"&&(v.preventDefault(),l.store.dropdownOpened?f(l.store.selectNextOption()):(l.store.openDropdown("keyboard"),f(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),v.nativeEvent.code==="ArrowUp"&&(v.preventDefault(),l.store.dropdownOpened?f(l.store.selectPreviousOption()):(l.store.openDropdown("keyboard"),f(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),v.nativeEvent.code==="Enter"||v.nativeEvent.code==="NumpadEnter"){if(v.nativeEvent.keyCode===229)return;const b=l.store.getSelectedOptionIndex();l.store.dropdownOpened&&b!==-1?(v.preventDefault(),l.store.clickSelectedOption()):a==="button"&&(v.preventDefault(),l.store.openDropdown("keyboard"))}v.key==="Escape"&&l.store.closeDropdown("keyboard"),v.nativeEvent.code==="Space"&&a==="button"&&(v.preventDefault(),l.store.toggleDropdown("keyboard"))}};return{...i?{...r?{role:"combobox"}:{},"aria-haspopup":"listbox","aria-expanded":r?!!(l.store.listId&&l.store.dropdownOpened):void 0,"aria-controls":l.store.dropdownOpened&&l.store.listId?l.store.listId:void 0,"aria-activedescendant":l.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":l.store.dropdownOpened||void 0,"data-mantine-stop-propagation":l.store.dropdownOpened||void 0}:{},onKeyDown:h,onClick:v=>{a==="button"&&v.currentTarget.focus(),n==null||n(v)}}}const Tee={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},kI=De(e=>{const{children:n,refProp:t,withKeyboardNavigation:i,withAriaAttributes:r,withExpandedAttribute:a,targetType:o,autoComplete:l,ref:c,...f}=be("ComboboxEventsTarget",Tee,e),h=Mu(n);if(!h)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 d=Oa();return A.cloneElement(h,{...yC({targetType:o,withAriaAttributes:r,withKeyboardNavigation:i,withExpandedAttribute:a,onKeyDown:h.props.onKeyDown,onClick:h.props.onClick,autoComplete:l}),...f,[t]:Kt(c,d.store.targetRef,uy(h))})});kI.displayName="@mantine/core/ComboboxEventsTarget";const bC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("ComboboxFooter",null,e);return g.jsx(he,{...Oa().getStyles("footer",{className:t,classNames:n,style:i,styles:r}),...o,onMouseDown:l=>{l.preventDefault()}})});bC.classes=cr;bC.displayName="@mantine/core/ComboboxFooter";const wC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,children:o,label:l,id:c,...f}=be("ComboboxGroup",null,e),h=Oa(),d=Vi(c);return g.jsxs(he,{role:"group","aria-labelledby":l?d:void 0,...h.getStyles("group",{className:t,classNames:n,style:i,styles:r}),...f,children:[l&&g.jsx("div",{id:d,...h.getStyles("groupLabel",{classNames:n,styles:r}),children:l}),o]})});wC.classes=cr;wC.displayName="@mantine/core/ComboboxGroup";const kC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("ComboboxHeader",null,e);return g.jsx(he,{...Oa().getStyles("header",{className:t,classNames:n,style:i,styles:r}),...o,onMouseDown:l=>{l.preventDefault()}})});kC.classes=cr;kC.displayName="@mantine/core/ComboboxHeader";function _I({value:e,valuesDivider:n=",",...t}){return g.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(n):e?`${e}`:"",...t})}_I.displayName="@mantine/core/ComboboxHiddenInput";const _C=De(e=>{const n=be("ComboboxOption",null,e),{classNames:t,className:i,style:r,styles:a,vars:o,onClick:l,id:c,active:f,onMouseDown:h,onMouseOver:d,disabled:p,selected:v,mod:b,...w}=n,k=Oa(),_=A.useId(),C=c||_;return g.jsx(he,{...k.getStyles("option",{className:i,classNames:t,styles:a,style:r}),...w,id:C,mod:["combobox-option",{"combobox-active":f,"combobox-disabled":p,"combobox-selected":v},b],role:"option",onClick:x=>{var E;p?x.preventDefault():((E=k.onOptionSubmit)==null||E.call(k,n.value,n),l==null||l(x))},onMouseDown:x=>{x.preventDefault(),h==null||h(x)},onMouseOver:x=>{k.resetSelectionOnOptionHover&&k.store.resetSelectedOption(),d==null||d(x)}})});_C.classes=cr;_C.displayName="@mantine/core/ComboboxOption";const xC=De(e=>{const{classNames:n,className:t,style:i,styles:r,id:a,onMouseDown:o,labelledBy:l,...c}=be("ComboboxOptions",null,e),f=Oa(),h=Vi(a);return A.useEffect(()=>{f.store.setListId(h)},[h]),g.jsx(he,{...f.getStyles("options",{className:t,style:i,classNames:n,styles:r}),...c,id:h,role:"listbox","aria-labelledby":l,onMouseDown:d=>{d.preventDefault(),o==null||o(d)}})});xC.classes=cr;xC.displayName="@mantine/core/ComboboxOptions";const Mee={withAriaAttributes:!0,withKeyboardNavigation:!0},SC=De(e=>{const{classNames:n,styles:t,unstyled:i,vars:r,withAriaAttributes:a,onKeyDown:o,onClick:l,withKeyboardNavigation:c,size:f,ref:h,...d}=be("ComboboxSearch",Mee,e),p=Oa(),v=p.getStyles("search"),b=yC({targetType:"input",withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:l,autoComplete:"off"});return g.jsx(Gt,{ref:Kt(h,p.store.searchRef),classNames:[{input:v.className},n],styles:[{input:v.style},t],size:f||p.size,...b,...d,__staticSelector:"Combobox"})});SC.classes=cr;SC.displayName="@mantine/core/ComboboxSearch";const Dee={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},xI=De(e=>{const{children:n,refProp:t,withKeyboardNavigation:i,withAriaAttributes:r,withExpandedAttribute:a,targetType:o,autoComplete:l,ref:c,...f}=be("ComboboxTarget",Dee,e),h=Mu(n);if(!h)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 d=Oa(),p=A.cloneElement(h,{...yC({targetType:o,withAriaAttributes:r,withKeyboardNavigation:i,withExpandedAttribute:a,onKeyDown:h.props.onKeyDown,onClick:h.props.onClick,autoComplete:l}),...f});return g.jsx(On.Target,{refProp:t,ref:Kt(c,d.store.targetRef),children:p})});xI.displayName="@mantine/core/ComboboxTarget";function Ree(e,n,t){for(let i=e-1;i>=0;i-=1)if(!n[i].hasAttribute("data-combobox-disabled"))return i;if(t){for(let i=n.length-1;i>-1;i-=1)if(!n[i].hasAttribute("data-combobox-disabled"))return i}return e}function Pee(e,n,t){for(let i=e+1;i{l||(c(!0),r==null||r(P))},[c,r,l]),_=A.useCallback((P="unknown")=>{l&&(c(!1),i==null||i(P))},[c,i,l]),C=A.useCallback((P="unknown")=>{l?_(P):k(P)},[_,k,l]),x=A.useCallback(()=>{const P=Wo(p.current),I=pg(`#${f.current} [data-combobox-selected]`,P);I==null||I.removeAttribute("data-combobox-selected"),I==null||I.removeAttribute("aria-selected")},[]),E=A.useCallback(P=>{const I=Wo(p.current),H=pg(`#${f.current}`,I),U=H?Ko("[data-combobox-option]",H):null;if(!U)return null;const D=P>=U.length?0:P<0?U.length-1:P;return h.current=D,U!=null&&U[D]&&!U[D].hasAttribute("data-combobox-disabled")?(x(),U[D].setAttribute("data-combobox-selected","true"),U[D].setAttribute("aria-selected","true"),U[D].scrollIntoView({block:"nearest",behavior:o}),U[D].id):null},[o,x]),j=A.useCallback(()=>{const P=Wo(p.current),I=pg(`#${f.current} [data-combobox-active]`,P);return E(I?Ko(`#${f.current} [data-combobox-option]`,P).findIndex(H=>H===I):0)},[E]),O=A.useCallback(()=>{const P=Wo(p.current),I=Ko(`#${f.current} [data-combobox-option]`,P);return E(Pee(h.current,I,a))},[E,a]),M=A.useCallback(()=>{const P=Wo(p.current),I=Ko(`#${f.current} [data-combobox-option]`,P);return E(Ree(h.current,I,a))},[E,a]),N=A.useCallback(()=>{const P=Wo(p.current);return E(Nee(Ko(`#${f.current} [data-combobox-option]`,P)))},[E]),q=A.useCallback((P="selected",I)=>{var H;if(typeof P=="number"){h.current=P;const U=Wo(p.current),D=Ko(`#${f.current} [data-combobox-option]`,U);I!=null&&I.scrollIntoView&&((H=D[P])==null||H.scrollIntoView({block:"nearest",behavior:o}));return}w.current=window.setTimeout(()=>{var G;const U=Wo(p.current),D=Ko(`#${f.current} [data-combobox-option]`,U),W=D.findIndex(z=>z.hasAttribute(`data-combobox-${P}`));h.current=W,I!=null&&I.scrollIntoView&&((G=D[W])==null||G.scrollIntoView({block:"nearest",behavior:o}))},0)},[]),R=A.useCallback(()=>{h.current=-1,x()},[x]),L=A.useCallback(()=>{var I,H;const P=Wo(p.current);(H=(I=Ko(`#${f.current} [data-combobox-option]`,P))==null?void 0:I[h.current])==null||H.click()},[]),F=A.useCallback(P=>{f.current=P},[]),Y=A.useCallback(()=>{v.current=window.setTimeout(()=>{var P;return(P=d.current)==null?void 0:P.focus()},0)},[]),V=A.useCallback(()=>{b.current=window.setTimeout(()=>{var P;return(P=p.current)==null?void 0:P.focus()},0)},[]),$=A.useCallback(()=>h.current,[]);return A.useEffect(()=>()=>{window.clearTimeout(v.current),window.clearTimeout(b.current),window.clearTimeout(w.current)},[]),{dropdownOpened:l,openDropdown:k,closeDropdown:_,toggleDropdown:C,selectedOptionIndex:h.current,getSelectedOptionIndex:$,selectOption:E,selectFirstOption:N,selectActiveOption:j,selectNextOption:O,selectPreviousOption:M,resetSelectedOption:R,updateSelectedOptionIndex:q,listId:f.current,setListId:F,clickSelectedOption:L,searchRef:d,focusSearchInput:Y,targetRef:p,focusTarget:V}}const $ee={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},SI=(e,{size:n,dropdownPadding:t})=>({options:{"--combobox-option-fz":ri(n),"--combobox-option-padding":Bn(n,"combobox-option-padding")},dropdown:{"--combobox-padding":t===void 0?void 0:me(t),"--combobox-option-fz":ri(n),"--combobox-option-padding":Bn(n,"combobox-option-padding")}}),An=e=>{const n=be("Combobox",$ee,e),{classNames:t,styles:i,unstyled:r,children:a,store:o,vars:l,onOptionSubmit:c,onClose:f,size:h,dropdownPadding:d,resetSelectionOnOptionHover:p,__staticSelector:v,readOnly:b,attributes:w,...k}=n,_=Bf(),C=o||_,x=Xe({name:v||"Combobox",classes:cr,props:n,classNames:t,styles:i,unstyled:r,attributes:w,vars:l,varsResolver:SI}),E=()=>{f==null||f(),C.closeDropdown()};return g.jsx(Oee,{value:{getStyles:x,store:C,onOptionSubmit:c,size:h,resetSelectionOnOptionHover:p,readOnly:b},children:g.jsx(On,{opened:C.dropdownOpened,preventPositionChangeWhenVisible:!1,...k,onChange:j=>!j&&E(),withRoles:!1,unstyled:r,children:a})})},zee=e=>e;An.extend=zee;An.classes=cr;An.varsResolver=SI;An.displayName="@mantine/core/Combobox";An.Target=xI;An.Dropdown=vC;An.Options=xC;An.Option=_C;An.Search=SC;An.Empty=gC;An.Chevron=Ay;An.Footer=bC;An.Header=kC;An.EventsTarget=kI;An.DropdownTarget=wI;An.Group=wC;An.ClearButton=bI;An.HiddenInput=_I;function Lee({children:e,role:n}){const t=A.use(Pu);return t?g.jsx("div",{role:n,"aria-labelledby":t.labelId,"aria-describedby":t.describedBy,children:e}):g.jsx(g.Fragment,{children:e})}const CC=A.createContext(null),Iee={hiddenInputValuesSeparator:","},AC=fy((e=>{const{value:n,defaultValue:t,onChange:i,size:r,wrapperProps:a,children:o,readOnly:l,name:c,hiddenInputValuesSeparator:f,hiddenInputProps:h,maxSelectedValues:d,disabled:p,...v}=be("CheckboxGroup",Iee,e),[b,w]=Ci({value:n,defaultValue:t,finalValue:[],onChange:i}),k=x=>{const E=typeof x=="string"?x:x.currentTarget.value;if(l)return;const j=b.includes(E);!j&&d&&b.length>=d||w(j?b.filter(O=>O!==E):[...b,E])},_=x=>{if(p)return!0;if(!d)return!1;const E=b.includes(x),j=b.length>=d;return!E&&j},C=b.join(f);return g.jsx(CC,{value:{value:b,onChange:k,size:r,isDisabled:_},children:g.jsxs(Gt.Wrapper,{size:r,...a,...v,labelElement:"div",__staticSelector:"CheckboxGroup",children:[g.jsx(Lee,{role:"group",children:o}),g.jsx("input",{type:"hidden",name:c,value:C,...h})]})})}));AC.classes=Gt.Wrapper.classes;AC.displayName="@mantine/core/CheckboxGroup";var CI={card:"m_26775b0a"};const AI=A.createContext(null),Bee={withBorder:!0},jI=(e,{radius:n})=>({card:{"--card-radius":Yt(n)}}),jy=De(e=>{const n=be("CheckboxCard",Bee,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,checked:c,mod:f,withBorder:h,value:d,onClick:p,defaultChecked:v,onChange:b,attributes:w,...k}=n,_=Xe({name:"CheckboxCard",classes:CI,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:w,vars:l,varsResolver:jI,rootSelector:"card"}),C=A.use(CC),[x,E]=Ci({value:typeof c=="boolean"?c:C?C.value.includes(d||""):void 0,defaultValue:v,finalValue:!1,onChange:b});return g.jsx(AI,{value:{checked:x},children:g.jsx(Et,{mod:[{"with-border":h,checked:x},f],..._("card"),...k,role:"checkbox","aria-checked":x,onClick:j=>{p==null||p(j),C==null||C.onChange(d||""),E(!x)}})})});jy.displayName="@mantine/core/CheckboxCard";jy.classes=CI;jy.varsResolver=jI;function jC({size:e,style:n,...t}){return g.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e!==void 0?{width:me(e),height:me(e),...n}:n,"aria-hidden":!0,...t,children:g.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function OI({indeterminate:e,...n}){return e?g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...n,children:g.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):g.jsx(jC,{...n})}var EI={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const Fee={icon:OI,variant:"filled",radius:"sm"},TI=(e,{radius:n,color:t,size:i,iconColor:r,variant:a,autoContrast:o})=>{const l=vs({color:t||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":Bn(i,"checkbox-size"),"--checkbox-radius":n===void 0?void 0:Yt(n),"--checkbox-color":a==="outline"?c:lt(t,e),"--checkbox-icon-color":r?lt(r,e):Gm(o,e)?Pf({color:t,theme:e,autoContrast:o}):void 0}}},Oy=De(e=>{const n=be("CheckboxIndicator",Fee,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,icon:c,indeterminate:f,radius:h,color:d,iconColor:p,autoContrast:v,checked:b,mod:w,variant:k,disabled:_,attributes:C,...x}=n,E=Xe({name:"CheckboxIndicator",classes:EI,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:C,vars:l,varsResolver:TI,rootSelector:"indicator"}),j=A.use(AI),O=typeof b=="boolean"||typeof f=="boolean"?b||f:(j==null?void 0:j.checked)||!1;return g.jsx(he,{...E("indicator",{variant:k}),variant:k,mod:[{checked:O,disabled:_},w],...x,children:g.jsx(c,{indeterminate:f,...E("icon")})})});Oy.displayName="@mantine/core/CheckboxIndicator";Oy.classes=EI;Oy.varsResolver=TI;var MI={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const qee=MI;function DI({__staticSelector:e,__stylesApiProps:n,className:t,classNames:i,styles:r,unstyled:a,children:o,label:l,description:c,id:f,disabled:h,error:d,size:p,labelPosition:v="left",bodyElement:b="div",labelElement:w="label",variant:k,style:_,vars:C,mod:x,attributes:E,...j}){const O=Xe({name:e,props:n,className:t,style:_,classes:MI,classNames:i,styles:r,unstyled:a,attributes:E});return g.jsx(he,{...O("root"),__vars:{"--label-fz":ri(p),"--label-lh":Bn(p,"label-lh")},mod:[{"label-position":v},x],variant:k,size:p,...j,children:g.jsxs(he,{component:b,htmlFor:b==="label"?f:void 0,...O("body"),children:[o,g.jsxs("div",{...O("labelWrapper"),"data-disabled":h||void 0,children:[l&&g.jsx(he,{component:w,htmlFor:w==="label"?f:void 0,...O("label"),"data-disabled":h||void 0,children:l}),c&&g.jsx(Gt.Description,{size:p,__inheritStyles:!1,...O("description"),children:c}),d&&typeof d!="boolean"&&g.jsx(Gt.Error,{size:p,__inheritStyles:!1,...O("error"),children:d})]})]})})}DI.displayName="@mantine/core/InlineInput";var RI={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const Hee={labelPosition:"right",icon:OI,withErrorStyles:!0,variant:"filled",radius:"sm"},PI=(e,{radius:n,color:t,size:i,iconColor:r,variant:a,autoContrast:o})=>{const l=vs({color:t||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":Bn(i,"checkbox-size"),"--checkbox-radius":n===void 0?void 0:Yt(n),"--checkbox-color":a==="outline"?c:lt(t,e),"--checkbox-icon-color":r?lt(r,e):Gm(o,e)?Pf({color:t,theme:e,autoContrast:o}):void 0}}},vo=De(e=>{var le;const n=be("Checkbox",Hee,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,color:c,label:f,id:h,size:d,radius:p,wrapperProps:v,checked:b,labelPosition:w,description:k,error:_,disabled:C,variant:x,indeterminate:E,icon:j,rootRef:O,iconColor:M,onChange:N,autoContrast:q,mod:R,attributes:L,readOnly:F,onClick:Y,withErrorStyles:V,ref:$,...P}=n,I=A.useRef(null),H=A.use(CC),U=d||(H==null?void 0:H.size),D=Xe({name:"Checkbox",props:n,classes:RI,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:L,vars:l,varsResolver:PI}),{styleProps:W,rest:G}=Du(P),z=Vi(h),X={checked:(H==null?void 0:H.value.includes(G.value))??b,onChange:ye=>{H==null||H.onChange(ye),N==null||N(ye)}},ee=((le=H==null?void 0:H.isDisabled)==null?void 0:le.call(H,G.value))??!1,re=C||ee;return A.useEffect(()=>{I.current&&(I.current.indeterminate=E||!1,E?I.current.setAttribute("data-indeterminate","true"):I.current.removeAttribute("data-indeterminate"))},[E]),g.jsx(DI,{...D("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:z,size:U,labelPosition:w,label:f,description:k,error:_,disabled:re,classNames:t,styles:a,unstyled:o,"data-checked":X.checked||b||void 0,variant:x,ref:O,mod:R,attributes:L,inert:G.inert,...W,...v,children:g.jsxs(he,{...D("inner"),mod:{"data-label-position":w},children:[g.jsx(he,{component:"input",id:z,ref:Kt(I,$),mod:{error:!!_},...D("input",{focusable:!0,variant:x}),...G,...X,disabled:re,inert:G.inert,type:"checkbox",onClick:ye=>{F&&ye.preventDefault(),Y==null||Y(ye)}}),g.jsx(j,{indeterminate:E,...D("icon")})]})})});vo.classes={...RI,...qee};vo.varsResolver=PI;vo.displayName="@mantine/core/Checkbox";vo.Group=AC;vo.Indicator=Oy;vo.Card=jy;function wu(e){return"group"in e}function NI({options:e,search:n,limit:t}){const i=n.trim().toLowerCase(),r=[];for(let a=0;a0)return!1;return!0}function $I(e,n=new Set){if(Array.isArray(e))for(const t of e)if(wu(t))$I(t.items,n);else{if(typeof t.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(n.has(t.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${t.value}" was provided more than once`);n.add(t.value)}}function Vee(e,n){return Array.isArray(e)?e.includes(n):e===n}function zI({data:e,withCheckIcon:n,withAlignedLabels:t,value:i,checkIconPosition:r,unstyled:a,renderOption:o}){if(!wu(e)){const c=Vee(i,e.value),f=n&&(c?g.jsx(jC,{className:cr.optionsDropdownCheckIcon}):t?g.jsx("div",{className:cr.optionsDropdownCheckPlaceholder}):null),h=g.jsxs(g.Fragment,{children:[r==="left"&&f,g.jsx("span",{children:e.label}),r==="right"&&f]});return g.jsx(An.Option,{value:e.value,disabled:e.disabled,className:pn({[cr.optionsDropdownOption]:!a}),"data-reverse":r==="right"||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof o=="function"?o({option:e,checked:c}):h})}const l=e.items.map(c=>g.jsx(zI,{data:c,value:i,unstyled:a,withCheckIcon:n,withAlignedLabels:t,checkIconPosition:r,renderOption:o},`${c.value}`));return g.jsx(An.Group,{label:e.group,children:l})}function Ey({data:e,hidden:n,hiddenWhenEmpty:t,filter:i,search:r,limit:a,maxDropdownHeight:o,withScrollArea:l=!0,filterOptions:c=!0,withCheckIcon:f=!1,withAlignedLabels:h=!1,value:d,checkIconPosition:p,nothingFoundMessage:v,unstyled:b,labelId:w,renderOption:k,scrollAreaProps:_,"aria-label":C}){$I(e);const x=typeof r=="string"?(i||NI)({options:e,search:c?r:"",limit:a??1/0}):e,E=Uee(x),j=x.map(O=>g.jsx(zI,{data:O,withCheckIcon:f,withAlignedLabels:h,value:d,checkIconPosition:p,unstyled:b,renderOption:k},wu(O)?O.group:`${O.value}`));return g.jsx(An.Dropdown,{hidden:n||t&&E,"data-composed":!0,children:g.jsxs(An.Options,{labelledBy:w,"aria-label":C,children:[l?g.jsx(fr.Autosize,{mah:o??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",..._,children:j}):j,E&&v&&g.jsx(An.Empty,{children:v})]})})}const Ty=De(e=>{const n=be("Autocomplete",{size:"sm"},e),{classNames:t,styles:i,unstyled:r,vars:a,dropdownOpened:o,defaultDropdownOpened:l,onDropdownClose:c,onDropdownOpen:f,onFocus:h,onBlur:d,onClick:p,onChange:v,data:b,value:w,defaultValue:k,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:x,comboboxProps:E,readOnly:j,disabled:O,filter:M,limit:N,withScrollArea:q,maxDropdownHeight:R,size:L,id:F,renderOption:Y,autoComplete:V,scrollAreaProps:$,onClear:P,clearButtonProps:I,error:H,clearable:U,clearSectionMode:D,rightSection:W,autoSelectOnBlur:G,openOnFocus:z=!0,attributes:X,...ee}=n,re=Vi(F),le=Cy(b),ye=ip(le),[ae,ue]=Ci({value:w,defaultValue:k,finalValue:"",onChange:v}),Se=Bf({opened:o,defaultOpened:l,onDropdownOpen:()=>{f==null||f(),C&&Se.selectFirstOption()},onDropdownClose:()=>{c==null||c(),setTimeout(Se.resetSelectedOption,0)}}),ne=Ne=>{ue(Ne),Se.resetSelectedOption()},{resolvedClassNames:Le,resolvedStyles:ke}=Wi({props:n,styles:i,classNames:t});A.useEffect(()=>{_&&Se.selectFirstOption()},[_,ae]);const je=g.jsx(An.ClearButton,{...I,onClear:()=>{ne(""),P==null||P()}});return g.jsxs(An,{store:Se,__staticSelector:"Autocomplete",classNames:Le,styles:ke,unstyled:r,readOnly:j,size:L,attributes:X,keepMounted:G,onOptionSubmit:Ne=>{x==null||x(Ne),ne(ye[Ne].label),Se.closeDropdown()},...E,children:[g.jsx(An.Target,{autoComplete:V,withExpandedAttribute:!0,children:g.jsx(Ri,{...ee,size:L,__staticSelector:"Autocomplete",__clearSection:je,__clearable:U&&!!ae&&!O&&!j,__clearSectionMode:D,rightSection:W,disabled:O,readOnly:j,value:ae,error:H,onChange:Ne=>{ne(Ne.currentTarget.value),Se.openDropdown(),_&&Se.selectFirstOption()},onFocus:Ne=>{z&&Se.openDropdown(),h==null||h(Ne)},onBlur:Ne=>{G&&Se.clickSelectedOption(),Se.closeDropdown(),d==null||d(Ne)},onClick:Ne=>{Se.openDropdown(),p==null||p(Ne)},classNames:Le,styles:ke,unstyled:r,attributes:X,id:re})}),g.jsx(Ey,{data:le,hidden:j||O,filter:M,search:ae,limit:N,hiddenWhenEmpty:!0,withScrollArea:q,maxDropdownHeight:R,unstyled:r,labelId:ee.label?`${re}-label`:void 0,"aria-label":ee.label?void 0:ee["aria-label"],renderOption:Y,scrollAreaProps:$})]})});Ty.classes={...Ri.classes,...An.classes};Ty.displayName="@mantine/core/Autocomplete";var My={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const LI=A.createContext({withinGroup:!1}),II=(e,{spacing:n})=>({group:{"--ag-spacing":Vt(n)}}),Dy=De(e=>{const n=be("AvatarGroup",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,spacing:c,attributes:f,...h}=n;return g.jsx(LI,{value:{withinGroup:!0},children:g.jsx(he,{...Xe({name:"AvatarGroup",classes:My,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:f,vars:l,varsResolver:II,rootSelector:"group"})("group"),...h})})});Dy.classes=My;Dy.varsResolver=II;Dy.displayName="@mantine/core/AvatarGroup";function Wee(e){return g.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function Gee(e){let n=0;for(let t=0;ti[0]).slice(0,n).join("").toUpperCase()}const BI=(e,{size:n,radius:t,variant:i,gradient:r,color:a,autoContrast:o,name:l,allowedInitialsColors:c})=>{const f=a==="initials"&&typeof l=="string"?Kee(l,c):a,h=e.variantColorResolver({color:f||"gray",theme:e,gradient:r,variant:i||"light",autoContrast:o});return{root:{"--avatar-size":Bn(n,"avatar-size"),"--avatar-radius":t===void 0?void 0:Yt(t),"--avatar-bg":f||i?h.background:void 0,"--avatar-color":f||i?h.color:void 0,"--avatar-bd":f||i?h.border:void 0}}},go=Ai(e=>{const n=be("Avatar",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,src:c,alt:f,radius:h,color:d,gradient:p,imageProps:v,children:b,autoContrast:w,mod:k,name:_,allowedInitialsColors:C,attributes:x,...E}=n,j=A.use(LI),[O,M]=A.useState(!c),N=Xe({name:"Avatar",props:n,classes:My,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:x,vars:l,varsResolver:BI});return A.useEffect(()=>M(!c),[c]),g.jsx(he,{...N("root"),mod:[{"within-group":j.withinGroup},k],...E,children:O||!c?g.jsx("span",{...N("placeholder"),title:f,children:b||typeof _=="string"&&Xee(_)||g.jsx(Wee,{})}):g.jsx("img",{...v,...N("image"),src:c,alt:f,onError:q=>{var R;M(!0),(R=v==null?void 0:v.onError)==null||R.call(v,q)}})})});go.classes=My;go.varsResolver=BI;go.displayName="@mantine/core/Avatar";go.Group=Dy;var FI={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const qI=(e,{radius:n,color:t,gradient:i,variant:r,size:a,autoContrast:o,circle:l})=>{const c=e.variantColorResolver({color:t||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:o});return{root:{"--badge-height":Bn(a,"badge-height"),"--badge-padding-x":Bn(a,"badge-padding-x"),"--badge-fz":Bn(a,"badge-fz"),"--badge-radius":l||n===void 0?void 0:Yt(n),"--badge-bg":t||r?c.background:void 0,"--badge-color":t||r?c.color:void 0,"--badge-bd":t||r?c.border:void 0,"--badge-dot-color":r==="dot"?lt(t,e):void 0}}},it=Ai(e=>{const n=be("Badge",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,radius:c,color:f,gradient:h,leftSection:d,rightSection:p,children:v,variant:b,fullWidth:w,autoContrast:k,circle:_,mod:C,attributes:x,...E}=n,j=Xe({name:"Badge",props:n,classes:FI,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:x,vars:l,varsResolver:qI});return g.jsxs(he,{variant:b,mod:[{block:w,circle:_,"with-right-section":!!p,"with-left-section":!!d},C],...j("root",{variant:b}),...E,children:[d&&g.jsx("span",{...j("section"),"data-position":"left",children:d}),g.jsx("span",{...j("label"),children:v}),p&&g.jsx("span",{...j("section"),"data-position":"right",children:p})]})});it.classes=FI;it.varsResolver=qI;it.displayName="@mantine/core/Badge";var Ff={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const cT={orientation:"horizontal"},HI=(e,{borderWidth:n})=>({group:{"--button-border-width":me(n)}}),Ry=De(e=>{const n=be("ButtonGroup",cT,e),{className:t,style:i,classNames:r,styles:a,unstyled:o,orientation:l,vars:c,borderWidth:f,mod:h,attributes:d,...p}=be("ButtonGroup",cT,e);return g.jsx(he,{...Xe({name:"ButtonGroup",props:n,classes:Ff,className:t,style:i,classNames:r,styles:a,unstyled:o,attributes:d,vars:c,varsResolver:HI,rootSelector:"group"})("group"),mod:[{"data-orientation":l},h],role:"group",...p})});Ry.classes=Ff;Ry.varsResolver=HI;Ry.displayName="@mantine/core/ButtonGroup";const UI=(e,{radius:n,color:t,gradient:i,variant:r,autoContrast:a,size:o})=>{const l=e.variantColorResolver({color:t||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:a});return{groupSection:{"--section-height":Bn(o,"section-height"),"--section-padding-x":Bn(o,"section-padding-x"),"--section-fz":o!=null&&o.includes("compact")?ri(o.replace("compact-","")):ri(o),"--section-radius":n===void 0?void 0:Yt(n),"--section-bg":t||r?l.background:void 0,"--section-color":l.color,"--section-bd":t||r?l.border:void 0}}},Py=De(e=>{const n=be("ButtonGroupSection",null,e),{className:t,style:i,classNames:r,styles:a,unstyled:o,vars:l,gradient:c,radius:f,autoContrast:h,attributes:d,...p}=n;return g.jsx(he,{...Xe({name:"ButtonGroupSection",props:n,classes:Ff,className:t,style:i,classNames:r,styles:a,unstyled:o,attributes:d,vars:l,varsResolver:UI,rootSelector:"groupSection"})("groupSection"),...p})});Py.classes=Ff;Py.varsResolver=UI;Py.displayName="@mantine/core/ButtonGroupSection";const Zee={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${me(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},VI=(e,{radius:n,color:t,gradient:i,variant:r,size:a,justify:o,autoContrast:l})=>{const c=e.variantColorResolver({color:t||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:l});return{root:{"--button-justify":o,"--button-height":Bn(a,"button-height"),"--button-padding-x":Bn(a,"button-padding-x"),"--button-fz":a!=null&&a.includes("compact")?ri(a.replace("compact-","")):ri(a),"--button-radius":n===void 0?void 0:Yt(n),"--button-bg":t||r?c.background:void 0,"--button-hover":t||r?c.hover:void 0,"--button-color":c.color,"--button-bd":t||r?c.border:void 0,"--button-hover-color":t||r?c.hoverColor:void 0}}},st=Ai(e=>{const n=be("Button",null,e),{style:t,vars:i,className:r,color:a,disabled:o,children:l,leftSection:c,rightSection:f,fullWidth:h,variant:d,radius:p,loading:v,loaderProps:b,gradient:w,classNames:k,styles:_,unstyled:C,"data-disabled":x,autoContrast:E,mod:j,attributes:O,...M}=n,N=Xe({name:"Button",props:n,classes:Ff,className:r,style:t,classNames:k,styles:_,unstyled:C,attributes:O,vars:i,varsResolver:VI}),q=!!c,R=!!f;return g.jsxs(Et,{...N("root",{active:!o&&!v&&!x}),unstyled:C,variant:d,disabled:o||v,mod:[{disabled:o||x,loading:v,block:h,"with-left-section":q,"with-right-section":R},j],...M,children:[typeof v=="boolean"&&g.jsx(cs,{mounted:v,transition:Zee,duration:150,children:L=>g.jsx(he,{component:"span",...N("loader",{style:L}),"aria-hidden":!0,children:g.jsx(ai,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...b})})}),g.jsxs("span",{...N("inner"),children:[c&&g.jsx(he,{component:"span",...N("section"),mod:{position:"left"},children:c}),g.jsx(he,{component:"span",mod:{loading:v},...N("label"),children:l}),f&&g.jsx(he,{component:"span",...N("section"),mod:{position:"right"},children:f})]})]})});st.classes=Ff;st.varsResolver=VI;st.displayName="@mantine/core/Button";st.Group=Ry;st.GroupSection=Py;const[Qee,Jee]=Xr("Card component was not found in tree");var OC={root:"m_e615b15f",section:"m_599a2148"};const Ny=Ai(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,withBorder:o,inheritPadding:l,mod:c,...f}=be("CardSection",null,e),h=Jee();return g.jsx(he,{mod:[{"with-border":o,"inherit-padding":l},c],...h.getStyles("section",{className:t,style:i,styles:r,classNames:n}),...f})});Ny.classes=OC;Ny.displayName="@mantine/core/CardSection";const WI=(e,{padding:n})=>({root:{"--card-padding":Vt(n)}}),ene={orientation:"vertical"},La=Ai(e=>{const n=be("Card",ene,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,children:c,padding:f,attributes:h,orientation:d,...p}=n,v=Xe({name:"Card",props:n,classes:OC,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:h,vars:l,varsResolver:WI}),b=A.Children.toArray(c),w=b.map((k,_)=>{var C;return typeof k=="object"&&k&&"type"in k&&(k.type===Ny||((C=k.type)==null?void 0:C.displayName)==="@mantine/core/CardSection")?A.cloneElement(k,{"data-orientation":d,"data-first-section":_===0||void 0,"data-last-section":_===b.length-1||void 0}):k});return g.jsx(Qee,{value:{getStyles:v},children:g.jsx(Dt,{unstyled:o,"data-orientation":d,...v("root"),...p,children:w})})});La.classes=OC;La.varsResolver=WI;La.displayName="@mantine/core/Card";La.Section=Ny;var GI={root:"m_4451eb3a"};const qf=Ai(e=>{const n=be("Center",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,inline:c,mod:f,attributes:h,...d}=n,p=Xe({name:"Center",props:n,classes:GI,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:h,vars:l});return g.jsx(he,{mod:[{inline:c},f],...p("root"),...d})});qf.classes=GI;qf.displayName="@mantine/core/Center";var YI={root:"m_b183c0a2"};const KI=(e,{color:n})=>({root:{"--code-bg":n?lt(n,e):void 0}}),Jh=De(e=>{const n=be("Code",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,color:c,block:f,mod:h,attributes:d,...p}=n,v=Xe({name:"Code",props:n,classes:YI,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:d,vars:l,varsResolver:KI});return g.jsx(he,{component:f?"pre":"code",mod:[{block:f},h],...v("root"),...p,dir:"ltr"})});Jh.classes=YI;Jh.varsResolver=KI;Jh.displayName="@mantine/core/Code";var XI={root:"m_de3d2490",colorOverlay:"m_862f3d1b",shadowOverlay:"m_98ae7f22",alphaOverlay:"m_95709ac0",childrenOverlay:"m_93e74e3"};const fT={withShadow:!0},ZI=(e,{radius:n,size:t})=>({root:{"--cs-radius":n===void 0?void 0:Yt(n),"--cs-size":me(t)}}),Hf=Ai(e=>{const n=be("ColorSwatch",fT,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,color:c,radius:f,withShadow:h,children:d,attributes:p,...v}=be("ColorSwatch",fT,n),b=Xe({name:"ColorSwatch",props:n,classes:XI,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:p,vars:l,varsResolver:ZI});return g.jsxs(he,{...b("root",{focusable:!0}),...v,children:[g.jsx("span",{...b("alphaOverlay")}),h&&g.jsx("span",{...b("shadowOverlay")}),g.jsx("span",{...b("colorOverlay",{style:{backgroundColor:c}})}),g.jsx("span",{...b("childrenOverlay"),children:d})]})});Hf.classes=XI;Hf.varsResolver=ZI;Hf.displayName="@mantine/core/ColorSwatch";function ya(e,n=0,t=10**n){return Math.round(t*e)/t}function nne({h:e,s:n,l:t,a:i}){const r=n*((t<50?t:100-t)/100);return{h:e,s:r>0?2*r/(t+r)*100:0,v:t+r,a:i}}const tne={grad:360/400,turn:360,rad:360/(Math.PI*2)};function ine(e,n="deg"){return Number(e)*(tne[n]||1)}const rne=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function dT(e){const n=rne.exec(e);return n?nne({h:ine(n[1],n[2]),s:Number(n[3]),l:Number(n[4]),a:n[5]===void 0?1:Number(n[5])/(n[6]?100:1)}):{h:0,s:0,v:0,a:1}}function OS({r:e,g:n,b:t,a:i}){const r=Math.max(e,n,t),a=r-Math.min(e,n,t),o=a?r===e?(n-t)/a:r===n?2+(t-e)/a:4+(e-n)/a:0;return{h:ya(60*(o<0?o+6:o),3),s:ya(r?a/r*100:0,3),v:ya(r/255*100,3),a:i}}function ES(e){const n=e[0]==="#"?e.slice(1):e;return n.length===3?OS({r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:1}):OS({r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:1})}function ane(e){const n=e[0]==="#"?e.slice(1):e,t=a=>ya(parseInt(a,16)/255,3);if(n.length===4){const a=n.slice(0,3),o=t(n[3]+n[3]);return{...ES(a),a:o}}const i=n.slice(0,6),r=t(n.slice(6,8));return{...ES(i),a:r}}const one=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function hT(e){const n=one.exec(e);return n?OS({r:Number(n[1])/(n[2]?100/255:1),g:Number(n[3])/(n[4]?100/255:1),b:Number(n[5])/(n[6]?100/255:1),a:n[7]===void 0?1:Number(n[7])/(n[8]?100:1)}):{h:0,s:0,v:0,a:1}}const QI={hex:/^#?([0-9A-F]{3}){1,2}$/i,hexa:/^#?([0-9A-F]{4}){1,2}$/i,rgb:/^rgb\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,rgba:/^rgba\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,hsl:/hsl\(\s*(\d+)\s*,\s*(\d+(?:\.\d+)?%)\s*,\s*(\d+(?:\.\d+)?%)\)/i,hsla:/^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/i},sne={hex:ES,hexa:ane,rgb:hT,rgba:hT,hsl:dT,hsla:dT};function lne(e){for(const[,n]of Object.entries(QI))if(n.test(e))return!0;return!1}function qv(e){if(typeof e!="string")return{h:0,s:0,v:0,a:1};if(e==="transparent")return{h:0,s:0,v:0,a:0};const n=e.trim();for(const[t,i]of Object.entries(QI))if(i.test(n))return sne[t](n);return{h:0,s:0,v:0,a:1}}const $y=A.createContext(null);function EC({position:e,...n}){return g.jsx(he,{__vars:{"--thumb-y-offset":`${e.y*100}%`,"--thumb-x-offset":`${e.x*100}%`},...n})}EC.displayName="@mantine/core/ColorPickerThumb";var zy={wrapper:"m_fee9c77",preview:"m_9dddfbac",body:"m_bffecc3e",sliders:"m_3283bb96",thumb:"m_40d572ba",swatch:"m_d8ee6fd8",swatches:"m_5711e686",saturation:"m_202a296e",saturationOverlay:"m_11b3db02",slider:"m_d856d47d",sliderOverlay:"m_8f327113"};const Uf=De(e=>{var H;const n=be("ColorSlider",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,onChange:c,onChangeEnd:f,maxValue:h,round:d,size:p="md",focusable:v=!0,value:b,overlays:w,thumbColor:k="transparent",onScrubStart:_,onScrubEnd:C,__staticSelector:x="ColorPicker",attributes:E,ref:j,...O}=n,M=Xe({name:x,classes:zy,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:E,rootSelector:"slider"}),N=((H=A.use($y))==null?void 0:H.getStyles)||M,q=ui(),[R,L]=A.useState({y:0,x:b/h}),F=A.useRef(R),Y=U=>d?Math.round(U*h):U*h,{ref:V}=Cz(({x:U,y:D})=>{F.current={x:U,y:D},c==null||c(Y(U))},{onScrubEnd:()=>{const{x:U}=F.current;f==null||f(Y(U)),C==null||C()},onScrubStart:_});ls(()=>{L({y:0,x:b/h})},[b]);const $=(U,D)=>{U.preventDefault();const W=Sz(D);c==null||c(Y(W.x)),f==null||f(Y(W.x))},P=U=>{switch(U.key){case"ArrowRight":$(U,{x:R.x+.05,y:R.y});break;case"ArrowLeft":$(U,{x:R.x-.05,y:R.y});break}},I=w.map((U,D)=>A.createElement("div",{...N("sliderOverlay"),style:U,key:D}));return g.jsxs(he,{...O,ref:Kt(V,j),...N("slider"),size:p,role:"slider","aria-valuenow":b,"aria-valuemax":h,"aria-valuemin":0,tabIndex:v?0:-1,onKeyDown:P,"data-focus-ring":q.focusRing,__vars:{"--cp-thumb-size":`var(--cp-thumb-size-${p})`},children:[I,g.jsx(EC,{position:R,...N("thumb",{style:{top:me(1),background:k}})})]})});Uf.displayName="@mantine/core/ColorSlider";Uf.classes=zy;const une={__staticSelector:"AlphaSlider"},TC=De(e=>{const{value:n,onChange:t,onChangeEnd:i,color:r,...a}=be("AlphaSlider",une,e);return g.jsx(Uf,{...a,value:n,onChange:o=>t==null?void 0:t(ya(o,2)),onChangeEnd:o=>i==null?void 0:i(ya(o,2)),maxValue:1,round:!1,"data-alpha":!0,overlays:[{backgroundImage:"linear-gradient(45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(-45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--slider-checkers) 75%), linear-gradient(-45deg, var(--mantine-color-body) 75%, var(--slider-checkers) 75%)",backgroundSize:`${me(8)} ${me(8)}`,backgroundPosition:`0 0, 0 ${me(4)}, ${me(4)} ${me(-4)}, ${me(-4)} 0`},{backgroundImage:`linear-gradient(90deg, transparent, ${r})`},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${me(1)} inset, rgb(0, 0, 0, .15) 0 0 ${me(4)} inset`}]})});TC.displayName="@mantine/core/AlphaSlider";TC.classes=Uf.classes;function JI({h:e,s:n,v:t,a:i}){const r=e/360*6,a=n/100,o=t/100,l=Math.floor(r),c=o*(1-a),f=o*(1-(r-l)*a),h=o*(1-(1-r+l)*a),d=l%6;return{r:ya([o,f,c,c,h,o][d]*255),g:ya([h,o,o,f,c,c][d]*255),b:ya([c,c,h,o,o,f][d]*255),a:ya(i,2)}}function mT(e,n){const{r:t,g:i,b:r,a}=JI(e);return n?`rgba(${t}, ${i}, ${r}, ${ya(a,2)})`:`rgb(${t}, ${i}, ${r})`}function pT({h:e,s:n,v:t,a:i},r){const a=(200-n)*t/100,o={h:Math.round(e),s:Math.round(a>0&&a<200?n*t/100/(a<=100?a:200-a)*100:0),l:Math.round(a/2)};return r?`hsla(${o.h}, ${o.s}%, ${o.l}%, ${ya(i,2)})`:`hsl(${o.h}, ${o.s}%, ${o.l}%)`}function kg(e){const n=e.toString(16);return n.length<2?`0${n}`:n}function eB(e){const{r:n,g:t,b:i}=JI(e);return`#${kg(n)}${kg(t)}${kg(i)}`}function cne(e){const n=Math.round(e.a*255);return`${eB(e)}${kg(n)}`}const jk={hex:eB,hexa:e=>cne(e),rgb:e=>mT(e,!1),rgba:e=>mT(e,!0),hsl:e=>pT(e,!1),hsla:e=>pT(e,!0)};function Ks(e,n){return n?e in jk?jk[e](n):jk.hex(n):"#000000"}const fne={__staticSelector:"HueSlider"},MC=De(e=>{const{value:n,onChange:t,onChangeEnd:i,color:r,...a}=be("HueSlider",fne,e);return g.jsx(Uf,{...a,value:n,onChange:t,onChangeEnd:i,maxValue:360,thumbColor:`hsl(${n}, 100%, 50%)`,round:!0,"data-hue":!0,overlays:[{backgroundImage:"linear-gradient(to right,hsl(0,100%,50%),hsl(60,100%,50%),hsl(120,100%,50%),hsl(170,100%,50%),hsl(240,100%,50%),hsl(300,100%,50%),hsl(360,100%,50%))"},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${me(1)} inset, rgb(0, 0, 0, .15) 0 0 ${me(4)} inset`}]})});MC.displayName="@mantine/core/HueSlider";MC.classes=Uf.classes;function nB({className:e,onChange:n,onChangeEnd:t,value:i,saturationLabel:r,focusable:a=!0,size:o,color:l,onScrubStart:c,onScrubEnd:f,...h}){const{getStyles:d}=A.use($y),[p,v]=A.useState({x:i.s/100,y:1-i.v/100}),b=A.useRef(p),{ref:w}=Cz(({x:C,y:x})=>{b.current={x:C,y:x},n({s:Math.round(C*100),v:Math.round((1-x)*100)})},{onScrubEnd:()=>{const{x:C,y:x}=b.current;t({s:Math.round(C*100),v:Math.round((1-x)*100)}),f==null||f()},onScrubStart:c});A.useEffect(()=>{v({x:i.s/100,y:1-i.v/100})},[i.s,i.v]);const k=(C,x)=>{C.preventDefault();const E=Sz(x);n({s:Math.round(E.x*100),v:Math.round((1-E.y)*100)}),t({s:Math.round(E.x*100),v:Math.round((1-E.y)*100)})},_=C=>{switch(C.key){case"ArrowUp":k(C,{y:p.y-.05,x:p.x});break;case"ArrowDown":k(C,{y:p.y+.05,x:p.x});break;case"ArrowRight":k(C,{x:p.x+.05,y:p.y});break;case"ArrowLeft":k(C,{x:p.x-.05,y:p.y});break}};return g.jsxs(he,{...d("saturation"),ref:w,...h,role:"slider","aria-label":r,"aria-valuenow":p.x,"aria-valuetext":Ks("rgba",i),tabIndex:a?0:-1,onKeyDown:_,children:[g.jsx("div",{...d("saturationOverlay",{style:{backgroundColor:`hsl(${i.h}, 100%, 50%)`}})}),g.jsx("div",{...d("saturationOverlay",{style:{backgroundImage:"linear-gradient(90deg, #fff, transparent)"}})}),g.jsx("div",{...d("saturationOverlay",{style:{backgroundImage:"linear-gradient(0deg, #000, transparent)"}})}),g.jsx(EC,{position:p,...d("thumb",{style:{backgroundColor:l}})})]})}nB.displayName="@mantine/core/Saturation";function tB({className:e,datatype:n,setValue:t,onChangeEnd:i,size:r,focusable:a,data:o,swatchesPerRow:l,value:c,...f}){const h=A.use($y),d=o.map((p,v)=>A.createElement(Hf,{...h.getStyles("swatch"),unstyled:h.unstyled,component:"button",type:"button",color:p,key:v,radius:"sm",onClick:()=>{t(p),i==null||i(p)},"aria-label":p,tabIndex:a?0:-1,"data-swatch":!0},c===p&&g.jsx(jC,{size:"35%",color:Ez(p)<.5?"white":"black"})));return g.jsx(he,{...h.getStyles("swatches"),...f,children:d})}tB.displayName="@mantine/core/Swatches";const dne={swatchesPerRow:7,withPicker:!0,focusable:!0,size:"md",__staticSelector:"ColorPicker"},iB=(e,{size:n,swatchesPerRow:t})=>({wrapper:{"--cp-preview-size":Bn(n,"cp-preview-size"),"--cp-width":Bn(n,"cp-width"),"--cp-body-spacing":Vt(n),"--cp-swatch-size":`${100/t}%`,"--cp-thumb-size":Bn(n,"cp-thumb-size"),"--cp-saturation-height":Bn(n,"cp-saturation-height")}}),Ly=De(e=>{const n=be("ColorPicker",dne,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,format:c="hex",value:f,defaultValue:h,onChange:d,onChangeEnd:p,withPicker:v,size:b,saturationLabel:w,hueLabel:k,alphaLabel:_,focusable:C,swatches:x,swatchesPerRow:E,fullWidth:j,onColorSwatchClick:O,__staticSelector:M,mod:N,attributes:q,name:R,hiddenInputProps:L,...F}=n,Y=Xe({name:M,props:n,classes:zy,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:q,rootSelector:"wrapper",vars:l,varsResolver:iB}),V=A.useRef(c||"hex"),$=A.useRef(""),P=A.useRef(-1),I=A.useRef(!1),H=c==="hexa"||c==="rgba"||c==="hsla",[U,D,W]=Ci({value:f,defaultValue:h,finalValue:"#FFFFFF",onChange:d}),[G,z]=A.useState(qv(U)),X=()=>{window.clearTimeout(P.current),I.current=!0},ee=()=>{window.clearTimeout(P.current),P.current=window.setTimeout(()=>{I.current=!1},200)},re=le=>{z(ye=>{const ae={...ye,...le};return $.current=Ks(V.current,ae),ae}),D($.current)};return ls(()=>{typeof f=="string"&&lne(f)&&!I.current&&z(qv(f))},[f]),ls(()=>{V.current=c||"hex",D(Ks(V.current,G))},[c]),g.jsx($y,{value:{getStyles:Y,unstyled:o},children:g.jsxs(he,{...Y("wrapper"),size:b,mod:[{"full-width":j},N],...F,children:[R&&g.jsx("input",{type:"hidden",name:R,value:U,...L}),v&&g.jsxs(g.Fragment,{children:[g.jsx(nB,{value:G,onChange:re,onChangeEnd:({s:le,v:ye})=>p==null?void 0:p(Ks(V.current,{...G,s:le,v:ye})),color:U,size:b,focusable:C,saturationLabel:w,onScrubStart:X,onScrubEnd:ee}),g.jsxs("div",{...Y("body"),children:[g.jsxs("div",{...Y("sliders"),children:[g.jsx(MC,{value:G.h,onChange:le=>re({h:le}),onChangeEnd:le=>p==null?void 0:p(Ks(V.current,{...G,h:le})),size:b,focusable:C,"aria-label":k,onScrubStart:X,onScrubEnd:ee}),H&&g.jsx(TC,{value:G.a,onChange:le=>re({a:le}),onChangeEnd:le=>{p==null||p(Ks(V.current,{...G,a:le}))},size:b,color:Ks("hex",G),focusable:C,"aria-label":_,onScrubStart:X,onScrubEnd:ee})]}),H&&g.jsx(Hf,{color:U,radius:"sm",size:"var(--cp-preview-size)",...Y("preview")})]})]}),Array.isArray(x)&&g.jsx(tB,{data:x,swatchesPerRow:E,focusable:C,setValue:D,value:U,onChangeEnd:le=>{const ye=Ks(c,qv(le));O==null||O(ye),p==null||p(ye),W||z(qv(le))}})]})})});Ly.classes=zy;Ly.varsResolver=iB;Ly.displayName="@mantine/core/ColorPicker";var rB={root:"m_3eebeb36",label:"m_9e365f20"};const hne={orientation:"horizontal"},aB=(e,{color:n,variant:t,size:i})=>({root:{"--divider-color":n?lt(n,e):void 0,"--divider-border-style":t,"--divider-size":Bn(i,"divider-size")}}),Nu=De(e=>{const n=be("Divider",hne,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,color:c,orientation:f,label:h,labelPosition:d,mod:p,attributes:v,...b}=n,w=Xe({name:"Divider",classes:rB,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:v,vars:l,varsResolver:aB});return g.jsx(he,{mod:[{orientation:f,withLabel:!!h},p],role:"separator",...w("root"),...b,children:h&&g.jsx(he,{component:"span",mod:{position:d},...w("label"),children:h})})});Nu.classes=rB;Nu.varsResolver=aB;Nu.displayName="@mantine/core/Divider";const[vT,oB]=Xr("Grid component was not found in tree"),TS=(e,n)=>{if(e==="content")return"auto";if(e==="auto")return"0rem";if(e)return e===n?"100%":`calc(${100*e/n}% - ${(n-e)/n} * var(--grid-column-gap))`},gT=(e,n,t)=>t||e==="auto"?"100%":e==="content"?"unset":TS(e,n),yT=(e,n)=>{if(e)return e==="auto"||n?"1":"auto"},bT=(e,n)=>{if(e===0)return"0";if(e)return`calc(${100*e/n}% + ${e/n} * var(--grid-column-gap))`};function mne({span:e,order:n,offset:t,align:i,selector:r}){var v;const a=ui(),o=oB(),l=o.breakpoints||a.breakpoints,c=Wr(e),f=c===void 0?12:c,h=Tu({"--col-order":(v=Wr(n))==null?void 0:v.toString(),"--col-flex-grow":yT(f,o.grow),"--col-flex-basis":TS(f,o.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":gT(f,o.columns,o.grow),"--col-offset":bT(Wr(t),o.columns),"--col-align-self":Wr(i)}),d=Pt(l).reduce((b,w)=>{var k;return b[w]||(b[w]={}),typeof n=="object"&&n[w]!==void 0&&(b[w]["--col-order"]=(k=n[w])==null?void 0:k.toString()),typeof e=="object"&&e[w]!==void 0&&(b[w]["--col-flex-grow"]=yT(e[w],o.grow),b[w]["--col-flex-basis"]=TS(e[w],o.columns),b[w]["--col-width"]=e[w]==="content"?"auto":void 0,b[w]["--col-max-width"]=gT(e[w],o.columns,o.grow)),typeof t=="object"&&t[w]!==void 0&&(b[w]["--col-offset"]=bT(t[w],o.columns)),typeof i=="object"&&i[w]!==void 0&&(b[w]["--col-align-self"]=i[w]),b},{}),p=Kh(Pt(d),l).filter(b=>Pt(d[b.value]).length>0).map(b=>({query:o.type==="container"?`mantine-grid (min-width: ${l[b.value]})`:`(min-width: ${l[b.value]})`,styles:d[b.value]}));return g.jsx(Nf,{styles:h,media:o.type==="container"?void 0:p,container:o.type==="container"?p:void 0,selector:r})}var DC={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const pne={span:12},RC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,span:o,order:l,offset:c,align:f,...h}=be("GridCol",pne,e),d=oB(),p=cy();return g.jsxs(g.Fragment,{children:[g.jsx(mne,{selector:`.${p}`,span:o,order:l,offset:c,align:f}),g.jsx(he,{...d.getStyles("col",{className:pn(t,p),style:i,classNames:n,styles:r}),...h})]})});RC.classes=DC;RC.displayName="@mantine/core/GridCol";function wT({gap:e,rowGap:n,columnGap:t,selector:i,breakpoints:r,type:a}){const o=ui(),l=r||o.breakpoints,c=Tu({"--grid-gap":Vt(Wr(e)),"--grid-row-gap":Vt(Wr(n)),"--grid-column-gap":Vt(Wr(t))}),f=Pt(l).reduce((d,p)=>(d[p]||(d[p]={}),typeof e=="object"&&e[p]!==void 0&&(d[p]["--grid-gap"]=Vt(e[p])),typeof n=="object"&&n[p]!==void 0&&(d[p]["--grid-row-gap"]=Vt(n[p])),typeof t=="object"&&t[p]!==void 0&&(d[p]["--grid-column-gap"]=Vt(t[p])),d),{}),h=Kh(Pt(f),l).filter(d=>Pt(f[d.value]).length>0).map(d=>({query:a==="container"?`mantine-grid (min-width: ${l[d.value]})`:`(min-width: ${l[d.value]})`,styles:f[d.value]}));return g.jsx(Nf,{styles:c,media:a==="container"?void 0:h,container:a==="container"?h:void 0,selector:i})}const vne={gap:"md",columns:12},sB=(e,{justify:n,align:t,overflow:i})=>({root:{"--grid-justify":n,"--grid-align":t,"--grid-overflow":i}}),Hr=De(e=>{const n=be("Grid",vne,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,grow:c,gap:f,rowGap:h,columnGap:d,columns:p,align:v,justify:b,children:w,breakpoints:k,type:_,attributes:C,...x}=n,E=Xe({name:"Grid",classes:DC,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:C,vars:l,varsResolver:sB}),j=cy();return _==="container"&&k?g.jsxs(vT,{value:{getStyles:E,grow:c,columns:p,breakpoints:k,type:_},children:[g.jsx(wT,{selector:`.${j}`,...n}),g.jsx("div",{...E("container"),children:g.jsx(he,{...E("root",{className:j}),...x,children:g.jsx("div",{...E("inner"),children:w})})})]}):g.jsxs(vT,{value:{getStyles:E,grow:c,columns:p,breakpoints:k,type:_},children:[g.jsx(wT,{selector:`.${j}`,...n}),g.jsx(he,{...E("root",{className:j}),...x,children:g.jsx("div",{...E("inner"),children:w})})]})});Hr.classes=DC;Hr.varsResolver=sB;Hr.displayName="@mantine/core/Grid";Hr.Col=RC;function gne(e="top-end",n=0){const t={"--indicator-top":void 0,"--indicator-bottom":void 0,"--indicator-left":void 0,"--indicator-right":void 0,"--indicator-translate-x":void 0,"--indicator-translate-y":void 0},i=typeof n=="number"?n:n.x,r=typeof n=="number"?n:n.y,a=me(i),o=me(r),[l,c]=e.split("-");return l==="top"&&(t["--indicator-top"]=o,t["--indicator-translate-y"]="-50%"),l==="middle"&&(t["--indicator-top"]="50%",t["--indicator-translate-y"]="-50%"),l==="bottom"&&(t["--indicator-bottom"]=o,t["--indicator-translate-y"]="50%"),c==="start"&&(t["--indicator-left"]=a,t["--indicator-translate-x"]="-50%"),c==="center"&&(t["--indicator-left"]="50%",t["--indicator-translate-x"]="-50%"),c==="end"&&(t["--indicator-right"]=a,t["--indicator-translate-x"]="50%"),t}var lB={root:"m_e5262200",indicator:"m_760d1fb1",processing:"m_885901b1"};const yne={position:"top-end",offset:0,showZero:!0},uB=(e,{color:n,position:t,offset:i,size:r,radius:a,zIndex:o,autoContrast:l})=>({root:{"--indicator-color":n?lt(n,e):void 0,"--indicator-text-color":Gm(l,e)?Pf({color:n,theme:e,autoContrast:l}):void 0,"--indicator-size":me(r),"--indicator-radius":a===void 0?void 0:Yt(a),"--indicator-z-index":o==null?void 0:o.toString(),...gne(t,i)}}),Iy=De(e=>{const n=be("Indicator",yne,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,children:c,position:f,offset:h,inline:d,label:p,radius:v,color:b,withBorder:w,disabled:k,processing:_,zIndex:C,autoContrast:x,maxValue:E,showZero:j,mod:O,attributes:M,...N}=n,q=Xe({name:"Indicator",classes:lB,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:M,vars:l,varsResolver:uB}),R=!j&&(p===0||p==="0"),L=E!==void 0&&typeof p=="number"&&p>E?`${E}+`:p;return g.jsxs(he,{...q("root"),mod:[{inline:d},O],...N,children:[!k&&!R&&g.jsx(he,{mod:{"with-label":!!p,"with-border":w,processing:_},...q("indicator"),children:L}),c]})});Iy.classes=lB;Iy.varsResolver=uB;Iy.displayName="@mantine/core/Indicator";const bne=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],kT={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"};function _T(e){Object.keys(kT).forEach(n=>{e.style.setProperty(n,kT[n],"important")})}function wne(e){const n=window.getComputedStyle(e);if(n===null)return null;const t={};for(const i of bne)t[i]=n[i];return t.boxSizing===""?null:{sizingStyle:t,paddingSize:parseFloat(t.paddingBottom)+parseFloat(t.paddingTop),borderSize:parseFloat(t.borderBottomWidth)+parseFloat(t.borderTopWidth)}}let Ti=null;function kne(e,n,t=1,i=1/0){Ti||(Ti=document.createElement("textarea"),Ti.setAttribute("tabindex","-1"),Ti.setAttribute("aria-hidden","true"),Ti.setAttribute("aria-label","autosize measurement"),_T(Ti)),Ti.parentNode===null&&document.body.appendChild(Ti);const{paddingSize:r,borderSize:a,sizingStyle:o}=e,{boxSizing:l}=o;Object.keys(o).forEach(p=>{Ti.style[p]=o[p]}),_T(Ti),Ti.value=n;let c=l==="border-box"?Ti.scrollHeight+a:Ti.scrollHeight-r;Ti.value=n,c=l==="border-box"?Ti.scrollHeight+a:Ti.scrollHeight-r,Ti.value="x";const f=Ti.scrollHeight-r;let h=f*t;l==="border-box"&&(h=h+r+a),c=Math.max(h,c);let d=f*i;return l==="border-box"&&(d=d+r+a),c=Math.min(d,c),[c,f]}function _ne({maxRows:e,minRows:n,onChange:t,ref:i,...r}){const a=r.value!==void 0,o=A.useRef(null),l=Kt(o,i),c=A.useRef(0),f=()=>{const d=o.current;if(!d)return;const p=wne(d);if(!p)return;const[v]=kne(p,d.value||d.placeholder||"x",n,e);c.current!==v&&(c.current=v,d.style.setProperty("height",`${v}px`,"important"))},h=d=>{a||f(),t==null||t(d)};return A.useLayoutEffect(f),A.useEffect(()=>{const d=()=>f();return window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[]),A.useEffect(()=>{const d=()=>f();return document.fonts.addEventListener("loadingdone",d),()=>document.fonts.removeEventListener("loadingdone",d)},[]),A.useEffect(()=>{const d=p=>{var v;if(((v=o.current)==null?void 0:v.form)===p.target&&!a){const b=o.current.value;requestAnimationFrame(()=>{o.current&&b!==o.current.value&&f()})}};return document.body.addEventListener("reset",d),()=>document.body.removeEventListener("reset",d)},[a]),g.jsx("textarea",{...r,onChange:h,ref:l})}const xne={size:"sm"},pl=De(e=>{const{autosize:n,maxRows:t,minRows:i,__staticSelector:r,resize:a,...o}=be("Textarea",xne,e),l=n&&YK()!=="test",c=l?{maxRows:t,minRows:i}:{};return g.jsx(Ri,{component:l?_ne:"textarea",...o,__staticSelector:r||"Textarea",multiline:!0,"data-no-overflow":n&&t===void 0||void 0,__vars:{"--input-resize":a},...c})});pl.classes=Ri.classes;pl.displayName="@mantine/core/Textarea";function xT(e,n){if(typeof e=="string"&&e.trim().length===0)return!0;try{return n(e),!0}catch{return!1}}const Sne={serialize:JSON.stringify,deserialize:JSON.parse,size:"sm",indentSpaces:2},PC=De(e=>{const{value:n,defaultValue:t,onChange:i,formatOnBlur:r,validationError:a,serialize:o,deserialize:l,onFocus:c,onBlur:f,readOnly:h,error:d,indentSpaces:p,...v}=be("JsonInput",Sne,e),[b,w]=Ci({value:n,defaultValue:t,finalValue:"",onChange:i}),[k,_]=A.useState(xT(b,l)),C=E=>{c==null||c(E),_(!0)},x=E=>{f==null||f(E);const j=xT(E.currentTarget.value,l);r&&!h&&j&&E.currentTarget.value.trim()!==""&&w(o(l(E.currentTarget.value),null,p)),_(j)};return g.jsx(pl,{value:b,onChange:E=>w(E.currentTarget.value),onFocus:C,onBlur:x,readOnly:h,...v,autoComplete:"off",__staticSelector:"JsonInput",error:k?d:a||!0,"data-monospace":!0})});PC.classes=Ri.classes;PC.displayName="@mantine/core/JsonInput";const[Cne,kl]=Xr("Menu component was not found in the tree");var _l={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const NC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("MenuDivider",null,e);return g.jsx(he,{...kl().getStyles("divider",{className:t,style:i,styles:r,classNames:n}),...o})});NC.classes=_l;NC.displayName="@mantine/core/MenuDivider";const $C=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,onMouseEnter:o,onMouseLeave:l,onKeyDown:c,children:f,ref:h,...d}=be("MenuDropdown",null,e),p=A.useRef(null),v=kl(),b=Sr(c,_=>{var C,x;(_.key==="ArrowUp"||_.key==="ArrowDown")&&(_.preventDefault(),(x=(C=p.current)==null?void 0:C.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||x.focus())}),w=Sr(o,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.openDropdown()),k=Sr(l,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.closeDropdown());return g.jsxs(On.Dropdown,{...d,onMouseEnter:w,onMouseLeave:k,role:"menu","aria-orientation":"vertical",ref:Kt(h,p),...v.getStyles("dropdown",{className:t,style:i,styles:r,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:[v.withInitialFocusPlaceholder&&g.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),f]})});$C.classes=_l;$C.displayName="@mantine/core/MenuDropdown";const em=A.createContext(null),zC=Ai(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,color:o,closeMenuOnClick:l,leftSection:c,rightSection:f,children:h,disabled:d,"data-disabled":p,ref:v,...b}=be("MenuItem",null,e),w=kl(),k=A.use(em),_=ui(),{dir:C}=Ru(),x=A.useRef(null),E=b,j=Sr(E.onClick,()=>{p||(typeof l=="boolean"?l&&w.closeDropdownImmediately():w.closeOnItemClick&&w.closeDropdownImmediately())}),O=o?_.variantColorResolver({color:o,theme:_,variant:"light"}):void 0,M=o?vs({color:o,theme:_}):null,N=Sr(E.onKeyDown,q=>{q.key==="ArrowLeft"&&k&&(k.close(),k.focusParentItem())});return g.jsxs(Et,{onMouseDown:q=>q.preventDefault(),...b,unstyled:w.unstyled,tabIndex:w.menuItemTabIndex,...w.getStyles("item",{className:t,style:i,styles:r,classNames:n}),ref:Kt(x,v),role:"menuitem",disabled:d,"data-menu-item":!0,"data-disabled":d||p||void 0,"data-mantine-stop-propagation":!0,onClick:j,onKeyDown:z6({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:w.loop,dir:C,orientation:"vertical",onKeyDown:N}),__vars:{"--menu-item-color":M!=null&&M.isThemeColor&&(M==null?void 0:M.shade)===void 0?`var(--mantine-color-${M.color}-6)`:O==null?void 0:O.color,"--menu-item-hover":O==null?void 0:O.hover},children:[c&&g.jsx("div",{...w.getStyles("itemSection",{styles:r,classNames:n}),"data-position":"left",children:c}),h&&g.jsx("div",{...w.getStyles("itemLabel",{styles:r,classNames:n}),children:h}),f&&g.jsx("div",{...w.getStyles("itemSection",{styles:r,classNames:n}),"data-position":"right",children:f})]})});zC.classes=_l;zC.displayName="@mantine/core/MenuItem";const LC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("MenuLabel",null,e);return g.jsx(he,{...kl().getStyles("label",{className:t,style:i,styles:r,classNames:n}),...o})});LC.classes=_l;LC.displayName="@mantine/core/MenuLabel";const IC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,onMouseEnter:o,onMouseLeave:l,onKeyDown:c,children:f,ref:h,...d}=be("MenuSubDropdown",null,e),p=A.useRef(null),v=kl(),b=A.use(em),w=Sr(o,b==null?void 0:b.open),k=Sr(l,b==null?void 0:b.close);return g.jsx(On.Dropdown,{...d,onMouseEnter:w,onMouseLeave:k,role:"menu","aria-orientation":"vertical",ref:Kt(h,p),...v.getStyles("dropdown",{className:t,style:i,styles:r,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:f})});IC.classes=_l;IC.displayName="@mantine/core/MenuSubDropdown";const BC=Ai(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,color:o,leftSection:l,rightSection:c,children:f,disabled:h,"data-disabled":d,closeMenuOnClick:p,ref:v,...b}=be("MenuSubItem",null,e),w=kl(),k=A.use(em),_=ui(),{dir:C}=Ru(),x=A.useRef(null),E=b,j=o?_.variantColorResolver({color:o,theme:_,variant:"light"}):void 0,O=o?vs({color:o,theme:_}):null,M=Sr(E.onKeyDown,L=>{L.key==="ArrowRight"&&(k==null||k.open(),k==null||k.focusFirstItem()),L.key==="ArrowLeft"&&(k!=null&&k.parentContext)&&(k.parentContext.close(),k.parentContext.focusParentItem())}),N=Sr(E.onClick,()=>{!d&&p&&w.closeDropdownImmediately()}),q=Sr(E.onMouseEnter,k==null?void 0:k.open),R=Sr(E.onMouseLeave,k==null?void 0:k.close);return g.jsxs(Et,{onMouseDown:L=>L.preventDefault(),...b,unstyled:w.unstyled,tabIndex:w.menuItemTabIndex,...w.getStyles("item",{className:t,style:i,styles:r,classNames:n}),ref:Kt(x,v),role:"menuitem",disabled:h,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":h||d||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:q,onMouseLeave:R,onClick:N,onKeyDown:z6({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:w.loop,dir:C,orientation:"vertical",onKeyDown:M}),__vars:{"--menu-item-color":O!=null&&O.isThemeColor&&(O==null?void 0:O.shade)===void 0?`var(--mantine-color-${O.color}-6)`:j==null?void 0:j.color,"--menu-item-hover":j==null?void 0:j.hover},children:[l&&g.jsx("div",{...w.getStyles("itemSection",{styles:r,classNames:n}),"data-position":"left",children:l}),f&&g.jsx("div",{...w.getStyles("itemLabel",{styles:r,classNames:n}),children:f}),g.jsx("div",{...w.getStyles("itemSection",{styles:r,classNames:n}),"data-position":"right",children:c||g.jsx(Bg,{...w.getStyles("chevron"),size:14})})]})});BC.classes=_l;BC.displayName="@mantine/core/MenuSubItem";function cB({children:e,refProp:n}){if(!$6(e))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return kl(),g.jsx(On.Target,{refProp:n,popupType:"menu",children:e})}cB.displayName="@mantine/core/MenuSubTarget";const Ane={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function Vf(e){const{children:n,closeDelay:t,openDelay:i,...r}=be("MenuSub",Ane,e),a=Vi(),[o,{open:l,close:c}]=Az(!1),f=A.use(em),{openDropdown:h,closeDropdown:d}=kL({open:l,close:c,closeDelay:t,openDelay:i}),p=()=>window.setTimeout(()=>{var b,w;(w=(b=document.getElementById(`${a}-dropdown`))==null?void 0:b.querySelectorAll("[data-menu-item]:not([data-disabled])")[0])==null||w.focus()},16),v=()=>window.setTimeout(()=>{var b;(b=document.getElementById(`${a}-target`))==null||b.focus()},16);return g.jsx(em,{value:{opened:o,close:d,open:h,focusFirstItem:p,focusParentItem:v,parentContext:f},children:g.jsx(On,{opened:o,withinPortal:!1,withArrow:!1,id:a,...r,children:n})})}Vf.extend=e=>e;Vf.displayName="@mantine/core/MenuSub";Vf.Target=cB;Vf.Dropdown=IC;Vf.Item=BC;const jne={refProp:"ref"};function fB(e){const{children:n,refProp:t,...i}=be("MenuTarget",jne,e),r=Mu(n);if(!r)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 a=kl(),o=r.props,l=Sr(o.onClick,()=>{a.trigger==="click"?a.toggleDropdown():a.trigger==="click-hover"&&(a.setOpenedViaClick(!0),a.opened||a.openDropdown())}),c=Sr(o.onMouseEnter,()=>(a.trigger==="hover"||a.trigger==="click-hover")&&a.openDropdown()),f=Sr(o.onMouseLeave,()=>{(a.trigger==="hover"||a.trigger==="click-hover"&&!a.openedViaClick)&&a.closeDropdown()});return g.jsx(On.Target,{refProp:t,popupType:"menu",...i,children:A.cloneElement(r,{onClick:l,onMouseEnter:c,onMouseLeave:f,"data-expanded":a.opened?!0:void 0})})}fB.displayName="@mantine/core/MenuTarget";const One={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1},Vn=De(e=>{const n=be("Menu",One,e),{children:t,onOpen:i,onClose:r,opened:a,defaultOpened:o,trapFocus:l,onChange:c,closeOnItemClick:f,loop:h,closeOnEscape:d,trigger:p,openDelay:v,closeDelay:b,classNames:w,styles:k,unstyled:_,variant:C,vars:x,menuItemTabIndex:E,keepMounted:j,withInitialFocusPlaceholder:O,attributes:M,...N}=n,q=Xe({name:"Menu",classes:_l,props:n,classNames:w,styles:k,unstyled:_,attributes:M}),[R,L]=Ci({value:a,defaultValue:o,finalValue:!1,onChange:c}),[F,Y]=A.useState(!1),V=()=>{L(!1),Y(!1),R&&(r==null||r())},$=()=>{L(!0),!R&&(i==null||i())},P=()=>{R?V():$()},{openDropdown:I,closeDropdown:H}=kL({open:$,close:V,closeDelay:b,openDelay:v}),U=G=>EK("[data-menu-item]","[data-menu-dropdown]",G),{resolvedClassNames:D,resolvedStyles:W}=Wi({classNames:w,styles:k,props:n});return g.jsx(Cne,{value:{getStyles:q,opened:R,toggleDropdown:P,getItemIndex:U,openedViaClick:F,setOpenedViaClick:Y,closeOnItemClick:f,closeDropdown:p==="click"?V:H,openDropdown:p==="click"?$:I,closeDropdownImmediately:V,loop:h,trigger:p,unstyled:_,menuItemTabIndex:E,withInitialFocusPlaceholder:O},children:g.jsx(On,{returnFocus:!0,...N,opened:R,onChange:P,defaultOpened:o,trapFocus:j?!1:l,closeOnEscape:d,__staticSelector:"Menu",classNames:D,styles:W,unstyled:_,variant:C,keepMounted:j,children:t})})});Vn.displayName="@mantine/core/Menu";Vn.classes=_l;Vn.Item=zC;Vn.Label=LC;Vn.Dropdown=$C;Vn.Target=fB;Vn.Divider=NC;Vn.Sub=Vf;const[Ene,Wf]=Xr("Modal component was not found in tree");var ys={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const By=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("ModalBody",null,e);return g.jsx(ZL,{...Wf().getStyles("body",{classNames:n,style:i,styles:r,className:t}),...o})});By.classes=ys;By.displayName="@mantine/core/ModalBody";const Fy=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("ModalCloseButton",null,e);return g.jsx(QL,{...Wf().getStyles("close",{classNames:n,style:i,styles:r,className:t}),...o})});Fy.classes=ys;Fy.displayName="@mantine/core/ModalCloseButton";const qy=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,children:o,__hidden:l,...c}=be("ModalContent",null,e),f=Wf(),h=f.scrollAreaComponent||oee;return g.jsx(JL,{...f.getStyles("content",{className:t,style:i,styles:r,classNames:n}),innerProps:f.getStyles("inner",{className:t,style:i,styles:r,classNames:n}),"data-full-screen":f.fullScreen||void 0,"data-modal-content":!0,"data-hidden":l||void 0,...c,children:g.jsx(h,{style:{maxHeight:f.fullScreen?"100dvh":`calc(100dvh - (${me(f.yOffset)} * 2))`},children:o})})});qy.classes=ys;qy.displayName="@mantine/core/ModalContent";const Hy=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("ModalHeader",null,e);return g.jsx(eI,{...Wf().getStyles("header",{classNames:n,style:i,styles:r,className:t}),...o})});Hy.classes=ys;Hy.displayName="@mantine/core/ModalHeader";const Uy=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("ModalOverlay",null,e);return g.jsx(nI,{...Wf().getStyles("overlay",{classNames:n,style:i,styles:r,className:t}),...o})});Uy.classes=ys;Uy.displayName="@mantine/core/ModalOverlay";const Tne={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Sa("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},dB=(e,{radius:n,size:t,yOffset:i,xOffset:r})=>({root:{"--modal-radius":n===void 0?void 0:Yt(n),"--modal-size":Bn(t,"modal-size"),"--modal-y-offset":me(i),"--modal-x-offset":me(r)}}),rp=De(e=>{const n=be("ModalRoot",Tne,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,yOffset:c,scrollAreaComponent:f,radius:h,fullScreen:d,centered:p,xOffset:v,__staticSelector:b,attributes:w,...k}=n,_=Xe({name:b,classes:ys,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:w,vars:l,varsResolver:dB});return g.jsx(Ene,{value:{yOffset:c,scrollAreaComponent:f,getStyles:_,fullScreen:d},children:g.jsx(XL,{..._("root"),"data-full-screen":d||void 0,"data-centered":p||void 0,"data-offset-scrollbars":f===fr.Autosize||void 0,unstyled:o,...k})})});rp.classes=ys;rp.varsResolver=dB;rp.displayName="@mantine/core/ModalRoot";const hB=A.createContext(null);function mB({children:e}){const[n,t]=A.useState([]),[i,r]=A.useState(Sa("modal"));return g.jsx(hB,{value:{stack:n,addModal:(a,o)=>{t(l=>[...new Set([...l,a])]),r(l=>typeof o=="number"&&typeof l=="number"?Math.max(l,o):l)},removeModal:a=>t(o=>o.filter(l=>l!==a)),getZIndex:a=>`calc(${i} + ${n.indexOf(a)} + 1)`,currentId:n[n.length-1],maxZIndex:i},children:e})}mB.displayName="@mantine/core/ModalStack";const Vy=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,...o}=be("ModalTitle",null,e);return g.jsx(tI,{...Wf().getStyles("title",{classNames:n,style:i,styles:r,className:t}),...o})});Vy.classes=ys;Vy.displayName="@mantine/core/ModalTitle";const Mne={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Sa("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},hr=De(e=>{const{title:n,withOverlay:t,overlayProps:i,withCloseButton:r,closeButtonProps:a,children:o,radius:l,opened:c,stackId:f,zIndex:h,...d}=be("Modal",Mne,e),p=A.use(hB),v=!!n||r,b=p&&f?{closeOnEscape:p.currentId===f,trapFocus:p.currentId===f,zIndex:p.getZIndex(f)}:{},w=t===!1?!1:f&&p?p.currentId===f:c;return A.useEffect(()=>{p&&f&&(c?p.addModal(f,h||Sa("modal")):p.removeModal(f))},[c,f,h]),g.jsxs(rp,{radius:l,opened:c,zIndex:p&&f?p.getZIndex(f):h,...d,...b,children:[t&&g.jsx(Uy,{visible:w,transitionProps:p&&f?{duration:0}:void 0,...i}),g.jsxs(qy,{radius:l,__hidden:p&&f&&c?f!==p.currentId:!1,children:[v&&g.jsxs(Hy,{children:[n&&g.jsx(Vy,{children:n}),r&&g.jsx(Fy,{...a})]}),g.jsx(By,{children:o})]})]})});hr.classes=ys;hr.displayName="@mantine/core/Modal";hr.Root=rp;hr.Overlay=Uy;hr.Content=qy;hr.Body=By;hr.Header=Hy;hr.Title=Vy;hr.CloseButton=Fy;hr.Stack=mB;const Wy=A.createContext(null);var Gy={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const pB=A.createContext(null),vB=(e,{gap:n},{size:t})=>({group:{"--pg-gap":n!==void 0?Bn(n):Bn(t,"pg-gap")}}),Yy=De(e=>{var b;const n=be("PillGroup",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,size:c,disabled:f,attributes:h,...d}=n,p=((b=A.use(Wy))==null?void 0:b.size)||c||void 0,v=Xe({name:"PillGroup",classes:Gy,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:h,vars:l,varsResolver:vB,stylesCtx:{size:p},rootSelector:"group"});return g.jsx(pB,{value:{size:p,disabled:f},children:g.jsx(he,{size:p,...v("group"),...d})})});Yy.classes=Gy;Yy.varsResolver=vB;Yy.displayName="@mantine/core/PillGroup";const Dne={variant:"default"},gB=(e,{radius:n},{size:t})=>({root:{"--pill-fz":Bn(t,"pill-fz"),"--pill-height":Bn(t,"pill-height"),"--pill-radius":n===void 0?void 0:Yt(n)}}),vl=De(e=>{const n=be("Pill",Dne,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,variant:c,children:f,withRemoveButton:h,onRemove:d,removeButtonProps:p,radius:v,size:b,disabled:w,mod:k,attributes:_,...C}=n,x=A.use(pB),E=A.use(Wy),j=b||(x==null?void 0:x.size)||void 0,O=(E==null?void 0:E.variant)==="filled"?"contrast":c||"default",M=Xe({name:"Pill",classes:Gy,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:_,vars:l,varsResolver:gB,stylesCtx:{size:j}});return g.jsxs(he,{component:"span",variant:O,size:j,...M("root",{variant:O}),mod:[{"with-remove":h&&!w,disabled:w||(x==null?void 0:x.disabled)},k],...C,children:[g.jsx("span",{...M("label"),children:f}),h&&g.jsx(bl,{variant:"transparent",radius:v,tabIndex:-1,"aria-hidden":!0,unstyled:o,...p,...M("remove",{className:p==null?void 0:p.className,style:p==null?void 0:p.style}),onMouseDown:N=>{var q;N.preventDefault(),N.stopPropagation(),(q=p==null?void 0:p.onMouseDown)==null||q.call(p,N)},onClick:N=>{var q;N.stopPropagation(),d==null||d(),(q=p==null?void 0:p.onClick)==null||q.call(p,N)}})]})});vl.classes=Gy;vl.varsResolver=gB;vl.displayName="@mantine/core/Pill";vl.Group=Yy;var yB={field:"m_45c4369d"};const Rne={type:"visible"},FC=De(e=>{const n=be("PillsInputField",Rne,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,type:c,disabled:f,id:h,pointer:d,mod:p,attributes:v,ref:b,...w}=n,k=A.use(Wy),_=A.use(Pu),C=Xe({name:"PillsInputField",classes:yB,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:v,rootSelector:"field"}),x=f||(k==null?void 0:k.disabled);return g.jsx(he,{component:"input",ref:Kt(b,k==null?void 0:k.fieldRef),"data-type":c,disabled:x,mod:[{disabled:x,pointer:d},p],...C("field"),...w,id:(_==null?void 0:_.inputId)||h,"aria-invalid":k==null?void 0:k.hasError,"aria-describedby":_==null?void 0:_.describedBy,type:"text",onMouseDown:E=>!d&&E.stopPropagation()})});FC.classes=yB;FC.displayName="@mantine/core/PillsInputField";const Pne={size:"sm"},ku=De(e=>{const{children:n,onMouseDown:t,onClick:i,size:r,disabled:a,__staticSelector:o,error:l,variant:c,...f}=be("PillsInput",Pne,e),h=A.useRef(null);return g.jsx(Wy,{value:{fieldRef:h,size:r,disabled:a,hasError:!!l,variant:c},children:g.jsx(Ri,{size:r,error:l,variant:c,component:"div","data-no-overflow":!0,onMouseDown:d=>{var p;d.preventDefault(),t==null||t(d),(p=h.current)==null||p.focus()},onClick:d=>{var p,v;d.preventDefault(),(p=d.currentTarget.closest("fieldset"))!=null&&p.disabled||((v=h.current)==null||v.focus(),i==null||i(d))},...f,multiline:!0,disabled:a,__staticSelector:o||"PillsInput",withAria:!1,children:n})})});ku.displayName="@mantine/core/PillsInput";ku.classes=Ri.classes;ku.Field=FC;function Ok(e){return typeof e=="string"?e.trim().toLowerCase():e}function Nne({data:e,value:n}){const t=n.map(Ok);return e.reduce((i,r)=>(wu(r)?i.push({group:r.group,items:r.items.filter(a=>t.indexOf(Ok(a.value))===-1)}):t.indexOf(Ok(r.value))===-1&&i.push(r),i),[])}const ST={xs:41,sm:50,md:60,lg:72,xl:89},$ne={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:",",clearSearchOnChange:!0,openOnFocus:!0,size:"sm"},Ky=fy(e=>{const n=be("MultiSelect",$ne,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,size:c,value:f,defaultValue:h,onChange:d,onKeyDown:p,variant:v,data:b,dropdownOpened:w,defaultDropdownOpened:k,onDropdownOpen:_,onDropdownClose:C,selectFirstOptionOnChange:x,selectFirstOptionOnDropdownOpen:E,onOptionSubmit:j,comboboxProps:O,filter:M,limit:N,withScrollArea:q,maxDropdownHeight:R,searchValue:L,defaultSearchValue:F,onSearchChange:Y,readOnly:V,disabled:$,onFocus:P,onBlur:I,radius:H,rightSection:U,rightSectionWidth:D,rightSectionPointerEvents:W,rightSectionProps:G,leftSection:z,leftSectionWidth:X,leftSectionPointerEvents:ee,leftSectionProps:re,inputContainer:le,inputWrapperOrder:ye,withAsterisk:ae,labelProps:ue,descriptionProps:Se,errorProps:ne,wrapperProps:Le,description:ke,label:je,error:Ne,maxValues:ge,searchable:Ce,nothingFoundMessage:Pe,withCheckIcon:ce,withAlignedLabels:qe,checkIconPosition:Ye,hidePickedOptions:We,withErrorStyles:Ze,name:Qe,form:ie,id:ve,clearable:Ke,clearSectionMode:Je,clearButtonProps:Ae,hiddenInputProps:an,placeholder:mn,hiddenInputValuesDivider:En,required:vn,mod:sn,renderOption:en,renderPill:zn,onRemove:Re,onClear:He,onMaxValues:Dn,scrollAreaProps:kn,chevronColor:bn,attributes:_n,clearSearchOnChange:ft,openOnFocus:Tt,loading:Be,loadingPosition:Ue,...Ln}=n,ut=Vi(ve),Pn=Cy(b),rn=ip(Pn),tn=A.useRef({}),on=Bf({opened:w,defaultOpened:k,onDropdownOpen:()=>{_==null||_(),E&&on.selectFirstOption()},onDropdownClose:()=>{C==null||C(),on.resetSelectedOption()}}),{styleProps:In,rest:{type:Gn,autoComplete:_t,...Rn}}=Du(Ln),[Tn,Kn]=Ci({value:f,defaultValue:h,finalValue:[],onChange:d}),[$t,Oi]=Ci({value:L,defaultValue:F,finalValue:"",onChange:Y}),tr=cn=>{Oi(cn),on.resetSelectedOption()},Zr=Xe({name:"MultiSelect",classes:{},props:n,classNames:t,styles:a,unstyled:o,attributes:_n}),{resolvedClassNames:Ka,resolvedStyles:Qr}=Wi({props:n,styles:a,classNames:t}),pr=cn=>{p==null||p(cn),cn.key===" "&&!Ce&&(cn.preventDefault(),on.toggleDropdown()),cn.key==="Backspace"&&$t.length===0&&Tn.length>0&&(Re==null||Re(Tn[Tn.length-1]),Kn(Tn.slice(0,Tn.length-1)))},Xa=Tn.map((cn,Er)=>{var Tr;const Za=rn[`${cn}`]||tn.current[`${cn}`];return zn?g.jsx(A.Fragment,{children:zn({option:Za,value:cn,onRemove:()=>{Kn(Tn.filter(Mr=>cn!==Mr)),Re==null||Re(cn)},disabled:$})},`${cn}-${Er}`):g.jsx(vl,{withRemoveButton:!V&&!((Tr=rn[`${cn}`])!=null&&Tr.disabled),onRemove:()=>{Kn(Tn.filter(Mr=>cn!==Mr)),Re==null||Re(cn)},unstyled:o,disabled:$,...Zr("pill"),children:(Za==null?void 0:Za.label)||cn},`${cn}-${Er}`)});A.useEffect(()=>{x&&on.selectFirstOption()},[x,$t]),A.useEffect(()=>{Tn.forEach(cn=>{`${cn}`in rn&&(tn.current[`${cn}`]=rn[`${cn}`])})},[rn,Tn]);const Jr=g.jsx(An.ClearButton,{...Ae,onClear:()=>{He==null||He(),Kn([]),tr("")}}),ea=Nne({data:Pn,value:Tn}),gn=Ke&&Tn.length>0&&!$&&!V,ci=gn?{paddingInlineEnd:ST[c]??ST.sm}:void 0;return g.jsxs(g.Fragment,{children:[g.jsxs(An,{store:on,classNames:Ka,styles:Qr,unstyled:o,size:c,readOnly:V,__staticSelector:"MultiSelect",attributes:_n,onOptionSubmit:cn=>{j==null||j(cn),ft&&tr(""),on.updateSelectedOptionIndex("selected"),Tn.includes(rn[`${cn}`].value)?(Kn(Tn.filter(Er=>Er!==rn[`${cn}`].value)),Re==null||Re(rn[`${cn}`].value)):Tn.lengthCe?on.openDropdown():on.toggleDropdown(),"data-expanded":on.dropdownOpened||void 0,id:ut,required:vn,mod:sn,attributes:_n,children:g.jsxs(vl.Group,{attributes:_n,disabled:$,unstyled:o,...Zr("pillsList",{style:ci}),children:[Xa,g.jsx(An.EventsTarget,{autoComplete:_t,withExpandedAttribute:!0,children:g.jsx(ku.Field,{...Rn,id:ut,placeholder:mn,type:!Ce&&!mn?"hidden":"visible",...Zr("inputField"),unstyled:o,onFocus:cn=>{P==null||P(cn),Tt&&Ce&&on.openDropdown()},onBlur:cn=>{I==null||I(cn),on.closeDropdown(),tr("")},onKeyDown:pr,value:$t,onChange:cn=>{tr(cn.currentTarget.value),Ce&&on.openDropdown(),x&&on.selectFirstOption()},disabled:$,readOnly:V||!Ce,pointer:!Ce})})]})})}),g.jsx(Ey,{data:We?ea:Pn,hidden:V||$,filter:M,search:$t,limit:N,hiddenWhenEmpty:!Pe,withScrollArea:q,maxDropdownHeight:R,filterOptions:Ce,value:Tn,checkIconPosition:Ye,withCheckIcon:ce,withAlignedLabels:qe,nothingFoundMessage:Pe,unstyled:o,labelId:je?`${ut}-label`:void 0,"aria-label":je?void 0:Ln["aria-label"],renderOption:en,scrollAreaProps:kn})]}),g.jsx(An.HiddenInput,{name:Qe,valuesDivider:En,value:Tn,form:ie,disabled:$,...an})]})});Ky.classes={...Ri.classes,...An.classes};Ky.displayName="@mantine/core/MultiSelect";var bB={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const zne={withCloseButton:!0},wB=(e,{radius:n,color:t})=>({root:{"--notification-radius":n===void 0?void 0:Yt(n),"--notification-color":t?lt(t,e):void 0}}),Xy=De(e=>{const n=be("Notification",zne,e),{className:t,color:i,radius:r,loading:a,withCloseButton:o,withBorder:l,title:c,icon:f,children:h,onClose:d,closeButtonProps:p,classNames:v,style:b,styles:w,unstyled:k,vars:_,mod:C,loaderProps:x,role:E,attributes:j,...O}=n,M=Xe({name:"Notification",classes:bB,props:n,className:t,style:b,classNames:v,styles:w,unstyled:k,attributes:j,vars:_,varsResolver:wB});return g.jsxs(he,{...M("root"),mod:[{"data-with-icon":!!f||a,"data-with-border":l},C],role:E||"alert",...O,children:[f&&!a&&g.jsx("div",{...M("icon"),children:f}),a&&g.jsx(ai,{size:28,color:i,...M("loader"),...x}),g.jsxs("div",{...M("body"),children:[c&&g.jsx("div",{...M("title"),children:c}),g.jsx(he,{...M("description"),mod:{"data-with-title":!!c},children:h})]}),o&&g.jsx(bl,{iconSize:16,color:"gray",...p,unstyled:k,onClick:N=>{var q;(q=p==null?void 0:p.onClick)==null||q.call(p,N),d==null||d()},...M("closeButton")})]})});Xy.classes=bB;Xy.varsResolver=wB;Xy.displayName="@mantine/core/Notification";function kB(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r=l?r=r+AT("0",o-l):r=(r.substring(0,o)||"0")+"."+r.substring(o),t+r}function jT(e,n,t){if(["","-"].indexOf(e)!==-1)return e;var i=(e.indexOf(".")!==-1||t)&&n,r=qC(e),a=r.beforeDecimal,o=r.afterDecimal,l=r.hasNegation,c=parseFloat("0."+(o||"0")),f=o.length<=n?"0."+o:c.toFixed(n),h=f.split("."),d=a;a&&Number(h[0])&&(d=a.split("").reverse().reduce(function(w,k,_){return w.length>_?(Number(w[0])+Number(k)).toString()+w.substring(1,w.length):k+w},h[0]));var p=SB(h[1]||"",n,t),v=l?"-":"",b=i?".":"";return""+v+d+b+p}function ou(e,n){if(e.value=e.value,e!==null){if(e.createTextRange){var t=e.createTextRange();return t.move("character",n),t.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(n,n),!0):(e.focus(),!1)}}var AB=Lne(function(e,n){for(var t=0,i=0,r=e.length,a=n.length;e[t]===n[t]&&tt&&r-i>t;)i++;return{from:{start:t,end:r-i},to:{start:t,end:a-i}}}),Hne=function(e,n){var t=Math.min(e.selectionStart,n);return{from:{start:t,end:e.selectionEnd},to:{start:t,end:n}}};function Une(e,n,t){return Math.min(Math.max(e,n),t)}function Ek(e){return Math.max(e.selectionStart,e.selectionEnd)}function Vne(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Wne(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function Gne(e){var n=e.currentValue,t=e.formattedValue,i=e.currentValueIndex,r=e.formattedValueIndex;return n[i]===t[r]}function Yne(e,n,t,i,r,a,o){o===void 0&&(o=Gne);var l=r.findIndex(function(E){return E}),c=e.slice(0,l);!n&&!t.startsWith(c)&&(n=c,t=c+t,i=i+c.length);for(var f=t.length,h=e.length,d={},p=new Array(f),v=0;v0&&p[_]===-1;)_--;var x=_===-1||p[_]===-1?0:p[_]+1;return x>C?C:i-x=0&&!t[n];)n--;n===-1&&(n=t.indexOf(!0))}else{for(;n<=r&&!t[n];)n++;n>r&&(n=t.lastIndexOf(!0))}return n===-1&&(n=r),n}function Kne(e){for(var n=Array.from({length:e.length+1}).map(function(){return!0}),t=0,i=n.length;tM.length-o.length||OL||d>e.length-o.length)&&(R=d),e=e.substring(0,R),e=Jne(x?"-"+e:e,r),e=(e.match(ete(b))||[]).join("");var F=e.indexOf(b);e=e.replace(new RegExp(xB(b),"g"),function(I,H){return H===F?".":""});var Y=qC(e,r),V=Y.beforeDecimal,$=Y.afterDecimal,P=Y.addNegation;return f.end-f.startW?!1:D>=ee.start&&Dt?t:e}function ute(e){return e.toString().replace(".","").length}function cte(e,n){return(typeof e=="number"?e=n)&&(t===void 0||e<=t)}const Rk={size:"sm",step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[".",","]},TB=(e,{size:n})=>({controls:{"--ni-chevron-size":Bn(n,"ni-chevron-size")}});function dte(e,n,t){const i=e.toString(),r=OB.test(i),a=i.replace(/^0+(?=\d)/,""),o=parseFloat(a);if(Number.isNaN(o))return a;if(o>Number.MAX_SAFE_INTEGER)return n!==void 0?n:a;const l=ns(o,t,n);return r?`${l.toString().replace(/^0+(?=\d)/,"")}.`:l}function hte(e,n){if(e===""||e==="-")return e;const t=Ch(e);return t===null?e:n.clampBehavior==="blur"?_g(t,n.min,n.max):t}const tm=fy(e=>{const n=be("NumberInput",Rk,e),{className:t,classNames:i,styles:r,unstyled:a,vars:o,onChange:l,onValueChange:c,value:f,defaultValue:h,max:d,min:p,step:v,hideControls:b,rightSection:w,isAllowed:k,clampBehavior:_,onBlur:C,allowDecimal:x,decimalScale:E,onKeyDown:j,onKeyDownCapture:O,handlersRef:M,startValue:N,disabled:q,rightSectionPointerEvents:R,allowNegative:L,readOnly:F,size:Y,rightSectionWidth:V,stepHoldInterval:$,stepHoldDelay:P,allowLeadingZeros:I,withKeyboardEvents:H,trimLeadingZeroesOnBlur:U,allowedDecimalSeparators:D,selectAllOnFocus:W,onMinReached:G,onMaxReached:z,onFocus:X,attributes:ee,ref:re,...le}=n,ye=L??!0,ae=I??!0,ue=Xe({name:"NumberInput",classes:MS,props:n,classNames:i,styles:r,unstyled:a,attributes:ee,vars:o,varsResolver:TB}),{resolvedClassNames:Se,resolvedStyles:ne}=Wi({classNames:i,styles:r,props:n}),Le=A.useRef(Tk(f)||Tk(h)?"bigint":"number");Tk(f)?Le.current="bigint":typeof f=="number"&&(Le.current="number");const ke=Le.current==="bigint",[je,Ne]=Ci({value:f,defaultValue:h,finalValue:"",onChange:l}),ge=P!==void 0&&$!==void 0,Ce=A.useRef(null),Pe=A.useRef(null),ce=A.useRef(0),qe=typeof p=="number"?p:void 0,Ye=typeof d=="number"?d:void 0,We=typeof v=="number"?v:Rk.step,Ze=typeof N=="number"?N:Rk.startValue,Qe=Hv(p),ie=Hv(d),ve=Hv(v)??BigInt(1),Ke=Hv(N)??BigInt(0),Je=Be=>!EB(Be,ye)||ae&&MT.test(Be)?Be:Ch(Be)??Be,Ae=Be=>{const Ue=Number(Be);return Number.isSafeInteger(Ue)?Ue:void 0},an=(Be,Ue)=>{Ue.source==="event"&&Ne(ke?Je(Be.value):cte(Be.floatValue,Be.value)&&!ste.test(Be.value)&&!(ae&&MT.test(Be.value))&&!lte.test(Be.value)&&!OB.test(Be.value)?Be.floatValue:Be.value),c==null||c(Be,Ue)},mn=Be=>{const Ue=String(Be).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Ue?Math.max(0,(Ue[1]?Ue[1].length:0)-(Ue[2]?+Ue[2]:0)):0},En=Be=>{Ce.current&&typeof Be<"u"&&Ce.current.setSelectionRange(Be,Be)},vn=A.useRef(mS);vn.current=()=>{if(ke){if(!Dk(je,ye))return;let tn;const on=je;if(typeof on=="bigint"){const Gn=on+ve;ie!==void 0&&Gn>ie&&(z==null||z()),tn=ie!==void 0&&Gn>ie?ie:Gn}else if(typeof on=="string"&&on!==""){const Gn=Ch(on);if(Gn===null)return;const _t=Gn+ve;ie!==void 0&&_t>ie&&(z==null||z()),tn=ie!==void 0&&_t>ie?ie:_t}else tn=_g(Ke,Qe,ie);const In=tn.toString();Ne(tn),c==null||c({floatValue:Ae(tn),formattedValue:In,value:In},{source:"increment"}),setTimeout(()=>{var Gn;return En((Gn=Ce.current)==null?void 0:Gn.value.length)},0);return}if(!Mk(je))return;let Be;const Ue=mn(je),Ln=mn(We),ut=Math.max(Ue,Ln),Pn=10**ut;if(!DS(je)&&(typeof je!="number"||Number.isNaN(je)))Be=ns(Ze,qe,Ye);else if(Ye!==void 0){const tn=(Math.round(Number(je)*Pn)+Math.round(We*Pn))/Pn;tn>Ye&&(z==null||z()),Be=tn<=Ye?tn:Ye}else Be=(Math.round(Number(je)*Pn)+Math.round(We*Pn))/Pn;const rn=Be.toFixed(ut);Ne(parseFloat(rn)),c==null||c({floatValue:parseFloat(rn),formattedValue:rn,value:rn},{source:"increment"}),setTimeout(()=>{var tn;return En((tn=Ce.current)==null?void 0:tn.value.length)},0)};const sn=A.useRef(mS);sn.current=()=>{if(ke){if(!Dk(je,ye))return;let on;const In=Qe!==void 0?Qe:ye?void 0:BigInt(0),Gn=je;if(typeof Gn=="bigint"){const Rn=Gn-ve;In!==void 0&&Rn{var Rn;return En((Rn=Ce.current)==null?void 0:Rn.value.length)},0);return}if(!Mk(je))return;let Be;const Ue=qe!==void 0?qe:ye?Number.MIN_SAFE_INTEGER:0,Ln=mn(je),ut=mn(We),Pn=Math.max(Ln,ut),rn=10**Pn;if(!DS(je)&&typeof je!="number"||Number.isNaN(je))Be=ns(Ze,Ue,Ye);else{const on=(Math.round(Number(je)*rn)-Math.round(We*rn))/rn;Ue!==void 0&&on{var on;return En((on=Ce.current)==null?void 0:on.value.length)},0)};const en=Be=>{var Pn,rn,tn;const Ue=Be.clipboardData.getData("text"),Ln=le.decimalSeparator||".",ut=(D||[".",","]).filter(on=>on!==Ln);if(ut.some(on=>Ue.includes(on))){Be.preventDefault();let on=Ue;ut.forEach(Gn=>{on=on.split(Gn).join(Ln)});const In=Ce.current;if(In){const Gn=In.selectionStart??0,_t=In.selectionEnd??0,Rn=In.value,Tn=Rn.substring(0,Gn)+on+Rn.substring(_t);(rn=(Pn=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:Pn.set)==null||rn.call(In,Tn),In.dispatchEvent(new Event("change",{bubbles:!0}));const Kn=Gn+on.length;setTimeout(()=>En(Kn),0)}}(tn=le.onPaste)==null||tn.call(le,Be)},zn=Be=>{var Ue,Ln;j==null||j(Be),!(F||!H)&&(Be.key==="ArrowUp"&&(Be.preventDefault(),(Ue=vn.current)==null||Ue.call(vn)),Be.key==="ArrowDown"&&(Be.preventDefault(),(Ln=sn.current)==null||Ln.call(sn)))},Re=Be=>{if(O==null||O(Be),Be.key==="Backspace"){const Ue=Ce.current;Ue&&Ue.selectionStart===0&&Ue.selectionStart===Ue.selectionEnd&&(Be.preventDefault(),window.setTimeout(()=>En(0),0))}},He=Be=>{W&&setTimeout(()=>Be.currentTarget.select(),0),X==null||X(Be)},Dn=Be=>{let Ue=je;ke?(_==="blur"&&typeof Ue=="bigint"&&(Ue=_g(Ue,Qe,ie)),U&&typeof Ue=="string"&&(Ue=hte(Ue,{min:Qe,max:ie,clampBehavior:_}))):(_==="blur"&&typeof Ue=="number"&&(Ue=ns(Ue,qe,Ye)),U&&typeof Ue=="string"&&mn(Ue)<15&&(Ue=dte(Ue,Ye,qe))),je!==Ue&&Ne(Ue),C==null||C(Be)};Dg(M,{increment:vn.current,decrement:sn.current});const kn=Be=>{var Ue,Ln;Be?(Ue=vn.current)==null||Ue.call(vn):(Ln=sn.current)==null||Ln.call(sn),ce.current+=1},bn=Be=>{if(kn(Be),ge){const Ue=typeof $=="number"?$:$(ce.current);Pe.current=window.setTimeout(()=>bn(Be),Ue)}},_n=(Be,Ue)=>{var Ln;Be.preventDefault(),(Ln=Ce.current)==null||Ln.focus(),kn(Ue),ge&&(Pe.current=window.setTimeout(()=>bn(Ue),P))},ft=()=>{Pe.current&&window.clearTimeout(Pe.current),Pe.current=null,ce.current=0},Tt=g.jsxs("div",{...ue("controls"),children:[g.jsx(Et,{...ue("control"),tabIndex:-1,"aria-hidden":!0,disabled:q||typeof je=="number"&&Ye!==void 0&&je>=Ye||typeof je=="bigint"&&ie!==void 0&&je>=ie,mod:{direction:"up"},onMouseDown:Be=>Be.preventDefault(),onPointerDown:Be=>{_n(Be,!0)},onPointerUp:ft,onPointerLeave:ft,children:g.jsx(TT,{direction:"up"})}),g.jsx(Et,{...ue("control"),tabIndex:-1,"aria-hidden":!0,disabled:q||typeof je=="number"&&qe!==void 0&&je<=qe||typeof je=="bigint"&&Qe!==void 0&&je<=Qe,mod:{direction:"down"},onMouseDown:Be=>Be.preventDefault(),onPointerDown:Be=>{_n(Be,!1)},onPointerUp:ft,onPointerLeave:ft,children:g.jsx(TT,{direction:"down"})})]});return g.jsx(Ri,{component:ote,allowNegative:L,className:pn(MS.root,t),size:Y,...le,inputMode:ke?"numeric":"decimal",readOnly:F,disabled:q,value:typeof je=="bigint"?je.toString():je,getInputRef:Kt(re,Ce),onValueChange:an,rightSection:b||F||!(ke?Dk(je,ye):Mk(je))?w:w||Tt,classNames:Se,styles:ne,unstyled:a,__staticSelector:"NumberInput",decimalScale:ke?0:x?E:0,onPaste:en,onFocus:He,onKeyDown:zn,onKeyDownCapture:Re,rightSectionPointerEvents:R??(q?"none":void 0),rightSectionWidth:V??`var(--ni-right-section-width-${Y||"sm"})`,allowLeadingZeros:I,allowedDecimalSeparators:D,onBlur:Dn,attributes:ee,isAllowed:Be=>{if(!(!k||k(Be)))return!1;if(_!=="strict")return!0;if(!ke)return fte(Be.floatValue,qe,Ye);if(Be.value===""||Be.value==="-")return!0;const Ue=Ch(Be.value);return Ue===null?!0:(Qe===void 0||Ue>=Qe)&&(ie===void 0||Ue<=ie)}})});tm.classes={...Ri.classes,...MS};tm.varsResolver=TB;tm.displayName="@mantine/core/NumberInput";function mte({reveal:e}){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:e?g.jsxs(g.Fragment,{children:[g.jsx("path",{fill:"none",d:"M0 0h256v256H0z"}),g.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16",d:"M48 40l160 176M154.91 157.6a40 40 0 01-53.82-59.2M135.53 88.71a40 40 0 0132.3 35.53"}),g.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16",d:"M208.61 169.1C230.41 149.58 240 128 240 128s-32-72-112-72a126 126 0 00-20.68 1.68M74 68.6C33.23 89.24 16 128 16 128s32 72 112 72a118.05 118.05 0 0054-12.6"})]}):g.jsxs(g.Fragment,{children:[g.jsx("path",{fill:"none",d:"M0 0h256v256H0z"}),g.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16",d:"M128 56c-80 0-112 72-112 72s32 72 112 72 112-72 112-72-32-72-112-72z"}),g.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"})]})})}var RS={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const pte={visibilityToggleIcon:mte,size:"sm"},MB=(e,{size:n})=>({root:{"--psi-icon-size":Bn(n,"psi-icon-size"),"--psi-button-size":Bn(n,"psi-button-size")}}),Qy=De(e=>{const n=be("PasswordInput",pte,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,required:c,error:f,leftSection:h,disabled:d,id:p,variant:v,inputContainer:b,description:w,label:k,size:_,errorProps:C,descriptionProps:x,labelProps:E,withAsterisk:j,inputWrapperOrder:O,wrapperProps:M,radius:N,rightSection:q,rightSectionWidth:R,rightSectionPointerEvents:L,leftSectionWidth:F,visible:Y,defaultVisible:V,onVisibilityChange:$,visibilityToggleIcon:P,visibilityToggleButtonProps:I,rightSectionProps:H,leftSectionProps:U,leftSectionPointerEvents:D,withErrorStyles:W,mod:G,attributes:z,...X}=n,ee=Vi(p),[re,le]=Ci({value:Y,defaultValue:V,finalValue:!1,onChange:$}),ye=()=>le(!re),ae=Xe({name:"PasswordInput",classes:RS,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:z,vars:l,varsResolver:MB}),{resolvedClassNames:ue,resolvedStyles:Se}=Wi({classNames:t,styles:a,props:n}),{styleProps:ne,rest:Le}=Du(X),ke=(C==null?void 0:C.id)||`${ee}-error`,je=(x==null?void 0:x.id)||`${ee}-description`,Ne=`${f&&typeof f!="boolean"?ke:""} ${w?je:""}`,ge=Ne.trim().length>0?Ne.trim():void 0,Ce=g.jsx(vt,{...ae("visibilityToggle"),disabled:d,radius:N,"aria-pressed":re,tabIndex:-1,"aria-label":"Toggle password visibility",...I,variant:(I==null?void 0:I.variant)??"subtle",color:"gray",unstyled:o,onTouchEnd:Pe=>{var ce;Pe.preventDefault(),(ce=I==null?void 0:I.onTouchEnd)==null||ce.call(I,Pe),ye()},onMouseDown:Pe=>{var ce;Pe.preventDefault(),(ce=I==null?void 0:I.onMouseDown)==null||ce.call(I,Pe),ye()},onKeyDown:Pe=>{var ce;(ce=I==null?void 0:I.onKeyDown)==null||ce.call(I,Pe),Pe.key===" "&&(Pe.preventDefault(),ye())},children:g.jsx(P,{reveal:re})});return g.jsx(Gt.Wrapper,{required:c,id:ee,label:k,error:f,description:w,size:_,classNames:ue,styles:Se,__staticSelector:"PasswordInput",__stylesApiProps:n,unstyled:o,withAsterisk:j,inputWrapperOrder:O,inputContainer:b,variant:v,labelProps:{...E,htmlFor:ee},descriptionProps:{...x,id:je},errorProps:{...C,id:ke},mod:G,attributes:z,...ae("root"),...ne,...M,children:g.jsx(Gt,{component:"div",error:f,leftSection:h,size:_,classNames:{...ue,input:pn(RS.input,ue==null?void 0:ue.input)},styles:Se,radius:N,disabled:d,__staticSelector:"PasswordInput",__stylesApiProps:n,rightSectionWidth:R,rightSection:q??Ce,variant:v,unstyled:o,leftSectionWidth:F,rightSectionPointerEvents:L||"all",rightSectionProps:H,leftSectionProps:U,leftSectionPointerEvents:D,withAria:!1,withErrorStyles:W,attributes:z,children:g.jsx("input",{required:c,"data-invalid":!!f||void 0,"data-with-left-section":!!h||void 0,...ae("innerInput"),disabled:d,id:ee,...Le,"aria-describedby":ge,autoComplete:Le.autoComplete||"off",type:re?"text":"password"})})})});Qy.classes={...Ri.classes,...RS};Qy.varsResolver=MB;Qy.displayName="@mantine/core/PasswordInput";function vte({offset:e,position:n,defaultOpened:t}){const[i,r]=A.useState(t),a=A.useRef(null),{x:o,y:l,elements:c,refs:f,update:h,placement:d}=aC({placement:n,middleware:[nC({crossAxis:!0,padding:5,rootBoundary:"document"})]}),p=d.includes("right")?e:n.includes("left")?e*-1:0,v=d.includes("bottom")?e:n.includes("top")?e*-1:0,b=A.useCallback(({clientX:w,clientY:k})=>{f.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:w,y:k,left:w+p,top:k+v,right:w,bottom:k}}})},[c.reference]);return A.useEffect(()=>{if(f.floating.current){const w=a.current;w.addEventListener("mousemove",b);const k=is(f.floating.current);return k.forEach(_=>{_.addEventListener("scroll",h)}),()=>{w.removeEventListener("mousemove",b),k.forEach(_=>{_.removeEventListener("scroll",h)})}}},[c.reference,f.floating.current,h,b,i]),{handleMouseMove:b,x:o,y:l,opened:i,setOpened:r,boundaryRef:a,floating:f.setFloating}}var Jy={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const gte={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Sa("popover")},DB=(e,{radius:n,color:t})=>({tooltip:{"--tooltip-radius":n===void 0?void 0:Yt(n),"--tooltip-bg":t?lt(t,e):void 0,"--tooltip-color":t?"var(--mantine-color-white)":void 0}}),e0=De(e=>{const n=be("TooltipFloating",gte,e),{children:t,refProp:i,withinPortal:r,style:a,className:o,classNames:l,styles:c,unstyled:f,radius:h,color:d,label:p,offset:v,position:b,multiline:w,zIndex:k,disabled:_,defaultOpened:C,variant:x,vars:E,portalProps:j,attributes:O,ref:M,...N}=n,q=ui(),R=Xe({name:"TooltipFloating",props:n,classes:Jy,className:o,style:a,classNames:l,styles:c,unstyled:f,attributes:O,rootSelector:"tooltip",vars:E,varsResolver:DB}),{handleMouseMove:L,x:F,y:Y,opened:V,boundaryRef:$,floating:P,setOpened:I}=vte({offset:v,position:b,defaultOpened:C}),H=Mu(t);if(!H)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 U=Kt($,uy(H),M),D=H.props,W=z=>{var X;(X=D.onMouseEnter)==null||X.call(D,z),L(z),I(!0)},G=z=>{var X;(X=D.onMouseLeave)==null||X.call(D,z),I(!1)};return g.jsxs(g.Fragment,{children:[g.jsx(ml,{...j,withinPortal:r,children:g.jsx(he,{...N,...R("tooltip",{style:{...$z(a,q),zIndex:k,display:!_&&V?"block":"none",top:(Y&&Math.round(Y))??"",left:(F&&Math.round(F))??""}}),variant:x,ref:P,mod:{multiline:w},children:p})}),A.cloneElement(H,{...D,[i]:U,onMouseEnter:W,onMouseLeave:G})]})});e0.classes=Jy;e0.varsResolver=DB;e0.displayName="@mantine/core/TooltipFloating";const RB=A.createContext({withinGroup:!1}),yte={openDelay:0,closeDelay:0};function HC(e){const{openDelay:n,closeDelay:t,children:i}=be("TooltipGroup",yte,e);return g.jsx(RB,{value:{withinGroup:!0},children:g.jsx(HQ,{delay:{open:n,close:t},children:i})})}HC.displayName="@mantine/core/TooltipGroup";HC.extend=e=>e;function bte(e){if(e===void 0)return{shift:!0,flip:!0};const n={...e};return e.shift===void 0&&(n.shift=!0),e.flip===void 0&&(n.flip=!0),n}function wte(e){const n=bte(e.middlewares),t=[uL(e.offset)];return n.shift&&t.push(nC(typeof n.shift=="boolean"?{padding:8}:{padding:8,...n.shift})),n.flip&&t.push(typeof n.flip=="boolean"?Lg():Lg(n.flip)),t.push(cL({element:e.arrowRef,padding:e.arrowOffset})),n.inline?t.push(typeof n.inline=="boolean"?Nh():Nh(n.inline)):e.inline&&t.push(Nh()),t}function kte(e){var E,j,O;const[n,t]=A.useState(e.defaultOpened),i=typeof e.opened=="boolean"?e.opened:n,r=A.use(RB).withinGroup,a=Vi(),o=A.useCallback(M=>{t(M),M&&k(a)},[a]),{x:l,y:c,context:f,refs:h,placement:d,middlewareData:{arrow:{x:p,y:v}={}}}=aC({strategy:e.strategy,placement:e.position,open:i,onOpenChange:o,middleware:wte(e),whileElementsMounted:CS}),{delay:b,currentId:w,setCurrentId:k}=UQ(f,{id:a}),{getReferenceProps:_,getFloatingProps:C}=XQ([FQ(f,{enabled:(E=e.events)==null?void 0:E.hover,delay:r?b:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((j=e.events)!=null&&j.touch)}),KQ(f,{enabled:(O=e.events)==null?void 0:O.focus,visibleOnly:!0}),QQ(f,{role:"tooltip"}),GQ(f,{enabled:typeof e.opened>"u"})]);ls(()=>{var M;(M=e.onPositionChange)==null||M.call(e,d)},[d]);const x=i&&w&&w!==a;return{x:l,y:c,arrowX:p,arrowY:v,reference:h.setReference,floating:h.setFloating,getFloatingProps:C,getReferenceProps:_,isGroupPhase:x,opened:i,placement:d}}const _te={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Sa("popover"),middlewares:{flip:!0,shift:!0,inline:!1}},PB=(e,{radius:n,color:t,variant:i,autoContrast:r})=>{const a=e.variantColorResolver({theme:e,color:t||e.primaryColor,autoContrast:r,variant:i||"filled"});return{tooltip:{"--tooltip-radius":n===void 0?void 0:Yt(n),"--tooltip-bg":t?a.background:void 0,"--tooltip-color":t?a.color:void 0}}},Zt=De(e=>{const n=be("Tooltip",_te,e),{children:t,position:i,refProp:r,label:a,openDelay:o,closeDelay:l,onPositionChange:c,opened:f,defaultOpened:h,withinPortal:d,radius:p,color:v,classNames:b,styles:w,unstyled:k,style:_,className:C,withArrow:x,arrowSize:E,arrowOffset:j,arrowRadius:O,arrowPosition:M,offset:N,transitionProps:q,multiline:R,events:L,zIndex:F,disabled:Y,onClick:V,onMouseEnter:$,onMouseLeave:P,inline:I,variant:H,keepMounted:U,vars:D,portalProps:W,mod:G,floatingStrategy:z,middlewares:X,autoContrast:ee,attributes:re,target:le,ref:ye,...ae}=n,{dir:ue}=Ru(),Se=A.useRef(null),ne=kte({position:wL(ue,i),closeDelay:l,openDelay:o,onPositionChange:c,opened:f,defaultOpened:h,events:L,arrowRef:Se,arrowOffset:j,offset:typeof N=="number"?N+(x?E/2:0):N,inline:I,strategy:z,middlewares:X});A.useEffect(()=>{const Pe=le instanceof HTMLElement?le:typeof le=="string"?document.querySelector(le):(le==null?void 0:le.current)||null;Pe&&ne.reference(Pe)},[le,ne]);const Le=Xe({name:"Tooltip",props:n,classes:Jy,className:C,style:_,classNames:b,styles:w,unstyled:k,attributes:re,rootSelector:"tooltip",vars:D,varsResolver:PB}),ke=Mu(t);if(!le&&!ke)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 je=Le("tooltip");if(le){const Pe=iT(q,{duration:100,transition:"fade"});return g.jsx(g.Fragment,{children:g.jsx(ml,{...W,withinPortal:d,children:g.jsx(cs,{...Pe,keepMounted:U,mounted:!Y&&!!ne.opened,duration:ne.isGroupPhase?10:Pe.duration,children:ce=>g.jsxs(he,{...ae,"data-fixed":z==="fixed"||void 0,variant:H,mod:[{multiline:R},G],...je,...ne.getFloatingProps({ref:ne.floating,className:je.className,style:{...je.style,...ce,zIndex:F,top:ne.y??0,left:ne.x??0}}),children:[a,g.jsx(Ig,{ref:Se,arrowX:ne.arrowX,arrowY:ne.arrowY,visible:x,position:ne.placement,arrowSize:E,arrowOffset:j,arrowRadius:O,arrowPosition:M,...Le("arrow")})]})})})})}const Ne=ke.props,ge=Kt(ne.reference,uy(ke),ye),Ce=iT(q,{duration:100,transition:"fade"});return g.jsxs(g.Fragment,{children:[g.jsx(ml,{...W,withinPortal:d,children:g.jsx(cs,{...Ce,keepMounted:U,mounted:!Y&&!!ne.opened,duration:ne.isGroupPhase?10:Ce.duration,children:Pe=>g.jsxs(he,{...ae,"data-fixed":z==="fixed"||void 0,variant:H,mod:[{multiline:R},G],...ne.getFloatingProps({ref:ne.floating,className:Le("tooltip").className,style:{...Le("tooltip").style,...Pe,zIndex:F,top:ne.y??0,left:ne.x??0}}),children:[a,g.jsx(Ig,{ref:Se,arrowX:ne.arrowX,arrowY:ne.arrowY,visible:x,position:ne.placement,arrowSize:E,arrowOffset:j,arrowRadius:O,arrowPosition:M,...Le("arrow")})]})})}),A.cloneElement(ke,ne.getReferenceProps({onClick:V,onMouseEnter:$,onMouseLeave:P,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...Ne,className:pn(C,Ne.className),[r]:ge}))]})});Zt.classes=Jy;Zt.varsResolver=PB;Zt.displayName="@mantine/core/Tooltip";Zt.Floating=e0;Zt.Group=HC;const xte={size:"sm",withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left",openOnFocus:!0},Kr=fy(e=>{const n=be("Select",xte,e),{classNames:t,styles:i,unstyled:r,vars:a,dropdownOpened:o,defaultDropdownOpened:l,onDropdownClose:c,onDropdownOpen:f,onFocus:h,onBlur:d,onClick:p,onChange:v,data:b,value:w,defaultValue:k,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:x,comboboxProps:E,readOnly:j,disabled:O,filter:M,limit:N,withScrollArea:q,maxDropdownHeight:R,size:L,searchable:F,rightSection:Y,checkIconPosition:V,withCheckIcon:$,withAlignedLabels:P,nothingFoundMessage:I,name:H,form:U,searchValue:D,defaultSearchValue:W,onSearchChange:G,allowDeselect:z,error:X,rightSectionPointerEvents:ee,id:re,clearable:le,clearSectionMode:ye,clearButtonProps:ae,hiddenInputProps:ue,renderOption:Se,onClear:ne,autoComplete:Le,scrollAreaProps:ke,__defaultRightSection:je,__clearSection:Ne,__clearable:ge,chevronColor:Ce,autoSelectOnBlur:Pe,openOnFocus:ce,attributes:qe,...Ye}=n,We=A.useMemo(()=>Cy(b),[b]),Ze=A.useRef({}),Qe=A.useMemo(()=>ip(We),[We]),ie=Vi(re),[ve,Ke,Je]=Ci({value:w,defaultValue:k,finalValue:null,onChange:v}),Ae=ve!=null?`${ve}`in Qe?Qe[`${ve}`]:Ze.current[`${ve}`]:void 0,an=HK(Ae),[mn,En,vn]=Ci({value:D,defaultValue:W,finalValue:Ae?Ae.label:"",onChange:G}),sn=Bf({opened:o,defaultOpened:l,onDropdownOpen:()=>{f==null||f(),C?sn.selectFirstOption():sn.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{c==null||c(),setTimeout(sn.resetSelectedOption,0)}}),en=kn=>{En(kn),sn.resetSelectedOption()},{resolvedClassNames:zn,resolvedStyles:Re}=Wi({props:n,styles:i,classNames:t});A.useEffect(()=>{_&&sn.selectFirstOption()},[_,mn]),A.useEffect(()=>{w===null&&en(""),w!=null&&Ae&&((an==null?void 0:an.value)!==Ae.value||(an==null?void 0:an.label)!==Ae.label)&&en(Ae.label)},[w,Ae]),A.useEffect(()=>{var kn,bn;!Je&&!vn&&en(ve!=null?`${ve}`in Qe?(kn=Qe[`${ve}`])==null?void 0:kn.label:((bn=Ze.current[`${ve}`])==null?void 0:bn.label)||"":"")},[Qe,ve]),A.useEffect(()=>{ve&&`${ve}`in Qe&&(Ze.current[`${ve}`]=Qe[`${ve}`])},[Qe,ve]);const He=g.jsx(An.ClearButton,{...ae,onClear:()=>{Ke(null,null),en(""),ne==null||ne()}}),Dn=le&&!!ve&&!O&&!j;return g.jsxs(g.Fragment,{children:[g.jsxs(An,{store:sn,__staticSelector:"Select",classNames:zn,styles:Re,unstyled:r,readOnly:j,size:L,attributes:qe,keepMounted:Pe,onOptionSubmit:kn=>{x==null||x(kn);const bn=z&&`${Qe[kn].value}`==`${ve}`?null:Qe[kn],_n=bn?bn.value:null;_n!==ve&&Ke(_n,bn),!Je&&en(_n!=null&&(bn==null?void 0:bn.label)||""),sn.closeDropdown()},...E,children:[g.jsx(An.Target,{targetType:F?"input":"button",autoComplete:Le,withExpandedAttribute:!0,children:g.jsx(Ri,{id:ie,__defaultRightSection:g.jsx(An.Chevron,{size:L,error:X,unstyled:r,color:Ce}),__clearSection:He,__clearable:Dn,__clearSectionMode:ye,rightSection:Y,rightSectionPointerEvents:ee||"none",...Ye,size:L,__staticSelector:"Select",disabled:O,readOnly:j||!F,value:mn,onChange:kn=>{en(kn.currentTarget.value),sn.openDropdown(),_&&sn.selectFirstOption()},onFocus:kn=>{ce&&F&&sn.openDropdown(),h==null||h(kn)},onBlur:kn=>{Pe&&sn.clickSelectedOption(),F&&sn.closeDropdown();const bn=ve!=null&&(`${ve}`in Qe?Qe[`${ve}`]:Ze.current[`${ve}`]);en(bn&&bn.label||""),d==null||d(kn)},onClick:kn=>{F?sn.openDropdown():sn.toggleDropdown(),p==null||p(kn)},classNames:zn,styles:Re,unstyled:r,pointer:!F,error:X,attributes:qe})}),g.jsx(Ey,{data:We,hidden:j||O,filter:M,search:mn,limit:N,hiddenWhenEmpty:!I,withScrollArea:q,maxDropdownHeight:R,filterOptions:!!F&&(Ae==null?void 0:Ae.label)!==mn,value:ve,checkIconPosition:V,withCheckIcon:$,withAlignedLabels:P,nothingFoundMessage:I,unstyled:r,labelId:Ye.label?`${ie}-label`:void 0,"aria-label":Ye.label?void 0:Ye["aria-label"],renderOption:Se,scrollAreaProps:ke})]}),g.jsx(An.HiddenInput,{value:ve,name:H,form:U,disabled:O,...ue})]})});Kr.classes={...Ri.classes,...An.classes};Kr.displayName="@mantine/core/Select";function NB(e){if(e!==void 0)return typeof e=="number"?me(e):e}function Ste({spacing:e,verticalSpacing:n,cols:t,minColWidth:i,autoRows:r,selector:a}){var d;const o=ui(),l=n===void 0?e:n,c=i!==void 0,f=Tu({"--sg-spacing-x":Vt(Wr(e)),"--sg-spacing-y":Vt(Wr(l)),"--sg-auto-rows":r,...c?{"--sg-min-col-width":NB(i)}:{"--sg-cols":(d=Wr(t))==null?void 0:d.toString()}}),h=Pt(o.breakpoints).reduce((p,v)=>(p[v]||(p[v]={}),typeof e=="object"&&e[v]!==void 0&&(p[v]["--sg-spacing-x"]=Vt(e[v])),typeof l=="object"&&l[v]!==void 0&&(p[v]["--sg-spacing-y"]=Vt(l[v])),!c&&typeof t=="object"&&t[v]!==void 0&&(p[v]["--sg-cols"]=t[v]),p),{});return g.jsx(Nf,{styles:f,media:Kh(Pt(h),o.breakpoints).filter(p=>Pt(h[p.value]).length>0).map(p=>({query:`(min-width: ${o.breakpoints[p.value]})`,styles:h[p.value]})),selector:a})}function Pk(e){return typeof e=="object"&&e!==null?Pt(e):[]}function Cte(e){return e.sort((n,t)=>Yh(n)-Yh(t))}function Ate({spacing:e,verticalSpacing:n,cols:t,minColWidth:i}){return Cte(Array.from(new Set([...Pk(e),...Pk(n),...i!==void 0?[]:Pk(t)])))}function jte({spacing:e,verticalSpacing:n,cols:t,minColWidth:i,autoRows:r,selector:a}){var d;const o=n===void 0?e:n,l=i!==void 0,c=Tu({"--sg-spacing-x":Vt(Wr(e)),"--sg-spacing-y":Vt(Wr(o)),"--sg-auto-rows":r,...l?{"--sg-min-col-width":NB(i)}:{"--sg-cols":(d=Wr(t))==null?void 0:d.toString()}}),f=Ate({spacing:e,verticalSpacing:n,cols:t,minColWidth:i}),h=f.reduce((p,v)=>(p[v]||(p[v]={}),typeof e=="object"&&e[v]!==void 0&&(p[v]["--sg-spacing-x"]=Vt(e[v])),typeof o=="object"&&o[v]!==void 0&&(p[v]["--sg-spacing-y"]=Vt(o[v])),!l&&typeof t=="object"&&t[v]!==void 0&&(p[v]["--sg-cols"]=t[v]),p),{});return g.jsx(Nf,{styles:c,container:f.map(p=>({query:`simple-grid (min-width: ${p})`,styles:h[p]})),selector:a})}var $B={container:"m_925c2d2c",root:"m_2415a157"};const Ote={cols:1,spacing:"md",type:"media"},Zo=De(e=>{const n=be("SimpleGrid",Ote,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,cols:c,verticalSpacing:f,spacing:h,type:d,minColWidth:p,autoFlow:v,autoRows:b,attributes:w,...k}=n,_=Xe({name:"SimpleGrid",classes:$B,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:w,vars:l}),C=cy(),x=p!==void 0?v||"auto-fill":void 0;return d==="container"?g.jsxs(g.Fragment,{children:[g.jsx(jte,{...n,selector:`.${C}`}),g.jsx("div",{..._("container"),children:g.jsx(he,{..._("root",{className:C}),...k,"data-auto-cols":x})})]}):g.jsxs(g.Fragment,{children:[g.jsx(Ste,{...n,selector:`.${C}`}),g.jsx(he,{..._("root",{className:C}),...k,"data-auto-cols":x})]})});Zo.classes=$B;Zo.displayName="@mantine/core/SimpleGrid";var zB={root:"m_6d731127"};const Ete={gap:"md",align:"stretch",justify:"flex-start"},LB=(e,{gap:n,align:t,justify:i})=>({root:{"--stack-gap":Vt(n),"--stack-align":t,"--stack-justify":i}}),$n=De(e=>{const n=be("Stack",Ete,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,align:c,justify:f,gap:h,variant:d,attributes:p,...v}=n;return g.jsx(he,{...Xe({name:"Stack",props:n,classes:zB,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:p,vars:l,varsResolver:LB})("root"),variant:d,...v})});$n.classes=zB;$n.varsResolver=LB;$n.displayName="@mantine/core/Stack";const[Tte,Mte]=Xr("Table component was not found in the tree");var ap={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 Dte(e,n){if(!n)return;const t={};return n.columnBorder&&e.withColumnBorders&&(t["data-with-column-border"]=!0),n.rowBorder&&e.withRowBorders&&(t["data-with-row-border"]=!0),n.striped&&e.striped&&(t["data-striped"]=e.striped),n.highlightOnHover&&e.highlightOnHover&&(t["data-hover"]=!0),n.captionSide&&e.captionSide&&(t["data-side"]=e.captionSide),n.stickyHeader&&e.stickyHeader&&(t["data-sticky"]=!0),t}function $u(e,n){const t=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,i=De(r=>{const a=be(t,{},r),{classNames:o,className:l,style:c,styles:f,...h}=a,d=Mte();return g.jsx(he,{component:e,...Dte(d,n),...d.getStyles(e,{className:l,classNames:o,style:c,styles:f,props:a}),...h})});return i.displayName=`@mantine/core/${t}`,i.classes=ap,i}const PS=$u("th",{columnBorder:!0}),IB=$u("td",{columnBorder:!0}),xg=$u("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),BB=$u("thead",{stickyHeader:!0}),FB=$u("tbody"),qB=$u("tfoot"),HB=$u("caption",{captionSide:!0}),Rte={type:"scrollarea"},UB=(e,{minWidth:n,maxHeight:t,type:i})=>({scrollContainer:{"--table-min-width":me(n),"--table-max-height":me(t),"--table-overflow":i==="native"?"auto":void 0}}),n0=De(e=>{const n=be("TableScrollContainer",Rte,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,children:c,minWidth:f,maxHeight:h,type:d,scrollAreaProps:p,attributes:v,...b}=n,w=Xe({name:"TableScrollContainer",classes:ap,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:v,vars:l,varsResolver:UB,rootSelector:"scrollContainer"});return g.jsx(he,{component:d==="scrollarea"?fr:"div",...d==="scrollarea"?h?{offsetScrollbars:"xy",...p}:{offsetScrollbars:"x",...p}:{},...w("scrollContainer"),...b,children:g.jsx("div",{...w("scrollContainerInner"),children:c})})});n0.classes=ap;n0.varsResolver=UB;n0.displayName="@mantine/core/TableScrollContainer";function UC({data:e}){return g.jsxs(g.Fragment,{children:[e.caption&&g.jsx(HB,{children:e.caption}),e.head&&g.jsx(BB,{children:g.jsx(xg,{children:e.head.map((n,t)=>g.jsx(PS,{children:n},t))})}),e.body&&g.jsx(FB,{children:e.body.map((n,t)=>g.jsx(xg,{children:n.map((i,r)=>g.jsx(IB,{children:i},r))},t))}),e.foot&&g.jsx(qB,{children:g.jsx(xg,{children:e.foot.map((n,t)=>g.jsx(PS,{children:n},t))})})]})}UC.displayName="@mantine/core/TableDataRenderer";const Pte={withRowBorders:!0,verticalSpacing:7},VB=(e,{layout:n,captionSide:t,horizontalSpacing:i,verticalSpacing:r,borderColor:a,stripedColor:o,highlightOnHoverColor:l,striped:c,highlightOnHover:f,stickyHeaderOffset:h,stickyHeader:d})=>({table:{"--table-layout":n,"--table-caption-side":t,"--table-horizontal-spacing":Vt(i),"--table-vertical-spacing":Vt(r),"--table-border-color":a?lt(a,e):void 0,"--table-striped-color":c&&o?lt(o,e):void 0,"--table-highlight-on-hover-color":f&&l?lt(l,e):void 0,"--table-sticky-header-offset":d?me(h):void 0}}),nn=De(e=>{const n=be("Table",Pte,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,horizontalSpacing:c,verticalSpacing:f,captionSide:h,stripedColor:d,highlightOnHoverColor:p,striped:v,highlightOnHover:b,withColumnBorders:w,withRowBorders:k,withTableBorder:_,borderColor:C,layout:x,data:E,children:j,stickyHeader:O,stickyHeaderOffset:M,mod:N,tabularNums:q,attributes:R,...L}=n,F=Xe({name:"Table",props:n,className:i,style:r,classes:ap,classNames:t,styles:a,unstyled:o,attributes:R,rootSelector:"table",vars:l,varsResolver:VB});return g.jsx(Tte,{value:{getStyles:F,stickyHeader:O,striped:v===!0?"odd":v||void 0,highlightOnHover:b,withColumnBorders:w,withRowBorders:k,captionSide:h||"bottom"},children:g.jsx(he,{component:"table",mod:[{"data-with-table-border":_,"data-tabular-nums":q},N],...F("table"),...L,children:j||!!E&&g.jsx(UC,{data:E})})})});nn.classes=ap;nn.varsResolver=VB;nn.displayName="@mantine/core/Table";nn.Td=IB;nn.Th=PS;nn.Tr=xg;nn.Thead=BB;nn.Tbody=FB;nn.Tfoot=qB;nn.Caption=HB;nn.ScrollContainer=n0;nn.DataRenderer=UC;const[Nte,VC]=Xr("Tabs component was not found in the tree");var op={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const WC=De(e=>{const n=be("TabsList",null,e),{children:t,className:i,grow:r,justify:a,classNames:o,styles:l,style:c,mod:f,...h}=n,d=VC();return g.jsx(he,{...d.getStyles("list",{className:i,style:c,classNames:o,styles:l,props:n,variant:d.variant}),role:"tablist",variant:d.variant,mod:[{grow:r,orientation:d.orientation,placement:d.orientation==="vertical"&&d.placement,inverted:d.inverted},f],"aria-orientation":d.orientation,__vars:{"--tabs-justify":a},...h,children:t})});WC.classes=op;WC.displayName="@mantine/core/TabsList";const GC=De(e=>{const n=be("TabsPanel",null,e),{children:t,className:i,value:r,classNames:a,styles:o,style:l,mod:c,keepMounted:f,...h}=n,d=Ym(),p=VC(),v=p.value===r,b=p.keepMounted||f,w=p.keepMountedMode!=="display-none",k=b&&w&&d!=="test"?g.jsx(A.Activity,{mode:v?"visible":"hidden",children:t}):b||v?t:null;return g.jsx(he,{...p.getStyles("panel",{className:i,classNames:a,styles:o,style:[l,v?void 0:{display:"none"}],props:n}),mod:[{orientation:p.orientation},c],role:"tabpanel",id:p.getPanelId(r),"aria-labelledby":p.getTabId(r),...h,children:k})});GC.classes=op;GC.displayName="@mantine/core/TabsPanel";const YC=De(e=>{const n=be("TabsTab",null,e),{className:t,children:i,rightSection:r,leftSection:a,value:o,onClick:l,onKeyDown:c,disabled:f,color:h,style:d,classNames:p,styles:v,vars:b,mod:w,tabIndex:k,..._}=n,C=ui(),{dir:x}=Ru(),E=VC(),j=o===E.value,O=N=>{E.onChange(E.allowTabDeactivation&&o===E.value?null:o),l==null||l(N)},M={classNames:p,styles:v,props:n};return g.jsxs(Et,{...E.getStyles("tab",{className:t,style:d,variant:E.variant,...M}),disabled:f,unstyled:E.unstyled,variant:E.variant,mod:[{active:j,disabled:f,orientation:E.orientation,inverted:E.inverted,placement:E.orientation==="vertical"&&E.placement},w],role:"tab",id:E.getTabId(o),"aria-selected":j,tabIndex:k!==void 0?k:j||E.value===null?0:-1,"aria-controls":E.getPanelId(o),onClick:O,__vars:{"--tabs-color":h?lt(h,C):void 0},onKeyDown:z6({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:E.activateTabWithKeyboard,loop:E.loop,orientation:E.orientation||"horizontal",dir:x,onKeyDown:c}),..._,children:[a&&g.jsx("span",{...E.getStyles("tabSection",M),"data-position":"left",children:a}),i&&g.jsx("span",{...E.getStyles("tabLabel",M),children:i}),r&&g.jsx("span",{...E.getStyles("tabSection",M),"data-position":"right",children:r})]})});YC.classes=op;YC.displayName="@mantine/core/TabsTab";const DT="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",$te={keepMounted:!0,keepMountedMode:"activity",orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},WB=(e,{radius:n,color:t,autoContrast:i})=>({root:{"--tabs-radius":Yt(n),"--tabs-color":lt(t,e),"--tabs-text-color":Gm(i,e)?Pf({color:t,theme:e,autoContrast:i}):void 0}}),Ut=De(e=>{const n=be("Tabs",$te,e),{defaultValue:t,value:i,onChange:r,orientation:a,children:o,loop:l,id:c,activateTabWithKeyboard:f,allowTabDeactivation:h,variant:d,color:p,radius:v,inverted:b,placement:w,keepMounted:k,keepMountedMode:_,classNames:C,styles:x,unstyled:E,className:j,style:O,vars:M,autoContrast:N,mod:q,attributes:R,...L}=n,F=Vi(c),[Y,V]=Ci({value:i,defaultValue:t,finalValue:null,onChange:r}),$=Xe({name:"Tabs",props:n,classes:op,className:j,style:O,classNames:C,styles:x,unstyled:E,attributes:R,vars:M,varsResolver:WB});return g.jsx(Nte,{value:{placement:w,value:Y,orientation:a,id:F,loop:l,activateTabWithKeyboard:f,getTabId:_5(`${F}-tab`,DT),getPanelId:_5(`${F}-panel`,DT),onChange:V,allowTabDeactivation:h,variant:d,color:p,radius:v,inverted:b,keepMounted:k,keepMountedMode:_,unstyled:E,getStyles:$},children:g.jsx(he,{id:F,variant:d,mod:[{orientation:a,inverted:a==="horizontal"&&b,placement:a==="vertical"&&w},q],...$("root"),...L,children:o})})});Ut.classes=op;Ut.varsResolver=WB;Ut.displayName="@mantine/core/Tabs";Ut.Tab=YC;Ut.Panel=GC;Ut.List=WC;function zte({data:e,value:n}){const t=n.map(i=>i.trim().toLowerCase());return e.reduce((i,r)=>(wu(r)?i.push({group:r.group,items:r.items.filter(a=>t.indexOf(a.label.toLowerCase().trim())===-1)}):t.indexOf(r.label.toLowerCase().trim())===-1&&i.push(r),i),[])}function Lte(e,n){return e?n.split(new RegExp(`[${e.join("")}]`)).map(t=>t.trim()).filter(t=>t!==""):[n]}function RT({splitChars:e,allowDuplicates:n,maxTags:t,value:i,currentTags:r,isDuplicate:a,onDuplicate:o}){const l=Lte(e,i),c=[];if(n)c.push(...r,...l);else{c.push(...r);for(const f of l)(a?h=>a(h,c):h=>c.some(d=>d.toLowerCase()===h.toLowerCase()))(f)?o==null||o(f):c.push(f)}return t?c.slice(0,t):c}const Ite={maxTags:1/0,acceptValueOnBlur:!0,splitChars:[","],hiddenInputValuesDivider:",",openOnFocus:!0,size:"sm"},KC=De(e=>{const n=be("TagsInput",Ite,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,size:c,value:f,defaultValue:h,onChange:d,onKeyDown:p,maxTags:v,allowDuplicates:b,onDuplicate:w,variant:k,data:_,dropdownOpened:C,defaultDropdownOpened:x,onDropdownOpen:E,onDropdownClose:j,selectFirstOptionOnChange:O,selectFirstOptionOnDropdownOpen:M,onOptionSubmit:N,comboboxProps:q,filter:R,limit:L,withScrollArea:F,maxDropdownHeight:Y,searchValue:V,defaultSearchValue:$,onSearchChange:P,readOnly:I,disabled:H,splitChars:U,onFocus:D,onBlur:W,onPaste:G,radius:z,rightSection:X,rightSectionWidth:ee,rightSectionPointerEvents:re,rightSectionProps:le,leftSection:ye,leftSectionWidth:ae,leftSectionPointerEvents:ue,leftSectionProps:Se,inputContainer:ne,inputWrapperOrder:Le,withAsterisk:ke,required:je,labelProps:Ne,descriptionProps:ge,errorProps:Ce,wrapperProps:Pe,description:ce,label:qe,error:Ye,withErrorStyles:We,name:Ze,form:Qe,id:ie,clearable:ve,clearSectionMode:Ke,clearButtonProps:Je,hiddenInputProps:Ae,hiddenInputValuesDivider:an,mod:mn,renderOption:En,renderPill:vn,onRemove:sn,onClear:en,onMaxTags:zn,scrollAreaProps:Re,acceptValueOnBlur:He,isDuplicate:Dn,openOnFocus:kn,attributes:bn,ref:_n,loading:ft,loadingPosition:Tt,...Be}=n,Ue=Vi(ie),Ln=Cy(_),ut=ip(Ln),Pn=A.useRef(null),rn=Kt(Pn,_n),tn=Bf({opened:C,defaultOpened:x,onDropdownOpen:()=>{E==null||E(),M&&tn.selectFirstOption()},onDropdownClose:()=>{j==null||j(),tn.resetSelectedOption()}}),{styleProps:on,rest:{type:In,autoComplete:Gn,..._t}}=Du(Be),[Rn,Tn]=Ci({value:f,defaultValue:h,finalValue:[],onChange:d}),[Kn,$t]=Ci({value:V,defaultValue:$,finalValue:"",onChange:P}),Oi=gn=>{$t(gn),tn.resetSelectedOption()},tr=Xe({name:"TagsInput",classes:{},props:n,classNames:t,styles:a,unstyled:o}),{resolvedClassNames:Zr,resolvedStyles:Ka}=Wi({props:n,styles:a,classNames:t}),Qr=gn=>{if((Dn?Dn(gn,Rn):Rn.some(ci=>ci.toLowerCase()===gn.toLowerCase()))&&(w==null||w(gn),!b)){Oi("");return}if(Rn.length>=v){zn==null||zn(gn);return}N==null||N(gn),Oi(""),gn.length>0&&Tn([...Rn,gn])},pr=gn=>{if(p==null||p(gn),gn.isPropagationStopped())return;const ci=Kn.trim(),{length:cn}=ci;if(U.includes(gn.key)&&cn>0&&(Tn(RT({splitChars:U,allowDuplicates:b,maxTags:v,value:Kn,currentTags:Rn,isDuplicate:Dn,onDuplicate:w})),Oi(""),gn.preventDefault()),gn.key==="Enter"&&cn>0&&!gn.nativeEvent.isComposing){if(gn.preventDefault(),document.querySelector(`#${tn.listId} [data-combobox-option][data-combobox-selected]`))return;Qr(ci)}gn.key==="Backspace"&&cn===0&&Rn.length>0&&!gn.nativeEvent.isComposing&&!I&&(sn==null||sn(Rn[Rn.length-1]),Tn(Rn.slice(0,Rn.length-1)))},Xa=gn=>{G==null||G(gn),gn.preventDefault(),gn.clipboardData&&(Tn(RT({splitChars:U,allowDuplicates:b,maxTags:v,value:`${Kn}${gn.clipboardData.getData("text/plain")}`,currentTags:Rn,isDuplicate:Dn,onDuplicate:w})),Oi(""))},Jr=Rn.map((gn,ci)=>{const cn=()=>{const Er=Rn.slice();Er.splice(ci,1),Tn(Er),sn==null||sn(gn)};return vn?g.jsx(A.Fragment,{children:vn({option:ut[gn]||{value:gn,label:gn,disabled:!1},value:gn,onRemove:cn,disabled:H||I})},`${gn}-${ci}`):g.jsx(vl,{withRemoveButton:!I,onRemove:cn,unstyled:o,disabled:H,attributes:bn,...tr("pill"),children:gn},`${gn}-${ci}`)});A.useEffect(()=>{O&&tn.selectFirstOption()},[O,Rn,Kn]);const ea=g.jsx(An.ClearButton,{...Je,onClear:()=>{var gn;Tn([]),Oi(""),(gn=Pn.current)==null||gn.focus(),tn.openDropdown(),en==null||en()}});return g.jsxs(g.Fragment,{children:[g.jsxs(An,{store:tn,classNames:Zr,styles:Ka,unstyled:o,size:c,readOnly:I,__staticSelector:"TagsInput",attributes:bn,onOptionSubmit:gn=>{N==null||N(gn),Oi(""),Rn.length>=v?zn==null||zn(gn):Tn([...Rn,ut[gn].value]),tn.resetSelectedOption()},...q,children:[g.jsx(An.DropdownTarget,{children:g.jsx(ku,{...on,__staticSelector:"TagsInput",classNames:Zr,styles:Ka,unstyled:o,size:c,className:i,style:r,variant:k,disabled:H,radius:z,rightSection:X,__clearSection:ea,__clearable:ve&&Rn.length>0&&!H&&!I,__clearSectionMode:Ke,rightSectionWidth:ee,rightSectionPointerEvents:re,rightSectionProps:le,leftSection:ye,leftSectionWidth:ae,leftSectionPointerEvents:ue,leftSectionProps:Se,loading:ft,loadingPosition:Tt,inputContainer:ne,inputWrapperOrder:Le,withAsterisk:ke,required:je,labelProps:Ne,descriptionProps:ge,errorProps:Ce,wrapperProps:Pe,description:ce,label:qe,error:Ye,withErrorStyles:We,__stylesApiProps:{...n,multiline:!0},id:Ue,mod:mn,attributes:bn,children:g.jsxs(vl.Group,{disabled:H,unstyled:o,...tr("pillsList"),children:[Jr,g.jsx(An.EventsTarget,{autoComplete:Gn,withExpandedAttribute:!0,children:g.jsx(ku.Field,{..._t,ref:rn,...tr("inputField"),unstyled:o,onKeyDown:pr,onFocus:gn=>{D==null||D(gn),kn&&tn.openDropdown()},onBlur:gn=>{W==null||W(gn),He&&Qr(Kn),tn.closeDropdown()},onPaste:Xa,value:Kn,onChange:gn=>Oi(gn.currentTarget.value),required:je&&Rn.length===0,disabled:H,readOnly:I,id:Ue})})]})})}),g.jsx(Ey,{data:zte({data:Ln,value:Rn}),hidden:I||H,filter:R,search:Kn,limit:L,hiddenWhenEmpty:!0,withScrollArea:F,maxDropdownHeight:Y,unstyled:o,labelId:qe?`${Ue}-label`:void 0,"aria-label":qe?void 0:Be["aria-label"],renderOption:En,scrollAreaProps:Re})]}),g.jsx(An.HiddenInput,{name:Ze,form:Qe,value:Rn,valuesDivider:an,disabled:H,...Ae})]})});KC.classes={...Ri.classes,...An.classes};KC.displayName="@mantine/core/TagsInput";const Gr=De(e=>g.jsx(Ri,{component:"input",...be("TextInput",null,e),__staticSelector:"TextInput"}));Gr.classes=Ri.classes;Gr.displayName="@mantine/core/TextInput";const[Bte,Fte]=Xr("Timeline component was not found in tree");var XC={root:"m_43657ece",itemTitle:"m_2ebe8099",item:"m_436178ff",itemBullet:"m_8affcee1",itemBody:"m_540e8f41"};const ZC=De(e=>{const{classNames:n,className:t,style:i,styles:r,vars:a,__active:o,__align:l,__lineActive:c,__vars:f,bullet:h,radius:d,color:p,lineVariant:v,children:b,title:w,mod:k,..._}=be("TimelineItem",null,e),C=Fte(),x=ui(),E={classNames:n,styles:r};return g.jsxs(he,{...C.getStyles("item",{...E,className:t,style:i}),mod:[{"line-active":c,active:o},k],__vars:{"--tli-radius":d!==void 0?Yt(d):void 0,"--tli-color":p?lt(p,x):void 0,"--tli-border-style":v||void 0},..._,children:[g.jsx(he,{...C.getStyles("itemBullet",E),mod:{"with-child":!!h,align:l,active:o},children:h}),g.jsxs("div",{...C.getStyles("itemBody",E),children:[w&&g.jsx("div",{...C.getStyles("itemTitle",E),children:w}),g.jsx("div",{...C.getStyles("itemContent",E),children:b})]})]})});ZC.classes=XC;ZC.displayName="@mantine/core/TimelineItem";const qte={active:-1,align:"left"},GB=(e,{bulletSize:n,lineWidth:t,radius:i,color:r,autoContrast:a})=>({root:{"--tl-bullet-size":me(n),"--tl-line-width":me(t),"--tl-radius":i===void 0?void 0:Yt(i),"--tl-color":r?lt(r,e):void 0,"--tl-icon-color":Gm(a,e)?Pf({color:r,theme:e,autoContrast:a}):void 0}}),af=De(e=>{const n=be("Timeline",qte,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,children:c,active:f,color:h,radius:d,bulletSize:p,align:v,lineWidth:b,reverseActive:w,mod:k,autoContrast:_,attributes:C,...x}=n,E=Xe({name:"Timeline",classes:XC,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:C,vars:l,varsResolver:GB}),j=A.Children.toArray(c),O=j.map((M,N)=>{var q,R;return A.cloneElement(M,{unstyled:o,__align:v,__active:((q=M.props)==null?void 0:q.active)||(w?f>=j.length-N-1:f>=N),__lineActive:((R=M.props)==null?void 0:R.lineActive)||(w?f>=j.length-N-1:f-1>=N)})});return g.jsx(Bte,{value:{getStyles:E},children:g.jsx(he,{...E("root"),mod:[{align:v},k],...x,children:O})})});af.classes=XC;af.varsResolver=GB;af.displayName="@mantine/core/Timeline";af.Item=ZC;const Hte=["h1","h2","h3","h4","h5","h6"],Ute=["xs","sm","md","lg","xl"];function Vte(e,n){const t=n!==void 0?n:`h${e}`;return Hte.includes(t)?{fontSize:`var(--mantine-${t}-font-size)`,fontWeight:`var(--mantine-${t}-font-weight)`,lineHeight:`var(--mantine-${t}-line-height)`}:Ute.includes(t)?{fontSize:`var(--mantine-font-size-${t})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:me(t),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var YB={root:"m_8a5d1357"};const Wte={order:1},KB=(e,{order:n,size:t,lineClamp:i,textWrap:r})=>{const a=Vte(n||1,t);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof i=="number"?i.toString():void 0,"--title-text-wrap":r}}},xl=De(e=>{const n=be("Title",Wte,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,order:l,vars:c,size:f,variant:h,lineClamp:d,textWrap:p,mod:v,attributes:b,...w}=n,k=Xe({name:"Title",props:n,classes:YB,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:b,vars:c,varsResolver:KB});return[1,2,3,4,5,6].includes(l)?g.jsx(he,{...k("root"),component:`h${l}`,variant:h,mod:[{order:l,"data-line-clamp":typeof d=="number"},v],size:f,...w}):null});xl.classes=YB;xl.varsResolver=KB;xl.displayName="@mantine/core/Title";const QC=A.createContext(null);QC.displayName="@mantine/modals/ModalsContext";function Gte(){const e=A.use(QC);if(!e)throw new Error("[@mantine/modals] useModals hook was called outside of context, wrap your app with ModalsProvider component");return e}const[Yte,zu]=WK("mantine-modals"),Kte=e=>{const n=e.modalId||cl();return zu("openModal")({...e,modalId:n}),n},Xte=e=>{const n=e.modalId||cl();return zu("openConfirmModal")({...e,modalId:n}),n},Zte=e=>{const n=e.modalId||cl();return zu("openContextModal")({...e,modalId:n}),n},Qte=zu("closeModal"),Jte=zu("closeAllModals"),eie=e=>zu("updateModal")(e),nie=e=>zu("updateContextModal")(e),Pa={open:Kte,close:Qte,closeAll:Jte,openConfirmModal:Xte,openContextModal:Zte,updateModal:eie,updateContextModal:nie};function tie({id:e,cancelProps:n,confirmProps:t,labels:i={cancel:"",confirm:""},closeOnConfirm:r=!0,closeOnCancel:a=!0,groupProps:o,onCancel:l,onConfirm:c,children:f}){const{cancel:h,confirm:d}=i,p=Gte(),v=w=>{typeof(n==null?void 0:n.onClick)=="function"&&(n==null||n.onClick(w)),typeof l=="function"&&l(),a&&p.closeModal(e)},b=w=>{typeof(t==null?void 0:t.onClick)=="function"&&(t==null||t.onClick(w)),typeof c=="function"&&c(),r&&p.closeModal(e)};return g.jsxs(g.Fragment,{children:[f&&g.jsx(he,{mb:"md",children:f}),g.jsxs(ze,{mt:f?0:"md",justify:"flex-end",...o,children:[g.jsx(st,{variant:"default",...n,onClick:v,children:(n==null?void 0:n.children)||h}),g.jsx(st,{...t,onClick:b,children:(t==null?void 0:t.children)||d})]})]})}function PT(e,n){var t,i,r,a;n&&e.type==="confirm"&&((i=(t=e.props).onCancel)==null||i.call(t)),(a=(r=e.props).onClose)==null||a.call(r)}function iie(e,n){var t;switch(n.type){case"OPEN":return{current:n.modal,modals:[...e.modals,n.modal]};case"CLOSE":{if(!e.modals.find(r=>r.id===n.modalId))return e;const i=e.modals.filter(r=>r.id!==n.modalId);return{current:i[i.length-1]||e.current,modals:i}}case"CLOSE_ALL":return e.modals.length?{current:e.current,modals:[]}:e;case"UPDATE":{const{modalId:i,newProps:r}=n,a=e.modals.map(l=>l.id!==i?l:l.type==="content"||l.type==="confirm"?{...l,props:{...l.props,...r}}:l.type==="context"?{...l,props:{...l.props,...r,innerProps:{...l.props.innerProps,...r.innerProps}}}:l),o=((t=e.current)==null?void 0:t.id)===i&&a.find(l=>l.id===i)||e.current;return{...e,modals:a,current:o}}default:return e}}function rie(e){if(!e)return{confirmProps:{},modalProps:{}};const{id:n,children:t,onCancel:i,onConfirm:r,closeOnConfirm:a,closeOnCancel:o,cancelProps:l,confirmProps:c,groupProps:f,labels:h,...d}=e;return{confirmProps:{id:n,children:t,onCancel:i,onConfirm:r,closeOnConfirm:a,closeOnCancel:o,cancelProps:l,confirmProps:c,groupProps:f,labels:h},modalProps:{id:n,...d}}}function aie({children:e,modalProps:n,labels:t,modals:i}){const[r,a]=A.useReducer(iie,{modals:[],current:null}),o=A.useRef(r);o.current=r;const l=A.useRef(!1),c=A.useCallback(x=>{l.current||(l.current=!0,o.current.modals.concat().reverse().forEach(E=>{PT(E,x)}),l.current=!1),a({type:"CLOSE_ALL",canceled:x})},[o,a]),f=A.useCallback(({modalId:x,...E})=>{const j=x||cl();return a({type:"OPEN",modal:{id:j,type:"content",props:E}}),j},[a]),h=A.useCallback(({modalId:x,...E})=>{const j=x||cl();return a({type:"OPEN",modal:{id:j,type:"confirm",props:E}}),j},[a]),d=A.useCallback((x,{modalId:E,...j})=>{const O=E||cl();return a({type:"OPEN",modal:{id:O,type:"context",props:j,ctx:x}}),O},[a]),p=A.useCallback((x,E)=>{if(!l.current){const j=o.current.modals.find(O=>O.id===x);j&&(l.current=!0,PT(j,E),l.current=!1)}a({type:"CLOSE",modalId:x,canceled:E})},[o,a]),v=A.useCallback(({modalId:x,...E})=>{a({type:"UPDATE",modalId:x,newProps:E})},[a]),b=A.useCallback(({modalId:x,...E})=>{a({type:"UPDATE",modalId:x,newProps:E})},[a]);Yte({openModal:f,openConfirmModal:h,openContextModal:({modal:x,...E})=>d(x,E),closeModal:p,closeContextModal:p,closeAllModals:c,updateModal:v,updateContextModal:b});const w={modalProps:n||{},modals:r.modals,openModal:f,openConfirmModal:h,openContextModal:d,closeModal:p,closeContextModal:p,closeAll:c,updateModal:v,updateContextModal:b},k=()=>{const x=o.current.current;switch(x==null?void 0:x.type){case"context":{const{innerProps:E,...j}=x.props,O=i[x.ctx];return{modalProps:j,content:g.jsx(O,{innerProps:E,context:w,id:x.id})}}case"confirm":{const{modalProps:E,confirmProps:j}=rie(x.props);return{modalProps:E,content:g.jsx(tie,{...j,id:x.id,labels:x.props.labels||t})}}case"content":{const{children:E,...j}=x.props;return{modalProps:j,content:E}}default:return{modalProps:{},content:null}}},{modalProps:_,content:C}=k();return g.jsxs(QC,{value:w,children:[g.jsx(hr,{zIndex:Sa("modal")+1,...n,..._,opened:r.modals.length>0,onClose:()=>{var x;return p((x=r.current)==null?void 0:x.id)},children:C}),e]})}function oie(e){let n=e,t=!1;const i=new Set;return{getState(){return n},updateState(r){n=typeof r=="function"?r(n):r},setState(r){this.updateState(r),i.forEach(a=>a(n))},initialize(r){t||(n=r,t=!0)},subscribe(r){return i.add(r),()=>i.delete(r)}}}function sie(e){return A.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function lie(e,n,t){const i=[],r=[],a={};for(const o of e){const l=o.position||n;a[l]=a[l]||0,a[l]+=1,a[l]<=t?r.push(o):i.push(o)}return{notifications:r,queue:i}}const uie=()=>oie({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Lu=uie(),cie=(e=Lu)=>sie(e);function Gf(e,n){const t=e.getState(),i=lie(n([...t.notifications,...t.queue]),t.defaultPosition,t.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:t.limit,defaultPosition:t.defaultPosition})}function fie(e,n=Lu){const t=e.id||cl();return Gf(n,i=>e.id&&i.some(r=>r.id===e.id)?i:[...i,{...e,id:t}]),t}function XB(e,n=Lu){return Gf(n,t=>t.filter(i=>{var r;return i.id===e?((r=i.onClose)==null||r.call(i,i),!1):!0})),e}function die(e,n=Lu){return Gf(n,t=>t.map(i=>i.id===e.id?{...i,...e}:i)),e.id}function hie(e=Lu){Gf(e,()=>[])}function mie(e=Lu){Gf(e,n=>n.slice(0,e.getState().limit))}const wn={show:fie,hide:XB,update:die,clean:hie,cleanQueue:mie,updateState:Gf},ZB=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function pie(e,n){return e.reduce((t,i)=>(t[i.position||n].push(i),t),ZB.reduce((t,i)=>(t[i]=[],t),{}))}const NT={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},vie={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function gie({state:e,maxHeight:n,position:t,transitionDuration:i}){const[r,a]=t.split("-"),o=a==="center"?`${r}-center`:a,l={opacity:0,maxHeight:n,transform:NT[o],transitionDuration:`${i}ms, ${i}ms, ${i}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:vie[o]},f={opacity:0,maxHeight:0,transform:NT[o]};return{...l,...{entering:c,entered:c,exiting:f,exited:f}[e]}}function yie(e,n){return typeof n=="number"?n:n===!1||e===!1?!1:e}function QB({data:e,onHide:n,autoClose:t,paused:i,onHoverStart:r,onHoverEnd:a,...o}){const{autoClose:l,message:c,onOpen:f,...h}=e,d=yie(t,e.autoClose),p=A.useRef(-1),[v,b]=A.useState(!1),w=()=>window.clearTimeout(p.current),k=()=>{n(e.id),w()},_=()=>{w(),typeof d=="number"&&(p.current=window.setTimeout(k,d))},C=()=>{b(!0),r==null||r()},x=()=>{b(!1),a==null||a()};return A.useEffect(()=>{var E;(E=e.onOpen)==null||E.call(e,e)},[]),A.useEffect(()=>(_(),w),[d]),A.useEffect(()=>(i||v?w():_(),w),[i,v]),g.jsx(Xy,{...o,...h,onClose:k,onMouseEnter:C,onMouseLeave:x,children:c})}QB.displayName="@mantine/notifications/NotificationContainer";var JB={root:"m_b37d9ac7",notification:"m_5ed0edd0"};function NS(){return NS=Object.assign?Object.assign.bind():function(e){for(var n=1;n({root:{"--notifications-z-index":n==null?void 0:n.toString(),"--notifications-container-width":me(t)}}),So=De(e=>{const n=be("Notifications",Mie,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,attributes:c,position:f,autoClose:h,transitionDuration:d,containerWidth:p,notificationMaxHeight:v,limit:b,zIndex:w,store:k,portalProps:_,withinPortal:C,pauseResetOnHover:x,...E}=n,j=ui(),O=cie(k),M=FK(),N=B6(),q=A.useRef({}),R=A.useRef(0),[L,F]=A.useState(0),Y=A.useCallback(()=>F(U=>U+1),[]),V=A.useCallback(()=>F(U=>Math.max(0,U-1)),[]),$=j.respectReducedMotion&&N?1:d,P=Xe({name:"Notifications",classes:JB,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:c,vars:l,varsResolver:tF});A.useEffect(()=>{k==null||k.updateState(U=>({...U,limit:b||5,defaultPosition:f}))},[b,f]),ls(()=>{O.notifications.length>R.current&&setTimeout(()=>M(),0),R.current=O.notifications.length},[O.notifications]);const I=pie(O.notifications,f),H=ZB.reduce((U,D)=>(U[D]=I[D].map(({style:W,...G})=>g.jsx(Tie,{timeout:$,onEnter:()=>q.current[G.id].offsetHeight,nodeRef:{current:q.current[G.id]},children:z=>g.jsx(QB,{ref:X=>{X&&(q.current[G.id]=X)},data:G,onHide:X=>XB(X,k),autoClose:h,paused:x==="all"?L>0:!1,onHoverStart:Y,onHoverEnd:V,...P("notification",{style:{...gie({state:z,position:D,transitionDuration:$,maxHeight:v}),...W}})})},G.id)),U),{});return g.jsxs(ml,{withinPortal:C,..._,children:[g.jsx(he,{...P("root"),"data-position":"top-center",...E,children:g.jsx(Qs,{children:H["top-center"]})}),g.jsx(he,{...P("root"),"data-position":"top-left",...E,children:g.jsx(Qs,{children:H["top-left"]})}),g.jsx(he,{...P("root",{className:yu.classNames.fullWidth}),"data-position":"top-right",...E,children:g.jsx(Qs,{children:H["top-right"]})}),g.jsx(he,{...P("root",{className:yu.classNames.fullWidth}),"data-position":"bottom-right",...E,children:g.jsx(Qs,{children:H["bottom-right"]})}),g.jsx(he,{...P("root"),"data-position":"bottom-left",...E,children:g.jsx(Qs,{children:H["bottom-left"]})}),g.jsx(he,{...P("root"),"data-position":"bottom-center",...E,children:g.jsx(Qs,{children:H["bottom-center"]})})]})});So.classes=JB;So.varsResolver=tF;So.displayName="@mantine/notifications/Notifications";So.show=wn.show;So.hide=wn.hide;So.update=wn.update;So.clean=wn.clean;So.cleanQueue=wn.cleanQueue;So.updateState=wn.updateState;var Lk={exports:{}},oh={},Ik={exports:{}},Bk={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var BT;function Die(){return BT||(BT=1,(function(e){function n(P,I){var H=P.length;P.push(I);e:for(;0>>1,D=P[U];if(0>>1;Ur(z,H))Xr(ee,z)?(P[U]=ee,P[X]=H,U=X):(P[U]=z,P[G]=H,U=G);else if(Xr(ee,H))P[U]=ee,P[X]=H,U=X;else break e}}return I}function r(P,I){var H=P.sortIndex-I.sortIndex;return H!==0?H:P.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],f=[],h=1,d=null,p=3,v=!1,b=!1,w=!1,k=!1,_=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function E(P){for(var I=t(f);I!==null;){if(I.callback===null)i(f);else if(I.startTime<=P)i(f),I.sortIndex=I.expirationTime,n(c,I);else break;I=t(f)}}function j(P){if(w=!1,E(P),!b)if(t(c)!==null)b=!0,O||(O=!0,F());else{var I=t(f);I!==null&&$(j,I.startTime-P)}}var O=!1,M=-1,N=5,q=-1;function R(){return k?!0:!(e.unstable_now()-qP&&R());){var U=d.callback;if(typeof U=="function"){d.callback=null,p=d.priorityLevel;var D=U(d.expirationTime<=P);if(P=e.unstable_now(),typeof D=="function"){d.callback=D,E(P),I=!0;break n}d===t(c)&&i(c),E(P)}else i(c);d=t(c)}if(d!==null)I=!0;else{var W=t(f);W!==null&&$(j,W.startTime-P),I=!1}}break e}finally{d=null,p=H,v=!1}I=void 0}}finally{I?F():O=!1}}}var F;if(typeof x=="function")F=function(){x(L)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,V=Y.port2;Y.port1.onmessage=L,F=function(){V.postMessage(null)}}else F=function(){_(L,0)};function $(P,I){M=_(function(){P(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125U?(P.sortIndex=H,n(f,P),t(c)===null&&P===t(f)&&(w?(C(M),M=-1):w=!0,$(j,H-U))):(P.sortIndex=D,n(c,P),b||v||(b=!0,O||(O=!0,F()))),P},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(P){var I=p;return function(){var H=p;p=I;try{return P.apply(this,arguments)}finally{p=H}}}})(Bk)),Bk}var FT;function Rie(){return FT||(FT=1,Ik.exports=Die()),Ik.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var qT;function Pie(){if(qT)return oh;qT=1;var e=Rie(),n=N6(),t=jz();function i(s){var u="https://react.dev/errors/"+s;if(1D||(s.current=U[D],U[D]=null,D--)}function z(s,u){D++,U[D]=s.current,s.current=u}var X=W(null),ee=W(null),re=W(null),le=W(null);function ye(s,u){switch(z(re,u),z(ee,s),z(X,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?BE(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=BE(u),s=FE(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}G(X),z(X,s)}function ae(){G(X),G(ee),G(re)}function ue(s){s.memoizedState!==null&&z(le,s);var u=X.current,m=FE(u,s.type);u!==m&&(z(ee,s),z(X,m))}function Se(s){ee.current===s&&(G(X),G(ee)),le.current===s&&(G(le),Jd._currentValue=H)}var ne,Le;function ke(s){if(ne===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);ne=u&&u[1]||"",Le=-1)":-1S||J[y]!==de[S]){var Oe=` +`+J[y].replace(" at new "," at ");return s.displayName&&Oe.includes("")&&(Oe=Oe.replace("",s.displayName)),Oe}while(1<=y&&0<=S);break}}}finally{je=!1,Error.prepareStackTrace=m}return(m=s?s.displayName||s.name:"")?ke(m):""}function ge(s,u){switch(s.tag){case 26:case 27:case 5:return ke(s.type);case 16:return ke("Lazy");case 13:return s.child!==u&&u!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return Ne(s.type,!1);case 11:return Ne(s.type.render,!1);case 1:return Ne(s.type,!0);case 31:return ke("Activity");default:return""}}function Ce(s){try{var u="",m=null;do u+=ge(s,m),m=s,s=s.return;while(s);return u}catch(y){return` +Error generating stack: `+y.message+` +`+y.stack}}var Pe=Object.prototype.hasOwnProperty,ce=e.unstable_scheduleCallback,qe=e.unstable_cancelCallback,Ye=e.unstable_shouldYield,We=e.unstable_requestPaint,Ze=e.unstable_now,Qe=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Ke=e.unstable_NormalPriority,Je=e.unstable_LowPriority,Ae=e.unstable_IdlePriority,an=e.log,mn=e.unstable_setDisableYieldValue,En=null,vn=null;function sn(s){if(typeof an=="function"&&mn(s),vn&&typeof vn.setStrictMode=="function")try{vn.setStrictMode(En,s)}catch{}}var en=Math.clz32?Math.clz32:He,zn=Math.log,Re=Math.LN2;function He(s){return s>>>=0,s===0?32:31-(zn(s)/Re|0)|0}var Dn=256,kn=262144,bn=4194304;function _n(s){var u=s&42;if(u!==0)return u;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function ft(s,u,m){var y=s.pendingLanes;if(y===0)return 0;var S=0,T=s.suspendedLanes,B=s.pingedLanes;s=s.warmLanes;var K=y&134217727;return K!==0?(y=K&~T,y!==0?S=_n(y):(B&=K,B!==0?S=_n(B):m||(m=K&~s,m!==0&&(S=_n(m))))):(K=y&~T,K!==0?S=_n(K):B!==0?S=_n(B):m||(m=y&~s,m!==0&&(S=_n(m)))),S===0?0:u!==0&&u!==S&&(u&T)===0&&(T=S&-S,m=u&-u,T>=m||T===32&&(m&4194048)!==0)?u:S}function Tt(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function Be(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var s=bn;return bn<<=1,(bn&62914560)===0&&(bn=4194304),s}function Ln(s){for(var u=[],m=0;31>m;m++)u.push(s);return u}function ut(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Pn(s,u,m,y,S,T){var B=s.pendingLanes;s.pendingLanes=m,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=m,s.entangledLanes&=m,s.errorRecoveryDisabledLanes&=m,s.shellSuspendCounter=0;var K=s.entanglements,J=s.expirationTimes,de=s.hiddenUpdates;for(m=B&~m;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Ep=/[\n"\\]/g;function rr(s){return s.replace(Ep,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Yu(s,u,m,y,S,T,B,K){s.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?s.type=B:s.removeAttribute("type"),u!=null?B==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+ir(u)):s.value!==""+ir(u)&&(s.value=""+ir(u)):B!=="submit"&&B!=="reset"||s.removeAttribute("value"),u!=null?Ku(s,B,ir(u)):m!=null?Ku(s,B,ir(m)):y!=null&&s.removeAttribute("value"),S==null&&T!=null&&(s.defaultChecked=!!T),S!=null&&(s.checked=S&&typeof S!="function"&&typeof S!="symbol"),K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?s.name=""+ir(K):s.removeAttribute("name")}function md(s,u,m,y,S,T,B,K){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.type=T),u!=null||m!=null){if(!(T!=="submit"&&T!=="reset"||u!=null)){Gu(s);return}m=m!=null?""+ir(m):"",u=u!=null?""+ir(u):m,K||u===s.value||(s.value=u),s.defaultValue=u}y=y??S,y=typeof y!="function"&&typeof y!="symbol"&&!!y,s.checked=K?s.checked:!!y,s.defaultChecked=!!y,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(s.name=B),Gu(s)}function Ku(s,u,m){u==="number"&&Cs(s.ownerDocument)===s||s.defaultValue===""+m||(s.defaultValue=""+m)}function jo(s,u,m,y){if(s=s.options,u){u={};for(var S=0;S"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fi=!1;if(ht)try{var Ni={};Object.defineProperty(Ni,"passive",{get:function(){fi=!0}}),window.addEventListener("test",Ni,Ni),window.removeEventListener("test",Ni,Ni)}catch{fi=!1}var zt=null,dt=null,di=null;function ar(){if(di)return di;var s,u=dt,m=u.length,y,S="value"in zt?zt.value:zt.textContent,T=S.length;for(s=0;s=wd),GA=" ",YA=!1;function KA(s,u){switch(s){case"keyup":return IG.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XA(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Qu=!1;function FG(s,u){switch(s){case"compositionend":return XA(u);case"keypress":return u.which!==32?null:(YA=!0,GA);case"textInput":return s=u.data,s===GA&&YA?null:s;default:return null}}function qG(s,u){if(Qu)return s==="compositionend"||!db&&KA(s,u)?(s=ar(),di=dt=zt=null,Qu=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1=u)return{node:m,offset:u-s};s=y}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=rj(m)}}function oj(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?oj(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function sj(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=Cs(s.document);u instanceof s.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)s=u.contentWindow;else break;u=Cs(s.document)}return u}function pb(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var XG=ht&&"documentMode"in document&&11>=document.documentMode,Ju=null,vb=null,Sd=null,gb=!1;function lj(s,u,m){var y=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;gb||Ju==null||Ju!==Cs(y)||(y=Ju,"selectionStart"in y&&pb(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Sd&&xd(Sd,y)||(Sd=y,y=wv(vb,"onSelect"),0>=B,S-=B,Ja=1<<32-en(u)+S|m<Hn?(tt=dn,dn=null):tt=dn.sibling;var pt=pe(se,dn,fe[Hn],Te);if(pt===null){dn===null&&(dn=tt);break}s&&dn&&pt.alternate===null&&u(se,dn),te=T(pt,te,Hn),mt===null?yn=pt:mt.sibling=pt,mt=pt,dn=tt}if(Hn===fe.length)return m(se,dn),at&&Do(se,Hn),yn;if(dn===null){for(;HnHn?(tt=dn,dn=null):tt=dn.sibling;var Gs=pe(se,dn,pt.value,Te);if(Gs===null){dn===null&&(dn=tt);break}s&&dn&&Gs.alternate===null&&u(se,dn),te=T(Gs,te,Hn),mt===null?yn=Gs:mt.sibling=Gs,mt=Gs,dn=tt}if(pt.done)return m(se,dn),at&&Do(se,Hn),yn;if(dn===null){for(;!pt.done;Hn++,pt=fe.next())pt=Me(se,pt.value,Te),pt!==null&&(te=T(pt,te,Hn),mt===null?yn=pt:mt.sibling=pt,mt=pt);return at&&Do(se,Hn),yn}for(dn=y(dn);!pt.done;Hn++,pt=fe.next())pt=_e(dn,se,Hn,pt.value,Te),pt!==null&&(s&&pt.alternate!==null&&dn.delete(pt.key===null?Hn:pt.key),te=T(pt,te,Hn),mt===null?yn=pt:mt.sibling=pt,mt=pt);return s&&dn.forEach(function(vK){return u(se,vK)}),at&&Do(se,Hn),yn}function jt(se,te,fe,Te){if(typeof fe=="object"&&fe!==null&&fe.type===w&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case v:e:{for(var yn=fe.key;te!==null;){if(te.key===yn){if(yn=fe.type,yn===w){if(te.tag===7){m(se,te.sibling),Te=S(te,fe.props.children),Te.return=se,se=Te;break e}}else if(te.elementType===yn||typeof yn=="object"&&yn!==null&&yn.$$typeof===N&&Hl(yn)===te.type){m(se,te.sibling),Te=S(te,fe.props),Td(Te,fe),Te.return=se,se=Te;break e}m(se,te);break}else u(se,te);te=te.sibling}fe.type===w?(Te=Ll(fe.props.children,se.mode,Te,fe.key),Te.return=se,se=Te):(Te=zp(fe.type,fe.key,fe.props,null,se.mode,Te),Td(Te,fe),Te.return=se,se=Te)}return B(se);case b:e:{for(yn=fe.key;te!==null;){if(te.key===yn)if(te.tag===4&&te.stateNode.containerInfo===fe.containerInfo&&te.stateNode.implementation===fe.implementation){m(se,te.sibling),Te=S(te,fe.children||[]),Te.return=se,se=Te;break e}else{m(se,te);break}else u(se,te);te=te.sibling}Te=Sb(fe,se.mode,Te),Te.return=se,se=Te}return B(se);case N:return fe=Hl(fe),jt(se,te,fe,Te)}if($(fe))return un(se,te,fe,Te);if(F(fe)){if(yn=F(fe),typeof yn!="function")throw Error(i(150));return fe=yn.call(fe),Sn(se,te,fe,Te)}if(typeof fe.then=="function")return jt(se,te,Up(fe),Te);if(fe.$$typeof===x)return jt(se,te,Bp(se,fe),Te);Vp(se,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,te!==null&&te.tag===6?(m(se,te.sibling),Te=S(te,fe),Te.return=se,se=Te):(m(se,te),Te=xb(fe,se.mode,Te),Te.return=se,se=Te),B(se)):m(se,te)}return function(se,te,fe,Te){try{Ed=0;var yn=jt(se,te,fe,Te);return cc=null,yn}catch(dn){if(dn===uc||dn===qp)throw dn;var mt=Pr(29,dn,null,se.mode);return mt.lanes=Te,mt.return=se,mt}finally{}}}var Vl=Mj(!0),Dj=Mj(!1),Ts=!1;function $b(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zb(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Ms(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ds(s,u,m){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(bt&2)!==0){var S=y.pending;return S===null?u.next=u:(u.next=S.next,S.next=u),y.pending=u,u=$p(s),pj(s,null,m),u}return Np(s,y,u,m),$p(s)}function Md(s,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194048)!==0)){var y=u.lanes;y&=s.pendingLanes,m|=y,u.lanes=m,tn(s,m)}}function Lb(s,u){var m=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,m===y)){var S=null,T=null;if(m=m.firstBaseUpdate,m!==null){do{var B={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};T===null?S=T=B:T=T.next=B,m=m.next}while(m!==null);T===null?S=T=u:T=T.next=u}else S=T=u;m={baseState:y.baseState,firstBaseUpdate:S,lastBaseUpdate:T,shared:y.shared,callbacks:y.callbacks},s.updateQueue=m;return}s=m.lastBaseUpdate,s===null?m.firstBaseUpdate=u:s.next=u,m.lastBaseUpdate=u}var Ib=!1;function Dd(){if(Ib){var s=lc;if(s!==null)throw s}}function Rd(s,u,m,y){Ib=!1;var S=s.updateQueue;Ts=!1;var T=S.firstBaseUpdate,B=S.lastBaseUpdate,K=S.shared.pending;if(K!==null){S.shared.pending=null;var J=K,de=J.next;J.next=null,B===null?T=de:B.next=de,B=J;var Oe=s.alternate;Oe!==null&&(Oe=Oe.updateQueue,K=Oe.lastBaseUpdate,K!==B&&(K===null?Oe.firstBaseUpdate=de:K.next=de,Oe.lastBaseUpdate=J))}if(T!==null){var Me=S.baseState;B=0,Oe=de=J=null,K=T;do{var pe=K.lane&-536870913,_e=pe!==K.lane;if(_e?(nt&pe)===pe:(y&pe)===pe){pe!==0&&pe===sc&&(Ib=!0),Oe!==null&&(Oe=Oe.next={lane:0,tag:K.tag,payload:K.payload,callback:null,next:null});e:{var un=s,Sn=K;pe=u;var jt=m;switch(Sn.tag){case 1:if(un=Sn.payload,typeof un=="function"){Me=un.call(jt,Me,pe);break e}Me=un;break e;case 3:un.flags=un.flags&-65537|128;case 0:if(un=Sn.payload,pe=typeof un=="function"?un.call(jt,Me,pe):un,pe==null)break e;Me=d({},Me,pe);break e;case 2:Ts=!0}}pe=K.callback,pe!==null&&(s.flags|=64,_e&&(s.flags|=8192),_e=S.callbacks,_e===null?S.callbacks=[pe]:_e.push(pe))}else _e={lane:pe,tag:K.tag,payload:K.payload,callback:K.callback,next:null},Oe===null?(de=Oe=_e,J=Me):Oe=Oe.next=_e,B|=pe;if(K=K.next,K===null){if(K=S.shared.pending,K===null)break;_e=K,K=_e.next,_e.next=null,S.lastBaseUpdate=_e,S.shared.pending=null}}while(!0);Oe===null&&(J=Me),S.baseState=J,S.firstBaseUpdate=de,S.lastBaseUpdate=Oe,T===null&&(S.shared.lanes=0),zs|=B,s.lanes=B,s.memoizedState=Me}}function Rj(s,u){if(typeof s!="function")throw Error(i(191,s));s.call(u)}function Pj(s,u){var m=s.callbacks;if(m!==null)for(s.callbacks=null,s=0;sT?T:8;var B=P.T,K={};P.T=K,rw(s,!1,u,m);try{var J=S(),de=P.S;if(de!==null&&de(K,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var Oe=aY(J,y);$d(s,u,Oe,Ir(s))}else $d(s,u,y,Ir(s))}catch(Me){$d(s,u,{then:function(){},status:"rejected",reason:Me},Ir())}finally{I.p=T,B!==null&&K.types!==null&&(B.types=K.types),P.T=B}}function fY(){}function tw(s,u,m,y){if(s.tag!==5)throw Error(i(476));var S=dO(s).queue;fO(s,S,u,H,m===null?fY:function(){return hO(s),m(y)})}function dO(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:H},next:null};var m={};return u.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:m},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function hO(s){var u=dO(s);u.next===null&&(u=s.alternate.memoizedState),$d(s,u.next.queue,{},Ir())}function iw(){return Li(Jd)}function mO(){return li().memoizedState}function pO(){return li().memoizedState}function dY(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var m=Ir();s=Ms(m);var y=Ds(u,s,m);y!==null&&(kr(y,u,m),Md(y,u,m)),u={cache:Db()},s.payload=u;return}u=u.return}}function hY(s,u,m){var y=Ir();m={lane:y,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},nv(s)?gO(u,m):(m=kb(s,u,m,y),m!==null&&(kr(m,s,y),yO(m,u,y)))}function vO(s,u,m){var y=Ir();$d(s,u,m,y)}function $d(s,u,m,y){var S={lane:y,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(nv(s))gO(u,S);else{var T=s.alternate;if(s.lanes===0&&(T===null||T.lanes===0)&&(T=u.lastRenderedReducer,T!==null))try{var B=u.lastRenderedState,K=T(B,m);if(S.hasEagerState=!0,S.eagerState=K,Rr(K,B))return Np(s,u,S,0),Mt===null&&Pp(),!1}catch{}finally{}if(m=kb(s,u,S,y),m!==null)return kr(m,s,y),yO(m,u,y),!0}return!1}function rw(s,u,m,y){if(y={lane:2,revertLane:$w(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},nv(s)){if(u)throw Error(i(479))}else u=kb(s,m,y,2),u!==null&&kr(u,s,2)}function nv(s){var u=s.alternate;return s===Fn||u!==null&&u===Fn}function gO(s,u){dc=Yp=!0;var m=s.pending;m===null?u.next=u:(u.next=m.next,m.next=u),s.pending=u}function yO(s,u,m){if((m&4194048)!==0){var y=u.lanes;y&=s.pendingLanes,m|=y,u.lanes=m,tn(s,m)}}var zd={readContext:Li,use:Zp,useCallback:ei,useContext:ei,useEffect:ei,useImperativeHandle:ei,useLayoutEffect:ei,useInsertionEffect:ei,useMemo:ei,useReducer:ei,useRef:ei,useState:ei,useDebugValue:ei,useDeferredValue:ei,useTransition:ei,useSyncExternalStore:ei,useId:ei,useHostTransitionStatus:ei,useFormState:ei,useActionState:ei,useOptimistic:ei,useMemoCache:ei,useCacheRefresh:ei};zd.useEffectEvent=ei;var bO={readContext:Li,use:Zp,useCallback:function(s,u){return sr().memoizedState=[s,u===void 0?null:u],s},useContext:Li,useEffect:tO,useImperativeHandle:function(s,u,m){m=m!=null?m.concat([s]):null,Jp(4194308,4,oO.bind(null,u,s),m)},useLayoutEffect:function(s,u){return Jp(4194308,4,s,u)},useInsertionEffect:function(s,u){Jp(4,2,s,u)},useMemo:function(s,u){var m=sr();u=u===void 0?null:u;var y=s();if(Wl){sn(!0);try{s()}finally{sn(!1)}}return m.memoizedState=[y,u],y},useReducer:function(s,u,m){var y=sr();if(m!==void 0){var S=m(u);if(Wl){sn(!0);try{m(u)}finally{sn(!1)}}}else S=u;return y.memoizedState=y.baseState=S,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:S},y.queue=s,s=s.dispatch=hY.bind(null,Fn,s),[y.memoizedState,s]},useRef:function(s){var u=sr();return s={current:s},u.memoizedState=s},useState:function(s){s=Zb(s);var u=s.queue,m=vO.bind(null,Fn,u);return u.dispatch=m,[s.memoizedState,m]},useDebugValue:ew,useDeferredValue:function(s,u){var m=sr();return nw(m,s,u)},useTransition:function(){var s=Zb(!1);return s=fO.bind(null,Fn,s.queue,!0,!1),sr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,m){var y=Fn,S=sr();if(at){if(m===void 0)throw Error(i(407));m=m()}else{if(m=u(),Mt===null)throw Error(i(349));(nt&127)!==0||Bj(y,u,m)}S.memoizedState=m;var T={value:m,getSnapshot:u};return S.queue=T,tO(qj.bind(null,y,T,s),[s]),y.flags|=2048,mc(9,{destroy:void 0},Fj.bind(null,y,T,m,u),null),m},useId:function(){var s=sr(),u=Mt.identifierPrefix;if(at){var m=eo,y=Ja;m=(y&~(1<<32-en(y)-1)).toString(32)+m,u="_"+u+"R_"+m,m=Kp++,0<\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof y.is=="string"?B.createElement("select",{is:y.is}):B.createElement("select"),y.multiple?T.multiple=!0:y.size&&(T.size=y.size);break;default:T=typeof y.is=="string"?B.createElement(S,{is:y.is}):B.createElement(S)}}T[Kn]=u,T[$t]=y;e:for(B=u.child;B!==null;){if(B.tag===5||B.tag===6)T.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===u)break e;for(;B.sibling===null;){if(B.return===null||B.return===u)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}u.stateNode=T;e:switch(Bi(T,S,y),S){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&Lo(u)}}return qt(u),yw(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,m),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==y&&Lo(u);else{if(typeof y!="string"&&u.stateNode===null)throw Error(i(166));if(s=re.current,ac(u)){if(s=u.stateNode,m=u.memoizedProps,y=null,S=zi,S!==null)switch(S.tag){case 27:case 5:y=S.memoizedProps}s[Kn]=u,s=!!(s.nodeValue===m||y!==null&&y.suppressHydrationWarning===!0||LE(s.nodeValue,m)),s||Os(u,!0)}else s=kv(s).createTextNode(y),s[Kn]=u,u.stateNode=s}return qt(u),null;case 31:if(m=u.memoizedState,s===null||s.memoizedState!==null){if(y=ac(u),m!==null){if(s===null){if(!y)throw Error(i(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[Kn]=u}else Il(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;qt(u),s=!1}else m=Ob(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=m),s=!0;if(!s)return u.flags&256?($r(u),u):($r(u),null);if((u.flags&128)!==0)throw Error(i(558))}return qt(u),null;case 13:if(y=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(S=ac(u),y!==null&&y.dehydrated!==null){if(s===null){if(!S)throw Error(i(318));if(S=u.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(i(317));S[Kn]=u}else Il(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;qt(u),S=!1}else S=Ob(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=S),S=!0;if(!S)return u.flags&256?($r(u),u):($r(u),null)}return $r(u),(u.flags&128)!==0?(u.lanes=m,u):(m=y!==null,s=s!==null&&s.memoizedState!==null,m&&(y=u.child,S=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(S=y.alternate.memoizedState.cachePool.pool),T=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(T=y.memoizedState.cachePool.pool),T!==S&&(y.flags|=2048)),m!==s&&m&&(u.child.flags|=8192),ov(u,u.updateQueue),qt(u),null);case 4:return ae(),s===null&&Bw(u.stateNode.containerInfo),qt(u),null;case 10:return Po(u.type),qt(u),null;case 19:if(G(si),y=u.memoizedState,y===null)return qt(u),null;if(S=(u.flags&128)!==0,T=y.rendering,T===null)if(S)Id(y,!1);else{if(ni!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(T=Gp(s),T!==null){for(u.flags|=128,Id(y,!1),s=T.updateQueue,u.updateQueue=s,ov(u,s),u.subtreeFlags=0,s=m,m=u.child;m!==null;)vj(m,s),m=m.sibling;return z(si,si.current&1|2),at&&Do(u,y.treeForkCount),u.child}s=s.sibling}y.tail!==null&&Ze()>fv&&(u.flags|=128,S=!0,Id(y,!1),u.lanes=4194304)}else{if(!S)if(s=Gp(T),s!==null){if(u.flags|=128,S=!0,s=s.updateQueue,u.updateQueue=s,ov(u,s),Id(y,!0),y.tail===null&&y.tailMode==="hidden"&&!T.alternate&&!at)return qt(u),null}else 2*Ze()-y.renderingStartTime>fv&&m!==536870912&&(u.flags|=128,S=!0,Id(y,!1),u.lanes=4194304);y.isBackwards?(T.sibling=u.child,u.child=T):(s=y.last,s!==null?s.sibling=T:u.child=T,y.last=T)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=Ze(),s.sibling=null,m=si.current,z(si,S?m&1|2:m&1),at&&Do(u,y.treeForkCount),s):(qt(u),null);case 22:case 23:return $r(u),Fb(),y=u.memoizedState!==null,s!==null?s.memoizedState!==null!==y&&(u.flags|=8192):y&&(u.flags|=8192),y?(m&536870912)!==0&&(u.flags&128)===0&&(qt(u),u.subtreeFlags&6&&(u.flags|=8192)):qt(u),m=u.updateQueue,m!==null&&ov(u,m.retryQueue),m=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==m&&(u.flags|=2048),s!==null&&G(ql),null;case 24:return m=null,s!==null&&(m=s.memoizedState.cache),u.memoizedState.cache!==m&&(u.flags|=2048),Po(hi),qt(u),null;case 25:return null;case 30:return null}throw Error(i(156,u.tag))}function yY(s,u){switch(Ab(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Po(hi),ae(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return Se(u),null;case 31:if(u.memoizedState!==null){if($r(u),u.alternate===null)throw Error(i(340));Il()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if($r(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(i(340));Il()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return G(si),null;case 4:return ae(),null;case 10:return Po(u.type),null;case 22:case 23:return $r(u),Fb(),s!==null&&G(ql),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Po(hi),null;case 25:return null;default:return null}}function HO(s,u){switch(Ab(u),u.tag){case 3:Po(hi),ae();break;case 26:case 27:case 5:Se(u);break;case 4:ae();break;case 31:u.memoizedState!==null&&$r(u);break;case 13:$r(u);break;case 19:G(si);break;case 10:Po(u.type);break;case 22:case 23:$r(u),Fb(),s!==null&&G(ql);break;case 24:Po(hi)}}function Bd(s,u){try{var m=u.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var S=y.next;m=S;do{if((m.tag&s)===s){y=void 0;var T=m.create,B=m.inst;y=T(),B.destroy=y}m=m.next}while(m!==S)}}catch(K){St(u,u.return,K)}}function Ns(s,u,m){try{var y=u.updateQueue,S=y!==null?y.lastEffect:null;if(S!==null){var T=S.next;y=T;do{if((y.tag&s)===s){var B=y.inst,K=B.destroy;if(K!==void 0){B.destroy=void 0,S=u;var J=m,de=K;try{de()}catch(Oe){St(S,J,Oe)}}}y=y.next}while(y!==T)}}catch(Oe){St(u,u.return,Oe)}}function UO(s){var u=s.updateQueue;if(u!==null){var m=s.stateNode;try{Pj(u,m)}catch(y){St(s,s.return,y)}}}function VO(s,u,m){m.props=Gl(s.type,s.memoizedProps),m.state=s.memoizedState;try{m.componentWillUnmount()}catch(y){St(s,u,y)}}function Fd(s,u){try{var m=s.ref;if(m!==null){switch(s.tag){case 26:case 27:case 5:var y=s.stateNode;break;case 30:y=s.stateNode;break;default:y=s.stateNode}typeof m=="function"?s.refCleanup=m(y):m.current=y}}catch(S){St(s,u,S)}}function no(s,u){var m=s.ref,y=s.refCleanup;if(m!==null)if(typeof y=="function")try{y()}catch(S){St(s,u,S)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(S){St(s,u,S)}else m.current=null}function WO(s){var u=s.type,m=s.memoizedProps,y=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":m.autoFocus&&y.focus();break e;case"img":m.src?y.src=m.src:m.srcSet&&(y.srcset=m.srcSet)}}catch(S){St(s,s.return,S)}}function bw(s,u,m){try{var y=s.stateNode;BY(y,s.type,m,u),y[$t]=u}catch(S){St(s,s.return,S)}}function GO(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&qs(s.type)||s.tag===4}function ww(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||GO(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&qs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function kw(s,u,m){var y=s.tag;if(y===5||y===6)s=s.stateNode,u?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(s,u):(u=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,u.appendChild(s),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=vr));else if(y!==4&&(y===27&&qs(s.type)&&(m=s.stateNode,u=null),s=s.child,s!==null))for(kw(s,u,m),s=s.sibling;s!==null;)kw(s,u,m),s=s.sibling}function sv(s,u,m){var y=s.tag;if(y===5||y===6)s=s.stateNode,u?m.insertBefore(s,u):m.appendChild(s);else if(y!==4&&(y===27&&qs(s.type)&&(m=s.stateNode),s=s.child,s!==null))for(sv(s,u,m),s=s.sibling;s!==null;)sv(s,u,m),s=s.sibling}function YO(s){var u=s.stateNode,m=s.memoizedProps;try{for(var y=s.type,S=u.attributes;S.length;)u.removeAttributeNode(S[0]);Bi(u,y,m),u[Kn]=s,u[$t]=m}catch(T){St(s,s.return,T)}}var Io=!1,vi=!1,_w=!1,KO=typeof WeakSet=="function"?WeakSet:Set,Ei=null;function bY(s,u){if(s=s.containerInfo,Hw=Ov,s=sj(s),pb(s)){if("selectionStart"in s)var m={start:s.selectionStart,end:s.selectionEnd};else e:{m=(m=s.ownerDocument)&&m.defaultView||window;var y=m.getSelection&&m.getSelection();if(y&&y.rangeCount!==0){m=y.anchorNode;var S=y.anchorOffset,T=y.focusNode;y=y.focusOffset;try{m.nodeType,T.nodeType}catch{m=null;break e}var B=0,K=-1,J=-1,de=0,Oe=0,Me=s,pe=null;n:for(;;){for(var _e;Me!==m||S!==0&&Me.nodeType!==3||(K=B+S),Me!==T||y!==0&&Me.nodeType!==3||(J=B+y),Me.nodeType===3&&(B+=Me.nodeValue.length),(_e=Me.firstChild)!==null;)pe=Me,Me=_e;for(;;){if(Me===s)break n;if(pe===m&&++de===S&&(K=B),pe===T&&++Oe===y&&(J=B),(_e=Me.nextSibling)!==null)break;Me=pe,pe=Me.parentNode}Me=_e}m=K===-1||J===-1?null:{start:K,end:J}}else m=null}m=m||{start:0,end:0}}else m=null;for(Uw={focusedElem:s,selectionRange:m},Ov=!1,Ei=u;Ei!==null;)if(u=Ei,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Ei=s;else for(;Ei!==null;){switch(u=Ei,T=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(m=0;m title"))),Bi(T,y,m),T[Kn]=s,cn(T),y=T;break e;case"link":var B=n5("link","href",S).get(y+(m.href||""));if(B){for(var K=0;Kjt&&(B=jt,jt=Sn,Sn=B);var se=aj(K,Sn),te=aj(K,jt);if(se&&te&&(_e.rangeCount!==1||_e.anchorNode!==se.node||_e.anchorOffset!==se.offset||_e.focusNode!==te.node||_e.focusOffset!==te.offset)){var fe=Me.createRange();fe.setStart(se.node,se.offset),_e.removeAllRanges(),Sn>jt?(_e.addRange(fe),_e.extend(te.node,te.offset)):(fe.setEnd(te.node,te.offset),_e.addRange(fe))}}}}for(Me=[],_e=K;_e=_e.parentNode;)_e.nodeType===1&&Me.push({element:_e,left:_e.scrollLeft,top:_e.scrollTop});for(typeof K.focus=="function"&&K.focus(),K=0;Km?32:m,P.T=null,m=Ew,Ew=null;var T=Is,B=Uo;if(wi=0,bc=Is=null,Uo=0,(bt&6)!==0)throw Error(i(331));var K=bt;if(bt|=4,oE(T.current),iE(T,T.current,B,m),bt=K,Gd(0,!1),vn&&typeof vn.onPostCommitFiberRoot=="function")try{vn.onPostCommitFiberRoot(En,T)}catch{}return!0}finally{I.p=S,P.T=y,SE(s,u)}}function AE(s,u,m){u=ia(m,u),u=lw(s.stateNode,u,2),s=Ds(s,u,2),s!==null&&(ut(s,2),to(s))}function St(s,u,m){if(s.tag===3)AE(s,s,m);else for(;u!==null;){if(u.tag===3){AE(u,s,m);break}else if(u.tag===1){var y=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Ls===null||!Ls.has(y))){s=ia(m,s),m=jO(2),y=Ds(u,m,2),y!==null&&(OO(m,y,u,s),ut(y,2),to(y));break}}u=u.return}}function Rw(s,u,m){var y=s.pingCache;if(y===null){y=s.pingCache=new _Y;var S=new Set;y.set(u,S)}else S=y.get(u),S===void 0&&(S=new Set,y.set(u,S));S.has(m)||(Cw=!0,S.add(m),s=jY.bind(null,s,u,m),u.then(s,s))}function jY(s,u,m){var y=s.pingCache;y!==null&&y.delete(u),s.pingedLanes|=s.suspendedLanes&m,s.warmLanes&=~m,Mt===s&&(nt&m)===m&&(ni===4||ni===3&&(nt&62914560)===nt&&300>Ze()-cv?(bt&2)===0&&wc(s,0):Aw|=m,yc===nt&&(yc=0)),to(s)}function jE(s,u){u===0&&(u=Ue()),s=zl(s,u),s!==null&&(ut(s,u),to(s))}function OY(s){var u=s.memoizedState,m=0;u!==null&&(m=u.retryLane),jE(s,m)}function EY(s,u){var m=0;switch(s.tag){case 31:case 13:var y=s.stateNode,S=s.memoizedState;S!==null&&(m=S.retryLane);break;case 19:y=s.stateNode;break;case 22:y=s.stateNode._retryCache;break;default:throw Error(i(314))}y!==null&&y.delete(u),jE(s,m)}function TY(s,u){return ce(s,u)}var gv=null,_c=null,Pw=!1,yv=!1,Nw=!1,Fs=0;function to(s){s!==_c&&s.next===null&&(_c===null?gv=_c=s:_c=_c.next=s),yv=!0,Pw||(Pw=!0,DY())}function Gd(s,u){if(!Nw&&yv){Nw=!0;do for(var m=!1,y=gv;y!==null;){if(s!==0){var S=y.pendingLanes;if(S===0)var T=0;else{var B=y.suspendedLanes,K=y.pingedLanes;T=(1<<31-en(42|s)+1)-1,T&=S&~(B&~K),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(m=!0,ME(y,T))}else T=nt,T=ft(y,y===Mt?T:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(T&3)===0||Tt(y,T)||(m=!0,ME(y,T));y=y.next}while(m);Nw=!1}}function MY(){OE()}function OE(){yv=Pw=!1;var s=0;Fs!==0&&qY()&&(s=Fs);for(var u=Ze(),m=null,y=gv;y!==null;){var S=y.next,T=EE(y,u);T===0?(y.next=null,m===null?gv=S:m.next=S,S===null&&(_c=m)):(m=y,(s!==0||(T&3)!==0)&&(yv=!0)),y=S}wi!==0&&wi!==5||Gd(s),Fs!==0&&(Fs=0)}function EE(s,u){for(var m=s.suspendedLanes,y=s.pingedLanes,S=s.expirationTimes,T=s.pendingLanes&-62914561;0K)break;var Oe=J.transferSize,Me=J.initiatorType;Oe&&IE(Me)&&(J=J.responseEnd,B+=Oe*(J"u"?null:document;function ZE(s,u,m){var y=xc;if(y&&typeof u=="string"&&u){var S=rr(u);S='link[rel="'+s+'"][href="'+S+'"]',typeof m=="string"&&(S+='[crossorigin="'+m+'"]'),XE.has(S)||(XE.add(S),s={rel:s,crossOrigin:m,href:u},y.querySelector(S)===null&&(u=y.createElement("link"),Bi(u,"link",s),cn(u),y.head.appendChild(u)))}}function ZY(s){Vo.D(s),ZE("dns-prefetch",s,null)}function QY(s,u){Vo.C(s,u),ZE("preconnect",s,u)}function JY(s,u,m){Vo.L(s,u,m);var y=xc;if(y&&s&&u){var S='link[rel="preload"][as="'+rr(u)+'"]';u==="image"&&m&&m.imageSrcSet?(S+='[imagesrcset="'+rr(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(S+='[imagesizes="'+rr(m.imageSizes)+'"]')):S+='[href="'+rr(s)+'"]';var T=S;switch(u){case"style":T=Sc(s);break;case"script":T=Cc(s)}ua.has(T)||(s=d({rel:"preload",href:u==="image"&&m&&m.imageSrcSet?void 0:s,as:u},m),ua.set(T,s),y.querySelector(S)!==null||u==="style"&&y.querySelector(Zd(T))||u==="script"&&y.querySelector(Qd(T))||(u=y.createElement("link"),Bi(u,"link",s),cn(u),y.head.appendChild(u)))}}function eK(s,u){Vo.m(s,u);var m=xc;if(m&&s){var y=u&&typeof u.as=="string"?u.as:"script",S='link[rel="modulepreload"][as="'+rr(y)+'"][href="'+rr(s)+'"]',T=S;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=Cc(s)}if(!ua.has(T)&&(s=d({rel:"modulepreload",href:s},u),ua.set(T,s),m.querySelector(S)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(Qd(T)))return}y=m.createElement("link"),Bi(y,"link",s),cn(y),m.head.appendChild(y)}}}function nK(s,u,m){Vo.S(s,u,m);var y=xc;if(y&&s){var S=ci(y).hoistableStyles,T=Sc(s);u=u||"default";var B=S.get(T);if(!B){var K={loading:0,preload:null};if(B=y.querySelector(Zd(T)))K.loading=5;else{s=d({rel:"stylesheet",href:s,"data-precedence":u},m),(m=ua.get(T))&&Zw(s,m);var J=B=y.createElement("link");cn(J),Bi(J,"link",s),J._p=new Promise(function(de,Oe){J.onload=de,J.onerror=Oe}),J.addEventListener("load",function(){K.loading|=1}),J.addEventListener("error",function(){K.loading|=2}),K.loading|=4,xv(B,u,y)}B={type:"stylesheet",instance:B,count:1,state:K},S.set(T,B)}}}function tK(s,u){Vo.X(s,u);var m=xc;if(m&&s){var y=ci(m).hoistableScripts,S=Cc(s),T=y.get(S);T||(T=m.querySelector(Qd(S)),T||(s=d({src:s,async:!0},u),(u=ua.get(S))&&Qw(s,u),T=m.createElement("script"),cn(T),Bi(T,"link",s),m.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},y.set(S,T))}}function iK(s,u){Vo.M(s,u);var m=xc;if(m&&s){var y=ci(m).hoistableScripts,S=Cc(s),T=y.get(S);T||(T=m.querySelector(Qd(S)),T||(s=d({src:s,async:!0,type:"module"},u),(u=ua.get(S))&&Qw(s,u),T=m.createElement("script"),cn(T),Bi(T,"link",s),m.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},y.set(S,T))}}function QE(s,u,m,y){var S=(S=re.current)?_v(S):null;if(!S)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(u=Sc(m.href),m=ci(S).hoistableStyles,y=m.get(u),y||(y={type:"style",instance:null,count:0,state:null},m.set(u,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){s=Sc(m.href);var T=ci(S).hoistableStyles,B=T.get(s);if(B||(S=S.ownerDocument||S,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(s,B),(T=S.querySelector(Zd(s)))&&!T._p&&(B.instance=T,B.state.loading=5),ua.has(s)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},ua.set(s,m),T||rK(S,s,m,B.state))),u&&y===null)throw Error(i(528,""));return B}if(u&&y!==null)throw Error(i(529,""));return null;case"script":return u=m.async,m=m.src,typeof m=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=Cc(m),m=ci(S).hoistableScripts,y=m.get(u),y||(y={type:"script",instance:null,count:0,state:null},m.set(u,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function Sc(s){return'href="'+rr(s)+'"'}function Zd(s){return'link[rel="stylesheet"]['+s+"]"}function JE(s){return d({},s,{"data-precedence":s.precedence,precedence:null})}function rK(s,u,m,y){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?y.loading=1:(u=s.createElement("link"),y.preload=u,u.addEventListener("load",function(){return y.loading|=1}),u.addEventListener("error",function(){return y.loading|=2}),Bi(u,"link",m),cn(u),s.head.appendChild(u))}function Cc(s){return'[src="'+rr(s)+'"]'}function Qd(s){return"script[async]"+s}function e5(s,u,m){if(u.count++,u.instance===null)switch(u.type){case"style":var y=s.querySelector('style[data-href~="'+rr(m.href)+'"]');if(y)return u.instance=y,cn(y),y;var S=d({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return y=(s.ownerDocument||s).createElement("style"),cn(y),Bi(y,"style",S),xv(y,m.precedence,s),u.instance=y;case"stylesheet":S=Sc(m.href);var T=s.querySelector(Zd(S));if(T)return u.state.loading|=4,u.instance=T,cn(T),T;y=JE(m),(S=ua.get(S))&&Zw(y,S),T=(s.ownerDocument||s).createElement("link"),cn(T);var B=T;return B._p=new Promise(function(K,J){B.onload=K,B.onerror=J}),Bi(T,"link",y),u.state.loading|=4,xv(T,m.precedence,s),u.instance=T;case"script":return T=Cc(m.src),(S=s.querySelector(Qd(T)))?(u.instance=S,cn(S),S):(y=m,(S=ua.get(T))&&(y=d({},m),Qw(y,S)),s=s.ownerDocument||s,S=s.createElement("script"),cn(S),Bi(S,"link",y),s.head.appendChild(S),u.instance=S);case"void":return null;default:throw Error(i(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(y=u.instance,u.state.loading|=4,xv(y,m.precedence,s));return u.instance}function xv(s,u,m){for(var y=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=y.length?y[y.length-1]:null,T=S,B=0;B title"):null)}function aK(s,u,m){if(m===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function i5(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function oK(s,u,m,y){if(m.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var S=Sc(y.href),T=u.querySelector(Zd(S));if(T){u=T._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=Cv.bind(s),u.then(s,s)),m.state.loading|=4,m.instance=T,cn(T);return}T=u.ownerDocument||u,y=JE(y),(S=ua.get(S))&&Zw(y,S),T=T.createElement("link"),cn(T);var B=T;B._p=new Promise(function(K,J){B.onload=K,B.onerror=J}),Bi(T,"link",y),m.instance=T}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(m,u),(u=m.state.preload)&&(m.state.loading&3)===0&&(s.count++,m=Cv.bind(s),u.addEventListener("load",m),u.addEventListener("error",m))}}var Jw=0;function sK(s,u){return s.stylesheets&&s.count===0&&jv(s,s.stylesheets),0Jw?50:800)+u);return s.unsuspend=m,function(){s.unsuspend=null,clearTimeout(y),clearTimeout(S)}}:null}function Cv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Av=null;function jv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Av=new Map,u.forEach(lK,s),Av=null,Cv.call(s))}function lK(s,u){if(!(u.state.loading&4)){var m=Av.get(s);if(m)var y=m.get(null);else{m=new Map,Av.set(s,m);for(var S=s.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Lk.exports=Pie(),Lk.exports}var $ie=Nie();class iF extends Error{constructor(n,t){super(t),this.status=n,this.name="HTTPError"}}async function zie(e,n,t){const i=await fetch(`${t}${e}`,{credentials:"include",...n,headers:{"Content-Type":"application/json",...(n==null?void 0:n.headers)??{}}});if(!i.ok){const r=await i.json().catch(()=>({Message:i.statusText}));throw new iF(i.status,r.Message??r.message??i.statusText)}if(i.status!==204)return i.json()}const Lie="/api";function Mn(e,n){return zie(e,n,Lie)}function UT(){return Mn("/board")}function Iie(){return Mn("/flags")}function rF(){return Mn("/version")}function Bie(e){return Mn("/columns",{method:"POST",body:JSON.stringify({name:e})})}function Ql(e,n){return Mn(`/columns/${e}`,{method:"PATCH",body:JSON.stringify(n)})}function Fie(e){return Mn(`/columns/${e}`,{method:"DELETE"})}function qie(e){return Mn("/columns/reorder",{method:"POST",body:JSON.stringify({ids:e})})}function Hie(e){return Mn("/cards",{method:"POST",body:JSON.stringify(e)})}function Mc(e,n){return Mn(`/cards/${e}`,{method:"PATCH",body:JSON.stringify(n)})}function Uie(e){return Mn(`/cards/${e}`,{method:"DELETE"})}function Fk(e,n){return Mn(`/cards/${e}/stickers`,{method:"PUT",body:JSON.stringify({stickers:n})})}function VT(){return Mn("/trash")}function Vie(e){return Mn(`/cards/${e}/restore`,{method:"POST"})}function Wie(e){return Mn(`/cards/${e}/purge`,{method:"DELETE"})}function WT(){return Mn("/archive")}function Gie(e){return Mn(`/cards/${e}/archive`,{method:"POST"})}function Yie(e){return Mn(`/cards/${e}/unarchive`,{method:"POST"})}function Kie(e,n){const t=new URLSearchParams({date:e});return Mn(`/reports/daily?${t.toString()}`)}function Xie(e){return Mn(`/reports/daily/summary?date=${encodeURIComponent(e)}`)}function Zie(e,n){const t=new URLSearchParams({date:e});return Mn(`/reports/daily/summary?${t.toString()}`,{method:"POST"})}function Qie(e){return Mn(`/settings/${encodeURIComponent(e)}`)}function Jie(e,n){return Mn(`/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({value:n})})}function ere(e,n,t){return Mn(`/cards/${e}/move`,{method:"POST",body:JSON.stringify({column_id:n,ordered_ids:t})})}function nre(e){return Mn(`/cards/${e}/history`)}function tre(e){return Mn(`/cards/${e}/messages`)}function ire(e,n){return Mn(`/cards/${e}/messages`,{method:"POST",body:JSON.stringify({body:n})})}function rre(e,n){return Mn(`/cards/${e}/messages/${n}`,{method:"DELETE"})}function are(e){return Mn(`/cards/${e}/duplicate`,{method:"POST"})}function ore(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/chat/ws`}function sre(e){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/cards/${e}/chat/ws`}function aF(e=!1){return Mn(`/notifications${e?"?unread=1":""}`)}function oF(){return Mn("/notifications/unread-count")}function lre(e){return Mn(`/notifications/${e}/read`,{method:"POST"})}function ure(){return Mn("/notifications/read-all",{method:"POST"})}function cre(){return Mn("/modules")}function fre(e){return Mn("/modules",{method:"POST",body:JSON.stringify(e)})}function dre(e,n){return Mn(`/modules/${e}`,{method:"PATCH",body:JSON.stringify(n)})}function hre(e){return Mn(`/modules/${e}`,{method:"DELETE"})}function mre(e,n=100){return Mn(`/modules/${e}/logs?limit=${n}`)}function GT(e,n){const t={method:"POST"};return n&&(t.body=JSON.stringify(n)),Mn(`/modules/${e}/test`,t)}function pre(e,n,t){return new Promise((i,r)=>{const a=new WebSocket(ore());let o=!1;const l=c=>{if(!o){o=!0;try{a.close()}catch{}c?r(c):i()}};a.onopen=()=>{a.send(JSON.stringify({messages:e}))},a.onmessage=c=>{try{const f=JSON.parse(typeof c.data=="string"?c.data:"");n(f),(f.type==="done"||f.type==="error")&&l(f.type==="error"?new Error(f.error):void 0)}catch(f){l(f)}},a.onerror=()=>l(new Error("websocket error")),a.onclose=()=>l()})}function YT(e,n){return Mn("/auth/login",{method:"POST",body:JSON.stringify({username:e,password:n})})}function vre(e,n,t){return Mn("/auth/register",{method:"POST",body:JSON.stringify({username:e,password:n,display_name:t})})}function gre(){return Mn("/auth/logout",{method:"POST"})}function yre(){return Mn("/me")}function KT(e){return Mn("/me",{method:"PATCH",body:JSON.stringify(e)})}function sF(){return Mn("/users")}function lF(){return Mn("/tags")}function bre(){return Mn("/requesters")}function uF(e){const n=new URLSearchParams;e.from&&n.set("from",e.from),e.to&&n.set("to",e.to),e.assignee_id&&n.set("assignee_id",e.assignee_id),e.requester&&n.set("requester",e.requester),e.tags&&e.tags.length>0&&n.set("tags",e.tags.join(","));const t=n.toString();return Mn(`/metrics${t?`?${t}`:""}`)}const cF=A.createContext(null);function wre({children:e}){const[n,t]=A.useState(null),[i,r]=A.useState(!0);A.useEffect(()=>{yre().then(t).catch(c=>{(!(c instanceof iF)||c.status!==401)&&console.warn("getMe failed",c)}).finally(()=>r(!1))},[]);const a=A.useCallback(async(c,f)=>{const h=await YT(c,f);t(h)},[]),o=A.useCallback(async(c,f,h)=>{await vre(c,f,h);const d=await YT(c,f);t(d)},[]),l=A.useCallback(async()=>{await gre(),t(null)},[]);return g.jsx(cF.Provider,{value:{user:n,loading:i,login:a,register:o,logout:l,setUser:t},children:e})}function e9(){const e=A.useContext(cF);if(!e)throw new Error("useAuth: missing AuthProvider");return e}function kre(){for(var e=arguments.length,n=new Array(e),t=0;ti=>{n.forEach(r=>r(i))},n)}const t0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yf(e){const n=Object.prototype.toString.call(e);return n==="[object Window]"||n==="[object global]"}function n9(e){return"nodeType"in e}function mr(e){var n,t;return e?Yf(e)?e:n9(e)&&(n=(t=e.ownerDocument)==null?void 0:t.defaultView)!=null?n:window:window}function t9(e){const{Document:n}=mr(e);return e instanceof n}function sp(e){return Yf(e)?!1:e instanceof mr(e).HTMLElement}function fF(e){return e instanceof mr(e).SVGElement}function Kf(e){return e?Yf(e)?e.document:n9(e)?t9(e)?e:sp(e)||fF(e)?e.ownerDocument:document:document:document}const Wa=t0?A.useLayoutEffect:A.useEffect;function i0(e){const n=A.useRef(e);return Wa(()=>{n.current=e}),A.useCallback(function(){for(var t=arguments.length,i=new Array(t),r=0;r{e.current=setInterval(i,r)},[]),t=A.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[n,t]}function im(e,n){n===void 0&&(n=[e]);const t=A.useRef(e);return Wa(()=>{t.current!==e&&(t.current=e)},n),t}function lp(e,n){const t=A.useRef();return A.useMemo(()=>{const i=e(t.current);return t.current=i,i},[...n])}function qg(e){const n=i0(e),t=A.useRef(null),i=A.useCallback(r=>{r!==t.current&&(n==null||n(r,t.current)),t.current=r},[]);return[t,i]}function Hg(e){const n=A.useRef();return A.useEffect(()=>{n.current=e},[e]),n.current}let qk={};function up(e,n){return A.useMemo(()=>{if(n)return n;const t=qk[e]==null?0:qk[e]+1;return qk[e]=t,e+"-"+t},[e,n])}function dF(e){return function(n){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r{const l=Object.entries(o);for(const[c,f]of l){const h=a[c];h!=null&&(a[c]=h+e*f)}return a},{...n})}}const Yc=dF(1),rm=dF(-1);function xre(e){return"clientX"in e&&"clientY"in e}function r0(e){if(!e)return!1;const{KeyboardEvent:n}=mr(e.target);return n&&e instanceof n}function Sre(e){if(!e)return!1;const{TouchEvent:n}=mr(e.target);return n&&e instanceof n}function Ug(e){if(Sre(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return xre(e)?{x:e.clientX,y:e.clientY}:null}const yo=Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:t}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:t}=e;return"scaleX("+n+") scaleY("+t+")"}},Transform:{toString(e){if(e)return[yo.Translate.toString(e),yo.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:i}=e;return n+" "+t+"ms "+i}}}),XT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Cre(e){return e.matches(XT)?e:e.querySelector(XT)}const Are={display:"none"};function jre(e){let{id:n,value:t}=e;return Q.createElement("div",{id:n,style:Are},t)}function Ore(e){let{id:n,announcement:t,ariaLiveType:i="assertive"}=e;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Q.createElement("div",{id:n,style:r,role:"status","aria-live":i,"aria-atomic":!0},t)}function Ere(){const[e,n]=A.useState("");return{announce:A.useCallback(i=>{i!=null&&n(i)},[]),announcement:e}}const hF=A.createContext(null);function Tre(e){const n=A.useContext(hF);A.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of ");return n(e)},[e,n])}function Mre(){const[e]=A.useState(()=>new Set),n=A.useCallback(i=>(e.add(i),()=>e.delete(i)),[e]);return[A.useCallback(i=>{let{type:r,event:a}=i;e.forEach(o=>{var l;return(l=o[r])==null?void 0:l.call(o,a)})},[e]),n]}const Dre={draggable:` + To pick up a draggable item, press the space bar. + While dragging, use the arrow keys to move the item. + Press space again to drop the item in its new position, or press escape to cancel. + `},Rre={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function Pre(e){let{announcements:n=Rre,container:t,hiddenTextDescribedById:i,screenReaderInstructions:r=Dre}=e;const{announce:a,announcement:o}=Ere(),l=up("DndLiveRegion"),[c,f]=A.useState(!1);if(A.useEffect(()=>{f(!0)},[]),Tre(A.useMemo(()=>({onDragStart(d){let{active:p}=d;a(n.onDragStart({active:p}))},onDragMove(d){let{active:p,over:v}=d;n.onDragMove&&a(n.onDragMove({active:p,over:v}))},onDragOver(d){let{active:p,over:v}=d;a(n.onDragOver({active:p,over:v}))},onDragEnd(d){let{active:p,over:v}=d;a(n.onDragEnd({active:p,over:v}))},onDragCancel(d){let{active:p,over:v}=d;a(n.onDragCancel({active:p,over:v}))}}),[a,n])),!c)return null;const h=Q.createElement(Q.Fragment,null,Q.createElement(jre,{id:i,value:r.draggable}),Q.createElement(Ore,{id:l,announcement:o}));return t?il.createPortal(h,t):h}var xi;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(xi||(xi={}));function Vg(){}function ZT(e,n){return A.useMemo(()=>({sensor:e,options:n??{}}),[e,n])}function Nre(){for(var e=arguments.length,n=new Array(e),t=0;t[...n].filter(i=>i!=null),[...n])}const Ga=Object.freeze({x:0,y:0});function i9(e,n){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function $re(e,n){const t=Ug(e);if(!t)return"0 0";const i={x:(t.x-n.left)/n.width*100,y:(t.y-n.top)/n.height*100};return i.x+"% "+i.y+"%"}function r9(e,n){let{data:{value:t}}=e,{data:{value:i}}=n;return t-i}function zre(e,n){let{data:{value:t}}=e,{data:{value:i}}=n;return i-t}function LS(e){let{left:n,top:t,height:i,width:r}=e;return[{x:n,y:t},{x:n+r,y:t},{x:n,y:t+i},{x:n+r,y:t+i}]}function mF(e,n){if(!e||e.length===0)return null;const[t]=e;return t[n]}function QT(e,n,t){return n===void 0&&(n=e.left),t===void 0&&(t=e.top),{x:n+e.width*.5,y:t+e.height*.5}}const Lre=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:i}=e;const r=QT(n,n.left,n.top),a=[];for(const o of i){const{id:l}=o,c=t.get(l);if(c){const f=i9(QT(c),r);a.push({id:l,data:{droppableContainer:o,value:f}})}}return a.sort(r9)},pF=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:i}=e;const r=LS(n),a=[];for(const o of i){const{id:l}=o,c=t.get(l);if(c){const f=LS(c),h=r.reduce((p,v,b)=>p+i9(f[b],v),0),d=Number((h/4).toFixed(4));a.push({id:l,data:{droppableContainer:o,value:d}})}}return a.sort(r9)};function Ire(e,n){const t=Math.max(n.top,e.top),i=Math.max(n.left,e.left),r=Math.min(n.left+n.width,e.left+e.width),a=Math.min(n.top+n.height,e.top+e.height),o=r-i,l=a-t;if(i{let{collisionRect:n,droppableRects:t,droppableContainers:i}=e;const r=[];for(const a of i){const{id:o}=a,l=t.get(o);if(l){const c=Ire(l,n);c>0&&r.push({id:o,data:{droppableContainer:a,value:c}})}}return r.sort(zre)};function Bre(e,n){const{top:t,left:i,bottom:r,right:a}=n;return t<=e.y&&e.y<=r&&i<=e.x&&e.x<=a}const Fre=e=>{let{droppableContainers:n,droppableRects:t,pointerCoordinates:i}=e;if(!i)return[];const r=[];for(const a of n){const{id:o}=a,l=t.get(o);if(l&&Bre(i,l)){const f=LS(l).reduce((d,p)=>d+i9(i,p),0),h=Number((f/4).toFixed(4));r.push({id:o,data:{droppableContainer:a,value:h}})}}return r.sort(r9)};function qre(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}function gF(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:Ga}function Hre(e){return function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),a=1;a({...o,top:o.top+e*l.y,bottom:o.bottom+e*l.y,left:o.left+e*l.x,right:o.right+e*l.x}),{...t})}}const Ure=Hre(1);function yF(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function Vre(e,n,t){const i=yF(n);if(!i)return e;const{scaleX:r,scaleY:a,x:o,y:l}=i,c=e.left-o-(1-r)*parseFloat(t),f=e.top-l-(1-a)*parseFloat(t.slice(t.indexOf(" ")+1)),h=r?e.width/r:e.width,d=a?e.height/a:e.height;return{width:h,height:d,top:f,right:c+h,bottom:f+d,left:c}}const Wre={ignoreTransform:!1};function Xf(e,n){n===void 0&&(n=Wre);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:f,transformOrigin:h}=mr(e).getComputedStyle(e);f&&(t=Vre(t,f,h))}const{top:i,left:r,width:a,height:o,bottom:l,right:c}=t;return{top:i,left:r,width:a,height:o,bottom:l,right:c}}function JT(e){return Xf(e,{ignoreTransform:!0})}function Gre(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}function Yre(e,n){return n===void 0&&(n=mr(e).getComputedStyle(e)),n.position==="fixed"}function Kre(e,n){n===void 0&&(n=mr(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const a=n[r];return typeof a=="string"?t.test(a):!1})}function a0(e,n){const t=[];function i(r){if(n!=null&&t.length>=n||!r)return t;if(t9(r)&&r.scrollingElement!=null&&!t.includes(r.scrollingElement))return t.push(r.scrollingElement),t;if(!sp(r)||fF(r)||t.includes(r))return t;const a=mr(e).getComputedStyle(r);return r!==e&&Kre(r,a)&&t.push(r),Yre(r,a)?t:i(r.parentNode)}return e?i(e):t}function bF(e){const[n]=a0(e,1);return n??null}function Hk(e){return!t0||!e?null:Yf(e)?e:n9(e)?t9(e)||e===Kf(e).scrollingElement?window:sp(e)?e:null:null}function wF(e){return Yf(e)?e.scrollX:e.scrollLeft}function kF(e){return Yf(e)?e.scrollY:e.scrollTop}function IS(e){return{x:wF(e),y:kF(e)}}var Di;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Di||(Di={}));function _F(e){return!t0||!e?!1:e===document.scrollingElement}function xF(e){const n={x:0,y:0},t=_F(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height},r=e.scrollTop<=n.y,a=e.scrollLeft<=n.x,o=e.scrollTop>=i.y,l=e.scrollLeft>=i.x;return{isTop:r,isLeft:a,isBottom:o,isRight:l,maxScroll:i,minScroll:n}}const Xre={x:.2,y:.2};function Zre(e,n,t,i,r){let{top:a,left:o,right:l,bottom:c}=t;i===void 0&&(i=10),r===void 0&&(r=Xre);const{isTop:f,isBottom:h,isLeft:d,isRight:p}=xF(e),v={x:0,y:0},b={x:0,y:0},w={height:n.height*r.y,width:n.width*r.x};return!f&&a<=n.top+w.height?(v.y=Di.Backward,b.y=i*Math.abs((n.top+w.height-a)/w.height)):!h&&c>=n.bottom-w.height&&(v.y=Di.Forward,b.y=i*Math.abs((n.bottom-w.height-c)/w.height)),!p&&l>=n.right-w.width?(v.x=Di.Forward,b.x=i*Math.abs((n.right-w.width-l)/w.width)):!d&&o<=n.left+w.width&&(v.x=Di.Backward,b.x=i*Math.abs((n.left+w.width-o)/w.width)),{direction:v,speed:b}}function Qre(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:o}=window;return{top:0,left:0,right:a,bottom:o,width:a,height:o}}const{top:n,left:t,right:i,bottom:r}=e.getBoundingClientRect();return{top:n,left:t,right:i,bottom:r,width:e.clientWidth,height:e.clientHeight}}function SF(e){return e.reduce((n,t)=>Yc(n,IS(t)),Ga)}function Jre(e){return e.reduce((n,t)=>n+wF(t),0)}function eae(e){return e.reduce((n,t)=>n+kF(t),0)}function CF(e,n){if(n===void 0&&(n=Xf),!e)return;const{top:t,left:i,bottom:r,right:a}=n(e);bF(e)&&(r<=0||a<=0||t>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const nae=[["x",["left","right"],Jre],["y",["top","bottom"],eae]];class a9{constructor(n,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=a0(t),r=SF(i);this.rect={...n},this.width=n.width,this.height=n.height;for(const[a,o,l]of nae)for(const c of o)Object.defineProperty(this,c,{get:()=>{const f=l(i),h=r[a]-f;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class $h{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...t)})},this.target=n}add(n,t,i){var r;(r=this.target)==null||r.addEventListener(n,t,i),this.listeners.push([n,t,i])}}function tae(e){const{EventTarget:n}=mr(e);return e instanceof n?e:Kf(e)}function Uk(e,n){const t=Math.abs(e.x),i=Math.abs(e.y);return typeof n=="number"?Math.sqrt(t**2+i**2)>n:"x"in n&&"y"in n?t>n.x&&i>n.y:"x"in n?t>n.x:"y"in n?i>n.y:!1}var pa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(pa||(pa={}));function eM(e){e.preventDefault()}function iae(e){e.stopPropagation()}var ot;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ot||(ot={}));const AF={start:[ot.Space,ot.Enter],cancel:[ot.Esc],end:[ot.Space,ot.Enter,ot.Tab]},rae=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case ot.Right:return{...t,x:t.x+25};case ot.Left:return{...t,x:t.x-25};case ot.Down:return{...t,y:t.y+25};case ot.Up:return{...t,y:t.y-25}}};class o9{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:t}}=n;this.props=n,this.listeners=new $h(Kf(t)),this.windowListeners=new $h(mr(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:t}=this.props,i=n.node.current;i&&CF(i),t(Ga)}handleKeyDown(n){if(r0(n)){const{active:t,context:i,options:r}=this.props,{keyboardCodes:a=AF,coordinateGetter:o=rae,scrollBehavior:l="smooth"}=r,{code:c}=n;if(a.end.includes(c)){this.handleEnd(n);return}if(a.cancel.includes(c)){this.handleCancel(n);return}const{collisionRect:f}=i.current,h=f?{x:f.left,y:f.top}:Ga;this.referenceCoordinates||(this.referenceCoordinates=h);const d=o(n,{active:t,context:i.current,currentCoordinates:h});if(d){const p=rm(d,h),v={x:0,y:0},{scrollableAncestors:b}=i.current;for(const w of b){const k=n.code,{isTop:_,isRight:C,isLeft:x,isBottom:E,maxScroll:j,minScroll:O}=xF(w),M=Qre(w),N={x:Math.min(k===ot.Right?M.right-M.width/2:M.right,Math.max(k===ot.Right?M.left:M.left+M.width/2,d.x)),y:Math.min(k===ot.Down?M.bottom-M.height/2:M.bottom,Math.max(k===ot.Down?M.top:M.top+M.height/2,d.y))},q=k===ot.Right&&!C||k===ot.Left&&!x,R=k===ot.Down&&!E||k===ot.Up&&!_;if(q&&N.x!==d.x){const L=w.scrollLeft+p.x,F=k===ot.Right&&L<=j.x||k===ot.Left&&L>=O.x;if(F&&!p.y){w.scrollTo({left:L,behavior:l});return}F?v.x=w.scrollLeft-L:v.x=k===ot.Right?w.scrollLeft-j.x:w.scrollLeft-O.x,v.x&&w.scrollBy({left:-v.x,behavior:l});break}else if(R&&N.y!==d.y){const L=w.scrollTop+p.y,F=k===ot.Down&&L<=j.y||k===ot.Up&&L>=O.y;if(F&&!p.x){w.scrollTo({top:L,behavior:l});return}F?v.y=w.scrollTop-L:v.y=k===ot.Down?w.scrollTop-j.y:w.scrollTop-O.y,v.y&&w.scrollBy({top:-v.y,behavior:l});break}}this.handleMove(n,Yc(rm(d,this.referenceCoordinates),v))}}}handleMove(n,t){const{onMove:i}=this.props;n.preventDefault(),i(t)}handleEnd(n){const{onEnd:t}=this.props;n.preventDefault(),this.detach(),t()}handleCancel(n){const{onCancel:t}=this.props;n.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}o9.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:i=AF,onActivation:r}=n,{active:a}=t;const{code:o}=e.nativeEvent;if(i.start.includes(o)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),r==null||r({event:e.nativeEvent}),!0)}return!1}}];function nM(e){return!!(e&&"distance"in e)}function tM(e){return!!(e&&"delay"in e)}class s9{constructor(n,t,i){var r;i===void 0&&(i=tae(n.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=n,this.events=t;const{event:a}=n,{target:o}=a;this.props=n,this.events=t,this.document=Kf(o),this.documentListeners=new $h(this.document),this.listeners=new $h(i),this.windowListeners=new $h(mr(o)),this.initialCoordinates=(r=Ug(a))!=null?r:Ga,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:n,props:{options:{activationConstraint:t,bypassActivationConstraint:i}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.DragStart,eM),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),this.windowListeners.add(pa.ContextMenu,eM),this.documentListeners.add(pa.Keydown,this.handleKeydown),t){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tM(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(nM(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(n,t){const{active:i,onPending:r}=this.props;r(i,n,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:n}=this,{onStart:t}=this.props;n&&(this.activated=!0,this.documentListeners.add(pa.Click,iae,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pa.SelectionChange,this.removeTextSelection),t(n))}handleMove(n){var t;const{activated:i,initialCoordinates:r,props:a}=this,{onMove:o,options:{activationConstraint:l}}=a;if(!r)return;const c=(t=Ug(n))!=null?t:Ga,f=rm(r,c);if(!i&&l){if(nM(l)){if(l.tolerance!=null&&Uk(f,l.tolerance))return this.handleCancel();if(Uk(f,l.distance))return this.handleStart()}if(tM(l)&&Uk(f,l.tolerance))return this.handleCancel();this.handlePending(l,f);return}n.cancelable&&n.preventDefault(),o(c)}handleEnd(){const{onAbort:n,onEnd:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleCancel(){const{onAbort:n,onCancel:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleKeydown(n){n.code===ot.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const aae={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class l9 extends s9{constructor(n){const{event:t}=n,i=Kf(t.target);super(n,aae,i)}}l9.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:i}=n;return!t.isPrimary||t.button!==0?!1:(i==null||i({event:t}),!0)}}];const oae={move:{name:"mousemove"},end:{name:"mouseup"}};var BS;(function(e){e[e.RightClick=2]="RightClick"})(BS||(BS={}));class sae extends s9{constructor(n){super(n,oae,Kf(n.event.target))}}sae.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:i}=n;return t.button===BS.RightClick?!1:(i==null||i({event:t}),!0)}}];const Vk={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class lae extends s9{constructor(n){super(n,Vk)}static setup(){return window.addEventListener(Vk.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(Vk.move.name,n)};function n(){}}}lae.activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:i}=n;const{touches:r}=t;return r.length>1?!1:(i==null||i({event:t}),!0)}}];var zh;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(zh||(zh={}));var Wg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Wg||(Wg={}));function uae(e){let{acceleration:n,activator:t=zh.Pointer,canScroll:i,draggingRect:r,enabled:a,interval:o=5,order:l=Wg.TreeOrder,pointerCoordinates:c,scrollableAncestors:f,scrollableAncestorRects:h,delta:d,threshold:p}=e;const v=fae({delta:d,disabled:!a}),[b,w]=_re(),k=A.useRef({x:0,y:0}),_=A.useRef({x:0,y:0}),C=A.useMemo(()=>{switch(t){case zh.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case zh.DraggableRect:return r}},[t,r,c]),x=A.useRef(null),E=A.useCallback(()=>{const O=x.current;if(!O)return;const M=k.current.x*_.current.x,N=k.current.y*_.current.y;O.scrollBy(M,N)},[]),j=A.useMemo(()=>l===Wg.TreeOrder?[...f].reverse():f,[l,f]);A.useEffect(()=>{if(!a||!f.length||!C){w();return}for(const O of j){if((i==null?void 0:i(O))===!1)continue;const M=f.indexOf(O),N=h[M];if(!N)continue;const{direction:q,speed:R}=Zre(O,N,C,n,p);for(const L of["x","y"])v[L][q[L]]||(R[L]=0,q[L]=0);if(R.x>0||R.y>0){w(),x.current=O,b(E,o),k.current=R,_.current=q;return}}k.current={x:0,y:0},_.current={x:0,y:0},w()},[n,E,i,w,a,o,JSON.stringify(C),JSON.stringify(v),b,f,j,h,JSON.stringify(p)])}const cae={x:{[Di.Backward]:!1,[Di.Forward]:!1},y:{[Di.Backward]:!1,[Di.Forward]:!1}};function fae(e){let{delta:n,disabled:t}=e;const i=Hg(n);return lp(r=>{if(t||!i||!r)return cae;const a={x:Math.sign(n.x-i.x),y:Math.sign(n.y-i.y)};return{x:{[Di.Backward]:r.x[Di.Backward]||a.x===-1,[Di.Forward]:r.x[Di.Forward]||a.x===1},y:{[Di.Backward]:r.y[Di.Backward]||a.y===-1,[Di.Forward]:r.y[Di.Forward]||a.y===1}}},[t,n,i])}function dae(e,n){const t=n!=null?e.get(n):void 0,i=t?t.node.current:null;return lp(r=>{var a;return n==null?null:(a=i??r)!=null?a:null},[i,n])}function hae(e,n){return A.useMemo(()=>e.reduce((t,i)=>{const{sensor:r}=i,a=r.activators.map(o=>({eventName:o.eventName,handler:n(o.handler,i)}));return[...t,...a]},[]),[e,n])}var am;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(am||(am={}));var FS;(function(e){e.Optimized="optimized"})(FS||(FS={}));const iM=new Map;function mae(e,n){let{dragging:t,dependencies:i,config:r}=n;const[a,o]=A.useState(null),{frequency:l,measure:c,strategy:f}=r,h=A.useRef(e),d=k(),p=im(d),v=A.useCallback(function(_){_===void 0&&(_=[]),!p.current&&o(C=>C===null?_:C.concat(_.filter(x=>!C.includes(x))))},[p]),b=A.useRef(null),w=lp(_=>{if(d&&!t)return iM;if(!_||_===iM||h.current!==e||a!=null){const C=new Map;for(let x of e){if(!x)continue;if(a&&a.length>0&&!a.includes(x.id)&&x.rect.current){C.set(x.id,x.rect.current);continue}const E=x.node.current,j=E?new a9(c(E),E):null;x.rect.current=j,j&&C.set(x.id,j)}return C}return _},[e,a,t,d,c]);return A.useEffect(()=>{h.current=e},[e]),A.useEffect(()=>{d||v()},[t,d]),A.useEffect(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),A.useEffect(()=>{d||typeof l!="number"||b.current!==null||(b.current=setTimeout(()=>{v(),b.current=null},l))},[l,d,v,...i]),{droppableRects:w,measureDroppableContainers:v,measuringScheduled:a!=null};function k(){switch(f){case am.Always:return!1;case am.BeforeDragging:return t;default:return!t}}}function u9(e,n){return lp(t=>e?t||(typeof n=="function"?n(e):e):null,[n,e])}function pae(e,n){return u9(e,n)}function vae(e){let{callback:n,disabled:t}=e;const i=i0(n),r=A.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(i)},[i,t]);return A.useEffect(()=>()=>r==null?void 0:r.disconnect(),[r]),r}function o0(e){let{callback:n,disabled:t}=e;const i=i0(n),r=A.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(i)},[t]);return A.useEffect(()=>()=>r==null?void 0:r.disconnect(),[r]),r}function gae(e){return new a9(Xf(e),e)}function rM(e,n,t){n===void 0&&(n=gae);const[i,r]=A.useState(null);function a(){r(c=>{if(!e)return null;if(e.isConnected===!1){var f;return(f=c??t)!=null?f:null}const h=n(e);return JSON.stringify(c)===JSON.stringify(h)?c:h})}const o=vae({callback(c){if(e)for(const f of c){const{type:h,target:d}=f;if(h==="childList"&&d instanceof HTMLElement&&d.contains(e)){a();break}}}}),l=o0({callback:a});return Wa(()=>{a(),e?(l==null||l.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),o==null||o.disconnect())},[e]),i}function yae(e){const n=u9(e);return gF(e,n)}const aM=[];function bae(e){const n=A.useRef(e),t=lp(i=>e?i&&i!==aM&&e&&n.current&&e.parentNode===n.current.parentNode?i:a0(e):aM,[e]);return A.useEffect(()=>{n.current=e},[e]),t}function wae(e){const[n,t]=A.useState(null),i=A.useRef(e),r=A.useCallback(a=>{const o=Hk(a.target);o&&t(l=>l?(l.set(o,IS(o)),new Map(l)):null)},[]);return A.useEffect(()=>{const a=i.current;if(e!==a){o(a);const l=e.map(c=>{const f=Hk(c);return f?(f.addEventListener("scroll",r,{passive:!0}),[f,IS(f)]):null}).filter(c=>c!=null);t(l.length?new Map(l):null),i.current=e}return()=>{o(e),o(a)};function o(l){l.forEach(c=>{const f=Hk(c);f==null||f.removeEventListener("scroll",r)})}},[r,e]),A.useMemo(()=>e.length?n?Array.from(n.values()).reduce((a,o)=>Yc(a,o),Ga):SF(e):Ga,[e,n])}function oM(e,n){n===void 0&&(n=[]);const t=A.useRef(null);return A.useEffect(()=>{t.current=null},n),A.useEffect(()=>{const i=e!==Ga;i&&!t.current&&(t.current=e),!i&&t.current&&(t.current=null)},[e]),t.current?rm(e,t.current):Ga}function kae(e){A.useEffect(()=>{if(!t0)return;const n=e.map(t=>{let{sensor:i}=t;return i.setup==null?void 0:i.setup()});return()=>{for(const t of n)t==null||t()}},e.map(n=>{let{sensor:t}=n;return t}))}function _ae(e,n){return A.useMemo(()=>e.reduce((t,i)=>{let{eventName:r,handler:a}=i;return t[r]=o=>{a(o,n)},t},{}),[e,n])}function jF(e){return A.useMemo(()=>e?Gre(e):null,[e])}const sM=[];function xae(e,n){n===void 0&&(n=Xf);const[t]=e,i=jF(t?mr(t):null),[r,a]=A.useState(sM);function o(){a(()=>e.length?e.map(c=>_F(c)?i:new a9(n(c),c)):sM)}const l=o0({callback:o});return Wa(()=>{l==null||l.disconnect(),o(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),r}function OF(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return sp(n)?n:e}function Sae(e){let{measure:n}=e;const[t,i]=A.useState(null),r=A.useCallback(f=>{for(const{target:h}of f)if(sp(h)){i(d=>{const p=n(h);return d?{...d,width:p.width,height:p.height}:p});break}},[n]),a=o0({callback:r}),o=A.useCallback(f=>{const h=OF(f);a==null||a.disconnect(),h&&(a==null||a.observe(h)),i(h?n(h):null)},[n,a]),[l,c]=qg(o);return A.useMemo(()=>({nodeRef:l,rect:t,setRef:c}),[t,l,c])}const Cae=[{sensor:l9,options:{}},{sensor:o9,options:{}}],Aae={current:{}},Sg={draggable:{measure:JT},droppable:{measure:JT,strategy:am.WhileDragging,frequency:FS.Optimized},dragOverlay:{measure:Xf}};class Lh extends Map{get(n){var t;return n!=null&&(t=super.get(n))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:t}=n;return!t})}getNodeFor(n){var t,i;return(t=(i=this.get(n))==null?void 0:i.node.current)!=null?t:void 0}}const jae={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Lh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sg,measureDroppableContainers:Vg,windowRect:null,measuringScheduled:!1},EF={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vg,draggableNodes:new Map,over:null,measureDroppableContainers:Vg},cp=A.createContext(EF),TF=A.createContext(jae);function Oae(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Lh}}}function Eae(e,n){switch(n.type){case xi.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case xi.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case xi.DragEnd:case xi.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xi.RegisterDroppable:{const{element:t}=n,{id:i}=t,r=new Lh(e.droppable.containers);return r.set(i,t),{...e,droppable:{...e.droppable,containers:r}}}case xi.SetDroppableDisabled:{const{id:t,key:i,disabled:r}=n,a=e.droppable.containers.get(t);if(!a||i!==a.key)return e;const o=new Lh(e.droppable.containers);return o.set(t,{...a,disabled:r}),{...e,droppable:{...e.droppable,containers:o}}}case xi.UnregisterDroppable:{const{id:t,key:i}=n,r=e.droppable.containers.get(t);if(!r||i!==r.key)return e;const a=new Lh(e.droppable.containers);return a.delete(t),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Tae(e){let{disabled:n}=e;const{active:t,activatorEvent:i,draggableNodes:r}=A.useContext(cp),a=Hg(i),o=Hg(t==null?void 0:t.id);return A.useEffect(()=>{if(!n&&!i&&a&&o!=null){if(!r0(a)||document.activeElement===a.target)return;const l=r.get(o);if(!l)return;const{activatorNode:c,node:f}=l;if(!c.current&&!f.current)return;requestAnimationFrame(()=>{for(const h of[c.current,f.current]){if(!h)continue;const d=Cre(h);if(d){d.focus();break}}})}},[i,n,r,o,a]),null}function MF(e,n){let{transform:t,...i}=n;return e!=null&&e.length?e.reduce((r,a)=>a({transform:r,...i}),t):t}function Mae(e){return A.useMemo(()=>({draggable:{...Sg.draggable,...e==null?void 0:e.draggable},droppable:{...Sg.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Sg.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Dae(e){let{activeNode:n,measure:t,initialRect:i,config:r=!0}=e;const a=A.useRef(!1),{x:o,y:l}=typeof r=="boolean"?{x:r,y:r}:r;Wa(()=>{if(!o&&!l||!n){a.current=!1;return}if(a.current||!i)return;const f=n==null?void 0:n.node.current;if(!f||f.isConnected===!1)return;const h=t(f),d=gF(h,i);if(o||(d.x=0),l||(d.y=0),a.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=bF(f);p&&p.scrollBy({top:d.y,left:d.x})}},[n,o,l,i,t])}const s0=A.createContext({...Ga,scaleX:1,scaleY:1});var Js;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Js||(Js={}));const Rae=A.memo(function(n){var t,i,r,a;let{id:o,accessibility:l,autoScroll:c=!0,children:f,sensors:h=Cae,collisionDetection:d=vF,measuring:p,modifiers:v,...b}=n;const w=A.useReducer(Eae,void 0,Oae),[k,_]=w,[C,x]=Mre(),[E,j]=A.useState(Js.Uninitialized),O=E===Js.Initialized,{draggable:{active:M,nodes:N,translate:q},droppable:{containers:R}}=k,L=M!=null?N.get(M):null,F=A.useRef({initial:null,translated:null}),Y=A.useMemo(()=>{var bn;return M!=null?{id:M,data:(bn=L==null?void 0:L.data)!=null?bn:Aae,rect:F}:null},[M,L]),V=A.useRef(null),[$,P]=A.useState(null),[I,H]=A.useState(null),U=im(b,Object.values(b)),D=up("DndDescribedBy",o),W=A.useMemo(()=>R.getEnabled(),[R]),G=Mae(p),{droppableRects:z,measureDroppableContainers:X,measuringScheduled:ee}=mae(W,{dragging:O,dependencies:[q.x,q.y],config:G.droppable}),re=dae(N,M),le=A.useMemo(()=>I?Ug(I):null,[I]),ye=kn(),ae=pae(re,G.draggable.measure);Dae({activeNode:M!=null?N.get(M):null,config:ye.layoutShiftCompensation,initialRect:ae,measure:G.draggable.measure});const ue=rM(re,G.draggable.measure,ae),Se=rM(re?re.parentElement:null),ne=A.useRef({activatorEvent:null,active:null,activeNode:re,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Le=R.getNodeFor((t=ne.current.over)==null?void 0:t.id),ke=Sae({measure:G.dragOverlay.measure}),je=(i=ke.nodeRef.current)!=null?i:re,Ne=O?(r=ke.rect)!=null?r:ue:null,ge=!!(ke.nodeRef.current&&ke.rect),Ce=yae(ge?null:ue),Pe=jF(je?mr(je):null),ce=bae(O?Le??re:null),qe=xae(ce),Ye=MF(v,{transform:{x:q.x-Ce.x,y:q.y-Ce.y,scaleX:1,scaleY:1},activatorEvent:I,active:Y,activeNodeRect:ue,containerNodeRect:Se,draggingNodeRect:Ne,over:ne.current.over,overlayNodeRect:ke.rect,scrollableAncestors:ce,scrollableAncestorRects:qe,windowRect:Pe}),We=le?Yc(le,q):null,Ze=wae(ce),Qe=oM(Ze),ie=oM(Ze,[ue]),ve=Yc(Ye,Qe),Ke=Ne?Ure(Ne,Ye):null,Je=Y&&Ke?d({active:Y,collisionRect:Ke,droppableRects:z,droppableContainers:W,pointerCoordinates:We}):null,Ae=mF(Je,"id"),[an,mn]=A.useState(null),En=ge?Ye:Yc(Ye,ie),vn=qre(En,(a=an==null?void 0:an.rect)!=null?a:null,ue),sn=A.useRef(null),en=A.useCallback((bn,_n)=>{let{sensor:ft,options:Tt}=_n;if(V.current==null)return;const Be=N.get(V.current);if(!Be)return;const Ue=bn.nativeEvent,Ln=new ft({active:V.current,activeNode:Be,event:Ue,options:Tt,context:ne,onAbort(Pn){if(!N.get(Pn))return;const{onDragAbort:tn}=U.current,on={id:Pn};tn==null||tn(on),C({type:"onDragAbort",event:on})},onPending(Pn,rn,tn,on){if(!N.get(Pn))return;const{onDragPending:Gn}=U.current,_t={id:Pn,constraint:rn,initialCoordinates:tn,offset:on};Gn==null||Gn(_t),C({type:"onDragPending",event:_t})},onStart(Pn){const rn=V.current;if(rn==null)return;const tn=N.get(rn);if(!tn)return;const{onDragStart:on}=U.current,In={activatorEvent:Ue,active:{id:rn,data:tn.data,rect:F}};il.unstable_batchedUpdates(()=>{on==null||on(In),j(Js.Initializing),_({type:xi.DragStart,initialCoordinates:Pn,active:rn}),C({type:"onDragStart",event:In}),P(sn.current),H(Ue)})},onMove(Pn){_({type:xi.DragMove,coordinates:Pn})},onEnd:ut(xi.DragEnd),onCancel:ut(xi.DragCancel)});sn.current=Ln;function ut(Pn){return async function(){const{active:tn,collisions:on,over:In,scrollAdjustedTranslate:Gn}=ne.current;let _t=null;if(tn&&Gn){const{cancelDrop:Rn}=U.current;_t={activatorEvent:Ue,active:tn,collisions:on,delta:Gn,over:In},Pn===xi.DragEnd&&typeof Rn=="function"&&await Promise.resolve(Rn(_t))&&(Pn=xi.DragCancel)}V.current=null,il.unstable_batchedUpdates(()=>{_({type:Pn}),j(Js.Uninitialized),mn(null),P(null),H(null),sn.current=null;const Rn=Pn===xi.DragEnd?"onDragEnd":"onDragCancel";if(_t){const Tn=U.current[Rn];Tn==null||Tn(_t),C({type:Rn,event:_t})}})}}},[N]),zn=A.useCallback((bn,_n)=>(ft,Tt)=>{const Be=ft.nativeEvent,Ue=N.get(Tt);if(V.current!==null||!Ue||Be.dndKit||Be.defaultPrevented)return;const Ln={active:Ue};bn(ft,_n.options,Ln)===!0&&(Be.dndKit={capturedBy:_n.sensor},V.current=Tt,en(ft,_n))},[N,en]),Re=hae(h,zn);kae(h),Wa(()=>{ue&&E===Js.Initializing&&j(Js.Initialized)},[ue,E]),A.useEffect(()=>{const{onDragMove:bn}=U.current,{active:_n,activatorEvent:ft,collisions:Tt,over:Be}=ne.current;if(!_n||!ft)return;const Ue={active:_n,activatorEvent:ft,collisions:Tt,delta:{x:ve.x,y:ve.y},over:Be};il.unstable_batchedUpdates(()=>{bn==null||bn(Ue),C({type:"onDragMove",event:Ue})})},[ve.x,ve.y]),A.useEffect(()=>{const{active:bn,activatorEvent:_n,collisions:ft,droppableContainers:Tt,scrollAdjustedTranslate:Be}=ne.current;if(!bn||V.current==null||!_n||!Be)return;const{onDragOver:Ue}=U.current,Ln=Tt.get(Ae),ut=Ln&&Ln.rect.current?{id:Ln.id,rect:Ln.rect.current,data:Ln.data,disabled:Ln.disabled}:null,Pn={active:bn,activatorEvent:_n,collisions:ft,delta:{x:Be.x,y:Be.y},over:ut};il.unstable_batchedUpdates(()=>{mn(ut),Ue==null||Ue(Pn),C({type:"onDragOver",event:Pn})})},[Ae]),Wa(()=>{ne.current={activatorEvent:I,active:Y,activeNode:re,collisionRect:Ke,collisions:Je,droppableRects:z,draggableNodes:N,draggingNode:je,draggingNodeRect:Ne,droppableContainers:R,over:an,scrollableAncestors:ce,scrollAdjustedTranslate:ve},F.current={initial:Ne,translated:Ke}},[Y,re,Je,Ke,N,je,Ne,z,R,an,ce,ve]),uae({...ye,delta:q,draggingRect:Ke,pointerCoordinates:We,scrollableAncestors:ce,scrollableAncestorRects:qe});const He=A.useMemo(()=>({active:Y,activeNode:re,activeNodeRect:ue,activatorEvent:I,collisions:Je,containerNodeRect:Se,dragOverlay:ke,draggableNodes:N,droppableContainers:R,droppableRects:z,over:an,measureDroppableContainers:X,scrollableAncestors:ce,scrollableAncestorRects:qe,measuringConfiguration:G,measuringScheduled:ee,windowRect:Pe}),[Y,re,ue,I,Je,Se,ke,N,R,z,an,X,ce,qe,G,ee,Pe]),Dn=A.useMemo(()=>({activatorEvent:I,activators:Re,active:Y,activeNodeRect:ue,ariaDescribedById:{draggable:D},dispatch:_,draggableNodes:N,over:an,measureDroppableContainers:X}),[I,Re,Y,ue,_,D,N,an,X]);return Q.createElement(hF.Provider,{value:x},Q.createElement(cp.Provider,{value:Dn},Q.createElement(TF.Provider,{value:He},Q.createElement(s0.Provider,{value:vn},f)),Q.createElement(Tae,{disabled:(l==null?void 0:l.restoreFocus)===!1})),Q.createElement(Pre,{...l,hiddenTextDescribedById:D}));function kn(){const bn=($==null?void 0:$.autoScrollEnabled)===!1,_n=typeof c=="object"?c.enabled===!1:c===!1,ft=O&&!bn&&!_n;return typeof c=="object"?{...c,enabled:ft}:{enabled:ft}}}),Pae=A.createContext(null),lM="button",Nae="Draggable";function $ae(e){let{id:n,data:t,disabled:i=!1,attributes:r}=e;const a=up(Nae),{activators:o,activatorEvent:l,active:c,activeNodeRect:f,ariaDescribedById:h,draggableNodes:d,over:p}=A.useContext(cp),{role:v=lM,roleDescription:b="draggable",tabIndex:w=0}=r??{},k=(c==null?void 0:c.id)===n,_=A.useContext(k?s0:Pae),[C,x]=qg(),[E,j]=qg(),O=_ae(o,n),M=im(t);Wa(()=>(d.set(n,{id:n,key:a,node:C,activatorNode:E,data:M}),()=>{const q=d.get(n);q&&q.key===a&&d.delete(n)}),[d,n]);const N=A.useMemo(()=>({role:v,tabIndex:w,"aria-disabled":i,"aria-pressed":k&&v===lM?!0:void 0,"aria-roledescription":b,"aria-describedby":h.draggable}),[i,v,w,k,b,h.draggable]);return{active:c,activatorEvent:l,activeNodeRect:f,attributes:N,isDragging:k,listeners:i?void 0:O,node:C,over:p,setNodeRef:x,setActivatorNodeRef:j,transform:_}}function DF(){return A.useContext(TF)}const zae="Droppable",Lae={timeout:25};function Iae(e){let{data:n,disabled:t=!1,id:i,resizeObserverConfig:r}=e;const a=up(zae),{active:o,dispatch:l,over:c,measureDroppableContainers:f}=A.useContext(cp),h=A.useRef({disabled:t}),d=A.useRef(!1),p=A.useRef(null),v=A.useRef(null),{disabled:b,updateMeasurementsFor:w,timeout:k}={...Lae,...r},_=im(w??i),C=A.useCallback(()=>{if(!d.current){d.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{f(Array.isArray(_.current)?_.current:[_.current]),v.current=null},k)},[k]),x=o0({callback:C,disabled:b||!o}),E=A.useCallback((N,q)=>{x&&(q&&(x.unobserve(q),d.current=!1),N&&x.observe(N))},[x]),[j,O]=qg(E),M=im(n);return A.useEffect(()=>{!x||!j.current||(x.disconnect(),d.current=!1,x.observe(j.current))},[j,x]),A.useEffect(()=>(l({type:xi.RegisterDroppable,element:{id:i,key:a,disabled:t,node:j,rect:p,data:M}}),()=>l({type:xi.UnregisterDroppable,key:a,id:i})),[i]),A.useEffect(()=>{t!==h.current.disabled&&(l({type:xi.SetDroppableDisabled,id:i,key:a,disabled:t}),h.current.disabled=t)},[i,a,t,l]),{active:o,rect:p,isOver:(c==null?void 0:c.id)===i,node:j,over:c,setNodeRef:O}}function Bae(e){let{animation:n,children:t}=e;const[i,r]=A.useState(null),[a,o]=A.useState(null),l=Hg(t);return!t&&!i&&l&&r(l),Wa(()=>{if(!a)return;const c=i==null?void 0:i.key,f=i==null?void 0:i.props.id;if(c==null||f==null){r(null);return}Promise.resolve(n(f,a)).then(()=>{r(null)})},[n,i,a]),Q.createElement(Q.Fragment,null,t,i?A.cloneElement(i,{ref:o}):null)}const Fae={x:0,y:0,scaleX:1,scaleY:1};function qae(e){let{children:n}=e;return Q.createElement(cp.Provider,{value:EF},Q.createElement(s0.Provider,{value:Fae},n))}const Hae={position:"fixed",touchAction:"none"},Uae=e=>r0(e)?"transform 250ms ease":void 0,Vae=A.forwardRef((e,n)=>{let{as:t,activatorEvent:i,adjustScale:r,children:a,className:o,rect:l,style:c,transform:f,transition:h=Uae}=e;if(!l)return null;const d=r?f:{...f,scaleX:1,scaleY:1},p={...Hae,width:l.width,height:l.height,top:l.top,left:l.left,transform:yo.Transform.toString(d),transformOrigin:r&&i?$re(i,l):void 0,transition:typeof h=="function"?h(i):h,...c};return Q.createElement(t,{className:o,style:p,ref:n},a)}),Wae=e=>n=>{let{active:t,dragOverlay:i}=n;const r={},{styles:a,className:o}=e;if(a!=null&&a.active)for(const[l,c]of Object.entries(a.active))c!==void 0&&(r[l]=t.node.style.getPropertyValue(l),t.node.style.setProperty(l,c));if(a!=null&&a.dragOverlay)for(const[l,c]of Object.entries(a.dragOverlay))c!==void 0&&i.node.style.setProperty(l,c);return o!=null&&o.active&&t.node.classList.add(o.active),o!=null&&o.dragOverlay&&i.node.classList.add(o.dragOverlay),function(){for(const[c,f]of Object.entries(r))t.node.style.setProperty(c,f);o!=null&&o.active&&t.node.classList.remove(o.active)}},Gae=e=>{let{transform:{initial:n,final:t}}=e;return[{transform:yo.Transform.toString(n)},{transform:yo.Transform.toString(t)}]},Yae={duration:250,easing:"ease",keyframes:Gae,sideEffects:Wae({styles:{active:{opacity:"0"}}})};function Kae(e){let{config:n,draggableNodes:t,droppableContainers:i,measuringConfiguration:r}=e;return i0((a,o)=>{if(n===null)return;const l=t.get(a);if(!l)return;const c=l.node.current;if(!c)return;const f=OF(o);if(!f)return;const{transform:h}=mr(o).getComputedStyle(o),d=yF(h);if(!d)return;const p=typeof n=="function"?n:Xae(n);return CF(c,r.draggable.measure),p({active:{id:a,data:l.data,node:c,rect:r.draggable.measure(c)},draggableNodes:t,dragOverlay:{node:o,rect:r.dragOverlay.measure(f)},droppableContainers:i,measuringConfiguration:r,transform:d})})}function Xae(e){const{duration:n,easing:t,sideEffects:i,keyframes:r}={...Yae,...e};return a=>{let{active:o,dragOverlay:l,transform:c,...f}=a;if(!n)return;const h={x:l.rect.left-o.rect.left,y:l.rect.top-o.rect.top},d={scaleX:c.scaleX!==1?o.rect.width*c.scaleX/l.rect.width:1,scaleY:c.scaleY!==1?o.rect.height*c.scaleY/l.rect.height:1},p={x:c.x-h.x,y:c.y-h.y,...d},v=r({...f,active:o,dragOverlay:l,transform:{initial:c,final:p}}),[b]=v,w=v[v.length-1];if(JSON.stringify(b)===JSON.stringify(w))return;const k=i==null?void 0:i({active:o,dragOverlay:l,...f}),_=l.node.animate(v,{duration:n,easing:t,fill:"forwards"});return new Promise(C=>{_.onfinish=()=>{k==null||k(),C()}})}}let uM=0;function Zae(e){return A.useMemo(()=>{if(e!=null)return uM++,uM},[e])}const Qae=Q.memo(e=>{let{adjustScale:n=!1,children:t,dropAnimation:i,style:r,transition:a,modifiers:o,wrapperElement:l="div",className:c,zIndex:f=999}=e;const{activatorEvent:h,active:d,activeNodeRect:p,containerNodeRect:v,draggableNodes:b,droppableContainers:w,dragOverlay:k,over:_,measuringConfiguration:C,scrollableAncestors:x,scrollableAncestorRects:E,windowRect:j}=DF(),O=A.useContext(s0),M=Zae(d==null?void 0:d.id),N=MF(o,{activatorEvent:h,active:d,activeNodeRect:p,containerNodeRect:v,draggingNodeRect:k.rect,over:_,overlayNodeRect:k.rect,scrollableAncestors:x,scrollableAncestorRects:E,transform:O,windowRect:j}),q=u9(p),R=Kae({config:i,draggableNodes:b,droppableContainers:w,measuringConfiguration:C}),L=q?k.setRef:void 0;return Q.createElement(qae,null,Q.createElement(Bae,{animation:R},d&&M?Q.createElement(Vae,{key:M,id:d.id,ref:L,as:l,activatorEvent:h,adjustScale:n,className:c,transition:a,rect:q,style:{zIndex:f,...r},transform:N},t):null))});function Gg(e,n,t){const i=e.slice();return i.splice(t<0?i.length+t:t,0,i.splice(n,1)[0]),i}function Jae(e,n){return e.reduce((t,i,r)=>{const a=n.get(i);return a&&(t[r]=a),t},Array(e.length))}function Uv(e){return e!==null&&e>=0}function eoe(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{var n;let{rects:t,activeNodeRect:i,activeIndex:r,overIndex:a,index:o}=e;const l=(n=t[r])!=null?n:i;if(!l)return null;const c=ioe(t,o,r);if(o===r){const f=t[a];return f?{x:rr&&o<=a?{x:-l.width-c,y:0,...Vv}:o=a?{x:l.width+c,y:0,...Vv}:{x:0,y:0,...Vv}};function ioe(e,n,t){const i=e[n],r=e[n-1],a=e[n+1];return!i||!r&&!a?0:t{let{rects:n,activeIndex:t,overIndex:i,index:r}=e;const a=Gg(n,i,t),o=n[r],l=a[r];return!l||!o?null:{x:l.left-o.left,y:l.top-o.top,scaleX:l.width/o.width,scaleY:l.height/o.height}},Wv={scaleX:1,scaleY:1},PF=e=>{var n;let{activeIndex:t,activeNodeRect:i,index:r,rects:a,overIndex:o}=e;const l=(n=a[t])!=null?n:i;if(!l)return null;if(r===t){const f=a[o];return f?{x:0,y:tt&&r<=o?{x:0,y:-l.height-c,...Wv}:r=o?{x:0,y:l.height+c,...Wv}:{x:0,y:0,...Wv}};function roe(e,n,t){const i=e[n],r=e[n-1],a=e[n+1];return i?ti.map(O=>typeof O=="object"&&"id"in O?O.id:O),[i]),b=o!=null,w=o?v.indexOf(o.id):-1,k=f?v.indexOf(f.id):-1,_=A.useRef(v),C=!eoe(v,_.current),x=k!==-1&&w===-1||C,E=noe(a);Wa(()=>{C&&b&&h(v)},[C,v,b,h]),A.useEffect(()=>{_.current=v},[v]);const j=A.useMemo(()=>({activeIndex:w,containerId:d,disabled:E,disableTransforms:x,items:v,overIndex:k,useDragOverlay:p,sortedRects:Jae(v,c),strategy:r}),[w,d,E.draggable,E.droppable,x,v,k,c,p,r]);return Q.createElement($F.Provider,{value:j},n)}const aoe=e=>{let{id:n,items:t,activeIndex:i,overIndex:r}=e;return Gg(t,i,r).indexOf(n)},ooe=e=>{let{containerId:n,isSorting:t,wasDragging:i,index:r,items:a,newIndex:o,previousItems:l,previousContainerId:c,transition:f}=e;return!f||!i||l!==a&&r===o?!1:t?!0:o!==r&&n===c},soe={duration:200,easing:"ease"},zF="transform",loe=yo.Transition.toString({property:zF,duration:0,easing:"linear"}),uoe={roleDescription:"sortable"};function coe(e){let{disabled:n,index:t,node:i,rect:r}=e;const[a,o]=A.useState(null),l=A.useRef(t);return Wa(()=>{if(!n&&t!==l.current&&i.current){const c=r.current;if(c){const f=Xf(i.current,{ignoreTransform:!0}),h={x:c.left-f.left,y:c.top-f.top,scaleX:c.width/f.width,scaleY:c.height/f.height};(h.x||h.y)&&o(h)}}t!==l.current&&(l.current=t)},[n,t,i,r]),A.useEffect(()=>{a&&o(null)},[a]),a}function LF(e){let{animateLayoutChanges:n=ooe,attributes:t,disabled:i,data:r,getNewIndex:a=aoe,id:o,strategy:l,resizeObserverConfig:c,transition:f=soe}=e;const{items:h,containerId:d,activeIndex:p,disabled:v,disableTransforms:b,sortedRects:w,overIndex:k,useDragOverlay:_,strategy:C}=A.useContext($F),x=foe(i,v),E=h.indexOf(o),j=A.useMemo(()=>({sortable:{containerId:d,index:E,items:h},...r}),[d,r,E,h]),O=A.useMemo(()=>h.slice(h.indexOf(o)),[h,o]),{rect:M,node:N,isOver:q,setNodeRef:R}=Iae({id:o,data:j,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...c}}),{active:L,activatorEvent:F,activeNodeRect:Y,attributes:V,setNodeRef:$,listeners:P,isDragging:I,over:H,setActivatorNodeRef:U,transform:D}=$ae({id:o,data:j,attributes:{...uoe,...t},disabled:x.draggable}),W=kre(R,$),G=!!L,z=G&&!b&&Uv(p)&&Uv(k),X=!_&&I,ee=X&&z?D:null,le=z?ee??(l??C)({rects:w,activeNodeRect:Y,activeIndex:p,overIndex:k,index:E}):null,ye=Uv(p)&&Uv(k)?a({id:o,items:h,activeIndex:p,overIndex:k}):E,ae=L==null?void 0:L.id,ue=A.useRef({activeId:ae,items:h,newIndex:ye,containerId:d}),Se=h!==ue.current.items,ne=n({active:L,containerId:d,isDragging:I,isSorting:G,id:o,index:E,items:h,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:f,wasDragging:ue.current.activeId!=null}),Le=coe({disabled:!ne,index:E,node:N,rect:M});return A.useEffect(()=>{G&&ue.current.newIndex!==ye&&(ue.current.newIndex=ye),d!==ue.current.containerId&&(ue.current.containerId=d),h!==ue.current.items&&(ue.current.items=h)},[G,ye,d,h]),A.useEffect(()=>{if(ae===ue.current.activeId)return;if(ae!=null&&ue.current.activeId==null){ue.current.activeId=ae;return}const je=setTimeout(()=>{ue.current.activeId=ae},50);return()=>clearTimeout(je)},[ae]),{active:L,activeIndex:p,attributes:V,data:j,rect:M,index:E,newIndex:ye,items:h,isOver:q,isSorting:G,isDragging:I,listeners:P,node:N,overIndex:k,over:H,setNodeRef:W,setActivatorNodeRef:U,setDroppableNodeRef:R,setDraggableNodeRef:$,transform:Le??le,transition:ke()};function ke(){if(Le||Se&&ue.current.newIndex===E)return loe;if(!(X&&!r0(F)||!f)&&(G||ne))return yo.Transition.toString({...f,property:zF})}}function foe(e,n){var t,i;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e==null?void 0:e.draggable)!=null?t:n.draggable,droppable:(i=e==null?void 0:e.droppable)!=null?i:n.droppable}}function Yg(e){if(!e)return!1;const n=e.data.current;return!!(n&&"sortable"in n&&typeof n.sortable=="object"&&"containerId"in n.sortable&&"items"in n.sortable&&"index"in n.sortable)}const doe=[ot.Down,ot.Right,ot.Up,ot.Left],hoe=(e,n)=>{let{context:{active:t,collisionRect:i,droppableRects:r,droppableContainers:a,over:o,scrollableAncestors:l}}=n;if(doe.includes(e.code)){if(e.preventDefault(),!t||!i)return;const c=[];a.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=r.get(d.id);if(p)switch(e.code){case ot.Down:i.topp.top&&c.push(d);break;case ot.Left:i.left>p.left&&c.push(d);break;case ot.Right:i.left1&&(h=f[1].id),h!=null){const d=a.get(t.id),p=a.get(h),v=p?r.get(p.id):null,b=p==null?void 0:p.node.current;if(b&&v&&d&&p){const k=a0(b).some((O,M)=>l[M]!==O),_=IF(d,p),C=moe(d,p),x=k||!_?{x:0,y:0}:{x:C?i.width-v.width:0,y:C?i.height-v.height:0},E={x:v.left,y:v.top};return x.x&&x.y?E:rm(E,x)}}}};function IF(e,n){return!Yg(e)||!Yg(n)?!1:e.data.current.sortable.containerId===n.data.current.sortable.containerId}function moe(e,n){return!Yg(e)||!Yg(n)||!IF(e,n)?!1:e.data.current.sortable.index=$?V:""+Array($+1-I.length).join(P)+V},E={s:x,z:function(V){var $=-V.utcOffset(),P=Math.abs($),I=Math.floor(P/60),H=P%60;return($<=0?"+":"-")+x(I,2,"0")+":"+x(H,2,"0")},m:function V($,P){if($.date()1)return V(D[0])}else{var W=$.name;O[W]=$,H=W}return!I&&H&&(j=H),H||!I&&j},R=function(V,$){if(N(V))return V.clone();var P=typeof $=="object"?$:{};return P.date=V,P.args=arguments,new F(P)},L=E;L.l=q,L.i=N,L.w=function(V,$){return R(V,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var F=(function(){function V(P){this.$L=q(P.locale,null,!0),this.parse(P),this.$x=this.$x||P.x||{},this[M]=!0}var $=V.prototype;return $.parse=function(P){this.$d=(function(I){var H=I.date,U=I.utc;if(H===null)return new Date(NaN);if(L.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var D=H.match(k);if(D){var W=D[2]-1||0,G=(D[7]||"0").substring(0,3);return U?new Date(Date.UTC(D[1],W,D[3]||1,D[4]||0,D[5]||0,D[6]||0,G)):new Date(D[1],W,D[3]||1,D[4]||0,D[5]||0,D[6]||0,G)}}return new Date(H)})(P),this.init()},$.init=function(){var P=this.$d;this.$y=P.getFullYear(),this.$M=P.getMonth(),this.$D=P.getDate(),this.$W=P.getDay(),this.$H=P.getHours(),this.$m=P.getMinutes(),this.$s=P.getSeconds(),this.$ms=P.getMilliseconds()},$.$utils=function(){return L},$.isValid=function(){return this.$d.toString()!==w},$.isSame=function(P,I){var H=R(P);return this.startOf(I)<=H&&H<=this.endOf(I)},$.isAfter=function(P,I){return R(P)Ie(o).locale(t).format(i);return e==="default"?n===null?"":a(n):e==="multiple"?n.map(a).join(", "):e==="range"&&Array.isArray(n)?n[0]&&n[1]?`${a(n[0])} ${r} ${a(n[1])}`:n[0]?`${a(n[0])} ${r} `:"":""}function boe({formatter:e,...n}){return(e||yoe)(n)}function woe({direction:e,levelIndex:n,rowIndex:t,cellIndex:i,size:r}){switch(e){case"up":return n===0&&t===0?null:t===0?{levelIndex:n-1,rowIndex:i<=r[n-1][r[n-1].length-1]-1?r[n-1].length-1:r[n-1].length-2,cellIndex:i}:{levelIndex:n,rowIndex:t-1,cellIndex:i};case"down":return t===r[n].length-1?{levelIndex:n+1,rowIndex:0,cellIndex:i}:t===r[n].length-2&&i>=r[n][r[n].length-1]?{levelIndex:n+1,rowIndex:0,cellIndex:i}:{levelIndex:n,rowIndex:t+1,cellIndex:i};case"left":return n===0&&t===0&&i===0?null:t===0&&i===0?{levelIndex:n-1,rowIndex:r[n-1].length-1,cellIndex:r[n-1][r[n-1].length-1]-1}:i===0?{levelIndex:n,rowIndex:t-1,cellIndex:r[n][t-1]-1}:{levelIndex:n,rowIndex:t,cellIndex:i-1};case"right":return t===r[n].length-1&&i===r[n][t]-1?{levelIndex:n+1,rowIndex:0,cellIndex:0}:i===r[n][t]-1?{levelIndex:n,rowIndex:t+1,cellIndex:0}:{levelIndex:n,rowIndex:t,cellIndex:i+1};default:return{levelIndex:n,rowIndex:t,cellIndex:i}}}function BF({controlsRef:e,direction:n,levelIndex:t,rowIndex:i,cellIndex:r,size:a}){var c,f,h;const o=woe({direction:n,size:a,rowIndex:i,cellIndex:r,levelIndex:t});if(!o)return;const l=(h=(f=(c=e.current)==null?void 0:c[o.levelIndex])==null?void 0:f[o.rowIndex])==null?void 0:h[o.cellIndex];l&&(l.disabled||l.getAttribute("data-hidden")||l.getAttribute("data-outside")?BF({controlsRef:e,direction:n,levelIndex:o.levelIndex,cellIndex:o.cellIndex,rowIndex:o.rowIndex,size:a}):l.focus())}function koe(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function _oe(e){var n;return(n=e.current)==null?void 0:n.map(t=>t.map(i=>i.length))}function c9({controlsRef:e,levelIndex:n,rowIndex:t,cellIndex:i,event:r}){const a=koe(r.key);a&&(r.preventDefault(),BF({controlsRef:e,direction:a,levelIndex:n,rowIndex:t,cellIndex:i,size:_oe(e)}))}function Ji(e){return e==null||e===""?e:Ie(e).format("YYYY-MM-DD")}function FF(e){return e==null||e===""?e:Ie(e).format("YYYY-MM-DD HH:mm:ss")}function HS({minDate:e,maxDate:n}){const t=Ie();return!e&&!n?Ji(t):e&&Ie(t).isBefore(e)?Ji(e):n&&Ie(t).isAfter(n)?Ji(n):Ji(t)}const xoe={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Soe=A.createContext(xoe);function Sl(){const e=A.use(Soe),n=A.useCallback(a=>a||e.locale,[e.locale]),t=A.useCallback(a=>typeof a=="number"?a:e.firstDayOfWeek,[e.firstDayOfWeek]),i=A.useCallback(a=>Array.isArray(a)?a:e.weekendDays,[e.weekendDays]),r=A.useCallback(a=>typeof a=="string"?a:e.labelSeparator,[e.labelSeparator]);return{...e,getLocale:n,getFirstDayOfWeek:t,getWeekendDays:i,getLabelSeparator:r}}function Coe({value:e,type:n,withTime:t}){const i=t?FF:Ji;if(n==="range"&&Array.isArray(e)){const r=i(e[0]),a=i(e[1]);return r?a?`${r} – ${a}`:`${r} –`:""}return n==="multiple"&&Array.isArray(e)?e.filter(Boolean).join(", "):!Array.isArray(e)&&e?i(e):""}function qF({value:e,type:n,name:t,form:i,withTime:r=!1}){return g.jsx("input",{type:"hidden",value:Coe({value:e,type:n,withTime:r}),name:t,form:i})}qF.displayName="@mantine/dates/HiddenDatesInput";var HF={day:"m_396ce5cb"};const UF=(e,{size:n})=>({day:{"--day-size":Bn(n,"day-size")}}),l0=De(e=>{const n=be("Day",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,date:c,disabled:f,__staticSelector:h,weekend:d,outside:p,selected:v,renderDay:b,inRange:w,firstInRange:k,lastInRange:_,hidden:C,static:x,highlightToday:E,fullWidth:j,attributes:O,...M}=n;return g.jsx(Et,{...Xe({name:h||"Day",classes:HF,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:O,vars:l,varsResolver:UF,rootSelector:"day"})("day",{style:C?{display:"none"}:void 0}),component:x?"div":"button",disabled:f,"data-today":Ie(c).isSame(new Date,"day")||void 0,"data-hidden":C||void 0,"data-highlight-today":E||void 0,"data-disabled":f||void 0,"data-weekend":!f&&!p&&d||void 0,"data-outside":!f&&p||void 0,"data-selected":!f&&v||void 0,"data-in-range":w&&!f||void 0,"data-first-in-range":k&&!f||void 0,"data-last-in-range":_&&!f||void 0,"data-static":x||void 0,"data-full-width":j||void 0,unstyled:o,...M,children:(b==null?void 0:b(c))||Ie(c).date()})});l0.classes=HF;l0.varsResolver=UF;l0.displayName="@mantine/dates/Day";function Aoe({locale:e,format:n="dd",firstDayOfWeek:t=1}){const i=Ie().day(t),r=[];for(let a=0;a<7;a+=1)typeof n=="string"?r.push(Ie(i).add(a,"days").locale(e).format(n)):r.push(n(Ie(i).add(a,"days").format("YYYY-MM-DD")));return r}var VF={weekday:"m_18a3eca"};const WF=(e,{size:n})=>({weekdaysRow:{"--wr-fz":ri(n),"--wr-spacing":Vt(n)}}),u0=De(e=>{const n=be("WeekdaysRow",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,locale:c,firstDayOfWeek:f,weekdayFormat:h,cellComponent:d="th",__staticSelector:p,withWeekNumbers:v,attributes:b,...w}=n,k=Xe({name:p||"WeekdaysRow",classes:VF,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:b,vars:l,varsResolver:WF,rootSelector:"weekdaysRow"}),_=Sl(),C=Aoe({locale:_.getLocale(c),format:h,firstDayOfWeek:_.getFirstDayOfWeek(f)}).map((x,E)=>g.jsx(d,{...k("weekday"),children:x},E));return g.jsxs(he,{component:"tr",...k("weekdaysRow"),...w,children:[v&&g.jsx(d,{...k("weekday"),children:"#"}),C]})});u0.classes=VF;u0.varsResolver=WF;u0.displayName="@mantine/dates/WeekdaysRow";function joe(e,n=1){let t=Ie(e);if(!t.isValid())return t;const i=n===0?6:n-1;for(;t.day()!==i;)t=t.add(1,"day");return t.format("YYYY-MM-DD")}function Ooe(e,n=1){let t=Ie(e);for(;t.day()!==n;)t=t.subtract(1,"day");return t.format("YYYY-MM-DD")}function Eoe({month:e,firstDayOfWeek:n=1,consistentWeeks:t}){const i=Ie(Ie(e).subtract(Ie(e).date()-1,"day").format("YYYY-M-D")),r=i.format("YYYY-MM-DD"),a=joe(i.add(+i.daysInMonth()-1,"day").format("YYYY-MM-DD"),n),o=[];let l=Ie(Ooe(r,n));for(;Ie(l).isBefore(a,"day");){const c=[];for(let f=0;f<7;f+=1)c.push(l.format("YYYY-MM-DD")),l=l.add(1,"day");o.push(c)}if(t&&o.length<6){const c=o[o.length-1],f=c[c.length-1];let h=Ie(f).add(1,"day");for(;o.length<6;){const d=[];for(let p=0;p<7;p+=1)d.push(h.format("YYYY-MM-DD")),h=h.add(1,"day");o.push(d)}}return o}function f9(e,n){return Ie(e).format("YYYY-MM")===Ie(n).format("YYYY-MM")}function GF(e,n){return n?Ie(e).isAfter(Ie(n).subtract(1,"day"),"day"):!0}function YF(e,n){return n?Ie(e).isBefore(Ie(n).add(1,"day"),"day"):!0}function Toe({dates:e,minDate:n,maxDate:t,getDayProps:i,excludeDate:r,hideOutsideDates:a,month:o}){const l=e.flat().filter(h=>{var d;return YF(h,t)&&GF(h,n)&&!(r!=null&&r(h))&&!((d=i==null?void 0:i(h))!=null&&d.disabled)&&(!a||f9(h,o))}),c=l.find(h=>{var d;return(d=i==null?void 0:i(h))==null?void 0:d.selected});if(c)return c;const f=l.find(h=>Ie().isSame(h,"date"));return f||l[0]}var Ag={exports:{}},Moe=Ag.exports,fM;function Doe(){return fM||(fM=1,(function(e,n){(function(t,i){e.exports=i()})(Moe,(function(){var t="day";return function(i,r,a){var o=function(f){return f.add(4-f.isoWeekday(),t)},l=r.prototype;l.isoWeekYear=function(){return o(this).year()},l.isoWeek=function(f){if(!this.$utils().u(f))return this.add(7*(f-this.isoWeek()),t);var h,d,p,v,b=o(this),w=(h=this.isoWeekYear(),d=this.$u,p=(d?a.utc:a)().year(h).startOf("year"),v=4-p.isoWeekday(),p.isoWeekday()>4&&(v+=7),p.add(v,t));return b.diff(w,"week")+1},l.isoWeekday=function(f){return this.$utils().u(f)?this.day()||7:this.day(this.day()%7?f:f-7)};var c=l.startOf;l.startOf=function(f,h){var d=this.$utils(),p=!!d.u(h)||h;return d.p(f)==="isoweek"?p?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):c.bind(this)(f,h)}}}))})(Ag)),Ag.exports}var Roe=Doe();const Poe=yt(Roe);Ie.extend(Poe);function Noe(e){return Ie(e.find(n=>Ie(n).day()===1)).isoWeek()}var KF={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const $oe={withCellSpacing:!0},XF=(e,{size:n})=>({weekNumber:{"--wn-fz":ri(n),"--wn-size":Bn(n,"wn-size")}}),fp=De(e=>{const n=be("Month",$oe,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:c,locale:f,firstDayOfWeek:h,weekdayFormat:d,month:p,weekendDays:v,getDayProps:b,excludeDate:w,minDate:k,maxDate:_,renderDay:C,hideOutsideDates:x,hideWeekdays:E,getDayAriaLabel:j,static:O,__getDayRef:M,__onDayKeyDown:N,__onDayClick:q,__onDayMouseEnter:R,__preventFocus:L,__stopPropagation:F,withCellSpacing:Y,size:V,highlightToday:$,withWeekNumbers:P,fullWidth:I,attributes:H,...U}=n,D=Xe({name:c||"Month",classes:KF,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:H,vars:l,varsResolver:XF,rootSelector:"month"}),W=Sl(),G=Eoe({month:p,firstDayOfWeek:W.getFirstDayOfWeek(h),consistentWeeks:W.consistentWeeks}),z=Toe({dates:G,minDate:Ji(k),maxDate:Ji(_),getDayProps:b,excludeDate:w,hideOutsideDates:x,month:p}),{resolvedClassNames:X,resolvedStyles:ee}=Wi({classNames:t,styles:a,props:n}),re=G.map((le,ye)=>{const ae=le.map((ue,Se)=>{const ne=!f9(ue,p),Le=(j==null?void 0:j(ue))||Ie(ue).locale(f||W.locale).format("D MMMM YYYY"),ke=b==null?void 0:b(ue),je=Ie(ue).isSame(z,"date");return g.jsx("td",{...D("monthCell"),"data-with-spacing":Y||void 0,children:g.jsx(l0,{__staticSelector:c||"Month",classNames:X,styles:ee,attributes:H,unstyled:o,"data-mantine-stop-propagation":F||void 0,highlightToday:$,renderDay:C,date:ue,size:V,weekend:W.getWeekendDays(v).includes(Ie(ue).get("day")),outside:ne,hidden:x?ne:!1,"aria-label":Le,static:O,fullWidth:I,disabled:(w==null?void 0:w(ue))||!YF(ue,Ji(_))||!GF(ue,Ji(k)),ref:Ne=>{Ne&&(M==null||M(ye,Se,Ne))},...ke,onKeyDown:Ne=>{var ge;(ge=ke==null?void 0:ke.onKeyDown)==null||ge.call(ke,Ne),N==null||N(Ne,{rowIndex:ye,cellIndex:Se,date:ue})},onMouseEnter:Ne=>{var ge;(ge=ke==null?void 0:ke.onMouseEnter)==null||ge.call(ke,Ne),R==null||R(Ne,ue)},onClick:Ne=>{var ge;(ge=ke==null?void 0:ke.onClick)==null||ge.call(ke,Ne),q==null||q(Ne,ue)},onMouseDown:Ne=>{var ge;(ge=ke==null?void 0:ke.onMouseDown)==null||ge.call(ke,Ne),L&&Ne.preventDefault()},tabIndex:L||!je?-1:0})},ue.toString())});return g.jsxs("tr",{...D("monthRow"),children:[P&&g.jsx("td",{...D("weekNumber"),children:Noe(le)}),ae]},ye)});return g.jsxs(he,{component:"table",...D("month"),size:V,"data-full-width":I||void 0,...U,children:[!E&&g.jsx("thead",{...D("monthThead"),children:g.jsx(u0,{__staticSelector:c||"Month",locale:f,firstDayOfWeek:h,weekdayFormat:d,withWeekNumbers:P,size:V,classNames:X,styles:ee,unstyled:o,attributes:H})}),g.jsx("tbody",{...D("monthTbody"),children:re})]})});fp.classes=KF;fp.varsResolver=XF;fp.displayName="@mantine/dates/Month";var ZF={pickerControl:"m_dc6a3c71"};const QF=(e,{size:n})=>({pickerControl:{"--dpc-fz":ri(n),"--dpc-size":Bn(n,"dpc-size")}}),dp=De(e=>{const n=be("PickerControl",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,firstInRange:c,lastInRange:f,inRange:h,__staticSelector:d,selected:p,disabled:v,fullWidth:b,attributes:w,...k}=n;return g.jsx(Et,{...Xe({name:d||"PickerControl",classes:ZF,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:w,vars:l,varsResolver:QF,rootSelector:"pickerControl"})("pickerControl"),unstyled:o,"data-picker-control":!0,"data-full-width":b||void 0,"data-selected":p&&!v||void 0,"data-disabled":v||void 0,"data-in-range":h&&!v&&!p||void 0,"data-first-in-range":c&&!v||void 0,"data-last-in-range":f&&!v||void 0,disabled:v,...k})});dp.classes=ZF;dp.varsResolver=QF;dp.displayName="@mantine/dates/PickerControl";function JF({year:e,minDate:n,maxDate:t}){return!n&&!t?!1:!!(n&&Ie(e).isBefore(n,"year")||t&&Ie(e).isAfter(t,"year"))}function zoe({years:e,minDate:n,maxDate:t,getYearControlProps:i}){const r=e.flat().filter(l=>{var c;return!JF({year:l,minDate:n,maxDate:t})&&!((c=i==null?void 0:i(l))!=null&&c.disabled)}),a=r.find(l=>{var c;return(c=i==null?void 0:i(l))==null?void 0:c.selected});if(a)return a;const o=r.find(l=>Ie().isSame(l,"year"));return o||r[0]}function eq(e){const n=Ie(e).year(),t=n-n%10;let i=0;const r=[[],[],[],[]];for(let a=0;a<4;a+=1){const o=a===3?1:3;for(let l=0;l{const n=be("YearsList",Loe,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,decade:c,yearsListFormat:f,locale:h,minDate:d,maxDate:p,getYearControlProps:v,__staticSelector:b,__getControlRef:w,__onControlKeyDown:k,__onControlClick:_,__onControlMouseEnter:C,__preventFocus:x,__stopPropagation:E,withCellSpacing:j,fullWidth:O,size:M,attributes:N,...q}=n,R=Xe({name:b||"YearsList",classes:nq,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:N,vars:l,rootSelector:"yearsList"}),L=Sl(),F=eq(c),Y=zoe({years:F,minDate:d,maxDate:p,getYearControlProps:v}),V=F.map(($,P)=>{const I=$.map((H,U)=>{const D=v==null?void 0:v(H),W=Ie(H).isSame(Y,"year");return g.jsx("td",{...R("yearsListCell"),"data-with-spacing":j||void 0,children:g.jsx(dp,{...R("yearsListControl"),size:M,unstyled:o,fullWidth:O,"data-mantine-stop-propagation":E||void 0,disabled:JF({year:H,minDate:d,maxDate:p}),ref:G=>{G&&(w==null||w(P,U,G))},...D,onKeyDown:G=>{var z;(z=D==null?void 0:D.onKeyDown)==null||z.call(D,G),k==null||k(G,{rowIndex:P,cellIndex:U,date:H})},onClick:G=>{var z;(z=D==null?void 0:D.onClick)==null||z.call(D,G),_==null||_(G,H)},onMouseEnter:G=>{var z;(z=D==null?void 0:D.onMouseEnter)==null||z.call(D,G),C==null||C(G,H)},onMouseDown:G=>{var z;(z=D==null?void 0:D.onMouseDown)==null||z.call(D,G),x&&G.preventDefault()},tabIndex:x||!W?-1:0,children:(D==null?void 0:D.children)??Ie(H).locale(L.getLocale(h)).format(f)})},U)});return g.jsx("tr",{...R("yearsListRow"),children:I},P)});return g.jsx(he,{component:"table",size:M,...R("yearsList"),"data-full-width":O||void 0,...q,children:g.jsx("tbody",{children:V})})});c0.classes=nq;c0.displayName="@mantine/dates/YearsList";function tq({month:e,minDate:n,maxDate:t}){return!n&&!t?!1:!!(n&&Ie(e).isBefore(n,"month")||t&&Ie(e).isAfter(t,"month"))}function Ioe({months:e,minDate:n,maxDate:t,getMonthControlProps:i}){const r=e.flat().filter(l=>{var c;return!tq({month:l,minDate:n,maxDate:t})&&!((c=i==null?void 0:i(l))!=null&&c.disabled)}),a=r.find(l=>{var c;return(c=i==null?void 0:i(l))==null?void 0:c.selected});if(a)return a;const o=r.find(l=>Ie().isSame(l,"month"));return o||r[0]}function Boe(e){const n=Ie(e).startOf("year").toDate(),t=[[],[],[],[]];let i=0;for(let r=0;r<4;r+=1)for(let a=0;a<3;a+=1)t[r].push(Ie(n).add(i,"months").format("YYYY-MM-DD")),i+=1;return t}var iq={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Foe={monthsListFormat:"MMM",withCellSpacing:!0},f0=De(e=>{const n=be("MonthsList",Foe,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:c,year:f,monthsListFormat:h,locale:d,minDate:p,maxDate:v,getMonthControlProps:b,__getControlRef:w,__onControlKeyDown:k,__onControlClick:_,__onControlMouseEnter:C,__preventFocus:x,__stopPropagation:E,withCellSpacing:j,fullWidth:O,size:M,attributes:N,...q}=n,R=Xe({name:c||"MonthsList",classes:iq,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:N,vars:l,rootSelector:"monthsList"}),L=Sl(),F=Boe(f),Y=Ioe({months:F,minDate:Ji(p),maxDate:Ji(v),getMonthControlProps:b}),V=F.map(($,P)=>{const I=$.map((H,U)=>{const D=b==null?void 0:b(H),W=Ie(H).isSame(Y,"month");return g.jsx("td",{...R("monthsListCell"),"data-with-spacing":j||void 0,children:g.jsx(dp,{...R("monthsListControl"),size:M,unstyled:o,fullWidth:O,__staticSelector:c||"MonthsList","data-mantine-stop-propagation":E||void 0,disabled:tq({month:H,minDate:Ji(p),maxDate:Ji(v)}),ref:G=>{G&&(w==null||w(P,U,G))},...D,onKeyDown:G=>{var z;(z=D==null?void 0:D.onKeyDown)==null||z.call(D,G),k==null||k(G,{rowIndex:P,cellIndex:U,date:H})},onClick:G=>{var z;(z=D==null?void 0:D.onClick)==null||z.call(D,G),_==null||_(G,H)},onMouseEnter:G=>{var z;(z=D==null?void 0:D.onMouseEnter)==null||z.call(D,G),C==null||C(G,H)},onMouseDown:G=>{var z;(z=D==null?void 0:D.onMouseDown)==null||z.call(D,G),x&&G.preventDefault()},tabIndex:x||!W?-1:0,children:(D==null?void 0:D.children)??Ie(H).locale(L.getLocale(d)).format(h)})},U)});return g.jsx("tr",{...R("monthsListRow"),children:I},P)});return g.jsx(he,{component:"table",size:M,...R("monthsList"),"data-full-width":O||void 0,...q,children:g.jsx("tbody",{children:V})})});f0.classes=iq;f0.displayName="@mantine/dates/MonthsList";var rq={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const qoe={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},aq=(e,{size:n})=>({calendarHeader:{"--dch-control-size":Bn(n,"dch-control-size"),"--dch-fz":ri(n)}}),ws=De(e=>{const n=be("CalendarHeader",qoe,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,nextIcon:c,previousIcon:f,nextLabel:h,previousLabel:d,onNext:p,onPrevious:v,onLevelClick:b,label:w,nextDisabled:k,previousDisabled:_,hasNextLevel:C,levelControlAriaLabel:x,withNext:E,withPrevious:j,headerControlsOrder:O,fullWidth:M,__staticSelector:N,__preventFocus:q,__stopPropagation:R,attributes:L,...F}=n,Y=Xe({name:N||"CalendarHeader",classes:rq,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:L,vars:l,varsResolver:aq,rootSelector:"calendarHeader"}),V=q?U=>U.preventDefault():void 0,$=j&&A.createElement(Et,{...Y("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":d,onClick:v,unstyled:o,onMouseDown:V,disabled:_,"data-disabled":_||void 0,tabIndex:q||_?-1:0,"data-mantine-stop-propagation":R||void 0},f||g.jsx(Bg,{...Y("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),P=A.createElement(Et,{component:C?"button":"div",...Y("calendarHeaderLevel"),key:"level",onClick:C?b:void 0,unstyled:o,onMouseDown:C?V:void 0,disabled:!C,"data-static":!C||void 0,"aria-label":x,tabIndex:q||!C?-1:0,"data-mantine-stop-propagation":R||void 0},w),I=E&&A.createElement(Et,{...Y("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":h,onClick:p,unstyled:o,onMouseDown:V,disabled:k,"data-disabled":k||void 0,tabIndex:q||k?-1:0,"data-mantine-stop-propagation":R||void 0},c||g.jsx(Bg,{...Y("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),H=O.map(U=>U==="previous"?$:U==="level"?P:U==="next"?I:null);return g.jsx(he,{...Y("calendarHeader"),"data-full-width":M||void 0,...F,children:H})});ws.classes=rq;ws.varsResolver=aq;ws.displayName="@mantine/dates/CalendarHeader";function Hoe(e){const n=eq(e);return[n[0][0],n[3][0]]}const Uoe={decadeLabelFormat:"YYYY"},d0=De(e=>{const{decade:n,locale:t,minDate:i,maxDate:r,yearsListFormat:a,getYearControlProps:o,__getControlRef:l,__onControlKeyDown:c,__onControlClick:f,__onControlMouseEnter:h,withCellSpacing:d,__preventFocus:p,nextIcon:v,previousIcon:b,nextLabel:w,previousLabel:k,onNext:_,onPrevious:C,nextDisabled:x,previousDisabled:E,levelControlAriaLabel:j,withNext:O,withPrevious:M,headerControlsOrder:N,decadeLabelFormat:q,classNames:R,styles:L,unstyled:F,__staticSelector:Y,__stopPropagation:V,size:$,fullWidth:P,attributes:I,...H}=be("DecadeLevel",Uoe,e),U=Sl(),[D,W]=Hoe(n),G={__staticSelector:Y||"DecadeLevel",classNames:R,styles:L,unstyled:F,size:$,attributes:I},z=typeof x=="boolean"?x:r?!Ie(W).endOf("year").isBefore(r):!1,X=typeof E=="boolean"?E:i?!Ie(D).startOf("year").isAfter(i):!1,ee=(re,le)=>Ie(re).locale(t||U.locale).format(le);return g.jsxs(he,{"data-decade-level":!0,size:$,...H,children:[g.jsx(ws,{label:typeof q=="function"?q(D,W):`${ee(D,q)} – ${ee(W,q)}`,__preventFocus:p,__stopPropagation:V,nextIcon:v,previousIcon:b,nextLabel:w,previousLabel:k,onNext:_,onPrevious:C,nextDisabled:z,previousDisabled:X,hasNextLevel:!1,levelControlAriaLabel:j,withNext:O,withPrevious:M,headerControlsOrder:N,fullWidth:P,...G}),g.jsx(c0,{decade:n,locale:t,minDate:i,maxDate:r,yearsListFormat:a,getYearControlProps:o,__getControlRef:l,__onControlKeyDown:c,__onControlClick:f,__onControlMouseEnter:h,__preventFocus:p,__stopPropagation:V,withCellSpacing:d,fullWidth:P,...G})]})});d0.classes={...c0.classes,...ws.classes};d0.displayName="@mantine/dates/DecadeLevel";const Voe={yearLabelFormat:"YYYY"},h0=De(e=>{const{year:n,locale:t,minDate:i,maxDate:r,monthsListFormat:a,getMonthControlProps:o,__getControlRef:l,__onControlKeyDown:c,__onControlClick:f,__onControlMouseEnter:h,withCellSpacing:d,__preventFocus:p,nextIcon:v,previousIcon:b,nextLabel:w,previousLabel:k,onNext:_,onPrevious:C,onLevelClick:x,nextDisabled:E,previousDisabled:j,hasNextLevel:O,levelControlAriaLabel:M,withNext:N,withPrevious:q,headerControlsOrder:R,yearLabelFormat:L,__staticSelector:F,__stopPropagation:Y,size:V,classNames:$,styles:P,unstyled:I,fullWidth:H,attributes:U,...D}=be("YearLevel",Voe,e),W=Sl(),G={__staticSelector:F||"YearLevel",classNames:$,styles:P,unstyled:I,size:V,attributes:U},z=typeof E=="boolean"?E:r?!Ie(n).endOf("year").isBefore(r):!1,X=typeof j=="boolean"?j:i?!Ie(n).startOf("year").isAfter(i):!1;return g.jsxs(he,{"data-year-level":!0,size:V,...D,children:[g.jsx(ws,{label:typeof L=="function"?L(n):Ie(n).locale(t||W.locale).format(L),__preventFocus:p,__stopPropagation:Y,nextIcon:v,previousIcon:b,nextLabel:w,previousLabel:k,onNext:_,onPrevious:C,onLevelClick:x,nextDisabled:z,previousDisabled:X,hasNextLevel:O,levelControlAriaLabel:M,withNext:N,withPrevious:q,headerControlsOrder:R,fullWidth:H,...G}),g.jsx(f0,{year:n,locale:t,minDate:i,maxDate:r,monthsListFormat:a,getMonthControlProps:o,__getControlRef:l,__onControlKeyDown:c,__onControlClick:f,__onControlMouseEnter:h,__preventFocus:p,__stopPropagation:Y,withCellSpacing:d,fullWidth:H,...G})]})});h0.classes={...ws.classes,...f0.classes};h0.displayName="@mantine/dates/YearLevel";const Woe={monthLabelFormat:"MMMM YYYY"},m0=De(e=>{const{month:n,locale:t,firstDayOfWeek:i,weekdayFormat:r,weekendDays:a,getDayProps:o,excludeDate:l,minDate:c,maxDate:f,renderDay:h,hideOutsideDates:d,hideWeekdays:p,getDayAriaLabel:v,__getDayRef:b,__onDayKeyDown:w,__onDayClick:k,__onDayMouseEnter:_,withCellSpacing:C,highlightToday:x,withWeekNumbers:E,__preventFocus:j,__stopPropagation:O,nextIcon:M,previousIcon:N,nextLabel:q,previousLabel:R,onNext:L,onPrevious:F,onLevelClick:Y,nextDisabled:V,previousDisabled:$,hasNextLevel:P,levelControlAriaLabel:I,withNext:H,withPrevious:U,headerControlsOrder:D,monthLabelFormat:W,classNames:G,styles:z,unstyled:X,__staticSelector:ee,size:re,static:le,fullWidth:ye,attributes:ae,...ue}=be("MonthLevel",Woe,e),Se=Sl(),ne={__staticSelector:ee||"MonthLevel",classNames:G,styles:z,unstyled:X,size:re,attributes:ae},Le=typeof V=="boolean"?V:f?!Ie(n).endOf("month").isBefore(f):!1,ke=typeof $=="boolean"?$:c?!Ie(n).startOf("month").isAfter(c):!1;return g.jsxs(he,{"data-month-level":!0,size:re,...ue,children:[g.jsx(ws,{label:typeof W=="function"?W(n):Ie(n).locale(t||Se.locale).format(W),__preventFocus:j,__stopPropagation:O,nextIcon:M,previousIcon:N,nextLabel:q,previousLabel:R,onNext:L,onPrevious:F,onLevelClick:Y,nextDisabled:Le,previousDisabled:ke,hasNextLevel:P,levelControlAriaLabel:I,withNext:H,withPrevious:U,headerControlsOrder:D,fullWidth:ye,...ne}),g.jsx(fp,{month:n,locale:t,firstDayOfWeek:i,weekdayFormat:r,weekendDays:a,getDayProps:o,excludeDate:l,minDate:c,maxDate:f,renderDay:h,hideOutsideDates:d,hideWeekdays:p,getDayAriaLabel:v,__getDayRef:b,__onDayKeyDown:w,__onDayClick:k,__onDayMouseEnter:_,__preventFocus:j,__stopPropagation:O,static:le,withCellSpacing:C,highlightToday:x,withWeekNumbers:E,fullWidth:ye,...ne})]})});m0.classes={...fp.classes,...ws.classes};m0.displayName="@mantine/dates/MonthLevel";var oq={levelsGroup:"m_30b26e33"};const Cl=De(e=>{const n=be("LevelsGroup",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:c,fullWidth:f,attributes:h,...d}=n;return g.jsx(he,{...Xe({name:c||"LevelsGroup",classes:oq,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:h,vars:l,rootSelector:"levelsGroup"})("levelsGroup"),"data-full-width":f||void 0,...d})});Cl.classes=oq;Cl.displayName="@mantine/dates/LevelsGroup";const Goe={numberOfColumns:1},p0=De(e=>{const{decade:n,locale:t,minDate:i,maxDate:r,yearsListFormat:a,getYearControlProps:o,__onControlClick:l,__onControlMouseEnter:c,withCellSpacing:f,__preventFocus:h,nextIcon:d,previousIcon:p,nextLabel:v,previousLabel:b,onNext:w,onPrevious:k,nextDisabled:_,previousDisabled:C,headerControlsOrder:x,classNames:E,styles:j,unstyled:O,__staticSelector:M,__stopPropagation:N,numberOfColumns:q,levelControlAriaLabel:R,decadeLabelFormat:L,size:F,fullWidth:Y,vars:V,attributes:$,...P}=be("DecadeLevelGroup",Goe,e),I=A.useRef([]),H=Array(q).fill(0).map((U,D)=>{const W=Ie(n).add(D*10,"years").format("YYYY-MM-DD");return g.jsx(d0,{size:F,yearsListFormat:a,decade:W,withNext:D===q-1,withPrevious:D===0,decadeLabelFormat:L,__onControlClick:l,__onControlMouseEnter:c,__onControlKeyDown:(G,z)=>c9({levelIndex:D,rowIndex:z.rowIndex,cellIndex:z.cellIndex,event:G,controlsRef:I}),__getControlRef:(G,z,X)=>{Array.isArray(I.current[D])||(I.current[D]=[]),Array.isArray(I.current[D][G])||(I.current[D][G]=[]),I.current[D][G][z]=X},levelControlAriaLabel:typeof R=="function"?R(W):R,locale:t,minDate:i,maxDate:r,__preventFocus:h,__stopPropagation:N,nextIcon:d,previousIcon:p,nextLabel:v,previousLabel:b,onNext:w,onPrevious:k,nextDisabled:_,previousDisabled:C,getYearControlProps:o,__staticSelector:M||"DecadeLevelGroup",classNames:E,styles:j,unstyled:O,withCellSpacing:f,headerControlsOrder:x,fullWidth:Y,attributes:$},D)});return g.jsx(Cl,{classNames:E,styles:j,__staticSelector:M||"DecadeLevelGroup",size:F,unstyled:O,fullWidth:Y,attributes:$,...P,children:H})});p0.classes={...Cl.classes,...d0.classes};p0.displayName="@mantine/dates/DecadeLevelGroup";const Yoe={numberOfColumns:1},v0=De(e=>{const{year:n,locale:t,minDate:i,maxDate:r,monthsListFormat:a,getMonthControlProps:o,__onControlClick:l,__onControlMouseEnter:c,withCellSpacing:f,__preventFocus:h,nextIcon:d,previousIcon:p,nextLabel:v,previousLabel:b,onNext:w,onPrevious:k,onLevelClick:_,nextDisabled:C,previousDisabled:x,hasNextLevel:E,headerControlsOrder:j,classNames:O,styles:M,unstyled:N,__staticSelector:q,__stopPropagation:R,numberOfColumns:L,levelControlAriaLabel:F,yearLabelFormat:Y,size:V,fullWidth:$,vars:P,attributes:I,...H}=be("YearLevelGroup",Yoe,e),U=A.useRef([]),D=Array(L).fill(0).map((W,G)=>{const z=Ie(n).add(G,"years").format("YYYY-MM-DD");return g.jsx(h0,{size:V,monthsListFormat:a,year:z,withNext:G===L-1,withPrevious:G===0,yearLabelFormat:Y,__stopPropagation:R,__onControlClick:l,__onControlMouseEnter:c,__onControlKeyDown:(X,ee)=>c9({levelIndex:G,rowIndex:ee.rowIndex,cellIndex:ee.cellIndex,event:X,controlsRef:U}),__getControlRef:(X,ee,re)=>{Array.isArray(U.current[G])||(U.current[G]=[]),Array.isArray(U.current[G][X])||(U.current[G][X]=[]),U.current[G][X][ee]=re},levelControlAriaLabel:typeof F=="function"?F(z):F,locale:t,minDate:i,maxDate:r,__preventFocus:h,nextIcon:d,previousIcon:p,nextLabel:v,previousLabel:b,onNext:w,onPrevious:k,onLevelClick:_,nextDisabled:C,previousDisabled:x,hasNextLevel:E,getMonthControlProps:o,classNames:O,styles:M,unstyled:N,__staticSelector:q||"YearLevelGroup",withCellSpacing:f,headerControlsOrder:j,fullWidth:$,attributes:I},G)});return g.jsx(Cl,{classNames:O,styles:M,__staticSelector:q||"YearLevelGroup",size:V,unstyled:N,fullWidth:$,attributes:I,...H,children:D})});v0.classes={...h0.classes,...Cl.classes};v0.displayName="@mantine/dates/YearLevelGroup";const Koe={numberOfColumns:1},g0=De(e=>{const{month:n,locale:t,firstDayOfWeek:i,weekdayFormat:r,weekendDays:a,getDayProps:o,excludeDate:l,minDate:c,maxDate:f,renderDay:h,hideOutsideDates:d,hideWeekdays:p,getDayAriaLabel:v,__onDayClick:b,__onDayMouseEnter:w,withCellSpacing:k,highlightToday:_,withWeekNumbers:C,__preventFocus:x,nextIcon:E,previousIcon:j,nextLabel:O,previousLabel:M,onNext:N,onPrevious:q,onLevelClick:R,nextDisabled:L,previousDisabled:F,hasNextLevel:Y,headerControlsOrder:V,classNames:$,styles:P,unstyled:I,numberOfColumns:H,levelControlAriaLabel:U,monthLabelFormat:D,__staticSelector:W,__stopPropagation:G,size:z,static:X,fullWidth:ee,vars:re,attributes:le,...ye}=be("MonthLevelGroup",Koe,e),ae=A.useRef([]),ue=Array(H).fill(0).map((Se,ne)=>{const Le=Ie(n).add(ne,"months").format("YYYY-MM-DD");return g.jsx(m0,{month:Le,withNext:ne===H-1,withPrevious:ne===0,monthLabelFormat:D,__stopPropagation:G,__onDayClick:b,__onDayMouseEnter:w,__onDayKeyDown:(ke,je)=>c9({levelIndex:ne,rowIndex:je.rowIndex,cellIndex:je.cellIndex,event:ke,controlsRef:ae}),__getDayRef:(ke,je,Ne)=>{Array.isArray(ae.current[ne])||(ae.current[ne]=[]),Array.isArray(ae.current[ne][ke])||(ae.current[ne][ke]=[]),ae.current[ne][ke][je]=Ne},levelControlAriaLabel:typeof U=="function"?U(Le):U,locale:t,firstDayOfWeek:i,weekdayFormat:r,weekendDays:a,getDayProps:o,excludeDate:l,minDate:c,maxDate:f,renderDay:h,hideOutsideDates:d,hideWeekdays:p,getDayAriaLabel:v,__preventFocus:x,nextIcon:E,previousIcon:j,nextLabel:O,previousLabel:M,onNext:N,onPrevious:q,onLevelClick:R,nextDisabled:L,previousDisabled:F,hasNextLevel:Y,classNames:$,styles:P,unstyled:I,__staticSelector:W||"MonthLevelGroup",size:z,static:X,withCellSpacing:k,highlightToday:_,withWeekNumbers:C,headerControlsOrder:V,fullWidth:ee,attributes:le},ne)});return g.jsx(Cl,{classNames:$,styles:P,__staticSelector:W||"MonthLevelGroup",size:z,fullWidth:ee,attributes:le,...ye,children:ue})});g0.classes={...Cl.classes,...m0.classes};g0.displayName="@mantine/dates/MonthLevelGroup";var sq={input:"m_6fa5e2aa"};const Zf=De(e=>{const{inputProps:n,wrapperProps:t,placeholder:i,classNames:r,styles:a,unstyled:o,popoverProps:l,modalProps:c,dropdownType:f,children:h,formattedValue:d,dropdownHandlers:p,dropdownOpened:v,onClick:b,clearable:w,clearSectionMode:k,onClear:_,clearButtonProps:C,rightSection:x,shouldClear:E,readOnly:j,disabled:O,value:M,name:N,form:q,type:R,onDropdownClose:L,withTime:F,...Y}=cI("PickerInputBase",{size:"sm"},e),V=g.jsx(Gt.ClearButton,{onClick:_,unstyled:o,...C}),$=()=>{R==="range"&&Array.isArray(M)&&M[0]&&!M[1]&&_(),p.close()};return g.jsxs(g.Fragment,{children:[f==="modal"&&!j&&g.jsx(hr,{opened:v,onClose:$,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:o,...c,children:h}),g.jsx(Gt.Wrapper,{...t,children:g.jsxs(On,{position:"bottom-start",opened:v,trapFocus:!0,returnFocus:!1,unstyled:o,onClose:L,...l,disabled:(l==null?void 0:l.disabled)||f==="modal"||j,onChange:P=>{var I;P||((I=l==null?void 0:l.onClose)==null||I.call(l),$())},children:[g.jsx(On.Target,{children:g.jsx(Gt,{"data-dates-input":!0,"data-read-only":j||void 0,disabled:O,component:"button",type:"button",multiline:!0,onClick:P=>{b==null||b(P),p.toggle()},__clearSection:V,__clearable:w&&E&&!j&&!O,__clearSectionMode:k,rightSection:x,...n,classNames:{...r,input:pn(sq.input,r==null?void 0:r.input)},...Y,children:d||g.jsx(Gt.Placeholder,{error:n.error,unstyled:o,classNames:r,styles:a,__staticSelector:n.__staticSelector,children:i})})}),g.jsx(On.Dropdown,{"data-dates-dropdown":!0,children:h})]})}),g.jsx(qF,{value:M,name:N,form:q,type:R,withTime:F})]})});Zf.classes=sq;Zf.displayName="@mantine/dates/PickerInputBase";const dM=e=>e==="range"?[null,null]:e==="multiple"?[]:null,hM=(e,n)=>{const t=n?FF:Ji;return Array.isArray(e)?e.map(t):t(e)};function d9({type:e,value:n,defaultValue:t,onChange:i,withTime:r=!1}){const a=A.useRef(e),[o,l,c]=Ci({value:hM(n,r),defaultValue:hM(t,r),finalValue:dM(e),onChange:i});let f=o;return a.current!==e&&(a.current=e,n===void 0&&(f=t!==void 0?t:dM(e),l(f))),[f,l,c]}function Wk(e,n){return e?e==="month"?0:e==="year"?1:2:n||0}function Xoe(e){return e===0?"month":e===1?"year":"decade"}function sh(e,n,t){return Xoe(ns(Wk(e,0),Wk(n,0),Wk(t,2)))}const Zoe={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Qf=De(e=>{const n=be("Calendar",Zoe,e),{vars:t,maxLevel:i,minLevel:r,defaultLevel:a,level:o,onLevelChange:l,date:c,defaultDate:f,onDateChange:h,numberOfColumns:d,columnsToScroll:p,ariaLabels:v,nextLabel:b,previousLabel:w,onYearSelect:k,onMonthSelect:_,onYearMouseEnter:C,onMonthMouseEnter:x,headerControlsOrder:E,__updateDateOnYearSelect:j,__updateDateOnMonthSelect:O,__setDateRef:M,__setLevelRef:N,firstDayOfWeek:q,weekdayFormat:R,weekendDays:L,getDayProps:F,excludeDate:Y,renderDay:V,hideOutsideDates:$,hideWeekdays:P,getDayAriaLabel:I,monthLabelFormat:H,nextIcon:U,previousIcon:D,__onDayClick:W,__onDayMouseEnter:G,withCellSpacing:z,highlightToday:X,withWeekNumbers:ee,monthsListFormat:re,getMonthControlProps:le,yearLabelFormat:ye,yearsListFormat:ae,getYearControlProps:ue,decadeLabelFormat:Se,classNames:ne,styles:Le,unstyled:ke,minDate:je,maxDate:Ne,locale:ge,__staticSelector:Ce,size:Pe,__preventFocus:ce,__stopPropagation:qe,onNextDecade:Ye,onPreviousDecade:We,onNextYear:Ze,onPreviousYear:Qe,onNextMonth:ie,onPreviousMonth:ve,static:Ke,enableKeyboardNavigation:Je,fullWidth:Ae,attributes:an,ref:mn,...En}=n,{resolvedClassNames:vn,resolvedStyles:sn}=Wi({classNames:ne,styles:Le,props:n}),[en,zn]=Ci({value:o?sh(o,r,i):void 0,defaultValue:a?sh(a,r,i):void 0,finalValue:sh(void 0,r,i),onChange:l}),[Re,He]=d9({type:"default",value:Ji(c),defaultValue:Ji(f),onChange:h});A.useImperativeHandle(M,()=>rn=>{He(rn)}),A.useImperativeHandle(N,()=>rn=>{zn(rn)});const Dn={__staticSelector:Ce||"Calendar",styles:sn,classNames:vn,unstyled:ke,size:Pe,attributes:an},kn=p||d||1,bn=A.useRef(null);if(bn.current===null){const rn=new Date;bn.current=je&&Ie(rn).isAfter(je)?je:Ie(rn).format("YYYY-MM-DD")}const _n=Re||bn.current,ft=()=>{const rn=Ie(_n).add(kn,"month").format("YYYY-MM-DD");ie==null||ie(rn),He(rn)},Tt=()=>{const rn=Ie(_n).subtract(kn,"month").format("YYYY-MM-DD");ve==null||ve(rn),He(rn)},Be=()=>{const rn=Ie(_n).add(kn,"year").format("YYYY-MM-DD");Ze==null||Ze(rn),He(rn)},Ue=()=>{const rn=Ie(_n).subtract(kn,"year").format("YYYY-MM-DD");Qe==null||Qe(rn),He(rn)},Ln=()=>{const rn=Ie(_n).add(10*kn,"year").format("YYYY-MM-DD");Ye==null||Ye(rn),He(rn)},ut=()=>{const rn=Ie(_n).subtract(10*kn,"year").format("YYYY-MM-DD");We==null||We(rn),He(rn)},Pn=A.useRef(null);return A.useEffect(()=>{if(!Je||Ke)return;const rn=tn=>{var Gn;if(!((Gn=Pn.current)!=null&&Gn.contains(document.activeElement)))return;const on=tn.ctrlKey||tn.metaKey,In=tn.shiftKey;switch(tn.key){case"ArrowUp":on&&In?(tn.preventDefault(),ut()):on&&(tn.preventDefault(),Ue());break;case"ArrowDown":on&&In?(tn.preventDefault(),Ln()):on&&(tn.preventDefault(),Be());break;case"y":case"Y":en==="month"&&(tn.preventDefault(),zn("year"));break}};return document.addEventListener("keydown",rn),()=>{document.removeEventListener("keydown",rn)}},[Je,Ke,en,Be,Ue,Ln,ut]),g.jsxs(he,{ref:Kt(Pn,mn),size:Pe,"data-calendar":!0,"data-full-width":Ae||void 0,...En,children:[en==="month"&&g.jsx(g0,{month:_n,minDate:je,maxDate:Ne,firstDayOfWeek:q,weekdayFormat:R,weekendDays:L,getDayProps:F,excludeDate:Y,renderDay:V,hideOutsideDates:$,hideWeekdays:P,getDayAriaLabel:I,onNext:ft,onPrevious:Tt,hasNextLevel:i!=="month",onLevelClick:()=>zn("year"),numberOfColumns:d,locale:ge,levelControlAriaLabel:v==null?void 0:v.monthLevelControl,nextLabel:(v==null?void 0:v.nextMonth)??b,nextIcon:U,previousLabel:(v==null?void 0:v.previousMonth)??w,previousIcon:D,monthLabelFormat:H,__onDayClick:W,__onDayMouseEnter:G,__preventFocus:ce,__stopPropagation:qe,static:Ke,withCellSpacing:z,highlightToday:X,withWeekNumbers:ee,headerControlsOrder:E,fullWidth:Ae,...Dn}),en==="year"&&g.jsx(v0,{year:_n,numberOfColumns:d,minDate:je,maxDate:Ne,monthsListFormat:re,getMonthControlProps:le,locale:ge,onNext:Be,onPrevious:Ue,hasNextLevel:i!=="month"&&i!=="year",onLevelClick:()=>zn("decade"),levelControlAriaLabel:v==null?void 0:v.yearLevelControl,nextLabel:(v==null?void 0:v.nextYear)??b,nextIcon:U,previousLabel:(v==null?void 0:v.previousYear)??w,previousIcon:D,yearLabelFormat:ye,__onControlMouseEnter:x,__onControlClick:(rn,tn)=>{O&&He(tn),zn(sh("month",r,i)),_==null||_(tn)},__preventFocus:ce,__stopPropagation:qe,withCellSpacing:z,headerControlsOrder:E,fullWidth:Ae,...Dn}),en==="decade"&&g.jsx(p0,{decade:_n,minDate:je,maxDate:Ne,yearsListFormat:ae,getYearControlProps:ue,locale:ge,onNext:Ln,onPrevious:ut,numberOfColumns:d,nextLabel:(v==null?void 0:v.nextDecade)??b,nextIcon:U,previousLabel:(v==null?void 0:v.previousDecade)??w,previousIcon:D,decadeLabelFormat:Se,__onControlMouseEnter:C,__onControlClick:(rn,tn)=>{j&&He(tn),zn(sh("year",r,i)),k==null||k(tn)},__preventFocus:ce,__stopPropagation:qe,withCellSpacing:z,headerControlsOrder:E,fullWidth:Ae,...Dn})]})});Qf.classes={...p0.classes,...v0.classes,...g0.classes};Qf.displayName="@mantine/dates/Calendar";function y0(e){const{maxLevel:n,minLevel:t,defaultLevel:i,level:r,onLevelChange:a,nextIcon:o,previousIcon:l,date:c,defaultDate:f,onDateChange:h,numberOfColumns:d,columnsToScroll:p,ariaLabels:v,nextLabel:b,previousLabel:w,onYearSelect:k,onMonthSelect:_,onYearMouseEnter:C,onMonthMouseEnter:x,onNextMonth:E,onPreviousMonth:j,onNextYear:O,onPreviousYear:M,onNextDecade:N,onPreviousDecade:q,withCellSpacing:R,highlightToday:L,__updateDateOnYearSelect:F,__updateDateOnMonthSelect:Y,__setDateRef:V,__setLevelRef:$,withWeekNumbers:P,headerControlsOrder:I,firstDayOfWeek:H,weekdayFormat:U,weekendDays:D,getDayProps:W,excludeDate:G,renderDay:z,hideOutsideDates:X,hideWeekdays:ee,getDayAriaLabel:re,monthLabelFormat:le,monthsListFormat:ye,getMonthControlProps:ae,yearLabelFormat:ue,yearsListFormat:Se,getYearControlProps:ne,decadeLabelFormat:Le,allowSingleDateInRange:ke,allowDeselect:je,minDate:Ne,maxDate:ge,locale:Ce,...Pe}=e;return{calendarProps:{maxLevel:n,minLevel:t,defaultLevel:i,level:r,onLevelChange:a,nextIcon:o,previousIcon:l,date:c,defaultDate:f,onDateChange:h,numberOfColumns:d,columnsToScroll:p,ariaLabels:v,nextLabel:b,previousLabel:w,onYearSelect:k,onMonthSelect:_,onYearMouseEnter:C,onMonthMouseEnter:x,onNextMonth:E,onPreviousMonth:j,onNextYear:O,onPreviousYear:M,onNextDecade:N,onPreviousDecade:q,withCellSpacing:R,highlightToday:L,__updateDateOnYearSelect:F,__updateDateOnMonthSelect:Y,__setDateRef:V,withWeekNumbers:P,headerControlsOrder:I,firstDayOfWeek:H,weekdayFormat:U,weekendDays:D,getDayProps:W,excludeDate:G,renderDay:z,hideOutsideDates:X,hideWeekdays:ee,getDayAriaLabel:re,monthLabelFormat:le,monthsListFormat:ye,getMonthControlProps:ae,yearLabelFormat:ue,yearsListFormat:Se,getYearControlProps:ne,decadeLabelFormat:Le,allowSingleDateInRange:ke,allowDeselect:je,minDate:Ne,maxDate:ge,locale:Ce},others:Pe}}function mM(e,n){const t=[...n].sort((i,r)=>Ie(i).isAfter(Ie(r))?1:-1);return Ie(t[0]).startOf("day").subtract(1,"ms").isBefore(e)&&Ie(t[1]).endOf("day").add(1,"ms").isAfter(e)}function lq({type:e,level:n,value:t,defaultValue:i,onChange:r,allowSingleDateInRange:a,allowDeselect:o,onMouseLeave:l}){const[c,f]=d9({type:e,value:t,defaultValue:i,onChange:r}),[h,d]=A.useState(e==="range"&&c[0]&&!c[1]?c[0]:null),[p,v]=A.useState(null),b=j=>{if(e==="range"){if(h&&!c[1]){if(Ie(j).isSame(h,n)&&!a){d(null),v(null),f([null,null]);return}const O=[j,h];O.sort((M,N)=>Ie(M).isAfter(Ie(N))?1:-1),f(O),v(null),d(null);return}if(c[0]&&!c[1]&&Ie(j).isSame(c[0],n)&&!a){d(null),v(null),f([null,null]);return}f([j,null]),v(null),d(j);return}if(e==="multiple"){c.some(O=>Ie(O).isSame(j,n))?f(c.filter(O=>!Ie(O).isSame(j,n))):f([...c,j]);return}c&&o&&Ie(j).isSame(c,n)?f(null):f(j)},w=j=>h&&p?mM(j,[p,h]):c[0]&&c[1]?mM(j,c):!1,k=e==="range"?j=>{l==null||l(j),v(null)}:l,_=j=>c[0]&&Ie(j).isSame(c[0],n)?!(p&&Ie(p).isBefore(c[0])):!1,C=j=>c[1]?Ie(j).isSame(c[1],n):!c[0]||!p?!1:Ie(p).isBefore(c[0])&&Ie(j).isSame(c[0],n),x=j=>{if(e==="range")return{selected:c.some(M=>M&&Ie(M).isSame(j,n)),inRange:w(j),firstInRange:_(j),lastInRange:C(j),"data-autofocus":!!c[0]&&Ie(c[0]).isSame(j,n)||void 0};if(e==="multiple")return{selected:c.some(M=>M&&Ie(M).isSame(j,n)),"data-autofocus":!!c[0]&&Ie(c[0]).isSame(j,n)||void 0};const O=Ie(c).isSame(j,n);return{selected:O,"data-autofocus":O||void 0}},E=e==="range"&&h?v:()=>{};return A.useEffect(()=>{if(e==="range")if(c[0]&&!c[1])d(c[0]);else{const j=c[0]==null&&c[1]==null,O=c[0]!=null&&c[1]!=null;(j||O)&&(d(null),v(null))}},[c]),{onDateChange:b,onRootMouseLeave:k,onHoveredDateChange:E,getControlProps:x,_value:c,setValue:f}}var uq={monthPickerRoot:"m_53c9e871",presetsList:"m_cccb8ff3",presetButton:"m_7b4fbf50"};const cq=(e,{size:n})=>({monthPickerRoot:{"--preset-font-size":ri(n)}}),Qoe={type:"default"},hp=De(e=>{const n=be("MonthPicker",Qoe,e),{classNames:t,styles:i,vars:r,type:a,defaultValue:o,value:l,onChange:c,__staticSelector:f,getMonthControlProps:h,allowSingleDateInRange:d,allowDeselect:p,onMouseLeave:v,onMonthSelect:b,__updateDateOnMonthSelect:w,__onPresetSelect:k,__stopPropagation:_,presets:C,className:x,style:E,unstyled:j,size:O,attributes:M,onLevelChange:N,...q}=n,{calendarProps:R,others:L}=y0(q),F=A.useRef(null),Y=A.useRef(null),V=Xe({name:f||"MonthPicker",classes:uq,props:n,className:x,style:E,classNames:t,styles:i,unstyled:j,attributes:M,rootSelector:C?"monthPickerRoot":void 0,varsResolver:cq,vars:r}),{onDateChange:$,onRootMouseLeave:P,onHoveredDateChange:I,getControlProps:H,setValue:U}=lq({type:a,level:"month",allowDeselect:p,allowSingleDateInRange:d,value:l,defaultValue:o,onChange:c,onMouseLeave:v}),{resolvedClassNames:D,resolvedStyles:W}=Wi({classNames:t,styles:i,props:n}),G=g.jsx(Qf,{classNames:D,styles:W,size:O,...R,...C?{}:L,minLevel:"year",__updateDateOnMonthSelect:w??!1,__staticSelector:f||"MonthPicker",onMouseLeave:P,onMonthMouseEnter:(ee,re)=>I(re),onMonthSelect:ee=>{$(ee),b==null||b(ee)},getMonthControlProps:ee=>({...H(ee),...h==null?void 0:h(ee)}),onLevelChange:N,__setDateRef:F,__setLevelRef:Y,__stopPropagation:_,attributes:M,...C?{}:{className:x,style:E}});if(!C)return G;const z=ee=>{var le,ye;const re=Array.isArray(ee)?ee[0]:ee;re!==void 0&&((le=F.current)==null||le.call(F,re),(ye=Y.current)==null||ye.call(Y,"year"),k?k(re):U(ee))},X=C.map((ee,re)=>g.jsx(Et,{...V("presetButton"),onClick:()=>z(ee.value),onMouseDown:le=>le.preventDefault(),"data-mantine-stop-propagation":_||void 0,children:ee.label},re));return g.jsxs(he,{...V("monthPickerRoot"),size:O,...L,children:[g.jsx("div",{...V("presetsList"),children:X}),G]})});hp.classes={...Qf.classes,...uq};hp.varsResolver=cq;hp.displayName="@mantine/dates/MonthPicker";var Joe={datePickerRoot:"m_765a40cf",presetsList:"m_d6a681e1",presetButton:"m_acd30b22"};const fq=(e,{size:n})=>({datePickerRoot:{"--preset-font-size":ri(n)}}),ese={type:"default",defaultLevel:"month",numberOfColumns:1,size:"sm"},mp=De(e=>{const n=be("DatePicker",ese,e),{allowDeselect:t,allowSingleDateInRange:i,value:r,defaultValue:a,onChange:o,onMouseLeave:l,classNames:c,styles:f,__staticSelector:h,__onDayClick:d,__onDayMouseEnter:p,__onPresetSelect:v,__stopPropagation:b,presets:w,className:k,style:_,unstyled:C,size:x,vars:E,attributes:j,...O}=n,{calendarProps:M,others:N}=y0(O),q=A.useRef(null),R=A.useRef(null),L=Xe({name:h||"DatePicker",classes:Joe,props:n,className:k,style:_,classNames:c,styles:f,unstyled:C,attributes:j,rootSelector:w?"datePickerRoot":void 0,varsResolver:fq,vars:E}),{onDateChange:F,onRootMouseLeave:Y,onHoveredDateChange:V,getControlProps:$,_value:P,setValue:I}=lq({type:N.type,level:"day",allowDeselect:t,allowSingleDateInRange:i,value:r,defaultValue:a,onChange:o,onMouseLeave:l}),{resolvedClassNames:H,resolvedStyles:U}=Wi({classNames:c,styles:f,props:n}),D=g.jsx(Qf,{classNames:H,styles:U,__staticSelector:h||"DatePicker",onMouseLeave:Y,size:x,...M,...w?{}:N,__stopPropagation:b,__setDateRef:q,__setLevelRef:R,minLevel:M.minLevel||"month",__onDayMouseEnter:(z,X)=>{V(X),p==null||p(z,X)},__onDayClick:(z,X)=>{F(X),d==null||d(z,X)},getDayProps:z=>{var X;return{...$(z),...(X=M.getDayProps)==null?void 0:X.call(M,z)}},getMonthControlProps:z=>{var X;return{selected:typeof P=="string"?f9(z,P):!1,...(X=M.getMonthControlProps)==null?void 0:X.call(M,z)}},getYearControlProps:z=>{var X;return{selected:typeof P=="string"?Ie(z).isSame(P,"year"):!1,...(X=M.getYearControlProps)==null?void 0:X.call(M,z)}},hideOutsideDates:M.hideOutsideDates??M.numberOfColumns!==1,attributes:j,...w?{}:{className:k,style:_}});if(!w)return D;const W=z=>{var ee,re;const X=Array.isArray(z)?z[0]:z;X!==void 0&&((ee=q.current)==null||ee.call(q,X),(re=R.current)==null||re.call(R,"month"),v?v(X):I(z))},G=w.map((z,X)=>g.jsx(Et,{...L("presetButton"),onClick:()=>W(z.value),onMouseDown:ee=>ee.preventDefault(),"data-mantine-stop-propagation":b||void 0,children:z.label},X));return g.jsxs(he,{...L("datePickerRoot"),size:x,...N,children:[g.jsx("div",{...L("presetsList"),children:G}),D]})});mp.classes=Qf.classes;mp.varsResolver=fq;mp.displayName="@mantine/dates/DatePicker";function dq({type:e,value:n,defaultValue:t,onChange:i,locale:r,format:a,closeOnChange:o,sortDates:l,labelSeparator:c,valueFormatter:f}){const h=Sl(),[d,p]=Az(!1),[v,b]=d9({type:e,value:n,defaultValue:t,onChange:i}),w=boe({type:e,date:v,locale:h.getLocale(r),format:a,labelSeparator:h.getLabelSeparator(c),formatter:f}),k=C=>{o&&(e==="default"&&p.close(),e==="range"&&C[0]&&C[1]&&p.close()),b(l&&e==="multiple"?[...C].sort((x,E)=>Ie(x).isAfter(Ie(E))?1:-1):C)};return{_value:v,setValue:k,onClear:()=>k(e==="range"?[null,null]:e==="multiple"?[]:null),shouldClear:e==="range"?!!v[0]:e==="multiple"?v.length>0:v!==null,formattedValue:w,dropdownOpened:d,dropdownHandlers:p}}const nse={type:"default",size:"sm",valueFormat:"MMMM YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},h9=De(e=>{const n=be("MonthPickerInput",nse,e),{type:t,value:i,defaultValue:r,onChange:a,valueFormat:o,labelSeparator:l,locale:c,classNames:f,styles:h,unstyled:d,closeOnChange:p,size:v,variant:b,dropdownType:w,sortDates:k,minDate:_,maxDate:C,vars:x,valueFormatter:E,presets:j,attributes:O,...M}=n,{resolvedClassNames:N,resolvedStyles:q}=Wi({classNames:f,styles:h,props:n}),{calendarProps:R,others:L}=y0(M),{_value:F,setValue:Y,formattedValue:V,dropdownHandlers:$,dropdownOpened:P,onClear:I,shouldClear:H}=dq({type:t,value:i,defaultValue:r,onChange:a,locale:c,format:o,labelSeparator:l,closeOnChange:p,sortDates:k,valueFormatter:E});return g.jsx(Zf,{formattedValue:V,dropdownOpened:P,dropdownHandlers:$,classNames:N,styles:q,unstyled:d,onClear:I,shouldClear:H,value:F,size:v,variant:b,dropdownType:w,...L,attributes:O,type:t,__staticSelector:"MonthPickerInput",children:g.jsx(hp,{...R,size:v,variant:b,type:t,value:F,defaultDate:R.defaultDate||(Array.isArray(F)?F[0]||HS({maxDate:C,minDate:_}):F||HS({maxDate:C,minDate:_})),onChange:Y,locale:c,classNames:N,styles:q,unstyled:d,__staticSelector:"MonthPickerInput",__stopPropagation:w==="popover",minDate:_,maxDate:C,presets:j,attributes:O})})});h9.classes={...Zf.classes,...hp.classes};h9.displayName="@mantine/dates/MonthPickerInput";const tse={type:"default",size:"sm",valueFormat:"MMMM D, YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},_u=De(e=>{const n=be("DatePickerInput",tse,e),{type:t,value:i,defaultValue:r,onChange:a,valueFormat:o,labelSeparator:l,locale:c,classNames:f,styles:h,unstyled:d,closeOnChange:p,size:v,variant:b,dropdownType:w,sortDates:k,minDate:_,maxDate:C,vars:x,defaultDate:E,valueFormatter:j,presets:O,attributes:M,...N}=n,{resolvedClassNames:q,resolvedStyles:R}=Wi({classNames:f,styles:h,props:n}),{calendarProps:L,others:F}=y0(N),{_value:Y,setValue:V,formattedValue:$,dropdownHandlers:P,dropdownOpened:I,onClear:H,shouldClear:U}=dq({type:t,value:i,defaultValue:r,onChange:a,locale:c,format:o,labelSeparator:l,closeOnChange:p,sortDates:k,valueFormatter:j}),D=Array.isArray(Y)?Y[0]||E:Y||E;return g.jsx(Zf,{formattedValue:$,dropdownOpened:I,dropdownHandlers:P,classNames:q,styles:R,unstyled:d,onClear:H,shouldClear:U,value:Y,size:v,variant:b,dropdownType:w,...F,type:t,__staticSelector:"DatePickerInput",attributes:M,children:g.jsx(mp,{...L,size:v,variant:b,type:t,value:Y,defaultDate:D||HS({maxDate:C,minDate:_}),onChange:V,locale:c,classNames:q,styles:R,unstyled:d,__staticSelector:"DatePickerInput",__stopPropagation:w==="popover",minDate:_,maxDate:C,presets:O,attributes:M})})});_u.classes={...Zf.classes,...mp.classes};_u.displayName="@mantine/dates/DatePickerInput";/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var ise={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const hn=(e,n,t,i)=>{const r=A.forwardRef(({color:a="currentColor",size:o=24,stroke:l=2,title:c,className:f,children:h,...d},p)=>A.createElement("svg",{ref:p,...ise[e],width:o,height:o,className:["tabler-icon",`tabler-icon-${n}`,f].join(" "),strokeWidth:l,stroke:a,...d},[c&&A.createElement("title",{key:"svg-title"},c),...i.map(([v,b])=>A.createElement(v,b)),...Array.isArray(h)?h:[h]]));return r.displayName=`${t}`,r};/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const rse=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],US=hn("outline","alert-triangle","AlertTriangle",rse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const ase=[["path",{d:"M8 4h11a2 2 0 1 1 0 4h-7m-4 0h-3a2 2 0 0 1 -.826 -3.822",key:"svg-0"}],["path",{d:"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 1.824 -1.18m.176 -3.82v-7",key:"svg-1"}],["path",{d:"M10 12h2",key:"svg-2"}],["path",{d:"M3 3l18 18",key:"svg-3"}]],ose=hn("outline","archive-off","ArchiveOff",ase);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const sse=[["path",{d:"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2",key:"svg-0"}],["path",{d:"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-10",key:"svg-1"}],["path",{d:"M10 12l4 0",key:"svg-2"}]],hq=hn("outline","archive","Archive",sse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const lse=[["path",{d:"M9 14l-4 -4l4 -4",key:"svg-0"}],["path",{d:"M5 10h11a4 4 0 1 1 0 8h-1",key:"svg-1"}]],Kg=hn("outline","arrow-back-up","ArrowBackUp",lse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const use=[["path",{d:"M7 8l-4 4l4 4",key:"svg-0"}],["path",{d:"M17 8l4 4l-4 4",key:"svg-1"}],["path",{d:"M3 12l18 0",key:"svg-2"}]],cse=hn("outline","arrows-horizontal","ArrowsHorizontal",use);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const fse=[["path",{d:"M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M16 12v1.5a2.5 2.5 0 0 0 5 0v-1.5a9 9 0 1 0 -5.5 8.28",key:"svg-1"}]],dse=hn("outline","at","At",fse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const hse=[["path",{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}]],mse=hn("outline","bell","Bell",hse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const pse=[["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 -2l0 -12",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}]],mq=hn("outline","calendar-due","CalendarDue",pse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const vse=[["path",{d:"M9 5h9a2 2 0 0 1 2 2v9m-.184 3.839a2 2 0 0 1 -1.816 1.161h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 1.158 -1.815",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v1",key:"svg-2"}],["path",{d:"M4 11h7m4 0h5",key:"svg-3"}],["path",{d:"M3 3l18 18",key:"svg-4"}]],gse=hn("outline","calendar-off","CalendarOff",vse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const yse=[["path",{d:"M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4",key:"svg-0"}],["path",{d:"M18 14v4h4",key:"svg-1"}],["path",{d:"M14 18a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-2"}],["path",{d:"M15 3v4",key:"svg-3"}],["path",{d:"M7 3v4",key:"svg-4"}],["path",{d:"M3 11h16",key:"svg-5"}]],bse=hn("outline","calendar-stats","CalendarStats",yse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const wse=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],kse=hn("outline","calendar","Calendar",wse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const _se=[["path",{d:"M3 13a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -6",key:"svg-0"}],["path",{d:"M15 9a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -10",key:"svg-1"}],["path",{d:"M9 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -14",key:"svg-2"}],["path",{d:"M4 20h14",key:"svg-3"}]],xse=hn("outline","chart-bar","ChartBar",_se);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Sse=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],xu=hn("outline","check","Check",Sse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Cse=[["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"}]],om=hn("outline","checkbox","Checkbox",Cse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ase=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],VS=hn("outline","chevron-down","ChevronDown",Ase);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const jse=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],WS=hn("outline","chevron-right","ChevronRight",jse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ose=[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2",key:"svg-1"}],["path",{d:"M9 12l.01 0",key:"svg-2"}],["path",{d:"M13 12l2 0",key:"svg-3"}],["path",{d:"M9 16l.01 0",key:"svg-4"}],["path",{d:"M13 16l2 0",key:"svg-5"}]],pM=hn("outline","clipboard-list","ClipboardList",Ose);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ese=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 12l3 2",key:"svg-1"}],["path",{d:"M12 7v5",key:"svg-2"}]],Tse=hn("outline","clock-hour-4","ClockHour4",Ese);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Mse=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],Xg=hn("outline","clock","Clock",Mse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Dse=[["path",{d:"M3 4a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-16",key:"svg-0"}],["path",{d:"M9 3v18",key:"svg-1"}],["path",{d:"M15 3v18",key:"svg-2"}]],Rse=hn("outline","columns-3","Columns3",Dse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Pse=[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],Nse=hn("outline","copy","Copy",Pse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const $se=[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14",key:"svg-0"}],["path",{d:"M8 8.5a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-1"}],["path",{d:"M15 8.5a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-2"}],["path",{d:"M15 15.5a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-3"}],["path",{d:"M8 15.5a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-4"}],["path",{d:"M11.5 12a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-5"}]],zse=hn("outline","dice-5","Dice5",$se);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Lse=[["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],pq=hn("outline","dots-vertical","DotsVertical",Lse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ise=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],Bse=hn("outline","download","Download",Ise);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Fse=[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]],jh=hn("outline","edit","Edit",Fse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const qse=[["path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6",key:"svg-0"}],["path",{d:"M11 13l9 -9",key:"svg-1"}],["path",{d:"M15 4h5v5",key:"svg-2"}]],Hse=hn("outline","external-link","ExternalLink",qse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Use=[["path",{d:"M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}]],vq=hn("outline","grip-vertical","GripVertical",Use);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Vse=[["path",{d:"M12 8l0 4l2 2",key:"svg-0"}],["path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5",key:"svg-1"}]],Wse=hn("outline","history","History",Vse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Gse=[["path",{d:"M6.5 7h11",key:"svg-0"}],["path",{d:"M6.5 17h11",key:"svg-1"}],["path",{d:"M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1",key:"svg-2"}],["path",{d:"M6 4v2a6 6 0 1 0 12 0v-2a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1",key:"svg-3"}]],Zg=hn("outline","hourglass","Hourglass",Gse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Yse=[["path",{d:"M4 4l6 0",key:"svg-0"}],["path",{d:"M14 4l6 0",key:"svg-1"}],["path",{d:"M4 10a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -8",key:"svg-2"}],["path",{d:"M14 10a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -2",key:"svg-3"}]],GS=hn("outline","layout-kanban","LayoutKanban",Yse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Kse=[["path",{d:"M9 15l6 -6",key:"svg-0"}],["path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464",key:"svg-1"}],["path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463",key:"svg-2"}]],Xse=hn("outline","link","Link",Kse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Zse=[["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 -2l0 -6",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-5a4 4 0 0 1 8 0",key:"svg-2"}]],gq=hn("outline","lock-open","LockOpen",Zse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Qse=[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]],al=hn("outline","lock","Lock",Qse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Jse=[["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"}]],ele=hn("outline","logout","Logout",Jse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const nle=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]],tle=hn("outline","menu-2","Menu2",nle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const ile=[["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12",key:"svg-0"}],["path",{d:"M9.5 9h.01",key:"svg-1"}],["path",{d:"M14.5 9h.01",key:"svg-2"}],["path",{d:"M9.5 13a3.5 3.5 0 0 0 5 0",key:"svg-3"}]],yq=hn("outline","message-chatbot","MessageChatbot",ile);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const rle=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12",key:"svg-2"}]],bq=hn("outline","message","Message",rle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const ale=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 10l.01 0",key:"svg-1"}],["path",{d:"M15 10l.01 0",key:"svg-2"}],["path",{d:"M9.5 15a3.5 3.5 0 0 0 5 0",key:"svg-3"}]],ole=hn("outline","mood-smile","MoodSmile",ale);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const sle=[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]],m9=hn("outline","palette","Palette",sle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const lle=[["path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5",key:"svg-0"}]],ule=hn("outline","paperclip","Paperclip",lle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const cle=[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]],fle=hn("outline","pencil","Pencil",cle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const dle=[["path",{d:"M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5",key:"svg-0"}],["path",{d:"M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5",key:"svg-1"}],["path",{d:"M3 21l2.5 -2.5",key:"svg-2"}],["path",{d:"M18.5 5.5l2.5 -2.5",key:"svg-3"}],["path",{d:"M10 11l-2 2",key:"svg-4"}],["path",{d:"M13 14l-2 2",key:"svg-5"}]],hle=hn("outline","plug-connected","PlugConnected",dle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const mle=[["path",{d:"M9.785 6l8.215 8.215l-2.054 2.054a5.81 5.81 0 1 1 -8.215 -8.215l2.054 -2.054",key:"svg-0"}],["path",{d:"M4 20l3.5 -3.5",key:"svg-1"}],["path",{d:"M15 4l-3.5 3.5",key:"svg-2"}],["path",{d:"M20 9l-3.5 3.5",key:"svg-3"}]],wq=hn("outline","plug","Plug",mle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const ple=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],of=hn("outline","plus","Plus",ple);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const vle=[["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"}]],sm=hn("outline","refresh","Refresh",vle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const gle=[["path",{d:"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],yle=hn("outline","search","Search",gle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const ble=[["path",{d:"M10 14l11 -11",key:"svg-0"}],["path",{d:"M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5",key:"svg-1"}]],kq=hn("outline","send","Send",ble);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const wle=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],kle=hn("outline","settings","Settings",wle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const _le=[["path",{d:"M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6",key:"svg-0"}]],xle=hn("outline","sparkles","Sparkles",_le);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Sle=[["path",{d:"M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3",key:"svg-1"}]],Cle=hn("outline","tag","Tag",Sle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ale=[["path",{d:"M20 8.04l-12.122 12.124a2.857 2.857 0 1 1 -4.041 -4.04l12.122 -12.124",key:"svg-0"}],["path",{d:"M7 13h8",key:"svg-1"}],["path",{d:"M19 15l1.5 1.6a2 2 0 1 1 -3 0l1.5 -1.6",key:"svg-2"}],["path",{d:"M15 3l6 6",key:"svg-3"}]],jle=hn("outline","test-pipe","TestPipe",Ale);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ole=[["path",{d:"M4 7h16",key:"svg-0"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-1"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-2"}],["path",{d:"M10 12l4 4m0 -4l-4 4",key:"svg-3"}]],Ele=hn("outline","trash-x","TrashX",Ole);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Tle=[["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"}]],gl=hn("outline","trash","Trash",Tle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Mle=[["path",{d:"M3 17l6 -6l4 4l8 -8",key:"svg-0"}],["path",{d:"M14 7l7 0l0 7",key:"svg-1"}]],YS=hn("outline","trending-up","TrendingUp",Mle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Dle=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4",key:"svg-1"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-2"}]],Rle=hn("outline","user-check","UserCheck",Dle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ple=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 10a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855",key:"svg-2"}]],Nle=hn("outline","user-circle","UserCircle",Ple);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const $le=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4c.348 0 .686 .045 1.009 .128",key:"svg-1"}],["path",{d:"M16 19h6",key:"svg-2"}]],zle=hn("outline","user-minus","UserMinus",$le);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Lle=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M16 19h6",key:"svg-1"}],["path",{d:"M19 16v6",key:"svg-2"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4",key:"svg-3"}]],Ile=hn("outline","user-plus","UserPlus",Lle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ble=[["path",{d:"M9 10a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-0"}],["path",{d:"M6 21v-1a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v1",key:"svg-1"}],["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14",key:"svg-2"}]],Fle=hn("outline","user-square","UserSquare",Ble);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const qle=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]],Hle=hn("outline","user","User",qle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ule=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],Oh=hn("outline","x","X",Ule);function _q({initial:e,submitLabel:n="Guardar",users:t=[],requesterOptions:i=[],tagOptions:r=[],onSubmit:a,onCancel:o}){const[l,c]=A.useState((e==null?void 0:e.requester)??""),[f,h]=A.useState((e==null?void 0:e.title)??""),[d,p]=A.useState((e==null?void 0:e.description)??""),[v,b]=A.useState((e==null?void 0:e.assignee_id)??null),[w,k]=A.useState((e==null?void 0:e.tags)??[]),_=async x=>{x==null||x.preventDefault();const E=f.trim();E&&await a({requester:l.trim(),title:E,description:d,assignee_id:v,tags:w})},C=x=>{x.key==="Enter"&&(x.ctrlKey||x.metaKey)&&(x.preventDefault(),_())};return g.jsx("form",{onSubmit:_,children:g.jsxs($n,{gap:"sm",children:[g.jsx(pl,{label:"Tarea",value:f,onChange:x=>h(x.currentTarget.value),tabIndex:1,required:!0,autoComplete:"off","data-autofocus":!0,autosize:!0,minRows:1,maxRows:4,onKeyDown:x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),_())}}),g.jsx(Ty,{label:"Solicitante",value:l,onChange:c,data:i,tabIndex:2,autoComplete:"off","data-field":"requester",placeholder:"Empieza a escribir y elige uno existente",limit:10,onKeyDown:x=>{x.key==="Enter"&&x.preventDefault()}}),g.jsx(pl,{label:"Descripcion",value:d,onChange:x=>p(x.currentTarget.value),tabIndex:3,autosize:!0,minRows:3,maxRows:8,onKeyDown:C,description:"Ctrl+Enter para guardar"}),g.jsx(Kr,{label:"Asignar a",placeholder:"Sin asignar",value:v,onChange:x=>b(x),data:t.map(x=>({value:x.id,label:x.display_name||x.username})),clearable:!0,searchable:!0,tabIndex:4}),g.jsx(KC,{label:"Tags",value:w,onChange:k,data:r,clearable:!0,tabIndex:5,placeholder:"Enter para añadir; sugiere existentes",splitChars:[","," "]}),g.jsxs(ze,{justify:"flex-end",gap:"xs",mt:"xs",children:[g.jsx(st,{variant:"subtle",color:"gray",tabIndex:7,type:"button",onClick:o,children:"Cancelar"}),g.jsx(st,{tabIndex:6,type:"submit",disabled:!f.trim(),children:n})]})]})})}function Vle(e,n){if(n.length===0)throw new Error("palette must not be empty");let t=0;for(let i=0;i>>0;return n[t%n.length]}const p9=new Set(["blue","cyan","teal","green","lime","yellow","orange","red","pink","grape","violet","indigo","gray","dark"]);function v9(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function xq(e){return e?v9(e)?`color-mix(in srgb, ${e} 18%, var(--mantine-color-dark-6))`:p9.has(e)?`color-mix(in srgb, var(--mantine-color-${e}-9) 18%, var(--mantine-color-dark-6))`:"var(--mantine-color-dark-6)":"var(--mantine-color-dark-6)"}function g9(e){return e?v9(e)?`color-mix(in srgb, ${e} 30%, var(--mantine-color-dark-4))`:p9.has(e)?`color-mix(in srgb, var(--mantine-color-${e}-7) 30%, var(--mantine-color-dark-4))`:"var(--mantine-color-dark-4)":"var(--mantine-color-dark-4)"}function Wle(e){return e?v9(e)?e:p9.has(e)?`var(--mantine-color-${e}-7)`:"var(--mantine-color-dark-3)":"var(--mantine-color-dark-3)"}const Sq=[{value:"",label:"Default"},{value:"blue",label:"Azul"},{value:"cyan",label:"Cian"},{value:"teal",label:"Teal"},{value:"green",label:"Verde"},{value:"lime",label:"Lima"},{value:"yellow",label:"Amarillo"},{value:"orange",label:"Naranja"},{value:"red",label:"Rojo"},{value:"pink",label:"Rosa"},{value:"grape",label:"Uva"},{value:"violet",label:"Violeta"},{value:"indigo",label:"Indigo"},{value:"gray",label:"Gris"},{value:"#0ea5e9",label:"Sky"},{value:"#14b8a6",label:"Esmeralda"},{value:"#84cc16",label:"Lima fluor"},{value:"#ec4899",label:"Magenta"},{value:"#a855f7",label:"Lavanda"},{value:"#f97316",label:"Mandarina"},{value:"#dc2626",label:"Rubi"},{value:"#0891b2",label:"Petroleo"},{value:"#fde047",label:"Limon"},{value:"#10b981",label:"Menta"},{value:"#fb7185",label:"Coral"},{value:"#6366f1",label:"Iris"},{value:"#94a3b8",label:"Pizarra"}],Gle=Sq,Yle=["blue","cyan","teal","green","lime","yellow","orange","red","pink","grape","violet","indigo"];function yl(e){return Vle(e,Yle)}const KS=6e4,Eh=60*KS,qc=24*Eh,Gv=7*qc,Gk=30*qc;function Jt(e){if(!Number.isFinite(e)||e<0)return"0m";if(e=0&&n-t<=64;t--){const i=e[t];if(i==="@"){if(t===0||/\s/.test(e[t-1])){const r=e.slice(t+1,n);if(/^[a-z0-9_.-]*$/i.test(r))return{start:t,query:r.toLowerCase()}}return null}if(/\s/.test(i))return null}return null}const Qle=/(^|\s)(@[a-z0-9][a-z0-9_.-]{0,63})/gi;function Jle(e,n){const t=[];let i=0,r=0;for(const a of e.matchAll(Qle)){const o=a[2].slice(1).toLowerCase(),l=(a.index??0)+a[1].length;l>i&&t.push(e.slice(i,l));const c=n.get(o);c?t.push(g.jsxs(it,{size:"xs",variant:"light",color:c.color||yl(c.username),style:{verticalAlign:"middle"},children:["@",c.username]},`m${r++}`)):t.push(`@${o}`),i=l+a[2].length}return inew Map(n.map(U=>[U.id,U])),[n]),O=A.useMemo(()=>new Map(n.map(U=>[U.username.toLowerCase(),U])),[n]),M=A.useCallback(async()=>{try{const U=await tre(e);o(U),i==null||i(U)}catch(U){wn.show({color:"red",message:U.message})}finally{c(!1)}},[e,i]);A.useEffect(()=>{M()},[M]),A.useEffect(()=>{const U=new WebSocket(sre(e));return C.current=U,U.onmessage=D=>{try{const W=JSON.parse(D.data);W.type==="message.created"&&W.message?o(G=>{if(G.some(X=>X.id===W.message.id))return G;const z=[...G,W.message];return i==null||i(z),z}):W.type==="typing"&&W.user_id?b(G=>({...G,[W.user_id]:Date.now()})):W.type==="error"&&wn.show({color:"red",message:W.error})}catch{}},U.onerror=()=>{},()=>{U.close(),C.current=null}},[e,i]),A.useEffect(()=>{const U=setInterval(()=>{const D=Date.now();b(W=>{const G={};for(const[z,X]of Object.entries(W))D-XclearInterval(U)},[]),A.useEffect(()=>{_.current&&_.current.scrollTo({top:_.current.scrollHeight,behavior:"smooth"})},[a.length]);const[N,q]=A.useState(null);A.useEffect(()=>{if(!r||!a.some(W=>W.id===r))return;const U=document.querySelector(`[data-msg-id="${r}"]`);U&&U instanceof HTMLElement&&U.scrollIntoView({behavior:"smooth",block:"center"}),q(r);const D=setTimeout(()=>q(null),2200);return()=>clearTimeout(D)},[r,a]);const R=()=>{const U=C.current;if(!U||U.readyState!==WebSocket.OPEN)return;const D=Date.now();D-E.currentk(null)}),F=A.useMemo(()=>w?n.filter(U=>U.username.toLowerCase().startsWith(w.query)).slice(0,8):[],[n,w]);A.useEffect(()=>{w&&F.length>0?(L.openDropdown(),L.selectFirstOption()):L.closeDropdown()},[w==null?void 0:w.query,F.length]);const Y=U=>{if(!w)return;const D=f.slice(0,w.start),W=f.slice(w.start+1+w.query.length),G=`@${U} `,z=D+G+W;h(z),k(null),requestAnimationFrame(()=>{const X=x.current;if(!X)return;const ee=(D+G).length;X.focus(),X.setSelectionRange(ee,ee)})},V=async()=>{const U=f.trim();if(!U||d)return;p(!0);const D=C.current;try{if(D&&D.readyState===WebSocket.OPEN)D.send(JSON.stringify({type:"send",body:U})),h("");else{const W=await ire(e,U);o(G=>[...G,W]),i==null||i([...a,W]),h("")}}catch(W){wn.show({color:"red",message:W.message})}finally{p(!1)}},$=async U=>{try{await rre(e,U);const D=a.filter(W=>W.id!==U);o(D),i==null||i(D)}catch(D){wn.show({color:"red",message:D.message})}},P=U=>{h(U.currentTarget.value),R();const D=U.currentTarget.selectionStart??U.currentTarget.value.length;k(Zle(U.currentTarget.value,D))},I=U=>{if(w&&F.length>0&&(U.key==="Enter"||U.key==="Tab")){U.preventDefault();const D=L.getSelectedOptionIndex(),W=F[Math.max(0,D)];W&&Y(W.username);return}if(w&&U.key==="Escape"){k(null);return}U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),V())},H=Object.keys(v).filter(U=>U!==t).map(U=>{const D=j.get(U);return(D==null?void 0:D.display_name)||(D==null?void 0:D.username)||"alguien"});return g.jsxs($n,{gap:"xs",style:{height:"100%",minHeight:0},children:[g.jsx(fr,{viewportRef:_,style:{flex:1,minHeight:200},type:"auto",offsetScrollbars:!0,children:l?g.jsx(ze,{justify:"center",p:"md",children:g.jsx(ai,{size:"sm"})}):a.length===0?g.jsx(xe,{size:"sm",c:"dimmed",ta:"center",p:"md",children:"Sin mensajes aun. Escribe el primero."}):g.jsx($n,{gap:6,p:4,children:a.map(U=>{const D=U.author_id?j.get(U.author_id):null,W=U.author_id&&U.author_id===t,G=D?D.display_name||D.username:"Anonimo",z=N===U.id;return g.jsx(Dt,{withBorder:!0,p:"xs",radius:"sm","data-msg-id":U.id,bg:z?"var(--mantine-color-yellow-light)":W?"var(--mantine-color-blue-light)":void 0,style:{transition:"background-color 600ms ease",boxShadow:z?"0 0 0 2px var(--mantine-color-yellow-5)":void 0},children:g.jsxs(ze,{gap:6,wrap:"nowrap",align:"flex-start",children:[g.jsx(go,{size:22,radius:"xl",color:(D==null?void 0:D.color)||yl(G),children:G.slice(0,2).toUpperCase()}),g.jsxs(he,{style:{flex:1,minWidth:0},children:[g.jsxs(ze,{gap:6,wrap:"nowrap",justify:"space-between",children:[g.jsxs(ze,{gap:6,wrap:"nowrap",children:[g.jsx(xe,{size:"xs",fw:600,children:G}),g.jsx(xe,{size:"xs",c:"dimmed",children:lm(U.created_at)})]}),W&&g.jsx(Zt,{label:"Borrar",withArrow:!0,children:g.jsx(vt,{size:"xs",variant:"subtle",color:"red",onClick:()=>$(U.id),children:g.jsx(gl,{size:12})})})]}),g.jsx(xe,{size:"sm",style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:Jle(U.body,O)})]})]})},U.id)})})}),H.length>0&&g.jsx(xe,{size:"xs",c:"dimmed",px:6,children:H.length===1?`${H[0]} esta escribiendo...`:`${H.slice(0,2).join(", ")}${H.length>2?"...":""} estan escribiendo...`}),g.jsxs(An,{store:L,onOptionSubmit:U=>Y(U),position:"top-start",withinPortal:!1,children:[g.jsx(An.DropdownTarget,{children:g.jsxs(ze,{gap:"xs",align:"flex-end",children:[g.jsx(pl,{ref:x,value:f,onChange:P,onKeyDown:I,placeholder:"Escribe un mensaje (Enter = enviar, @ para mencionar)",autosize:!0,minRows:1,maxRows:6,style:{flex:1},disabled:d}),g.jsx(Zt,{label:"Enviar",withArrow:!0,children:g.jsx(vt,{size:"lg",variant:"filled",color:"blue",onClick:V,disabled:!f.trim()||d,"aria-label":"Enviar",children:g.jsx(kq,{size:16})})})]})}),g.jsx(An.Dropdown,{hidden:!w||F.length===0,children:g.jsx(An.Options,{children:F.map(U=>g.jsx(An.Option,{value:U.username,children:g.jsxs(ze,{gap:6,wrap:"nowrap",children:[g.jsx(go,{size:18,radius:"xl",color:U.color||yl(U.username),children:(U.display_name||U.username).slice(0,2).toUpperCase()}),g.jsxs(xe,{size:"sm",fw:600,children:["@",U.username]}),U.display_name&&U.display_name!==U.username&&g.jsx(xe,{size:"xs",c:"dimmed",children:U.display_name})]})},U.id))})})]})]})}const vM=/(https?:\/\/[^\s<>()"']+)/gi;function Yk(e,n){if(!n)return[];const t=[],i=new Set;let r;for(vM.lastIndex=0;(r=vM.exec(n))!==null;){let a=r[1];a=a.replace(/[.,;:!?)\]}>]+$/,""),!i.has(a)&&(i.add(a),t.push({url:a,source:e,context:n}))}return t}function nue(e){try{return new URL(e).hostname}catch{return e}}function tue({card:e,messages:n}){const t=A.useMemo(()=>{const a=[...Yk("title",e.title),...Yk("description",e.description),...n.flatMap(l=>Yk("chat",l.body))],o=new Set;return a.filter(l=>o.has(l.url)?!1:(o.add(l.url),!0))},[e.title,e.description,n]);if(t.length===0)return g.jsxs($n,{gap:"xs",p:"md",align:"center",justify:"center",style:{minHeight:200},children:[g.jsx(xe,{size:"sm",c:"dimmed",children:"Sin enlaces detectados"}),g.jsx(xe,{size:"xs",c:"dimmed",ta:"center",children:"Pega URLs en el titulo, descripcion o chat y apareceran aqui."})]});const i=a=>a==="title"?"grape":a==="description"?"blue":"teal",r=a=>a==="title"?"titulo":a==="description"?"descripcion":"chat";return g.jsx($n,{gap:6,p:4,children:t.map(a=>g.jsx(Dt,{withBorder:!0,p:"xs",radius:"sm",children:g.jsxs(ze,{gap:"xs",wrap:"nowrap",justify:"space-between",align:"flex-start",children:[g.jsxs(he,{style:{flex:1,minWidth:0},children:[g.jsx(Sy,{href:a.url,target:"_blank",rel:"noopener noreferrer",size:"sm",style:{wordBreak:"break-all"},children:g.jsxs(ze,{gap:4,wrap:"nowrap",align:"center",children:[g.jsx(Hse,{size:12}),g.jsx("span",{children:nue(a.url)})]})}),g.jsx(xe,{size:"xs",c:"dimmed",style:{wordBreak:"break-all"},children:a.url})]}),g.jsx(it,{size:"xs",variant:"light",color:i(a.source),children:r(a.source)})]})},a.url))})}function iue({card:e,users:n,currentUserId:t,requesterOptions:i,tagOptions:r,onSubmit:a,onCancel:o,highlightMessageId:l}){const[c,f]=A.useState([]),[h,d]=A.useState(e),p=async v=>{d(b=>({...b,title:v.title,description:v.description,requester:v.requester,tags:v.tags,assignee_id:v.assignee_id})),await a(v)};return g.jsxs(ze,{align:"stretch",gap:"md",wrap:"nowrap",style:{minHeight:460},children:[g.jsx(he,{style:{flex:"1 1 0",minWidth:320},children:g.jsx(_q,{users:n,requesterOptions:i,tagOptions:r,initial:{requester:h.requester,title:h.title,description:h.description,assignee_id:h.assignee_id,tags:h.tags||[]},submitLabel:"Guardar",onSubmit:p,onCancel:o})}),g.jsx(Nu,{orientation:"vertical"}),g.jsx(he,{style:{flex:"1 1 0",minWidth:320,display:"flex",flexDirection:"column"},children:g.jsxs(Ut,{defaultValue:"chat",keepMounted:!1,style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[g.jsxs(Ut.List,{children:[g.jsx(Ut.Tab,{value:"chat",leftSection:g.jsx(bq,{size:14}),children:"Chat"}),g.jsx(Ut.Tab,{value:"links",leftSection:g.jsx(Xse,{size:14}),children:"Enlaces"}),g.jsx(Ut.Tab,{value:"files",leftSection:g.jsx(ule,{size:14}),disabled:!0,children:"Archivos"})]}),g.jsxs(he,{pt:"xs",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[g.jsx(Ut.Panel,{value:"chat",style:{flex:1,minHeight:0,display:"flex"},children:g.jsx(he,{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",width:"100%"},children:g.jsx(eue,{cardId:h.id,users:n,currentUserId:t,onMessagesChange:f,highlightMessageId:l})})}),g.jsx(Ut.Panel,{value:"links",children:g.jsx(tue,{card:h,messages:c})}),g.jsx(Ut.Panel,{value:"files",children:g.jsx(xe,{size:"sm",c:"dimmed",ta:"center",p:"md",children:"Proximamente: adjuntos de archivos."})})]})]})})]})}function rue(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const aue=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oue=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sue={};function gM(e,n){return(sue.jsx?oue:aue).test(e)}const lue=/[ \t\n\f\r]/g;function uue(e){return typeof e=="object"?e.type==="text"?yM(e.value):!1:yM(e)}function yM(e){return e.replace(lue,"")===""}class pp{constructor(n,t,i){this.normal=t,this.property=n,i&&(this.space=i)}}pp.prototype.normal={};pp.prototype.property={};pp.prototype.space=void 0;function Cq(e,n){const t={},i={};for(const r of e)Object.assign(t,r.property),Object.assign(i,r.normal);return new pp(t,i,n)}function XS(e){return e.toLowerCase()}class jr{constructor(n,t){this.attribute=t,this.property=n}}jr.prototype.attribute="";jr.prototype.booleanish=!1;jr.prototype.boolean=!1;jr.prototype.commaOrSpaceSeparated=!1;jr.prototype.commaSeparated=!1;jr.prototype.defined=!1;jr.prototype.mustUseProperty=!1;jr.prototype.number=!1;jr.prototype.overloadedBoolean=!1;jr.prototype.property="";jr.prototype.spaceSeparated=!1;jr.prototype.space=void 0;let cue=0;const Un=Iu(),gi=Iu(),ZS=Iu(),Ve=Iu(),Lt=Iu(),Kc=Iu(),Br=Iu();function Iu(){return 2**++cue}const QS=Object.freeze(Object.defineProperty({__proto__:null,boolean:Un,booleanish:gi,commaOrSpaceSeparated:Br,commaSeparated:Kc,number:Ve,overloadedBoolean:ZS,spaceSeparated:Lt},Symbol.toStringTag,{value:"Module"})),Kk=Object.keys(QS);class y9 extends jr{constructor(n,t,i,r){let a=-1;if(super(n,t),bM(this,"space",r),typeof i=="number")for(;++a4&&t.slice(0,4)==="data"&&pue.test(n)){if(n.charAt(4)==="-"){const a=n.slice(5).replace(wM,yue);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=n.slice(4);if(!wM.test(a)){let o=a.replace(mue,gue);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}r=y9}return new r(i,n)}function gue(e){return"-"+e.toLowerCase()}function yue(e){return e.charAt(1).toUpperCase()}const bue=Cq([Aq,fue,Eq,Tq,Mq],"html"),b9=Cq([Aq,due,Eq,Tq,Mq],"svg");function wue(e){return e.join(" ").trim()}var Dc={},Xk,kM;function kue(){if(kM)return Xk;kM=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=` +`,f="/",h="*",d="",p="comment",v="declaration";function b(k,_){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];_=_||{};var C=1,x=1;function E(V){var $=V.match(n);$&&(C+=$.length);var P=V.lastIndexOf(c);x=~P?V.length-P:x+V.length}function j(){var V={line:C,column:x};return function($){return $.position=new O(V),q(),$}}function O(V){this.start=V,this.end={line:C,column:x},this.source=_.source}O.prototype.content=k;function M(V){var $=new Error(_.source+":"+C+":"+x+": "+V);if($.reason=V,$.filename=_.source,$.line=C,$.column=x,$.source=k,!_.silent)throw $}function N(V){var $=V.exec(k);if($){var P=$[0];return E(P),k=k.slice(P.length),$}}function q(){N(t)}function R(V){var $;for(V=V||[];$=L();)$!==!1&&V.push($);return V}function L(){var V=j();if(!(f!=k.charAt(0)||h!=k.charAt(1))){for(var $=2;d!=k.charAt($)&&(h!=k.charAt($)||f!=k.charAt($+1));)++$;if($+=2,d===k.charAt($-1))return M("End of comment missing");var P=k.slice(2,$-2);return x+=2,E(P),k=k.slice($),x+=2,V({type:p,comment:P})}}function F(){var V=j(),$=N(i);if($){if(L(),!N(r))return M("property missing ':'");var P=N(a),I=V({type:v,property:w($[0].replace(e,d)),value:P?w(P[0].replace(e,d)):d});return N(o),I}}function Y(){var V=[];R(V);for(var $;$=F();)$!==!1&&(V.push($),R(V));return V}return q(),Y()}function w(k){return k?k.replace(l,d):d}return Xk=b,Xk}var _M;function _ue(){if(_M)return Dc;_M=1;var e=Dc&&Dc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.default=t;const n=e(kue());function t(i,r){let a=null;if(!i||typeof i!="string")return a;const o=(0,n.default)(i),l=typeof r=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:h}=c;l?r(f,h,c):h&&(a=a||{},a[f]=h)}),a}return Dc}var lh={},xM;function xue(){if(xM)return lh;xM=1,Object.defineProperty(lh,"__esModule",{value:!0}),lh.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,a=function(f){return!f||t.test(f)||e.test(f)},o=function(f,h){return h.toUpperCase()},l=function(f,h){return"".concat(h,"-")},c=function(f,h){return h===void 0&&(h={}),a(f)?f:(f=f.toLowerCase(),h.reactCompat?f=f.replace(r,l):f=f.replace(i,l),f.replace(n,o))};return lh.camelCase=c,lh}var uh,SM;function Sue(){if(SM)return uh;SM=1;var e=uh&&uh.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},n=e(_ue()),t=xue();function i(r,a){var o={};return!r||typeof r!="string"||(0,n.default)(r,function(l,c){l&&c&&(o[(0,t.camelCase)(l,a)]=c)}),o}return i.default=i,uh=i,uh}var Cue=Sue();const Aue=yt(Cue),Dq=Rq("end"),w9=Rq("start");function Rq(e){return n;function n(t){const i=t&&t.position&&t.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function jue(e){const n=w9(e),t=Dq(e);if(n&&t)return{start:n,end:t}}function Ih(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?CM(e.position):"start"in e||"end"in e?CM(e):"line"in e||"column"in e?JS(e):""}function JS(e){return AM(e&&e.line)+":"+AM(e&&e.column)}function CM(e){return JS(e&&e.start)+"-"+JS(e&&e.end)}function AM(e){return e&&typeof e=="number"?e:1}class nr extends Error{constructor(n,t,i){super(),typeof t=="string"&&(i=t,t=void 0);let r="",a={},o=!1;if(t&&("line"in t&&"column"in t?a={place:t}:"start"in t&&"end"in t?a={place:t}:"type"in t?a={ancestors:[t],place:t.position}:a={...t}),typeof n=="string"?r=n:!a.cause&&n&&(o=!0,r=n.message,a.cause=n),!a.ruleId&&!a.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?a.ruleId=i:(a.source=i.slice(0,c),a.ruleId=i.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=Ih(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nr.prototype.file="";nr.prototype.name="";nr.prototype.reason="";nr.prototype.message="";nr.prototype.stack="";nr.prototype.column=void 0;nr.prototype.line=void 0;nr.prototype.ancestors=void 0;nr.prototype.cause=void 0;nr.prototype.fatal=void 0;nr.prototype.place=void 0;nr.prototype.ruleId=void 0;nr.prototype.source=void 0;const k9={}.hasOwnProperty,Oue=new Map,Eue=/[A-Z]/g,Tue=new Set(["table","tbody","thead","tfoot","tr"]),Mue=new Set(["td","th"]),Pq="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Due(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let i;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Bue(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Iue(t,n.jsx,n.jsxs)}const r={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:i,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?b9:bue,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},a=Nq(r,e,void 0);return a&&typeof a!="string"?a:r.create(e,r.Fragment,{children:a||void 0},void 0)}function Nq(e,n,t){if(n.type==="element")return Rue(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Pue(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return $ue(e,n,t);if(n.type==="mdxjsEsm")return Nue(e,n);if(n.type==="root")return zue(e,n,t);if(n.type==="text")return Lue(e,n)}function Rue(e,n,t){const i=e.schema;let r=i;n.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=b9,e.schema=r),e.ancestors.push(n);const a=zq(e,n.tagName,!1),o=Fue(e,n);let l=x9(e,n);return Tue.has(n.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!uue(c):!0})),$q(e,o,a,n),_9(o,l),e.ancestors.pop(),e.schema=i,e.create(n,a,o,t)}function Pue(e,n){if(n.data&&n.data.estree&&e.evaluater){const i=n.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}um(e,n.position)}function Nue(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);um(e,n.position)}function $ue(e,n,t){const i=e.schema;let r=i;n.name==="svg"&&i.space==="html"&&(r=b9,e.schema=r),e.ancestors.push(n);const a=n.name===null?e.Fragment:zq(e,n.name,!0),o=que(e,n),l=x9(e,n);return $q(e,o,a,n),_9(o,l),e.ancestors.pop(),e.schema=i,e.create(n,a,o,t)}function zue(e,n,t){const i={};return _9(i,x9(e,n)),e.create(n,e.Fragment,i,t)}function Lue(e,n){return n.value}function $q(e,n,t,i){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=i)}function _9(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Iue(e,n,t){return i;function i(r,a,o,l){const f=Array.isArray(o.children)?t:n;return l?f(a,o,l):f(a,o)}}function Bue(e,n){return t;function t(i,r,a,o){const l=Array.isArray(a.children),c=w9(i);return n(r,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Fue(e,n){const t={};let i,r;for(r in n.properties)if(r!=="children"&&k9.call(n.properties,r)){const a=Hue(e,r,n.properties[r]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Mue.has(n.tagName)?i=l:t[o]=l}}if(i){const a=t.style||(t.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return t}function que(e,n){const t={};for(const i of n.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const a=i.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(t,e.evaluater.evaluateExpression(l.argument))}else um(e,n.position);else{const r=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else um(e,n.position);else a=i.value===null?!0:i.value;t[r]=a}return t}function x9(e,n){const t=[];let i=-1;const r=e.passKeys?new Map:Oue;for(;++ir?0:r+n:n=n>r?r:n,t=t>0?t:0,i.length<1e4)o=Array.from(i),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);a0?(Yr(e,e.length,0,n),e):n}const EM={}.hasOwnProperty;function Iq(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ha(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lr=Al(/[A-Za-z]/),er=Al(/[\dA-Za-z]/),Que=Al(/[#-'*+\--9=?A-Z^-~]/);function Qg(e){return e!==null&&(e<32||e===127)}const e4=Al(/\d/),Jue=Al(/[\dA-Fa-f]/),ece=Al(/[!-/:-@[-`{-~]/);function xn(e){return e!==null&&e<-2}function Nt(e){return e!==null&&(e<0||e===32)}function Jn(e){return e===-2||e===-1||e===32}const b0=Al(new RegExp("\\p{P}|\\p{S}","u")),Su=Al(/\s/);function Al(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ed(e){const n=[];let t=-1,i=0,r=0;for(;++t55295&&a<57344){const l=e.charCodeAt(t+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),r=1):o="�"}else o=String.fromCharCode(a);o&&(n.push(e.slice(i,t),encodeURIComponent(o)),i=t+r+1,o=""),r&&(t+=r,r=0)}return n.join("")+e.slice(i)}function ct(e,n,t,i){const r=i?i-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Jn(c)?(e.enter(t),l(c)):n(c)}function l(c){return Jn(c)&&a++o))return;const M=n.events.length;let N=M,q,R;for(;N--;)if(n.events[N][0]==="exit"&&n.events[N][1].type==="chunkFlow"){if(q){R=n.events[N][1].end;break}q=!0}for(_(i),O=M;Ox;){const j=t[E];n.containerState=j[1],j[0].exit.call(n,e)}t.length=x}function C(){r.write([null]),a=void 0,r=void 0,n.containerState._closeFlow=void 0}}function ace(e,n,t){return ct(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sf(e){if(e===null||Nt(e)||Su(e))return 1;if(b0(e))return 2}function w0(e,n,t){const i=[];let r=-1;for(;++r1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[i][1].end},p={...e[t][1].start};MM(d,-c),MM(p,c),o={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},a={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[t][1].start}},r={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[i][1].end={...o.start},e[t][1].start={...l.end},f=[],e[i][1].end.offset-e[i][1].start.offset&&(f=ga(f,[["enter",e[i][1],n],["exit",e[i][1],n]])),f=ga(f,[["enter",r,n],["enter",o,n],["exit",o,n],["enter",a,n]]),f=ga(f,w0(n.parser.constructs.insideSpan.null,e.slice(i+1,t),n)),f=ga(f,[["exit",a,n],["enter",l,n],["exit",l,n],["exit",r,n]]),e[t][1].end.offset-e[t][1].start.offset?(h=2,f=ga(f,[["enter",e[t][1],n],["exit",e[t][1],n]])):h=0,Yr(e,i-1,t-i+3,f),t=i+f.length-h-2;break}}for(t=-1;++t0&&Jn(O)?ct(e,C,"linePrefix",a+1)(O):C(O)}function C(O){return O===null||xn(O)?e.check(DM,w,E)(O):(e.enter("codeFlowValue"),x(O))}function x(O){return O===null||xn(O)?(e.exit("codeFlowValue"),C(O)):(e.consume(O),x)}function E(O){return e.exit("codeFenced"),n(O)}function j(O,M,N){let q=0;return R;function R($){return O.enter("lineEnding"),O.consume($),O.exit("lineEnding"),L}function L($){return O.enter("codeFencedFence"),Jn($)?ct(O,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):F($)}function F($){return $===l?(O.enter("codeFencedFenceSequence"),Y($)):N($)}function Y($){return $===l?(q++,O.consume($),Y):q>=o?(O.exit("codeFencedFenceSequence"),Jn($)?ct(O,V,"whitespace")($):V($)):N($)}function V($){return $===null||xn($)?(O.exit("codeFencedFence"),M($)):N($)}}}function gce(e,n,t){const i=this;return r;function r(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return i.parser.lazy[i.now().line]?t(o):n(o)}}const Qk={name:"codeIndented",tokenize:bce},yce={partial:!0,tokenize:wce};function bce(e,n,t){const i=this;return r;function r(f){return e.enter("codeIndented"),ct(e,a,"linePrefix",5)(f)}function a(f){const h=i.events[i.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(f):t(f)}function o(f){return f===null?c(f):xn(f)?e.attempt(yce,o,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||xn(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),n(f)}}function wce(e,n,t){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?t(o):xn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):ct(e,a,"linePrefix",5)(o)}function a(o){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?n(o):xn(o)?r(o):t(o)}}const kce={name:"codeText",previous:xce,resolve:_ce,tokenize:Sce};function _ce(e){let n=e.length-4,t=3,i,r;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(i=t;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(n,t,i){const r=t||0;this.setCursor(Math.trunc(n));const a=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&ch(this.left,i),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),ch(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),ch(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(o):e.interrupt(i.parser.constructs.flow,t,n)(o)}}function Vq(e,n,t,i,r,a,o,l,c){const f=c||Number.POSITIVE_INFINITY;let h=0;return d;function d(_){return _===60?(e.enter(i),e.enter(r),e.enter(a),e.consume(_),e.exit(a),p):_===null||_===32||_===41||Qg(_)?t(_):(e.enter(i),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(_))}function p(_){return _===62?(e.enter(a),e.consume(_),e.exit(a),e.exit(r),e.exit(i),n):(e.enter(l),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===62?(e.exit("chunkString"),e.exit(l),p(_)):_===null||_===60||xn(_)?t(_):(e.consume(_),_===92?b:v)}function b(_){return _===60||_===62||_===92?(e.consume(_),v):v(_)}function w(_){return!h&&(_===null||_===41||Nt(_))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(i),n(_)):h999||v===null||v===91||v===93&&!c||v===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?t(v):v===93?(e.exit(a),e.enter(r),e.consume(v),e.exit(r),e.exit(i),n):xn(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===null||v===91||v===93||xn(v)||l++>999?(e.exit("chunkString"),h(v)):(e.consume(v),c||(c=!Jn(v)),v===92?p:d)}function p(v){return v===91||v===92||v===93?(e.consume(v),l++,d):d(v)}}function Gq(e,n,t,i,r,a){let o;return l;function l(p){return p===34||p===39||p===40?(e.enter(i),e.enter(r),e.consume(p),e.exit(r),o=p===40?41:p,c):t(p)}function c(p){return p===o?(e.enter(r),e.consume(p),e.exit(r),e.exit(i),n):(e.enter(a),f(p))}function f(p){return p===o?(e.exit(a),c(o)):p===null?t(p):xn(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ct(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===o||p===null||xn(p)?(e.exit("chunkString"),f(p)):(e.consume(p),p===92?d:h)}function d(p){return p===o||p===92?(e.consume(p),h):h(p)}}function Bh(e,n){let t;return i;function i(r){return xn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t=!0,i):Jn(r)?ct(e,i,t?"linePrefix":"lineSuffix")(r):n(r)}}const Dce={name:"definition",tokenize:Pce},Rce={partial:!0,tokenize:Nce};function Pce(e,n,t){const i=this;let r;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return Wq.call(i,e,l,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function l(v){return r=Ha(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):t(v)}function c(v){return Nt(v)?Bh(e,f)(v):f(v)}function f(v){return Vq(e,h,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function h(v){return e.attempt(Rce,d,d)(v)}function d(v){return Jn(v)?ct(e,p,"whitespace")(v):p(v)}function p(v){return v===null||xn(v)?(e.exit("definition"),i.parser.defined.push(r),n(v)):t(v)}}function Nce(e,n,t){return i;function i(l){return Nt(l)?Bh(e,r)(l):t(l)}function r(l){return Gq(e,a,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Jn(l)?ct(e,o,"whitespace")(l):o(l)}function o(l){return l===null||xn(l)?n(l):t(l)}}const $ce={name:"hardBreakEscape",tokenize:zce};function zce(e,n,t){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),r}function r(a){return xn(a)?(e.exit("hardBreakEscape"),n(a)):t(a)}}const Lce={name:"headingAtx",resolve:Ice,tokenize:Bce};function Ice(e,n){let t=e.length-2,i=3,r,a;return e[i][1].type==="whitespace"&&(i+=2),t-2>i&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(i===t-1||t-4>i&&e[t-2][1].type==="whitespace")&&(t-=i+1===t?2:4),t>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[t][1].end},a={type:"chunkText",start:e[i][1].start,end:e[t][1].end,contentType:"text"},Yr(e,i,t-i+1,[["enter",r,n],["enter",a,n],["exit",a,n],["exit",r,n]])),e}function Bce(e,n,t){let i=0;return r;function r(h){return e.enter("atxHeading"),a(h)}function a(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&i++<6?(e.consume(h),o):h===null||Nt(h)?(e.exit("atxHeadingSequence"),l(h)):t(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||xn(h)?(e.exit("atxHeading"),n(h)):Jn(h)?ct(e,l,"whitespace")(h):(e.enter("atxHeadingText"),f(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),l(h))}function f(h){return h===null||h===35||Nt(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),f)}}const Fce=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],PM=["pre","script","style","textarea"],qce={concrete:!0,name:"htmlFlow",resolveTo:Vce,tokenize:Wce},Hce={partial:!0,tokenize:Yce},Uce={partial:!0,tokenize:Gce};function Vce(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Wce(e,n,t){const i=this;let r,a,o,l,c;return f;function f(z){return h(z)}function h(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),d}function d(z){return z===33?(e.consume(z),p):z===47?(e.consume(z),a=!0,w):z===63?(e.consume(z),r=3,i.interrupt?n:D):lr(z)?(e.consume(z),o=String.fromCharCode(z),k):t(z)}function p(z){return z===45?(e.consume(z),r=2,v):z===91?(e.consume(z),r=5,l=0,b):lr(z)?(e.consume(z),r=4,i.interrupt?n:D):t(z)}function v(z){return z===45?(e.consume(z),i.interrupt?n:D):t(z)}function b(z){const X="CDATA[";return z===X.charCodeAt(l++)?(e.consume(z),l===X.length?i.interrupt?n:F:b):t(z)}function w(z){return lr(z)?(e.consume(z),o=String.fromCharCode(z),k):t(z)}function k(z){if(z===null||z===47||z===62||Nt(z)){const X=z===47,ee=o.toLowerCase();return!X&&!a&&PM.includes(ee)?(r=1,i.interrupt?n(z):F(z)):Fce.includes(o.toLowerCase())?(r=6,X?(e.consume(z),_):i.interrupt?n(z):F(z)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?t(z):a?C(z):x(z))}return z===45||er(z)?(e.consume(z),o+=String.fromCharCode(z),k):t(z)}function _(z){return z===62?(e.consume(z),i.interrupt?n:F):t(z)}function C(z){return Jn(z)?(e.consume(z),C):R(z)}function x(z){return z===47?(e.consume(z),R):z===58||z===95||lr(z)?(e.consume(z),E):Jn(z)?(e.consume(z),x):R(z)}function E(z){return z===45||z===46||z===58||z===95||er(z)?(e.consume(z),E):j(z)}function j(z){return z===61?(e.consume(z),O):Jn(z)?(e.consume(z),j):x(z)}function O(z){return z===null||z===60||z===61||z===62||z===96?t(z):z===34||z===39?(e.consume(z),c=z,M):Jn(z)?(e.consume(z),O):N(z)}function M(z){return z===c?(e.consume(z),c=null,q):z===null||xn(z)?t(z):(e.consume(z),M)}function N(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Nt(z)?j(z):(e.consume(z),N)}function q(z){return z===47||z===62||Jn(z)?x(z):t(z)}function R(z){return z===62?(e.consume(z),L):t(z)}function L(z){return z===null||xn(z)?F(z):Jn(z)?(e.consume(z),L):t(z)}function F(z){return z===45&&r===2?(e.consume(z),P):z===60&&r===1?(e.consume(z),I):z===62&&r===4?(e.consume(z),W):z===63&&r===3?(e.consume(z),D):z===93&&r===5?(e.consume(z),U):xn(z)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Hce,G,Y)(z)):z===null||xn(z)?(e.exit("htmlFlowData"),Y(z)):(e.consume(z),F)}function Y(z){return e.check(Uce,V,G)(z)}function V(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),$}function $(z){return z===null||xn(z)?Y(z):(e.enter("htmlFlowData"),F(z))}function P(z){return z===45?(e.consume(z),D):F(z)}function I(z){return z===47?(e.consume(z),o="",H):F(z)}function H(z){if(z===62){const X=o.toLowerCase();return PM.includes(X)?(e.consume(z),W):F(z)}return lr(z)&&o.length<8?(e.consume(z),o+=String.fromCharCode(z),H):F(z)}function U(z){return z===93?(e.consume(z),D):F(z)}function D(z){return z===62?(e.consume(z),W):z===45&&r===2?(e.consume(z),D):F(z)}function W(z){return z===null||xn(z)?(e.exit("htmlFlowData"),G(z)):(e.consume(z),W)}function G(z){return e.exit("htmlFlow"),n(z)}}function Gce(e,n,t){const i=this;return r;function r(o){return xn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):t(o)}function a(o){return i.parser.lazy[i.now().line]?t(o):n(o)}}function Yce(e,n,t){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(vp,n,t)}}const Kce={name:"htmlText",tokenize:Xce};function Xce(e,n,t){const i=this;let r,a,o;return l;function l(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),c}function c(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),j):D===63?(e.consume(D),x):lr(D)?(e.consume(D),N):t(D)}function f(D){return D===45?(e.consume(D),h):D===91?(e.consume(D),a=0,b):lr(D)?(e.consume(D),C):t(D)}function h(D){return D===45?(e.consume(D),v):t(D)}function d(D){return D===null?t(D):D===45?(e.consume(D),p):xn(D)?(o=d,I(D)):(e.consume(D),d)}function p(D){return D===45?(e.consume(D),v):d(D)}function v(D){return D===62?P(D):D===45?p(D):d(D)}function b(D){const W="CDATA[";return D===W.charCodeAt(a++)?(e.consume(D),a===W.length?w:b):t(D)}function w(D){return D===null?t(D):D===93?(e.consume(D),k):xn(D)?(o=w,I(D)):(e.consume(D),w)}function k(D){return D===93?(e.consume(D),_):w(D)}function _(D){return D===62?P(D):D===93?(e.consume(D),_):w(D)}function C(D){return D===null||D===62?P(D):xn(D)?(o=C,I(D)):(e.consume(D),C)}function x(D){return D===null?t(D):D===63?(e.consume(D),E):xn(D)?(o=x,I(D)):(e.consume(D),x)}function E(D){return D===62?P(D):x(D)}function j(D){return lr(D)?(e.consume(D),O):t(D)}function O(D){return D===45||er(D)?(e.consume(D),O):M(D)}function M(D){return xn(D)?(o=M,I(D)):Jn(D)?(e.consume(D),M):P(D)}function N(D){return D===45||er(D)?(e.consume(D),N):D===47||D===62||Nt(D)?q(D):t(D)}function q(D){return D===47?(e.consume(D),P):D===58||D===95||lr(D)?(e.consume(D),R):xn(D)?(o=q,I(D)):Jn(D)?(e.consume(D),q):P(D)}function R(D){return D===45||D===46||D===58||D===95||er(D)?(e.consume(D),R):L(D)}function L(D){return D===61?(e.consume(D),F):xn(D)?(o=L,I(D)):Jn(D)?(e.consume(D),L):q(D)}function F(D){return D===null||D===60||D===61||D===62||D===96?t(D):D===34||D===39?(e.consume(D),r=D,Y):xn(D)?(o=F,I(D)):Jn(D)?(e.consume(D),F):(e.consume(D),V)}function Y(D){return D===r?(e.consume(D),r=void 0,$):D===null?t(D):xn(D)?(o=Y,I(D)):(e.consume(D),Y)}function V(D){return D===null||D===34||D===39||D===60||D===61||D===96?t(D):D===47||D===62||Nt(D)?q(D):(e.consume(D),V)}function $(D){return D===47||D===62||Nt(D)?q(D):t(D)}function P(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),n):t(D)}function I(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),H}function H(D){return Jn(D)?ct(e,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):U(D)}function U(D){return e.enter("htmlTextData"),o(D)}}const A9={name:"labelEnd",resolveAll:efe,resolveTo:nfe,tokenize:tfe},Zce={tokenize:ife},Qce={tokenize:rfe},Jce={tokenize:afe};function efe(e){let n=-1;const t=[];for(;++n=3&&(f===null||xn(f))?(e.exit("thematicBreak"),n(f)):t(f)}function c(f){return f===r?(e.consume(f),i++,c):(e.exit("thematicBreakSequence"),Jn(f)?ct(e,l,"whitespace")(f):l(f))}}const _r={continuation:{tokenize:pfe},exit:gfe,name:"list",tokenize:mfe},dfe={partial:!0,tokenize:yfe},hfe={partial:!0,tokenize:vfe};function mfe(e,n,t){const i=this,r=i.events[i.events.length-1];let a=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return l;function l(v){const b=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:e4(v)){if(i.containerState.type||(i.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(jg,t,f)(v):f(v);if(!i.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return t(v)}function c(v){return e4(v)&&++o<10?(e.consume(v),c):(!i.interrupt||o<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):t(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,e.check(vp,i.interrupt?t:h,e.attempt(dfe,p,d))}function h(v){return i.containerState.initialBlankLine=!0,a++,p(v)}function d(v){return Jn(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),p):t(v)}function p(v){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(v)}}function pfe(e,n,t){const i=this;return i.containerState._closeFlow=void 0,e.check(vp,r,a);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ct(e,n,"listItemIndent",i.containerState.size+1)(l)}function a(l){return i.containerState.furtherBlankLines||!Jn(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(hfe,n,o)(l))}function o(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,ct(e,e.attempt(_r,n,t),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function vfe(e,n,t){const i=this;return ct(e,r,"listItemIndent",i.containerState.size+1);function r(a){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?n(a):t(a)}}function gfe(e){e.exit(this.containerState.type)}function yfe(e,n,t){const i=this;return ct(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(a){const o=i.events[i.events.length-1];return!Jn(a)&&o&&o[1].type==="listItemPrefixWhitespace"?n(a):t(a)}}const NM={name:"setextUnderline",resolveTo:bfe,tokenize:wfe};function bfe(e,n){let t=e.length,i,r,a;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){i=t;break}e[t][1].type==="paragraph"&&(r=t)}else e[t][1].type==="content"&&e.splice(t,1),!a&&e[t][1].type==="definition"&&(a=t);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",a?(e.splice(r,0,["enter",o,n]),e.splice(a+1,0,["exit",e[i][1],n]),e[i][1].end={...e[a][1].end}):e[i][1]=o,e.push(["exit",o,n]),e}function wfe(e,n,t){const i=this;let r;return a;function a(f){let h=i.events.length,d;for(;h--;)if(i.events[h][1].type!=="lineEnding"&&i.events[h][1].type!=="linePrefix"&&i.events[h][1].type!=="content"){d=i.events[h][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),r=f,o(f)):t(f)}function o(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===r?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),Jn(f)?ct(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||xn(f)?(e.exit("setextHeadingLine"),n(f)):t(f)}}const kfe={tokenize:_fe};function _fe(e){const n=this,t=e.attempt(vp,i,e.attempt(this.parser.constructs.flowInitial,r,ct(e,e.attempt(this.parser.constructs.flow,r,e.attempt(jce,r)),"linePrefix")));return t;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const xfe={resolveAll:Kq()},Sfe=Yq("string"),Cfe=Yq("text");function Yq(e){return{resolveAll:Kq(e==="text"?Afe:void 0),tokenize:n};function n(t){const i=this,r=this.parser.constructs[e],a=t.attempt(r,o,l);return o;function o(h){return f(h)?a(h):l(h)}function l(h){if(h===null){t.consume(h);return}return t.enter("data"),t.consume(h),c}function c(h){return f(h)?(t.exit("data"),a(h)):(t.consume(h),c)}function f(h){if(h===null)return!0;const d=r[h];let p=-1;if(d)for(;++p-1){const l=o[0];typeof l=="string"?o[0]=l.slice(i):o.shift()}a>0&&o.push(e[r].slice(0,a))}return o}function Ife(e,n){let t=-1;const i=[];let r;for(;++t0){const an=Ke.tokenStack[Ke.tokenStack.length-1];(an[1]||zM).call(Ke,void 0,an[0])}for(ve.position={start:Ys(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:Ys(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae0&&(i.className=["language-"+r[0]]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:t}]};return n.meta&&(a.data={meta:n.meta}),e.patch(n,a),a=e.applyData(n,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(n,a),a}function Jfe(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ede(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function nde(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(n.identifier).toUpperCase(),r=ed(i.toLowerCase()),a=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+r,id:t+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,f),e.applyData(n,f)}function tde(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ide(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Qq(e,n){const t=n.referenceType;let i="]";if(t==="collapsed"?i+="[]":t==="full"&&(i+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+i}];const r=e.all(n),a=r[0];a&&a.type==="text"?a.value="["+a.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function rde(e,n){const t=String(n.identifier).toUpperCase(),i=e.definitionById.get(t);if(!i)return Qq(e,n);const r={src:ed(i.url||""),alt:n.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(n,a),e.applyData(n,a)}function ade(e,n){const t={src:ed(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const i={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,i),e.applyData(n,i)}function ode(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const i={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,i),e.applyData(n,i)}function sde(e,n){const t=String(n.identifier).toUpperCase(),i=e.definitionById.get(t);if(!i)return Qq(e,n);const r={href:ed(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"a",properties:r,children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function lde(e,n){const t={href:ed(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const i={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function ude(e,n,t){const i=e.all(n),r=t?cde(t):Jq(n),a={},o=[];if(typeof n.checked=="boolean"){const h=i[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},i.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function fde(e,n){const t={},i=e.all(n);let r=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++r0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},l=w9(n.children[1]),c=Dq(n.children[n.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(n,a),e.applyData(n,a)}function vde(e,n,t){const i=t?t.children:void 0,a=(i?i.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,l=o?o.length:n.children.length;let c=-1;const f=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=t.exec(n);return a.push(BM(n.slice(r),r>0,!1)),a.join("")}function BM(e,n,t){let i=0,r=e.length;if(n){let a=e.codePointAt(i);for(;a===LM||a===IM;)i++,a=e.codePointAt(i)}if(t){let a=e.codePointAt(r-1);for(;a===LM||a===IM;)r--,a=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function bde(e,n){const t={type:"text",value:yde(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function wde(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const kde={blockquote:Xfe,break:Zfe,code:Qfe,delete:Jfe,emphasis:ede,footnoteReference:nde,heading:tde,html:ide,imageReference:rde,image:ade,inlineCode:ode,linkReference:sde,link:lde,listItem:ude,list:fde,paragraph:dde,root:hde,strong:mde,table:pde,tableCell:gde,tableRow:vde,text:bde,thematicBreak:wde,toml:Yv,yaml:Yv,definition:Yv,footnoteDefinition:Yv};function Yv(){}const eH=-1,k0=0,Fh=1,Jg=2,j9=3,O9=4,E9=5,T9=6,nH=7,tH=8,_de=typeof self=="object"?self:globalThis,FM=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new _de[e](n)},xde=(e,n)=>{const t=(r,a)=>(e.set(a,r),r),i=r=>{if(e.has(r))return e.get(r);const[a,o]=n[r];switch(a){case k0:case eH:return t(o,r);case Fh:{const l=t([],r);for(const c of o)l.push(i(c));return l}case Jg:{const l=t({},r);for(const[c,f]of o)l[i(c)]=i(f);return l}case j9:return t(new Date(o),r);case O9:{const{source:l,flags:c}=o;return t(new RegExp(l,c),r)}case E9:{const l=t(new Map,r);for(const[c,f]of o)l.set(i(c),i(f));return l}case T9:{const l=t(new Set,r);for(const c of o)l.add(i(c));return l}case nH:{const{name:l,message:c}=o;return t(FM(l,c),r)}case tH:return t(BigInt(o),r);case"BigInt":return t(Object(BigInt(o)),r);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return t(new DataView(l),o)}}return t(FM(a,o),r)};return i},qM=e=>xde(new Map,e)(0),Rc="",{toString:Sde}={},{keys:Cde}=Object,fh=e=>{const n=typeof e;if(n!=="object"||!e)return[k0,n];const t=Sde.call(e).slice(8,-1);switch(t){case"Array":return[Fh,Rc];case"Object":return[Jg,Rc];case"Date":return[j9,Rc];case"RegExp":return[O9,Rc];case"Map":return[E9,Rc];case"Set":return[T9,Rc];case"DataView":return[Fh,t]}return t.includes("Array")?[Fh,t]:t.includes("Error")?[nH,t]:[Jg,t]},Kv=([e,n])=>e===k0&&(n==="function"||n==="symbol"),Ade=(e,n,t,i)=>{const r=(o,l)=>{const c=i.push(o)-1;return t.set(l,c),c},a=o=>{if(t.has(o))return t.get(o);let[l,c]=fh(o);switch(l){case k0:{let h=o;switch(c){case"bigint":l=tH,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return r([eH],o)}return r([l,h],o)}case Fh:{if(c){let p=o;return c==="DataView"?p=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(o)),r([c,[...p]],o)}const h=[],d=r([l,h],o);for(const p of o)h.push(a(p));return d}case Jg:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(n&&"toJSON"in o)return a(o.toJSON());const h=[],d=r([l,h],o);for(const p of Cde(o))(e||!Kv(fh(o[p])))&&h.push([a(p),a(o[p])]);return d}case j9:return r([l,o.toISOString()],o);case O9:{const{source:h,flags:d}=o;return r([l,{source:h,flags:d}],o)}case E9:{const h=[],d=r([l,h],o);for(const[p,v]of o)(e||!(Kv(fh(p))||Kv(fh(v))))&&h.push([a(p),a(v)]);return d}case T9:{const h=[],d=r([l,h],o);for(const p of o)(e||!Kv(fh(p)))&&h.push(a(p));return d}}const{message:f}=o;return r([l,{name:c,message:f}],o)};return a},HM=(e,{json:n,lossy:t}={})=>{const i=[];return Ade(!(n||t),!!n,new Map,i)(e),i},e1=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?qM(HM(e,n)):structuredClone(e):(e,n)=>qM(HM(e,n));function jde(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Ode(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Ede(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||jde,i=e.options.footnoteBackLabel||Ode,r=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&b.push({type:"text",value:" "});let C=typeof t=="string"?t:t(c,v);typeof C=="string"&&(C={type:"text",value:C}),b.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(c,v),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const k=h[h.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const C=k.children[k.children.length-1];C&&C.type==="text"?C.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...b)}else h.push(...b);const _={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(h,!0)};e.patch(f,_),l.push(_)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...e1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` +`}]}}const _0=(function(e){if(e==null)return Rde;if(typeof e=="function")return x0(e);if(typeof e=="object")return Array.isArray(e)?Tde(e):Mde(e);if(typeof e=="string")return Dde(e);throw new Error("Expected function, string, or object as test")});function Tde(e){const n=[];let t=-1;for(;++t":""))+")"})}return p;function p(){let v=iH,b,w,k;if((!n||a(c,f,h[h.length-1]||void 0))&&(v=zde(t(c,h)),v[0]===t4))return v;if("children"in c&&c.children){const _=c;if(_.children&&v[0]!==$de)for(w=(i?_.children.length:-1)+o,k=h.concat(_);w>-1&&w<_.children.length;){const C=_.children[w];if(b=l(C,w,k)(),b[0]===t4)return b;w=typeof b[1]=="number"?b[1]:w+o}}return v}}}function zde(e){return Array.isArray(e)?e:typeof e=="number"?[Nde,e]:e==null?iH:[e]}function M9(e,n,t,i){let r,a,o;typeof n=="function"&&typeof t!="function"?(a=void 0,o=n,r=t):(a=n,o=t,r=i),rH(e,a,l,r);function l(c,f){const h=f[f.length-1],d=h?h.children.indexOf(c):void 0;return o(c,d,h)}}const i4={}.hasOwnProperty,Lde={};function Ide(e,n){const t=n||Lde,i=new Map,r=new Map,a=new Map,o={...kde,...t.handlers},l={all:f,applyData:Fde,definitionById:i,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:t,patch:Bde,wrap:Hde};return M9(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?i:r,p=String(h.identifier).toUpperCase();d.has(p)||d.set(p,h)}}),l;function c(h,d){const p=h.type,v=l.handlers[p];if(i4.call(l.handlers,p)&&v)return v(l,h,d);if(l.options.passThrough&&l.options.passThrough.includes(p)){if("children"in h){const{children:w,...k}=h,_=e1(k);return _.children=l.all(h),_}return e1(h)}return(l.options.unknownHandler||qde)(l,h,d)}function f(h){const d=[];if("children"in h){const p=h.children;let v=-1;for(;++v0&&t.push({type:"text",value:` +`}),t}function UM(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function VM(e,n){const t=Ide(e,n),i=t.one(e,void 0),r=Ede(t),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&a.children.push({type:"text",value:` +`},r),a}function Ude(e,n){return e&&"run"in e?async function(t,i){const r=VM(t,{file:i,...n});await e.run(r,i)}:function(t,i){return VM(t,{file:i,...e||n})}}function WM(e){if(e)throw e}var e_,GM;function Vde(){if(GM)return e_;GM=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(f){return typeof Array.isArray=="function"?Array.isArray(f):n.call(f)==="[object Array]"},a=function(f){if(!f||n.call(f)!=="[object Object]")return!1;var h=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!h&&!d)return!1;var p;for(p in f);return typeof p>"u"||e.call(f,p)},o=function(f,h){t&&h.name==="__proto__"?t(f,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):f[h.name]=h.newValue},l=function(f,h){if(h==="__proto__")if(e.call(f,h)){if(i)return i(f,h).value}else return;return f[h]};return e_=function c(){var f,h,d,p,v,b,w=arguments[0],k=1,_=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},k=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});k<_;++k)if(f=arguments[k],f!=null)for(h in f)d=l(w,h),p=l(f,h),w!==p&&(C&&p&&(a(p)||(v=r(p)))?(v?(v=!1,b=d&&r(d)?d:[]):b=d&&a(d)?d:{},o(w,{name:h,newValue:c(C,b,p)})):typeof p<"u"&&o(w,{name:h,newValue:p}));return w},e_}var Wde=Vde();const n_=yt(Wde);function r4(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Gde(){const e=[],n={run:t,use:i};return n;function t(...r){let a=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...r);function l(c,...f){const h=e[++a];let d=-1;if(c){o(c);return}for(;++do.length;let c;l&&o.push(r);try{c=e.apply(this,o)}catch(f){const h=f;if(l&&t)throw h;return r(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,r):c instanceof Error?r(c):a(c))}function r(o,...l){t||(t=!0,n(o,...l))}function a(o){r(null,o)}}const io={basename:Kde,dirname:Xde,extname:Zde,join:Qde,sep:"/"};function Kde(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');gp(e);let t=0,i=-1,r=e.length,a;if(n===void 0||n.length===0||n.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(a){t=r+1;break}}else i<0&&(a=!0,i=r+1);return i<0?"":e.slice(t,i)}if(n===e)return"";let o=-1,l=n.length-1;for(;r--;)if(e.codePointAt(r)===47){if(a){t=r+1;break}}else o<0&&(a=!0,o=r+1),l>-1&&(e.codePointAt(r)===n.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return t===i?i=o:i<0&&(i=e.length),e.slice(t,i)}function Xde(e){if(gp(e),e.length===0)return".";let n=-1,t=e.length,i;for(;--t;)if(e.codePointAt(t)===47){if(i){n=t;break}}else i||(i=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Zde(e){gp(e);let n=e.length,t=-1,i=0,r=-1,a=0,o;for(;n--;){const l=e.codePointAt(n);if(l===47){if(o){i=n+1;break}continue}t<0&&(o=!0,t=n+1),l===46?r<0?r=n:a!==1&&(a=1):r>-1&&(a=-1)}return r<0||t<0||a===0||a===1&&r===t-1&&r===i+1?"":e.slice(r,t)}function Qde(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function ehe(e,n){let t="",i=0,r=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",i=0):(t=t.slice(0,c),i=t.length-1-t.lastIndexOf("/")),r=o,a=0;continue}}else if(t.length>0){t="",i=0,r=o,a=0;continue}}n&&(t=t.length>0?t+"/..":"..",i=2)}else t.length>0?t+="/"+e.slice(r+1,o):t=e.slice(r+1,o),i=o-r-1;r=o,a=0}else l===46&&a>-1?a++:a=-1}return t}function gp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nhe={cwd:the};function the(){return"/"}function a4(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ihe(e){if(typeof e=="string")e=new URL(e);else if(!a4(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return rhe(e)}function rhe(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const n=e.pathname;let t=-1;for(;++t0){let[v,...b]=h;const w=i[p][1];r4(w)&&r4(v)&&(v=n_(!0,w,v)),i[p]=[f,v,...b]}}}}const lhe=new D9().freeze();function a_(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function o_(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function s_(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function KM(e){if(!r4(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function XM(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Xv(e){return uhe(e)?e:new aH(e)}function uhe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function che(e){return typeof e=="string"||fhe(e)}function fhe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dhe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ZM=[],QM={allowDangerousHtml:!0},hhe=/^(https?|ircs?|mailto|xmpp)$/i,mhe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function phe(e){const n=vhe(e),t=ghe(e);return yhe(n.runSync(n.parse(t),t),e)}function vhe(e){const n=e.rehypePlugins||ZM,t=e.remarkPlugins||ZM,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...QM}:QM;return lhe().use(Kfe).use(t).use(Ude,i).use(n)}function ghe(e){const n=e.children||"",t=new aH;return typeof n=="string"&&(t.value=n),t}function yhe(e,n){const t=n.allowedElements,i=n.allowElement,r=n.components,a=n.disallowedElements,o=n.skipHtml,l=n.unwrapDisallowed,c=n.urlTransform||bhe;for(const h of mhe)Object.hasOwn(n,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+dhe+h.id,void 0);return M9(e,f),Due(e,{Fragment:g.Fragment,components:r,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function f(h,d,p){if(h.type==="raw"&&p&&typeof d=="number")return o?p.children.splice(d,1):p.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let v;for(v in Zk)if(Object.hasOwn(Zk,v)&&Object.hasOwn(h.properties,v)){const b=h.properties[v],w=Zk[v];(w===null||w.includes(h.tagName))&&(h.properties[v]=c(String(b||""),v,h))}}if(h.type==="element"){let v=t?!t.includes(h.tagName):a?a.includes(h.tagName):!1;if(!v&&i&&typeof d=="number"&&(v=!i(h,d,p)),v&&p&&typeof d=="number")return l&&h.children?p.children.splice(d,1,...h.children):p.children.splice(d,1),d}}}function bhe(e){const n=e.indexOf(":"),t=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return n===-1||r!==-1&&n>r||t!==-1&&n>t||i!==-1&&n>i||hhe.test(e.slice(0,n))?e:""}function JM(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,r=t.indexOf(n);for(;r!==-1;)i++,r=t.indexOf(n,r+n.length);return i}function whe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function khe(e,n,t){const r=_0((t||{}).ignore||[]),a=_he(n);let o=-1;for(;++o0?{type:"text",value:O}:void 0),O===!1?p.lastIndex=E+1:(b!==E&&C.push({type:"text",value:f.value.slice(b,E)}),Array.isArray(O)?C.push(...O):O&&C.push(O),b=E+x[0].length,_=!0),!p.global)break;x=p.exec(f.value)}return _?(b?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],i=t.indexOf(")");const r=JM(e,"(");let a=JM(e,")");for(;i!==-1&&r>a;)e+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),a++;return[e,t]}function oH(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Su(t)||b0(t))&&(!n||t!==47)}sH.peek=Vhe;function zhe(){this.buffer()}function Lhe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ihe(){this.buffer()}function Bhe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Fhe(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),t.label=n}function qhe(e){this.exit(e)}function Hhe(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Uhe(e){this.exit(e)}function Vhe(){return"["}function sH(e,n,t,i){const r=t.createTracker(i);let a=r.move("[^");const o=t.enter("footnoteReference"),l=t.enter("reference");return a+=r.move(t.safe(t.associationId(e),{after:"]",before:a})),l(),o(),a+=r.move("]"),a}function Whe(){return{enter:{gfmFootnoteCallString:zhe,gfmFootnoteCall:Lhe,gfmFootnoteDefinitionLabelString:Ihe,gfmFootnoteDefinition:Bhe},exit:{gfmFootnoteCallString:Fhe,gfmFootnoteCall:qhe,gfmFootnoteDefinitionLabelString:Hhe,gfmFootnoteDefinition:Uhe}}}function Ghe(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:sH},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,r,a,o){const l=a.createTracker(o);let c=l.move("[^");const f=a.enter("footnoteDefinition"),h=a.enter("label");return c+=l.move(a.safe(a.associationId(i),{before:c,after:"]"})),h(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((n?` +`:" ")+a.indentLines(a.containerFlow(i,l.current()),n?lH:Yhe))),f(),c}}function Yhe(e,n,t){return n===0?e:lH(e,n,t)}function lH(e,n,t){return(t?"":" ")+e}const Khe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uH.peek=eme;function Xhe(){return{canContainEols:["delete"],enter:{strikethrough:Qhe},exit:{strikethrough:Jhe}}}function Zhe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Khe}],handlers:{delete:uH}}}function Qhe(e){this.enter({type:"delete",children:[]},e)}function Jhe(e){this.exit(e)}function uH(e,n,t,i){const r=t.createTracker(i),a=t.enter("strikethrough");let o=r.move("~~");return o+=t.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),a(),o}function eme(){return"~"}function nme(e){return e.length}function tme(e,n){const t=n||{},i=(t.align||[]).concat(),r=t.stringLength||nme,a=[],o=[],l=[],c=[];let f=0,h=-1;for(;++hf&&(f=e[h].length);++_c[_])&&(c[_]=x)}w.push(C)}o[h]=w,l[h]=k}let d=-1;if(typeof i=="object"&&"length"in i)for(;++dc[d]&&(c[d]=C),v[d]=C),p[d]=x}o.splice(1,0,p),l.splice(1,0,v),h=-1;const b=[];for(;++h "),a.shift(2);const o=t.indentLines(t.containerFlow(e,a.current()),ame);return r(),o}function ame(e,n,t){return">"+(t?"":" ")+e}function ome(e,n){return n8(e,n.inConstruct,!0)&&!n8(e,n.notInConstruct,!1)}function n8(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let i=-1;for(;++io&&(o=a):a=1,r=i+n.length,i=t.indexOf(n,r);return o}function lme(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ume(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function cme(e,n,t,i){const r=ume(t),a=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(lme(e,t)){const d=t.enter("codeIndented"),p=t.indentLines(a,fme);return d(),p}const l=t.createTracker(i),c=r.repeat(Math.max(sme(a,r)+1,3)),f=t.enter("codeFenced");let h=l.move(c);if(e.lang){const d=t.enter(`codeFencedLang${o}`);h+=l.move(t.safe(e.lang,{before:h,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=t.enter(`codeFencedMeta${o}`);h+=l.move(" "),h+=l.move(t.safe(e.meta,{before:h,after:` +`,encode:["`"],...l.current()})),d()}return h+=l.move(` +`),a&&(h+=l.move(a+` +`)),h+=l.move(c),f(),h}function fme(e,n,t){return(t?"":" ")+e}function R9(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function dme(e,n,t,i){const r=R9(t),a=r==='"'?"Quote":"Apostrophe",o=t.enter("definition");let l=t.enter("label");const c=t.createTracker(i);let f=c.move("[");return f+=c.move(t.safe(t.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(t.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=t.enter("destinationRaw"),f+=c.move(t.safe(e.url,{before:f,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=t.enter(`title${a}`),f+=c.move(" "+r),f+=c.move(t.safe(e.title,{before:f,after:r,...c.current()})),f+=c.move(r),l()),o(),f}function hme(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function cm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function n1(e,n,t){const i=sf(e),r=sf(n);return i===void 0?r===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}cH.peek=mme;function cH(e,n,t,i){const r=hme(t),a=t.enter("emphasis"),o=t.createTracker(i),l=o.move(r);let c=o.move(t.containerPhrasing(e,{after:r,before:l,...o.current()}));const f=c.charCodeAt(0),h=n1(i.before.charCodeAt(i.before.length-1),f,r);h.inside&&(c=cm(f)+c.slice(1));const d=c.charCodeAt(c.length-1),p=n1(i.after.charCodeAt(0),d,r);p.inside&&(c=c.slice(0,-1)+cm(d));const v=o.move(r);return a(),t.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},l+c+v}function mme(e,n,t){return t.options.emphasis||"*"}function pme(e,n){let t=!1;return M9(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return t=!0,t4}),!!((!e.depth||e.depth<3)&&S9(e)&&(n.options.setext||t))}function vme(e,n,t,i){const r=Math.max(Math.min(6,e.depth||1),1),a=t.createTracker(i);if(pme(e,t)){const h=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...a.current(),before:` +`,after:` +`});return d(),h(),p+` +`+(r===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` +`))+1))}const o="#".repeat(r),l=t.enter("headingAtx"),c=t.enter("phrasing");a.move(o+" ");let f=t.containerPhrasing(e,{before:"# ",after:` +`,...a.current()});return/^[\t ]/.test(f)&&(f=cm(f.charCodeAt(0))+f.slice(1)),f=f?o+" "+f:o,t.options.closeAtx&&(f+=" "+o),c(),l(),f}fH.peek=gme;function fH(e){return e.value||""}function gme(){return"<"}dH.peek=yme;function dH(e,n,t,i){const r=R9(t),a=r==='"'?"Quote":"Apostrophe",o=t.enter("image");let l=t.enter("label");const c=t.createTracker(i);let f=c.move("![");return f+=c.move(t.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(t.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=t.enter("destinationRaw"),f+=c.move(t.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=t.enter(`title${a}`),f+=c.move(" "+r),f+=c.move(t.safe(e.title,{before:f,after:r,...c.current()})),f+=c.move(r),l()),f+=c.move(")"),o(),f}function yme(){return"!"}hH.peek=bme;function hH(e,n,t,i){const r=e.referenceType,a=t.enter("imageReference");let o=t.enter("label");const l=t.createTracker(i);let c=l.move("![");const f=t.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const h=t.stack;t.stack=[],o=t.enter("reference");const d=t.safe(t.associationId(e),{before:c,after:"]",...l.current()});return o(),t.stack=h,a(),r==="full"||!f||f!==d?c+=l.move(d+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function bme(){return"!"}mH.peek=wme;function mH(e,n,t){let i=e.value||"",r="`",a=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++a\u007F]/.test(e.url))}vH.peek=kme;function vH(e,n,t,i){const r=R9(t),a=r==='"'?"Quote":"Apostrophe",o=t.createTracker(i);let l,c;if(pH(e,t)){const h=t.stack;t.stack=[],l=t.enter("autolink");let d=o.move("<");return d+=o.move(t.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),l(),t.stack=h,d}l=t.enter("link"),c=t.enter("label");let f=o.move("[");return f+=o.move(t.containerPhrasing(e,{before:f,after:"](",...o.current()})),f+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),f+=o.move("<"),f+=o.move(t.safe(e.url,{before:f,after:">",...o.current()})),f+=o.move(">")):(c=t.enter("destinationRaw"),f+=o.move(t.safe(e.url,{before:f,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=t.enter(`title${a}`),f+=o.move(" "+r),f+=o.move(t.safe(e.title,{before:f,after:r,...o.current()})),f+=o.move(r),c()),f+=o.move(")"),l(),f}function kme(e,n,t){return pH(e,t)?"<":"["}gH.peek=_me;function gH(e,n,t,i){const r=e.referenceType,a=t.enter("linkReference");let o=t.enter("label");const l=t.createTracker(i);let c=l.move("[");const f=t.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const h=t.stack;t.stack=[],o=t.enter("reference");const d=t.safe(t.associationId(e),{before:c,after:"]",...l.current()});return o(),t.stack=h,a(),r==="full"||!f||f!==d?c+=l.move(d+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function _me(){return"["}function P9(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function xme(e){const n=P9(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Sme(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function yH(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Cme(e,n,t,i){const r=t.enter("list"),a=t.bulletCurrent;let o=e.ordered?Sme(t):P9(t);const l=e.ordered?o==="."?")":".":xme(t);let c=n&&t.bulletLastUsed?o===t.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&h&&(!h.children||!h.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(c=!0),yH(t)===o&&h){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+a);let o=a.length+1;(r==="tab"||r==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=t.createTracker(i);l.move(a+" ".repeat(o-a.length)),l.shift(o);const c=t.enter("listItem"),f=t.indentLines(t.containerFlow(e,l.current()),h);return c(),f;function h(d,p,v){return p?(v?"":" ".repeat(o))+d:(v?a:a+" ".repeat(o-a.length))+d}}function Ome(e,n,t,i){const r=t.enter("paragraph"),a=t.enter("phrasing"),o=t.containerPhrasing(e,i);return a(),r(),o}const Eme=_0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Tme(e,n,t,i){return(e.children.some(function(o){return Eme(o)})?t.containerPhrasing:t.containerFlow).call(t,e,i)}function Mme(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}bH.peek=Dme;function bH(e,n,t,i){const r=Mme(t),a=t.enter("strong"),o=t.createTracker(i),l=o.move(r+r);let c=o.move(t.containerPhrasing(e,{after:r,before:l,...o.current()}));const f=c.charCodeAt(0),h=n1(i.before.charCodeAt(i.before.length-1),f,r);h.inside&&(c=cm(f)+c.slice(1));const d=c.charCodeAt(c.length-1),p=n1(i.after.charCodeAt(0),d,r);p.inside&&(c=c.slice(0,-1)+cm(d));const v=o.move(r+r);return a(),t.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},l+c+v}function Dme(e,n,t){return t.options.strong||"*"}function Rme(e,n,t,i){return t.safe(e.value,i)}function Pme(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function Nme(e,n,t){const i=(yH(t)+(t.options.ruleSpaces?" ":"")).repeat(Pme(t));return t.options.ruleSpaces?i.slice(0,-1):i}const wH={blockquote:rme,break:t8,code:cme,definition:dme,emphasis:cH,hardBreak:t8,heading:vme,html:fH,image:dH,imageReference:hH,inlineCode:mH,link:vH,linkReference:gH,list:Cme,listItem:jme,paragraph:Ome,root:Tme,strong:bH,text:Rme,thematicBreak:Nme};function $me(){return{enter:{table:zme,tableData:i8,tableHeader:i8,tableRow:Ime},exit:{codeText:Bme,table:Lme,tableData:f_,tableHeader:f_,tableRow:f_}}}function zme(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Lme(e){this.exit(e),this.data.inTable=void 0}function Ime(e){this.enter({type:"tableRow",children:[]},e)}function f_(e){this.exit(e)}function i8(e){this.enter({type:"tableCell",children:[]},e)}function Bme(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Fme));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function Fme(e,n){return n==="|"?n:e}function qme(e){const n=e||{},t=n.tableCellPadding,i=n.tablePipeAlign,r=n.stringLength,a=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:c,tableRow:l}};function o(v,b,w,k){return f(h(v,w,k),v.align)}function l(v,b,w,k){const _=d(v,w,k),C=f([_]);return C.slice(0,C.indexOf(` +`))}function c(v,b,w,k){const _=w.enter("tableCell"),C=w.enter("phrasing"),x=w.containerPhrasing(v,{...k,before:a,after:a});return C(),_(),x}function f(v,b){return tme(v,{align:b,alignDelimiters:i,padding:t,stringLength:r})}function h(v,b,w){const k=v.children;let _=-1;const C=[],x=b.enter("table");for(;++_0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const ope={tokenize:mpe,partial:!0};function spe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fpe,continuation:{tokenize:dpe},exit:hpe}},text:{91:{name:"gfmFootnoteCall",tokenize:cpe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lpe,resolveTo:upe}}}}function lpe(e,n,t){const i=this;let r=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return t(c);const f=Ha(i.sliceSerialize({start:o.end,end:i.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function upe(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[t+1],e[t+2],["enter",i,n],e[t+3],e[t+4],["enter",r,n],["exit",r,n],["enter",a,n],["enter",o,n],["exit",o,n],["exit",a,n],e[e.length-2],e[e.length-1],["exit",i,n]];return e.splice(t,e.length-t+1,...l),e}function cpe(e,n,t){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,o;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(a>999||d===93&&!o||d===null||d===91||Nt(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return r.includes(Ha(i.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return Nt(d)||(o=!0),a++,e.consume(d),d===92?h:f}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function fpe(e,n,t){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):t(b)}function h(b){if(o>999||b===93&&!l||b===null||b===91||Nt(b))return t(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Ha(i.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Nt(b)||(l=!0),o++,e.consume(b),b===92?d:h}function d(b){return b===91||b===92||b===93?(e.consume(b),o++,h):h(b)}function p(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),r.includes(a)||r.push(a),ct(e,v,"gfmFootnoteDefinitionWhitespace")):t(b)}function v(b){return n(b)}}function dpe(e,n,t){return e.check(vp,n,e.attempt(ope,n,t))}function hpe(e){e.exit("gfmFootnoteDefinition")}function mpe(e,n,t){const i=this;return ct(e,r,"gfmFootnoteDefinitionIndent",5);function r(a){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?n(a):t(a)}}function ppe(e){let t=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:r};return t==null&&(t=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,l){let c=-1;for(;++c1?c(b):(o.consume(b),d++,v);if(d<2&&!t)return c(b);const k=o.exit("strikethroughSequenceTemporary"),_=sf(b);return k._open=!_||_===2&&!!w,k._close=!w||w===2&&!!_,l(b)}}}class vpe{constructor(){this.map=[]}add(n,t,i){gpe(this,n,t,i)}consume(n){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let t=this.map.length;const i=[];for(;t>0;)t-=1,i.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];i.push(n.slice()),n.length=0;let r=i.pop();for(;r;){for(const a of r)n.push(a);r=i.pop()}this.map.length=0}}function gpe(e,n,t,i){let r=0;if(!(t===0&&i.length===0)){for(;r-1;){const V=i.events[L][1].type;if(V==="lineEnding"||V==="linePrefix")L--;else break}const F=L>-1?i.events[L][1].type:null,Y=F==="tableHead"||F==="tableRow"?O:c;return Y===O&&i.parser.lazy[i.now().line]?t(R):Y(R)}function c(R){return e.enter("tableHead"),e.enter("tableRow"),f(R)}function f(R){return R===124||(o=!0,a+=1),h(R)}function h(R){return R===null?t(R):xn(R)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),v):t(R):Jn(R)?ct(e,h,"whitespace")(R):(a+=1,o&&(o=!1,r+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),o=!0,h):(e.enter("data"),d(R)))}function d(R){return R===null||R===124||Nt(R)?(e.exit("data"),h(R)):(e.consume(R),R===92?p:d)}function p(R){return R===92||R===124?(e.consume(R),d):d(R)}function v(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?t(R):(e.enter("tableDelimiterRow"),o=!1,Jn(R)?ct(e,b,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):b(R))}function b(R){return R===45||R===58?k(R):R===124?(o=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),w):j(R)}function w(R){return Jn(R)?ct(e,k,"whitespace")(R):k(R)}function k(R){return R===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),_):R===45?(a+=1,_(R)):R===null||xn(R)?E(R):j(R)}function _(R){return R===45?(e.enter("tableDelimiterFiller"),C(R)):j(R)}function C(R){return R===45?(e.consume(R),C):R===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(R))}function x(R){return Jn(R)?ct(e,E,"whitespace")(R):E(R)}function E(R){return R===124?b(R):R===null||xn(R)?!o||r!==a?j(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(R)):j(R)}function j(R){return t(R)}function O(R){return e.enter("tableRow"),M(R)}function M(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),M):R===null||xn(R)?(e.exit("tableRow"),n(R)):Jn(R)?ct(e,M,"whitespace")(R):(e.enter("data"),N(R))}function N(R){return R===null||R===124||Nt(R)?(e.exit("data"),M(R)):(e.consume(R),R===92?q:N)}function q(R){return R===92||R===124?(e.consume(R),N):N(R)}}function kpe(e,n){let t=-1,i=!0,r=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,f,h,d;const p=new vpe;for(;++tt[2]+1){const b=t[2]+1,w=t[3]-t[2]-1;e.add(b,w,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return r!==void 0&&(a.end=Object.assign({},Fc(n.events,r)),e.add(r,0,[["exit",a,n]]),a=void 0),a}function a8(e,n,t,i,r){const a=[],o=Fc(n.events,t);r&&(r.end=Object.assign({},o),a.push(["exit",r,n])),i.end=Object.assign({},o),a.push(["exit",i,n]),e.add(t+1,0,a)}function Fc(e,n){const t=e[n],i=t[0]==="enter"?"start":"end";return t[1][i]}const _pe={name:"tasklistCheck",tokenize:Spe};function xpe(){return{text:{91:_pe}}}function Spe(e,n,t){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?t(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return Nt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):t(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):t(c)}function l(c){return xn(c)?n(c):Jn(c)?e.check({tokenize:Cpe},n,t)(c):t(c)}}function Cpe(e,n,t){return ct(e,i,"whitespace");function i(r){return r===null?t(r):n(r)}}function Ape(e){return Iq([Zme(),spe(),ppe(e),bpe(),xpe()])}const jpe={};function Ope(e){const n=this,t=e||jpe,i=n.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(Ape(t)),a.push(Gme()),o.push(Yme(t))}const s4="kanban_chat_v1";function Epe(){try{const e=localStorage.getItem(s4);if(!e)return[];const n=JSON.parse(e);if(Array.isArray(n))return n}catch{}return[]}function Tpe({onBoardChange:e}){const[n,t]=A.useState(()=>Epe()),[i,r]=A.useState(""),[a,o]=A.useState(!1),[l,c]=A.useState(""),[f,h]=A.useState([]),d=A.useRef(null);A.useEffect(()=>{localStorage.setItem(s4,JSON.stringify(n))},[n]),A.useEffect(()=>{var w;(w=d.current)==null||w.scrollTo({top:d.current.scrollHeight,behavior:"smooth"})},[n,l,f,a]);const p=async()=>{const w=i.trim();if(!w||a)return;const k={role:"user",content:w,ts:Date.now()},_=[...n,k];t(_),r(""),o(!0),c(""),h([]);let C="";const x=[];let E=!1;const j=O=>{switch(O.type){case"delta":C+=O.text,c(C);break;case"tool_use":{const M={tool:O.tool,ok:!0,input:O.input};x.push(M),h([...x]);break}case"tool_result":{for(let M=x.length-1;M>=0;M--){const N=x[M];if(N.error===void 0&&N.ok){O.is_error&&(N.ok=!1,N.error=O.result||"tool error");break}}h([...x]);break}case"result":O.text&&C.trim()===""&&(C=O.text,c(C));break;case"done":O.board_changed&&(E=!0);break;case"error":C=`Error: ${O.error}`,c(C);break}};try{const O=_.map(M=>({role:M.role,content:M.content}));await pre(O,j)}catch(O){const M=O.message;wn.show({color:"red",message:M}),C=C||`Error: ${M}`}finally{const O={role:"assistant",content:C,ts:Date.now(),tool_calls:x.length>0?x:void 0};t(M=>[...M,O]),c(""),h([]),o(!1),E&&e()}},v=w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),p())},b=()=>{t([]),localStorage.removeItem(s4)};return g.jsxs($n,{gap:0,h:"100%",children:[g.jsxs(ze,{justify:"space-between",p:"xs",style:{borderBottom:"1px solid var(--mantine-color-dark-4)"},children:[g.jsxs(ze,{gap:6,children:[g.jsx(yq,{size:18}),g.jsx(xe,{fw:600,size:"sm",children:"Asistente"})]}),g.jsx(Zt,{label:"Limpiar conversacion",withArrow:!0,children:g.jsx(vt,{variant:"subtle",color:"gray",size:"sm",onClick:b,disabled:n.length===0,children:g.jsx(gl,{size:14})})})]}),g.jsx(fr,{viewportRef:d,style:{flex:1},type:"auto",p:"xs",children:g.jsxs($n,{gap:"xs",children:[n.length===0&&!a&&g.jsxs(xe,{size:"sm",c:"dimmed",ta:"center",mt:"md",children:["Escribe algo. Ejemplos:",g.jsx("br",{}),'- "crea columna Backlog"',g.jsx("br",{}),'- "anade tarjeta para revisar PR de Lucas en Doing"',g.jsx("br",{}),'- "que hay en Doing?"']}),n.map((w,k)=>g.jsx(o8,{msg:w},k)),a&&g.jsx(o8,{msg:{role:"assistant",content:l,ts:Date.now(),tool_calls:f.length>0?f:void 0},streaming:!0}),a&&l===""&&f.length===0&&g.jsxs(ze,{gap:6,pl:"xs",children:[g.jsx(ai,{size:"xs"}),g.jsx(xe,{size:"xs",c:"dimmed",children:"Pensando..."})]})]})}),g.jsx($n,{gap:4,p:"xs",style:{borderTop:"1px solid var(--mantine-color-dark-4)"},children:g.jsxs(ze,{align:"flex-end",gap:4,wrap:"nowrap",children:[g.jsx(pl,{placeholder:"Pide algo... (Enter envia, Shift+Enter newline)",value:i,onChange:w=>r(w.currentTarget.value),onKeyDown:v,disabled:a,autosize:!0,minRows:1,maxRows:6,style:{flex:1}}),g.jsx(vt,{size:"lg",variant:"filled",onClick:p,disabled:!i.trim()||a,"aria-label":"Send",children:a?g.jsx(ai,{size:"xs",color:"white"}):g.jsx(kq,{size:16})})]})})]})}function o8({msg:e,streaming:n=!1}){const t=e.role==="user";return g.jsx(Dt,{p:"xs",radius:"md",withBorder:!0,bg:t?"blue.9":"dark.6",style:{alignSelf:t?"flex-end":"flex-start",maxWidth:"92%"},children:g.jsxs($n,{gap:4,children:[e.content&&g.jsx(he,{className:"kanban-md",style:{fontSize:13,lineHeight:1.45,color:"var(--mantine-color-text)"},children:g.jsx(phe,{remarkPlugins:[Ope],children:e.content})}),n&&e.content&&g.jsx(he,{style:{display:"inline-block",width:8,height:14,background:"currentColor",opacity:.6}}),e.tool_calls&&e.tool_calls.length>0&&g.jsx(ze,{gap:4,wrap:"wrap",children:e.tool_calls.map((i,r)=>g.jsxs(it,{size:"xs",color:i.ok?"teal":"red",variant:"light",title:i.error||"",leftSection:i.ok&&n?g.jsx(ai,{size:8,color:"teal"}):null,children:[i.tool,!i.ok&&i.error?`: ${i.error}`:""]},r))})]})})}const Mpe=["Lun","Mar","Mie","Jue","Vie","Sab","Dom"];function Dpe({users:e,cards:n,onJumpToCard:t,onOpenDailyReport:i}){const[r,a]=A.useState(null),[o,l]=A.useState(new Date),[c,f]=A.useState(null),[h,d]=A.useState(null),[p,v]=A.useState(!1);A.useEffect(()=>{let x=!1;v(!0);const E=Ie(o).startOf("month").format("YYYY-MM-DD"),j=Ie(o).endOf("month").format("YYYY-MM-DD");return uF({from:E,to:j,assignee_id:c||void 0}).then(O=>{x||d(O)}).finally(()=>{x||v(!1)}),()=>{x=!0}},[o,c]);const b=A.useMemo(()=>e.map(x=>({value:x.id,label:x.display_name||x.username})),[e]),w=A.useMemo(()=>{const x=new Map;if(!h)return x;for(const E of h.created_daily){const j=x.get(E.date)??{created:0,done:0,deadlines:[]};j.created=E.count,x.set(E.date,j)}for(const E of h.throughput_daily){const j=x.get(E.date)??{created:0,done:0,deadlines:[]};j.done=E.count,x.set(E.date,j)}for(const E of n){if(!E.deadline||E.deleted_at)continue;const j=E.deadline.slice(0,10),O=x.get(j)??{created:0,done:0,deadlines:[]};O.deadlines.push(E),x.set(j,O)}return x},[h,n]),k=A.useMemo(()=>{const x=Ie(o).startOf("month"),E=Ie(o).endOf("month"),j=(x.day()+6)%7,O=[];for(let M=0;MArray.from(w.values()).reduce((x,E)=>x+E.created,0),[w]),C=A.useMemo(()=>Array.from(w.values()).reduce((x,E)=>x+E.done,0),[w]);return g.jsx(he,{p:"md",children:g.jsxs($n,{gap:"md",children:[g.jsxs(ze,{justify:"space-between",children:[g.jsx(xl,{order:3,children:"Calendario"}),g.jsxs(ze,{gap:"xs",wrap:"nowrap",children:[g.jsx(h9,{label:"Mes",size:"xs",value:o,onChange:x=>x&&l(typeof x=="string"?new Date(x):x),style:{minWidth:160},clearable:!1}),g.jsx(Kr,{label:"Asignado",size:"xs",placeholder:"Todos",value:c,onChange:f,data:b,clearable:!0,searchable:!0,style:{minWidth:180}})]})]}),g.jsxs(ze,{gap:"md",children:[g.jsx(Dt,{withBorder:!0,p:"sm",radius:"md",children:g.jsxs(ze,{gap:6,children:[g.jsx(of,{size:14,color:"var(--mantine-color-blue-5)"}),g.jsx(xe,{size:"sm",fw:600,children:_}),g.jsx(xe,{size:"xs",c:"dimmed",children:"creadas"})]})}),g.jsx(Dt,{withBorder:!0,p:"sm",radius:"md",children:g.jsxs(ze,{gap:6,children:[g.jsx(om,{size:14,color:"var(--mantine-color-green-5)"}),g.jsx(xe,{size:"sm",fw:600,children:C}),g.jsx(xe,{size:"xs",c:"dimmed",children:"hechas"})]})})]}),p&&!h?g.jsx(qf,{p:"xl",children:g.jsx(ai,{})}):g.jsxs(Dt,{withBorder:!0,p:"md",radius:"md",children:[g.jsx(Zo,{cols:7,spacing:4,mb:4,children:Mpe.map(x=>g.jsx(xe,{size:"xs",c:"dimmed",ta:"center",fw:600,children:x},x))}),g.jsx(Zo,{cols:7,spacing:4,children:k.map((x,E)=>{if(!x.date)return g.jsx(he,{style:{minHeight:72}},E);const j=w.get(x.date)??{created:0,done:0,deadlines:[]},O=parseInt(x.date.slice(8,10),10),M=x.date===Ie().format("YYYY-MM-DD"),N=Ie().startOf("day").valueOf(),R=Ie(x.date).startOf("day").valueOf()0?"rgba(81, 207, 102, 0.08)":j.created>0?"rgba(34, 139, 230, 0.06)":void 0},children:g.jsxs($n,{gap:2,children:[g.jsx(Et,{onClick:()=>x.date&&(i==null?void 0:i(x.date)),title:"Ver reporte diario",style:{alignSelf:"flex-start"},"data-test":`calendar-day-${x.date}`,children:g.jsx(xe,{size:"xs",fw:M?700:500,c:M?"blue":void 0,td:i?"underline":void 0,style:{cursor:i?"pointer":"default"},children:O})}),j.created>0&&g.jsxs(ze,{gap:3,wrap:"nowrap",children:[g.jsx(of,{size:10,color:"var(--mantine-color-blue-5)"}),g.jsx(xe,{size:"xs",c:"blue",children:j.created})]}),j.done>0&&g.jsxs(ze,{gap:3,wrap:"nowrap",children:[g.jsx(om,{size:10,color:"var(--mantine-color-green-5)"}),g.jsx(xe,{size:"xs",c:"green",children:j.done})]}),j.deadlines.length>0&&g.jsxs(On,{opened:r===x.date,onChange:L=>a(L?x.date:null),position:"bottom",withArrow:!0,shadow:"md",width:280,children:[g.jsx(On.Target,{children:g.jsx(Et,{onClick:()=>a(r===x.date?null:x.date),style:{textAlign:"left"},children:g.jsx($n,{gap:1,children:g.jsxs(ze,{gap:3,wrap:"nowrap",children:[g.jsx(Zg,{size:10,color:R?"var(--mantine-color-red-5)":"var(--mantine-color-orange-5)"}),g.jsxs(xe,{size:"xs",c:R?"red":"orange",fw:700,td:"underline",children:[j.deadlines.length," deadline",j.deadlines.length===1?"":"s"]})]})})})}),g.jsx(On.Dropdown,{p:6,children:g.jsxs($n,{gap:2,children:[g.jsxs(xe,{size:"xs",c:"dimmed",fw:600,mb:2,children:["Vencen el ",Ie(x.date).format("DD/MM/YYYY")]}),j.deadlines.map(L=>g.jsx(Et,{onClick:()=>{a(null),t==null||t(L.id)},style:{padding:"4px 6px",borderRadius:4,background:"var(--mantine-color-dark-6)"},children:g.jsxs(ze,{gap:6,wrap:"nowrap",children:[g.jsxs(xe,{size:"xs",c:"dimmed",ff:"monospace",children:["#",String(L.seq_num).padStart(5,"0")]}),g.jsx(xe,{size:"xs",lineClamp:1,title:L.title,children:L.title})]})},L.id))]})})]})]})},E)})})]})]})})}function EH(e){return e?e.reduce((n,t)=>{const i=t.name.search(/\./);if(i>=0){const r=t.name.substring(i+1);return n[r]=t.label,n}return n[t.name]=t.label,n},{}):{}}var Rpe={tooltip:"m_e4d36c9b",tooltipLabel:"m_7f4bcb19",tooltipBody:"m_3de554dd",tooltipItemColor:"m_b30369b5",tooltipItem:"m_3de8964e",tooltipItemBody:"m_50186d10",tooltipItemName:"m_501dadf9",tooltipItemData:"m_50192318"};function Ppe(e){return e.map(n=>{if(!n.payload||n.payload[n.name])return n;const t=n.name.search(/\./);if(t>=0){const i=n.name.substring(0,t),r={...n.payload[i]},a=Object.entries(n.payload).reduce((o,l)=>{const[c,f]=l;return c===i?o:{...o,[c]:f}},{});return{...n,name:n.name.substring(t+1),payload:{...a,...r}}}return n})}function Npe(e,n){const t=Ppe(e.filter(i=>i.fill!=="none"||!i.color));return n?t.filter(i=>i.name===n):t}function s8(e,n){return n==="radial"||n==="scatter"?Array.isArray(e.value)?e.value[1]-e.value[0]:e.value:Array.isArray(e.payload[e.dataKey])?e.payload[e.dataKey][1]-e.payload[e.dataKey][0]:e.payload[e.name]}const $pe={type:"area",showColor:!0},$9=De(e=>{var R,L;const n=be("ChartTooltip",$pe,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,payload:c,label:f,unit:h,type:d,segmentId:p,mod:v,series:b,valueFormatter:w,showColor:k,attributes:_,...C}=n,x=ui(),E=Xe({name:"ChartTooltip",classes:Rpe,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:_});if(!c)return null;const j=Npe(c,p),O=d==="scatter"?(L=(R=c[0])==null?void 0:R.payload)==null?void 0:L.name:null,M=EH(b),N=f||O,q=j.map(F=>g.jsxs("div",{"data-type":d,...E("tooltipItem"),children:[g.jsxs("div",{...E("tooltipItemBody"),children:[k&&g.jsx("svg",{...E("tooltipItemColor"),children:g.jsx("circle",{r:6,fill:lt(F.color,x),width:12,height:12,cx:6,cy:6})}),g.jsx("div",{...E("tooltipItemName"),children:M[F.name]||F.name})]}),g.jsxs("div",{...E("tooltipItemData"),children:[typeof w=="function"?w(s8(F,d)):s8(F,d),h||F.unit]})]},(F==null?void 0:F.key)??F.name));return g.jsxs(he,{...E("tooltip"),mod:[{type:d},v],...C,children:[N&&g.jsx("div",{...E("tooltipLabel"),children:N}),g.jsx("div",{...E("tooltipBody"),children:q})]})});$9.displayName="@mantine/charts/ChartTooltip";var TH={legend:"m_847eaf",legendItem:"m_17da7e62",legendItemColor:"m_6e236e21",legendItemName:"m_8ff56c0d"};function zpe(e){return e.map(n=>{var i;const t=(i=n.dataKey)==null?void 0:i.split(".").pop();return{...n,dataKey:t,payload:{...n.payload,name:t,dataKey:t}}})}function Lpe(e){return zpe(e.filter(n=>n.color!=="none"))}const S0=De(e=>{const n=be("ChartLegend",null,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,payload:c,onHighlight:f,legendPosition:h,mod:d,series:p,showColor:v,centered:b,attributes:w,...k}=n,_=Xe({name:"ChartLegend",classes:TH,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:w,rootSelector:"legend"});if(!c)return null;const C=Lpe(c),x=EH(p),E=C.map((j,O)=>g.jsxs("div",{..._("legendItem"),onMouseEnter:()=>f(j.dataKey),onMouseLeave:()=>f(null),"data-without-color":v===!1||void 0,children:[g.jsx(Hf,{color:j.color,size:12,..._("legendItemColor"),withShadow:!1}),g.jsx("p",{..._("legendItemName"),children:x[j.dataKey]||j.dataKey})]},O));return g.jsx(he,{mod:[{position:h,centered:b},d],..._("legend"),...k,children:E})});S0.displayName="@mantine/charts/ChartLegend";S0.classes=TH;function Ipe({x:e,y:n,value:t,valueFormatter:i}){return g.jsx("g",{transform:`translate(${e},${n})`,children:g.jsx("text",{x:0,y:0,dy:-8,dx:-10,textAnchor:"start",fill:"var(--chart-text-color, var(--mantine-color-dimmed))",fontSize:8,children:i?i(t):t})})}var C0={root:"m_a50f3e58",container:"m_af9188cb",grid:"m_a50a48bc",axis:"m_a507a517",axisLabel:"m_2293801d",tooltip:"m_92b296cd"},d_,l8;function Or(){if(l8)return d_;l8=1;var e=Array.isArray;return d_=e,d_}var h_,u8;function MH(){if(u8)return h_;u8=1;var e=typeof Nv=="object"&&Nv&&Nv.Object===Object&&Nv;return h_=e,h_}var m_,c8;function Ao(){if(c8)return m_;c8=1;var e=MH(),n=typeof self=="object"&&self&&self.Object===Object&&self,t=e||n||Function("return this")();return m_=t,m_}var p_,f8;function yp(){if(f8)return p_;f8=1;var e=Ao(),n=e.Symbol;return p_=n,p_}var v_,d8;function Bpe(){if(d8)return v_;d8=1;var e=yp(),n=Object.prototype,t=n.hasOwnProperty,i=n.toString,r=e?e.toStringTag:void 0;function a(o){var l=t.call(o,r),c=o[r];try{o[r]=void 0;var f=!0}catch{}var h=i.call(o);return f&&(l?o[r]=c:delete o[r]),h}return v_=a,v_}var g_,h8;function Fpe(){if(h8)return g_;h8=1;var e=Object.prototype,n=e.toString;function t(i){return n.call(i)}return g_=t,g_}var y_,m8;function _s(){if(m8)return y_;m8=1;var e=yp(),n=Bpe(),t=Fpe(),i="[object Null]",r="[object Undefined]",a=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?r:i:a&&a in Object(l)?n(l):t(l)}return y_=o,y_}var b_,p8;function xs(){if(p8)return b_;p8=1;function e(n){return n!=null&&typeof n=="object"}return b_=e,b_}var w_,v8;function nd(){if(v8)return w_;v8=1;var e=_s(),n=xs(),t="[object Symbol]";function i(r){return typeof r=="symbol"||n(r)&&e(r)==t}return w_=i,w_}var k_,g8;function z9(){if(g8)return k_;g8=1;var e=Or(),n=nd(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function r(a,o){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||n(a)?!0:i.test(a)||!t.test(a)||o!=null&&a in Object(o)}return k_=r,k_}var __,y8;function jl(){if(y8)return __;y8=1;function e(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}return __=e,__}var x_,b8;function L9(){if(b8)return x_;b8=1;var e=_s(),n=jl(),t="[object AsyncFunction]",i="[object Function]",r="[object GeneratorFunction]",a="[object Proxy]";function o(l){if(!n(l))return!1;var c=e(l);return c==i||c==r||c==t||c==a}return x_=o,x_}var S_,w8;function qpe(){if(w8)return S_;w8=1;var e=Ao(),n=e["__core-js_shared__"];return S_=n,S_}var C_,k8;function Hpe(){if(k8)return C_;k8=1;var e=qpe(),n=(function(){var i=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function t(i){return!!n&&n in i}return C_=t,C_}var A_,_8;function DH(){if(_8)return A_;_8=1;var e=Function.prototype,n=e.toString;function t(i){if(i!=null){try{return n.call(i)}catch{}try{return i+""}catch{}}return""}return A_=t,A_}var j_,x8;function Upe(){if(x8)return j_;x8=1;var e=L9(),n=Hpe(),t=jl(),i=DH(),r=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,f=l.hasOwnProperty,h=RegExp("^"+c.call(f).replace(r,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(p){if(!t(p)||n(p))return!1;var v=e(p)?h:a;return v.test(i(p))}return j_=d,j_}var O_,S8;function Vpe(){if(S8)return O_;S8=1;function e(n,t){return n==null?void 0:n[t]}return O_=e,O_}var E_,C8;function Bu(){if(C8)return E_;C8=1;var e=Upe(),n=Vpe();function t(i,r){var a=n(i,r);return e(a)?a:void 0}return E_=t,E_}var T_,A8;function A0(){if(A8)return T_;A8=1;var e=Bu(),n=e(Object,"create");return T_=n,T_}var M_,j8;function Wpe(){if(j8)return M_;j8=1;var e=A0();function n(){this.__data__=e?e(null):{},this.size=0}return M_=n,M_}var D_,O8;function Gpe(){if(O8)return D_;O8=1;function e(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}return D_=e,D_}var R_,E8;function Ype(){if(E8)return R_;E8=1;var e=A0(),n="__lodash_hash_undefined__",t=Object.prototype,i=t.hasOwnProperty;function r(a){var o=this.__data__;if(e){var l=o[a];return l===n?void 0:l}return i.call(o,a)?o[a]:void 0}return R_=r,R_}var P_,T8;function Kpe(){if(T8)return P_;T8=1;var e=A0(),n=Object.prototype,t=n.hasOwnProperty;function i(r){var a=this.__data__;return e?a[r]!==void 0:t.call(a,r)}return P_=i,P_}var N_,M8;function Xpe(){if(M8)return N_;M8=1;var e=A0(),n="__lodash_hash_undefined__";function t(i,r){var a=this.__data__;return this.size+=this.has(i)?0:1,a[i]=e&&r===void 0?n:r,this}return N_=t,N_}var $_,D8;function Zpe(){if(D8)return $_;D8=1;var e=Wpe(),n=Gpe(),t=Ype(),i=Kpe(),r=Xpe();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l-1}return q_=n,q_}var H_,I8;function tve(){if(I8)return H_;I8=1;var e=j0();function n(t,i){var r=this.__data__,a=e(r,t);return a<0?(++this.size,r.push([t,i])):r[a][1]=i,this}return H_=n,H_}var U_,B8;function O0(){if(B8)return U_;B8=1;var e=Qpe(),n=Jpe(),t=eve(),i=nve(),r=tve();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l0?1:-1},uu=function(n){return Cu(n)&&n.indexOf("%")===n.length-1},Ge=function(n){return Cve(n)&&!id(n)},Ave=function(n){return Yn(n)},Si=function(n){return Ge(n)||Cu(n)},jve=0,rd=function(n){var t=++jve;return"".concat(n||"").concat(t)},Au=function(n,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ge(n)&&!Cu(n))return i;var a;if(uu(n)){var o=n.indexOf("%");a=t*parseFloat(n.slice(0,o))/100}else a=+n;return id(a)&&(a=i),r&&a>t&&(a=t),a},tl=function(n){if(!n)return null;var t=Object.keys(n);return t&&t.length?n[t[0]]:null},Ove=function(n){if(!Array.isArray(n))return!1;for(var t=n.length,i={},r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function Nve(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function u4(e){"@babel/helpers - typeof";return u4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},u4(e)}var mD={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},rs=function(n){return typeof n=="string"?n:n?n.displayName||n.name||"Component":""},pD=null,v2=null,V9=function e(n){if(n===pD&&Array.isArray(v2))return v2;var t=[];return A.Children.forEach(n,function(i){Yn(i)||(kve.isFragment(i)?t=t.concat(e(i.props.children)):t.push(i))}),v2=t,pD=n,t};function ka(e,n){var t=[],i=[];return Array.isArray(n)?i=n.map(function(r){return rs(r)}):i=[rs(n)],V9(e).forEach(function(r){var a=wa(r,"type.displayName")||wa(r,"type.name");i.indexOf(a)!==-1&&t.push(r)}),t}function Ur(e,n){var t=ka(e,n);return t&&t[0]}var vD=function(n){if(!n||!n.props)return!1;var t=n.props,i=t.width,r=t.height;return!(!Ge(i)||i<=0||!Ge(r)||r<=0)},$ve=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],zve=function(n){return n&&n.type&&Cu(n.type)&&$ve.indexOf(n.type)>=0},LH=function(n){return n&&u4(n)==="object"&&"clipDot"in n},Lve=function(n,t,i,r){var a,o=(a=p2==null?void 0:p2[r])!==null&&a!==void 0?a:[];return t.startsWith("data-")||!qn(n)&&(r&&o.includes(t)||Mve.includes(t))||i&&U9.includes(t)},Wn=function(n,t,i){if(!n||typeof n=="function"||typeof n=="boolean")return null;var r=n;if(A.isValidElement(n)&&(r=n.props),!td(r))return null;var a={};return Object.keys(r).forEach(function(o){var l;Lve((l=r)===null||l===void 0?void 0:l[o],o,t,i)&&(a[o]=r[o])}),a},c4=function e(n,t){if(n===t)return!0;var i=A.Children.count(n);if(i!==A.Children.count(t))return!1;if(i===0)return!0;if(i===1)return gD(Array.isArray(n)?n[0]:n,Array.isArray(t)?t[0]:t);for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function Hve(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function d4(e){var n=e.children,t=e.width,i=e.height,r=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,f=qve(e,Fve),h=r||{width:t,height:i,x:0,y:0},d=pn("recharts-surface",a);return Q.createElement("svg",f4({},Wn(f,!0,"svg"),{className:d,width:t,height:i,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),Q.createElement("title",null,l),Q.createElement("desc",null,c),n)}var Uve=["children","className"];function h4(){return h4=Object.assign?Object.assign.bind():function(e){for(var n=1;n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function Wve(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}var Bt=Q.forwardRef(function(e,n){var t=e.children,i=e.className,r=Vve(e,Uve),a=pn("recharts-layer",i);return Q.createElement("g",h4({className:a},Wn(r,!0),{ref:n}),t)}),as=function(n,t){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;aa?0:a+t),i=i>a?a:i,i<0&&(i+=a),a=t>i?0:i-t>>>0,t>>>=0;for(var o=Array(a);++r=a?t:e(t,i,r)}return y2=n,y2}var b2,kD;function IH(){if(kD)return b2;kD=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",i="\\u20d0-\\u20ff",r=n+t+i,a="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+e+r+a+"]");function c(f){return l.test(f)}return b2=c,b2}var w2,_D;function Kve(){if(_D)return w2;_D=1;function e(n){return n.split("")}return w2=e,w2}var k2,xD;function Xve(){if(xD)return k2;xD=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",i="\\u20d0-\\u20ff",r=n+t+i,a="\\ufe0e\\ufe0f",o="["+e+"]",l="["+r+"]",c="\\ud83c[\\udffb-\\udfff]",f="(?:"+l+"|"+c+")",h="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b=f+"?",w="["+a+"]?",k="(?:"+v+"(?:"+[h,d,p].join("|")+")"+w+b+")*",_=w+b+k,C="(?:"+[h+l+"?",l,d,p,o].join("|")+")",x=RegExp(c+"(?="+c+")|"+C+_,"g");function E(j){return j.match(x)||[]}return k2=E,k2}var _2,SD;function Zve(){if(SD)return _2;SD=1;var e=Kve(),n=IH(),t=Xve();function i(r){return n(r)?t(r):e(r)}return _2=i,_2}var x2,CD;function Qve(){if(CD)return x2;CD=1;var e=Yve(),n=IH(),t=Zve(),i=PH();function r(a){return function(o){o=i(o);var l=n(o)?t(o):void 0,c=l?l[0]:o.charAt(0),f=l?e(l,1).join(""):o.slice(1);return c[a]()+f}}return x2=r,x2}var S2,AD;function Jve(){if(AD)return S2;AD=1;var e=Qve(),n=e("toUpperCase");return S2=n,S2}var ege=Jve();const M0=yt(ege);function It(e){return function(){return e}}const BH=Math.cos,a1=Math.sin,Ya=Math.sqrt,o1=Math.PI,D0=2*o1,m4=Math.PI,p4=2*m4,iu=1e-6,nge=p4-iu;function FH(e){this._+=e[0];for(let n=1,t=e.length;n=0))throw new Error(`invalid digits: ${e}`);if(n>15)return FH;const t=10**n;return function(i){this._+=i[0];for(let r=1,a=i.length;riu)if(!(Math.abs(d*c-f*h)>iu)||!a)this._append`L${this._x1=n},${this._y1=t}`;else{let v=i-o,b=r-l,w=c*c+f*f,k=v*v+b*b,_=Math.sqrt(w),C=Math.sqrt(p),x=a*Math.tan((m4-Math.acos((w+p-k)/(2*_*C)))/2),E=x/C,j=x/_;Math.abs(E-1)>iu&&this._append`L${n+E*h},${t+E*d}`,this._append`A${a},${a},0,0,${+(d*v>h*b)},${this._x1=n+j*c},${this._y1=t+j*f}`}}arc(n,t,i,r,a,o){if(n=+n,t=+t,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let l=i*Math.cos(r),c=i*Math.sin(r),f=n+l,h=t+c,d=1^o,p=o?r-a:a-r;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>iu||Math.abs(this._y1-h)>iu)&&this._append`L${f},${h}`,i&&(p<0&&(p=p%p4+p4),p>nge?this._append`A${i},${i},0,1,${d},${n-l},${t-c}A${i},${i},0,1,${d},${this._x1=f},${this._y1=h}`:p>iu&&this._append`A${i},${i},0,${+(p>=m4)},${d},${this._x1=n+i*Math.cos(a)},${this._y1=t+i*Math.sin(a)}`)}rect(n,t,i,r){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+t}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}}function W9(e){let n=3;return e.digits=function(t){if(!arguments.length)return n;if(t==null)n=null;else{const i=Math.floor(t);if(!(i>=0))throw new RangeError(`invalid digits: ${t}`);n=i}return e},()=>new ige(n)}function G9(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qH(e){this._context=e}qH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,n){switch(e=+e,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break;case 1:this._point=2;default:this._context.lineTo(e,n);break}}};function R0(e){return new qH(e)}function HH(e){return e[0]}function UH(e){return e[1]}function VH(e,n){var t=It(!0),i=null,r=R0,a=null,o=W9(l);e=typeof e=="function"?e:e===void 0?HH:It(e),n=typeof n=="function"?n:n===void 0?UH:It(n);function l(c){var f,h=(c=G9(c)).length,d,p=!1,v;for(i==null&&(a=r(v=o())),f=0;f<=h;++f)!(f=v;--b)l.point(x[b],E[b]);l.lineEnd(),l.areaEnd()}_&&(x[p]=+e(k,p,d),E[p]=+n(k,p,d),l.point(i?+i(k,p,d):x[p],t?+t(k,p,d):E[p]))}if(C)return l=null,C+""||null}function h(){return VH().defined(r).curve(o).context(a)}return f.x=function(d){return arguments.length?(e=typeof d=="function"?d:It(+d),i=null,f):e},f.x0=function(d){return arguments.length?(e=typeof d=="function"?d:It(+d),f):e},f.x1=function(d){return arguments.length?(i=d==null?null:typeof d=="function"?d:It(+d),f):i},f.y=function(d){return arguments.length?(n=typeof d=="function"?d:It(+d),t=null,f):n},f.y0=function(d){return arguments.length?(n=typeof d=="function"?d:It(+d),f):n},f.y1=function(d){return arguments.length?(t=d==null?null:typeof d=="function"?d:It(+d),f):t},f.lineX0=f.lineY0=function(){return h().x(e).y(n)},f.lineY1=function(){return h().x(e).y(t)},f.lineX1=function(){return h().x(i).y(n)},f.defined=function(d){return arguments.length?(r=typeof d=="function"?d:It(!!d),f):r},f.curve=function(d){return arguments.length?(o=d,a!=null&&(l=o(a)),f):o},f.context=function(d){return arguments.length?(d==null?a=l=null:l=o(a=d),f):a},f}class WH{constructor(n,t){this._context=n,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(n,t){switch(n=+n,t=+t,this._point){case 0:{this._point=1,this._line?this._context.lineTo(n,t):this._context.moveTo(n,t);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+n)/2,this._y0,this._x0,t,n,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,n,this._y0,n,t);break}}this._x0=n,this._y0=t}}function rge(e){return new WH(e,!0)}function age(e){return new WH(e,!1)}const Y9={draw(e,n){const t=Ya(n/o1);e.moveTo(t,0),e.arc(0,0,t,0,D0)}},oge={draw(e,n){const t=Ya(n/5)/2;e.moveTo(-3*t,-t),e.lineTo(-t,-t),e.lineTo(-t,-3*t),e.lineTo(t,-3*t),e.lineTo(t,-t),e.lineTo(3*t,-t),e.lineTo(3*t,t),e.lineTo(t,t),e.lineTo(t,3*t),e.lineTo(-t,3*t),e.lineTo(-t,t),e.lineTo(-3*t,t),e.closePath()}},GH=Ya(1/3),sge=GH*2,lge={draw(e,n){const t=Ya(n/sge),i=t*GH;e.moveTo(0,-t),e.lineTo(i,0),e.lineTo(0,t),e.lineTo(-i,0),e.closePath()}},uge={draw(e,n){const t=Ya(n),i=-t/2;e.rect(i,i,t,t)}},cge=.8908130915292852,YH=a1(o1/10)/a1(7*o1/10),fge=a1(D0/10)*YH,dge=-BH(D0/10)*YH,hge={draw(e,n){const t=Ya(n*cge),i=fge*t,r=dge*t;e.moveTo(0,-t),e.lineTo(i,r);for(let a=1;a<5;++a){const o=D0*a/5,l=BH(o),c=a1(o);e.lineTo(c*t,-l*t),e.lineTo(l*i-c*r,c*i+l*r)}e.closePath()}},C2=Ya(3),mge={draw(e,n){const t=-Ya(n/(C2*3));e.moveTo(0,t*2),e.lineTo(-C2*t,-t),e.lineTo(C2*t,-t),e.closePath()}},ca=-.5,fa=Ya(3)/2,v4=1/Ya(12),pge=(v4/2+1)*3,vge={draw(e,n){const t=Ya(n/pge),i=t/2,r=t*v4,a=i,o=t*v4+t,l=-a,c=o;e.moveTo(i,r),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(ca*i-fa*r,fa*i+ca*r),e.lineTo(ca*a-fa*o,fa*a+ca*o),e.lineTo(ca*l-fa*c,fa*l+ca*c),e.lineTo(ca*i+fa*r,ca*r-fa*i),e.lineTo(ca*a+fa*o,ca*o-fa*a),e.lineTo(ca*l+fa*c,ca*c-fa*l),e.closePath()}};function gge(e,n){let t=null,i=W9(r);e=typeof e=="function"?e:It(e||Y9),n=typeof n=="function"?n:It(n===void 0?64:+n);function r(){let a;if(t||(t=a=i()),e.apply(this,arguments).draw(t,+n.apply(this,arguments)),a)return t=null,a+""||null}return r.type=function(a){return arguments.length?(e=typeof a=="function"?a:It(a),r):e},r.size=function(a){return arguments.length?(n=typeof a=="function"?a:It(+a),r):n},r.context=function(a){return arguments.length?(t=a??null,r):t},r}function s1(){}function l1(e,n,t){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+n)/6,(e._y0+4*e._y1+t)/6)}function KH(e){this._context=e}KH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:l1(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,n){switch(e=+e,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:l1(this,e,n);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n}};function yge(e){return new KH(e)}function XH(e){this._context=e}XH.prototype={areaStart:s1,areaEnd:s1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,n){switch(e=+e,n=+n,this._point){case 0:this._point=1,this._x2=e,this._y2=n;break;case 1:this._point=2,this._x3=e,this._y3=n;break;case 2:this._point=3,this._x4=e,this._y4=n,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+n)/6);break;default:l1(this,e,n);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n}};function bge(e){return new XH(e)}function ZH(e){this._context=e}ZH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,n){switch(e=+e,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var t=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 3:this._point=4;default:l1(this,e,n);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n}};function wge(e){return new ZH(e)}function QH(e){this._context=e}QH.prototype={areaStart:s1,areaEnd:s1,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,n){e=+e,n=+n,this._point?this._context.lineTo(e,n):(this._point=1,this._context.moveTo(e,n))}};function kge(e){return new QH(e)}function jD(e){return e<0?-1:1}function OD(e,n,t){var i=e._x1-e._x0,r=n-e._x1,a=(e._y1-e._y0)/(i||r<0&&-0),o=(t-e._y1)/(r||i<0&&-0),l=(a*r+o*i)/(i+r);return(jD(a)+jD(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function ED(e,n){var t=e._x1-e._x0;return t?(3*(e._y1-e._y0)/t-n)/2:n}function A2(e,n,t){var i=e._x0,r=e._y0,a=e._x1,o=e._y1,l=(a-i)/3;e._context.bezierCurveTo(i+l,r+l*n,a-l,o-l*t,a,o)}function u1(e){this._context=e}u1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:A2(this,this._t0,ED(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,n){var t=NaN;if(e=+e,n=+n,!(e===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3,A2(this,ED(this,t=OD(this,e,n)),t);break;default:A2(this,this._t0,t=OD(this,e,n));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._t0=t}}};function JH(e){this._context=new eU(e)}(JH.prototype=Object.create(u1.prototype)).point=function(e,n){u1.prototype.point.call(this,n,e)};function eU(e){this._context=e}eU.prototype={moveTo:function(e,n){this._context.moveTo(n,e)},closePath:function(){this._context.closePath()},lineTo:function(e,n){this._context.lineTo(n,e)},bezierCurveTo:function(e,n,t,i,r,a){this._context.bezierCurveTo(n,e,i,t,a,r)}};function _ge(e){return new u1(e)}function xge(e){return new JH(e)}function nU(e){this._context=e}nU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,n=this._y,t=e.length;if(t)if(this._line?this._context.lineTo(e[0],n[0]):this._context.moveTo(e[0],n[0]),t===2)this._context.lineTo(e[1],n[1]);else for(var i=TD(e),r=TD(n),a=0,o=1;o=0;--n)r[n]=(o[n]-r[n+1])/a[n];for(a[t-1]=(e[t]+r[t-1])/2,n=0;n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,n){switch(e=+e,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(e,n);else{var t=this._x*(1-this._t)+e*this._t;this._context.lineTo(t,this._y),this._context.lineTo(t,n)}break}}this._x=e,this._y=n}};function Cge(e){return new P0(e,.5)}function Age(e){return new P0(e,0)}function jge(e){return new P0(e,1)}function lf(e,n){if((o=e.length)>1)for(var t=1,i,r,a=e[n[0]],o,l=a.length;t=0;)t[n]=n;return t}function Oge(e,n){return e[n]}function Ege(e){const n=[];return n.key=e,n}function Tge(){var e=It([]),n=g4,t=lf,i=Oge;function r(a){var o=Array.from(e.apply(this,arguments),Ege),l,c=o.length,f=-1,h;for(const d of a)for(l=0,++f;l0){for(var t,i,r=0,a=e[0].length,o;r0){for(var t=0,i=e[n[0]],r,a=i.length;t0)||!((a=(r=e[n[0]]).length)>0))){for(var t=0,i=1,r,a,o;i=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function Ige(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}var tU={symbolCircle:Y9,symbolCross:oge,symbolDiamond:lge,symbolSquare:uge,symbolStar:hge,symbolTriangle:mge,symbolWye:vge},Bge=Math.PI/180,Fge=function(n){var t="symbol".concat(M0(n));return tU[t]||Y9},qge=function(n,t,i){if(t==="area")return n;switch(i){case"cross":return 5*n*n/9;case"diamond":return .5*n*n/Math.sqrt(3);case"square":return n*n;case"star":{var r=18*Bge;return 1.25*n*n*(Math.tan(r)-Math.tan(r*2)*Math.pow(Math.tan(r),2))}case"triangle":return Math.sqrt(3)*n*n/4;case"wye":return(21-10*Math.sqrt(3))*n*n/8;default:return Math.PI*n*n/4}},Hge=function(n,t){tU["symbol".concat(M0(n))]=t},K9=function(n){var t=n.type,i=t===void 0?"circle":t,r=n.size,a=r===void 0?64:r,o=n.sizeType,l=o===void 0?"area":o,c=Lge(n,Pge),f=DD(DD({},c),{},{type:i,size:a,sizeType:l}),h=function(){var k=Fge(i),_=gge().type(k).size(qge(a,l,i));return _()},d=f.className,p=f.cx,v=f.cy,b=Wn(f,!0);return p===+p&&v===+v&&a===+a?Q.createElement("path",y4({},b,{className:pn("recharts-symbols",d),transform:"translate(".concat(p,", ").concat(v,")"),d:h()})):null};K9.registerSymbol=Hge;function uf(e){"@babel/helpers - typeof";return uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},uf(e)}function b4(){return b4=Object.assign?Object.assign.bind():function(e){for(var n=1;n`);var C=v.inactive?f:v.color;return Q.createElement("li",b4({className:k,style:d,key:"legend-item-".concat(b)},r1(i.props,v,b)),Q.createElement(d4,{width:o,height:o,viewBox:h,style:p},i.renderIcon(v)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},w?w(_,v,b):_))})}},{key:"render",value:function(){var i=this.props,r=i.payload,a=i.layout,o=i.align;if(!r||!r.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])})(A.PureComponent);dm(X9,"displayName","Legend");dm(X9,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var j2,PD;function Jge(){if(PD)return j2;PD=1;var e=O0();function n(){this.__data__=new e,this.size=0}return j2=n,j2}var O2,ND;function e1e(){if(ND)return O2;ND=1;function e(n){var t=this.__data__,i=t.delete(n);return this.size=t.size,i}return O2=e,O2}var E2,$D;function n1e(){if($D)return E2;$D=1;function e(n){return this.__data__.get(n)}return E2=e,E2}var T2,zD;function t1e(){if(zD)return T2;zD=1;function e(n){return this.__data__.has(n)}return T2=e,T2}var M2,LD;function i1e(){if(LD)return M2;LD=1;var e=O0(),n=B9(),t=F9(),i=200;function r(a,o){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!n||c.lengthv))return!1;var w=d.get(o),k=d.get(l);if(w&&k)return w==l&&k==o;var _=-1,C=!0,x=c&r?new e:void 0;for(d.set(o,l),d.set(l,o);++_-1&&i%1==0&&i-1&&t%1==0&&t<=e}return J2=n,J2}var ex,l7;function v1e(){if(l7)return ex;l7=1;var e=_s(),n=eA(),t=xs(),i="[object Arguments]",r="[object Array]",a="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",f="[object Map]",h="[object Number]",d="[object Object]",p="[object RegExp]",v="[object Set]",b="[object String]",w="[object WeakMap]",k="[object ArrayBuffer]",_="[object DataView]",C="[object Float32Array]",x="[object Float64Array]",E="[object Int8Array]",j="[object Int16Array]",O="[object Int32Array]",M="[object Uint8Array]",N="[object Uint8ClampedArray]",q="[object Uint16Array]",R="[object Uint32Array]",L={};L[C]=L[x]=L[E]=L[j]=L[O]=L[M]=L[N]=L[q]=L[R]=!0,L[i]=L[r]=L[k]=L[a]=L[_]=L[o]=L[l]=L[c]=L[f]=L[h]=L[d]=L[p]=L[v]=L[b]=L[w]=!1;function F(Y){return t(Y)&&n(Y.length)&&!!L[e(Y)]}return ex=F,ex}var nx,u7;function dU(){if(u7)return nx;u7=1;function e(n){return function(t){return n(t)}}return nx=e,nx}var Mh={exports:{}};Mh.exports;var c7;function g1e(){return c7||(c7=1,(function(e,n){var t=MH(),i=n&&!n.nodeType&&n,r=i&&!0&&e&&!e.nodeType&&e,a=r&&r.exports===i,o=a&&t.process,l=(function(){try{var c=r&&r.require&&r.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();e.exports=l})(Mh,Mh.exports)),Mh.exports}var tx,f7;function hU(){if(f7)return tx;f7=1;var e=v1e(),n=dU(),t=g1e(),i=t&&t.isTypedArray,r=i?n(i):e;return tx=r,tx}var ix,d7;function y1e(){if(d7)return ix;d7=1;var e=h1e(),n=Q9(),t=Or(),i=fU(),r=J9(),a=hU(),o=Object.prototype,l=o.hasOwnProperty;function c(f,h){var d=t(f),p=!d&&n(f),v=!d&&!p&&i(f),b=!d&&!p&&!v&&a(f),w=d||p||v||b,k=w?e(f.length,String):[],_=k.length;for(var C in f)(h||l.call(f,C))&&!(w&&(C=="length"||v&&(C=="offset"||C=="parent")||b&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||r(C,_)))&&k.push(C);return k}return ix=c,ix}var rx,h7;function b1e(){if(h7)return rx;h7=1;var e=Object.prototype;function n(t){var i=t&&t.constructor,r=typeof i=="function"&&i.prototype||e;return t===r}return rx=n,rx}var ax,m7;function mU(){if(m7)return ax;m7=1;function e(n,t){return function(i){return n(t(i))}}return ax=e,ax}var ox,p7;function w1e(){if(p7)return ox;p7=1;var e=mU(),n=e(Object.keys,Object);return ox=n,ox}var sx,v7;function k1e(){if(v7)return sx;v7=1;var e=b1e(),n=w1e(),t=Object.prototype,i=t.hasOwnProperty;function r(a){if(!e(a))return n(a);var o=[];for(var l in Object(a))i.call(a,l)&&l!="constructor"&&o.push(l);return o}return sx=r,sx}var lx,g7;function bp(){if(g7)return lx;g7=1;var e=L9(),n=eA();function t(i){return i!=null&&n(i.length)&&!e(i)}return lx=t,lx}var ux,y7;function N0(){if(y7)return ux;y7=1;var e=y1e(),n=k1e(),t=bp();function i(r){return t(r)?e(r):n(r)}return ux=i,ux}var cx,b7;function _1e(){if(b7)return cx;b7=1;var e=u1e(),n=d1e(),t=N0();function i(r){return e(r,t,n)}return cx=i,cx}var fx,w7;function x1e(){if(w7)return fx;w7=1;var e=_1e(),n=1,t=Object.prototype,i=t.hasOwnProperty;function r(a,o,l,c,f,h){var d=l&n,p=e(a),v=p.length,b=e(o),w=b.length;if(v!=w&&!d)return!1;for(var k=v;k--;){var _=p[k];if(!(d?_ in o:i.call(o,_)))return!1}var C=h.get(a),x=h.get(o);if(C&&x)return C==o&&x==a;var E=!0;h.set(a,o),h.set(o,a);for(var j=d;++k-1}return zx=n,zx}var Lx,G7;function H1e(){if(G7)return Lx;G7=1;function e(n,t,i){for(var r=-1,a=n==null?0:n.length;++r=o){var _=f?null:r(c);if(_)return a(_);b=!1,p=i,k=new e}else k=f?[]:w;e:for(;++d=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function rye(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function aye(e){return e.value}function oye(e,n){if(Q.isValidElement(e))return Q.cloneElement(e,n);if(typeof e=="function")return Q.createElement(e,n);n.ref;var t=iye(n,K1e);return Q.createElement(X9,t)}var nR=1,os=(function(e){function n(){var t;X1e(this,n);for(var i=arguments.length,r=new Array(i),a=0;anR||Math.abs(r.height-this.lastBoundingBox.height)>nR)&&(this.lastBoundingBox.width=r.width,this.lastBoundingBox.height=r.height,i&&i(r)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,i&&i(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Go({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(i){var r=this.props,a=r.layout,o=r.align,l=r.verticalAlign,c=r.margin,f=r.chartWidth,h=r.chartHeight,d,p;if(!i||(i.left===void 0||i.left===null)&&(i.right===void 0||i.right===null))if(o==="center"&&a==="vertical"){var v=this.getBBoxSnapshot();d={left:((f||0)-v.width)/2}}else d=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!i||(i.top===void 0||i.top===null)&&(i.bottom===void 0||i.bottom===null))if(l==="middle"){var b=this.getBBoxSnapshot();p={top:((h||0)-b.height)/2}}else p=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Go(Go({},d),p)}},{key:"render",value:function(){var i=this,r=this.props,a=r.content,o=r.width,l=r.height,c=r.wrapperStyle,f=r.payloadUniqBy,h=r.payload,d=Go(Go({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return Q.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(v){i.wrapperNode=v}},oye(a,Go(Go({},this.props),{},{payload:bU(h,f,aye)})))}}],[{key:"getWithHeight",value:function(i,r){var a=Go(Go({},this.defaultProps),i.props),o=a.layout;return o==="vertical"&&Ge(i.props.height)?{height:i.props.height}:o==="horizontal"?{width:i.props.width||r}:null}}])})(A.PureComponent);$0(os,"displayName","Legend");$0(os,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Hx,tR;function sye(){if(tR)return Hx;tR=1;var e=yp(),n=Q9(),t=Or(),i=e?e.isConcatSpreadable:void 0;function r(a){return t(a)||n(a)||!!(i&&a&&a[i])}return Hx=r,Hx}var Ux,iR;function _U(){if(iR)return Ux;iR=1;var e=cU(),n=sye();function t(i,r,a,o,l){var c=-1,f=i.length;for(a||(a=n),l||(l=[]);++c0&&a(h)?r>1?t(h,r-1,a,o,l):e(l,h):o||(l[l.length]=h)}return l}return Ux=t,Ux}var Vx,rR;function lye(){if(rR)return Vx;rR=1;function e(n){return function(t,i,r){for(var a=-1,o=Object(t),l=r(t),c=l.length;c--;){var f=l[n?c:++a];if(i(o[f],f,o)===!1)break}return t}}return Vx=e,Vx}var Wx,aR;function uye(){if(aR)return Wx;aR=1;var e=lye(),n=e();return Wx=n,Wx}var Gx,oR;function xU(){if(oR)return Gx;oR=1;var e=uye(),n=N0();function t(i,r){return i&&e(i,r,n)}return Gx=t,Gx}var Yx,sR;function cye(){if(sR)return Yx;sR=1;var e=bp();function n(t,i){return function(r,a){if(r==null)return r;if(!e(r))return t(r,a);for(var o=r.length,l=i?o:-1,c=Object(r);(i?l--:++li||l&&c&&h&&!f&&!d||a&&c&&h||!r&&h||!o)return 1;if(!a&&!l&&!d&&t=f)return h;var d=r[a];return h*(d=="desc"?-1:1)}}return t.index-i.index}return Jx=n,Jx}var e3,hR;function mye(){if(hR)return e3;hR=1;var e=q9(),n=H9(),t=Ol(),i=SU(),r=fye(),a=dU(),o=hye(),l=ad(),c=Or();function f(h,d,p){d.length?d=e(d,function(w){return c(w)?function(k){return n(k,w.length===1?w[0]:w)}:w}):d=[l];var v=-1;d=e(d,a(t));var b=i(h,function(w,k,_){var C=e(d,function(x){return x(w)});return{criteria:C,index:++v,value:w}});return r(b,function(w,k){return o(w,k,p)})}return e3=f,e3}var n3,mR;function pye(){if(mR)return n3;mR=1;function e(n,t,i){switch(i.length){case 0:return n.call(t);case 1:return n.call(t,i[0]);case 2:return n.call(t,i[0],i[1]);case 3:return n.call(t,i[0],i[1],i[2])}return n.apply(t,i)}return n3=e,n3}var t3,pR;function vye(){if(pR)return t3;pR=1;var e=pye(),n=Math.max;function t(i,r,a){return r=n(r===void 0?i.length-1:r,0),function(){for(var o=arguments,l=-1,c=n(o.length-r,0),f=Array(c);++l0){if(++a>=e)return arguments[0]}else a=0;return r.apply(void 0,arguments)}}return o3=i,o3}var s3,wR;function wye(){if(wR)return s3;wR=1;var e=yye(),n=bye(),t=n(e);return s3=t,s3}var l3,kR;function kye(){if(kR)return l3;kR=1;var e=ad(),n=vye(),t=wye();function i(r,a){return t(n(r,a,e),r+"")}return l3=i,l3}var u3,_R;function z0(){if(_R)return u3;_R=1;var e=I9(),n=bp(),t=J9(),i=jl();function r(a,o,l){if(!i(l))return!1;var c=typeof o;return(c=="number"?n(l)&&t(o,l.length):c=="string"&&o in l)?e(l[o],a):!1}return u3=r,u3}var c3,xR;function _ye(){if(xR)return c3;xR=1;var e=_U(),n=mye(),t=kye(),i=z0(),r=t(function(a,o){if(a==null)return[];var l=o.length;return l>1&&i(a,o[0],o[1])?o=[]:l>2&&i(o[0],o[1],o[2])&&(o=[o[0]]),n(a,e(o,1),[])});return c3=r,c3}var xye=_ye();const iA=yt(xye);function hm(e){"@babel/helpers - typeof";return hm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},hm(e)}function _4(){return _4=Object.assign?Object.assign.bind():function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,i=new Array(n);t=n.x),"".concat(dh,"-left"),Ge(t)&&n&&Ge(n.x)&&t=n.y),"".concat(dh,"-top"),Ge(i)&&n&&Ge(n.y)&&iw?Math.max(h,c[i]):Math.max(d,c[i])}function Lye(e){var n=e.translateX,t=e.translateY,i=e.useTranslate3d;return{transform:i?"translate3d(".concat(n,"px, ").concat(t,"px, 0)"):"translate(".concat(n,"px, ").concat(t,"px)")}}function Iye(e){var n=e.allowEscapeViewBox,t=e.coordinate,i=e.offsetTopLeft,r=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,f,h,d;return o.height>0&&o.width>0&&t?(h=AR({allowEscapeViewBox:n,coordinate:t,key:"x",offsetTopLeft:i,position:r,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=AR({allowEscapeViewBox:n,coordinate:t,key:"y",offsetTopLeft:i,position:r,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),f=Lye({translateX:h,translateY:d,useTranslate3d:l})):f=$ye,{cssProperties:f,cssClasses:zye({translateX:h,translateY:d,coordinate:t})}}function ff(e){"@babel/helpers - typeof";return ff=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ff(e)}function jR(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function OR(e){for(var n=1;nER||Math.abs(i.height-this.state.lastBoundingBox.height)>ER)&&this.setState({lastBoundingBox:{width:i.width,height:i.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var i,r;this.props.active&&this.updateBBox(),this.state.dismissed&&(((i=this.props.coordinate)===null||i===void 0?void 0:i.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var i=this,r=this.props,a=r.active,o=r.allowEscapeViewBox,l=r.animationDuration,c=r.animationEasing,f=r.children,h=r.coordinate,d=r.hasPayload,p=r.isAnimationActive,v=r.offset,b=r.position,w=r.reverseDirection,k=r.useTranslate3d,_=r.viewBox,C=r.wrapperStyle,x=Iye({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:v,position:b,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:k,viewBox:_}),E=x.cssClasses,j=x.cssProperties,O=OR(OR({transition:p&&a?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&d?"visible":"hidden",position:"absolute",top:0,left:0},C);return Q.createElement("div",{tabIndex:-1,className:E,style:O,ref:function(N){i.wrapperNode=N}},f)}}])})(A.PureComponent),Kye=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Fu={isSsr:Kye()};function df(e){"@babel/helpers - typeof";return df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},df(e)}function TR(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function MR(e){for(var n=1;n0;return Q.createElement(Yye,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:p,active:a,coordinate:h,hasPayload:O,offset:v,position:k,reverseDirection:_,useTranslate3d:C,viewBox:x,wrapperStyle:E},a0e(f,MR(MR({},this.props),{},{payload:j})))}}])})(A.PureComponent);rA(va,"displayName","Tooltip");rA(va,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Fu.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var d3,DR;function o0e(){if(DR)return d3;DR=1;var e=Ao(),n=function(){return e.Date.now()};return d3=n,d3}var h3,RR;function s0e(){if(RR)return h3;RR=1;var e=/\s/;function n(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}return h3=n,h3}var m3,PR;function l0e(){if(PR)return m3;PR=1;var e=s0e(),n=/^\s+/;function t(i){return i&&i.slice(0,e(i)+1).replace(n,"")}return m3=t,m3}var p3,NR;function TU(){if(NR)return p3;NR=1;var e=l0e(),n=jl(),t=nd(),i=NaN,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(f){if(typeof f=="number")return f;if(t(f))return i;if(n(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=n(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var d=a.test(f);return d||o.test(f)?l(f.slice(2),d?2:8):r.test(f)?i:+f}return p3=c,p3}var v3,$R;function u0e(){if($R)return v3;$R=1;var e=jl(),n=o0e(),t=TU(),i="Expected a function",r=Math.max,a=Math.min;function o(l,c,f){var h,d,p,v,b,w,k=0,_=!1,C=!1,x=!0;if(typeof l!="function")throw new TypeError(i);c=t(c)||0,e(f)&&(_=!!f.leading,C="maxWait"in f,p=C?r(t(f.maxWait)||0,c):p,x="trailing"in f?!!f.trailing:x);function E(Y){var V=h,$=d;return h=d=void 0,k=Y,v=l.apply($,V),v}function j(Y){return k=Y,b=setTimeout(N,c),_?E(Y):v}function O(Y){var V=Y-w,$=Y-k,P=c-V;return C?a(P,p-$):P}function M(Y){var V=Y-w,$=Y-k;return w===void 0||V>=c||V<0||C&&$>=p}function N(){var Y=n();if(M(Y))return q(Y);b=setTimeout(N,O(Y))}function q(Y){return b=void 0,x&&h?E(Y):(h=d=void 0,v)}function R(){b!==void 0&&clearTimeout(b),k=0,h=w=d=b=void 0}function L(){return b===void 0?v:q(n())}function F(){var Y=n(),V=M(Y);if(h=arguments,d=this,w=Y,V){if(b===void 0)return j(w);if(C)return clearTimeout(b),b=setTimeout(N,c),E(w)}return b===void 0&&(b=setTimeout(N,c)),v}return F.cancel=R,F.flush=L,F}return v3=o,v3}var g3,zR;function c0e(){if(zR)return g3;zR=1;var e=u0e(),n=jl(),t="Expected a function";function i(r,a,o){var l=!0,c=!0;if(typeof r!="function")throw new TypeError(t);return n(o)&&(l="leading"in o?!!o.leading:l,c="trailing"in o?!!o.trailing:c),e(r,a,{leading:l,maxWait:a,trailing:c})}return g3=i,g3}var f0e=c0e();const MU=yt(f0e);function pm(e){"@babel/helpers - typeof";return pm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},pm(e)}function LR(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function eg(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,i=new Array(n);t0&&(Y=MU(Y,w,{trailing:!0,leading:!1}));var V=new ResizeObserver(Y),$=j.current.getBoundingClientRect(),P=$.width,I=$.height;return L(P,I),V.observe(j.current),function(){V.disconnect()}},[L,w]);var F=A.useMemo(function(){var Y=q.containerWidth,V=q.containerHeight;if(Y<0||V<0)return null;as(uu(o)||uu(c),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,c),as(!t||t>0,"The aspect(%s) must be greater than zero.",t);var $=uu(o)?Y:o,P=uu(c)?V:c;t&&t>0&&($?P=$/t:P&&($=P*t),p&&P>p&&(P=p)),as($>0||P>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,$,P,o,c,h,d,t);var I=!Array.isArray(v)&&rs(v.type).endsWith("Chart");return Q.Children.map(v,function(H){return Q.isValidElement(H)?A.cloneElement(H,eg({width:$,height:P},I?{style:eg({height:"100%",width:"100%",maxHeight:P,maxWidth:$},H.props.style)}:{})):H})},[t,v,c,p,d,h,q,o]);return Q.createElement("div",{id:k?"".concat(k):void 0,className:pn("recharts-responsive-container",_),style:eg(eg({},E),{},{width:o,height:c,minWidth:h,minHeight:d,maxHeight:p}),ref:j},F)}),DU=function(n){return null};DU.displayName="Cell";function vm(e){"@babel/helpers - typeof";return vm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},vm(e)}function BR(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function A4(e){for(var n=1;n1&&arguments[1]!==void 0?arguments[1]:{};if(n==null||Fu.isSsr)return{width:0,height:0};var i=C0e(t),r=JSON.stringify({text:n,copyStyle:i});if(Pc.widthCache[r])return Pc.widthCache[r];try{var a=document.getElementById(FR);a||(a=document.createElement("span"),a.setAttribute("id",FR),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=A4(A4({},S0e),i);Object.assign(a.style,o),a.textContent="".concat(n);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Pc.widthCache[r]=c,++Pc.cacheCount>x0e&&(Pc.cacheCount=0,Pc.widthCache={}),c}catch{return{width:0,height:0}}},A0e=function(n){return{top:n.top+window.scrollY-document.documentElement.clientTop,left:n.left+window.scrollX-document.documentElement.clientLeft}};function gm(e){"@babel/helpers - typeof";return gm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},gm(e)}function m1(e,n){return T0e(e)||E0e(e,n)||O0e(e,n)||j0e()}function j0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O0e(e,n){if(e){if(typeof e=="string")return qR(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return qR(e,n)}}function qR(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function U0e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function YR(e,n){return Y0e(e)||G0e(e,n)||W0e(e,n)||V0e()}function V0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W0e(e,n){if(e){if(typeof e=="string")return KR(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return KR(e,n)}}function KR(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t0&&arguments[0]!==void 0?arguments[0]:[];return $.reduce(function(P,I){var H=I.word,U=I.width,D=P[P.length-1];if(D&&(r==null||a||D.width+U+iI.width?P:I})};if(!h)return v;for(var w="…",k=function($){var P=d.slice(0,$),I=$U({breakAll:f,style:c,children:P+w}).wordsWithComputedWidth,H=p(I),U=H.length>o||b(H).width>Number(r);return[U,H]},_=0,C=d.length-1,x=0,E;_<=C&&x<=d.length-1;){var j=Math.floor((_+C)/2),O=j-1,M=k(O),N=YR(M,2),q=N[0],R=N[1],L=k(j),F=YR(L,1),Y=F[0];if(!q&&!Y&&(_=j+1),q&&Y&&(C=j-1),!q&&Y){E=R;break}x++}return E||v},XR=function(n){var t=Yn(n)?[]:n.toString().split(NU);return[{words:t}]},X0e=function(n){var t=n.width,i=n.scaleToFit,r=n.children,a=n.style,o=n.breakAll,l=n.maxLines;if((t||i)&&!Fu.isSsr){var c,f,h=$U({breakAll:o,children:r,style:a});if(h){var d=h.wordsWithComputedWidth,p=h.spaceWidth;c=d,f=p}else return XR(r);return K0e({breakAll:o,children:r,maxLines:l,style:a},c,f,t,i)}return XR(r)},ZR="#808080",p1=function(n){var t=n.x,i=t===void 0?0:t,r=n.y,a=r===void 0?0:r,o=n.lineHeight,l=o===void 0?"1em":o,c=n.capHeight,f=c===void 0?"0.71em":c,h=n.scaleToFit,d=h===void 0?!1:h,p=n.textAnchor,v=p===void 0?"start":p,b=n.verticalAnchor,w=b===void 0?"end":b,k=n.fill,_=k===void 0?ZR:k,C=GR(n,q0e),x=A.useMemo(function(){return X0e({breakAll:C.breakAll,children:C.children,maxLines:C.maxLines,scaleToFit:d,style:C.style,width:C.width})},[C.breakAll,C.children,C.maxLines,d,C.style,C.width]),E=C.dx,j=C.dy,O=C.angle,M=C.className,N=C.breakAll,q=GR(C,H0e);if(!Si(i)||!Si(a))return null;var R=i+(Ge(E)?E:0),L=a+(Ge(j)?j:0),F;switch(w){case"start":F=y3("calc(".concat(f,")"));break;case"middle":F=y3("calc(".concat((x.length-1)/2," * -").concat(l," + (").concat(f," / 2))"));break;default:F=y3("calc(".concat(x.length-1," * -").concat(l,")"));break}var Y=[];if(d){var V=x[0].width,$=C.width;Y.push("scale(".concat((Ge($)?$/V:1)/V,")"))}return O&&Y.push("rotate(".concat(O,", ").concat(R,", ").concat(L,")")),Y.length&&(q.transform=Y.join(" ")),Q.createElement("text",j4({},Wn(q,!0),{x:R,y:L,className:pn("recharts-text",M),textAnchor:v,fill:_.includes("url")?ZR:_}),x.map(function(P,I){var H=P.words.join(N?"":" ");return Q.createElement("tspan",{x:R,dy:I===0?F:l,key:"".concat(H,"-").concat(I)},H)}))};function fl(e,n){return e==null||n==null?NaN:en?1:e>=n?0:NaN}function Z0e(e,n){return e==null||n==null?NaN:ne?1:n>=e?0:NaN}function oA(e){let n,t,i;e.length!==2?(n=fl,t=(l,c)=>fl(e(l),c),i=(l,c)=>e(l)-c):(n=e===fl||e===Z0e?e:Q0e,t=e,i=e);function r(l,c,f=0,h=l.length){if(f>>1;t(l[d],c)<0?f=d+1:h=d}while(f>>1;t(l[d],c)<=0?f=d+1:h=d}while(ff&&i(l[d-1],c)>-i(l[d],c)?d-1:d}return{left:r,center:o,right:a}}function Q0e(){return 0}function zU(e){return e===null?NaN:+e}function*J0e(e,n){for(let t of e)t!=null&&(t=+t)>=t&&(yield t)}const ebe=oA(fl),wp=ebe.right;oA(zU).center;class QR extends Map{constructor(n,t=ibe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),n!=null)for(const[i,r]of n)this.set(i,r)}get(n){return super.get(JR(this,n))}has(n){return super.has(JR(this,n))}set(n,t){return super.set(nbe(this,n),t)}delete(n){return super.delete(tbe(this,n))}}function JR({_intern:e,_key:n},t){const i=n(t);return e.has(i)?e.get(i):t}function nbe({_intern:e,_key:n},t){const i=n(t);return e.has(i)?e.get(i):(e.set(i,t),t)}function tbe({_intern:e,_key:n},t){const i=n(t);return e.has(i)&&(t=e.get(i),e.delete(i)),t}function ibe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function rbe(e=fl){if(e===fl)return LU;if(typeof e!="function")throw new TypeError("compare is not a function");return(n,t)=>{const i=e(n,t);return i||i===0?i:(e(t,t)===0)-(e(n,n)===0)}}function LU(e,n){return(e==null||!(e>=e))-(n==null||!(n>=n))||(en?1:0)}const abe=Math.sqrt(50),obe=Math.sqrt(10),sbe=Math.sqrt(2);function v1(e,n,t){const i=(n-e)/Math.max(0,t),r=Math.floor(Math.log10(i)),a=i/Math.pow(10,r),o=a>=abe?10:a>=obe?5:a>=sbe?2:1;let l,c,f;return r<0?(f=Math.pow(10,-r)/o,l=Math.round(e*f),c=Math.round(n*f),l/fn&&--c,f=-f):(f=Math.pow(10,r)*o,l=Math.round(e/f),c=Math.round(n/f),l*fn&&--c),c0))return[];if(e===n)return[e];const i=n=r))return[];const l=a-r+1,c=new Array(l);if(i)if(o<0)for(let f=0;f=i)&&(t=i);return t}function nP(e,n){let t;for(const i of e)i!=null&&(t>i||t===void 0&&i>=i)&&(t=i);return t}function IU(e,n,t=0,i=1/0,r){if(n=Math.floor(n),t=Math.floor(Math.max(0,t)),i=Math.floor(Math.min(e.length-1,i)),!(t<=n&&n<=i))return e;for(r=r===void 0?LU:rbe(r);i>t;){if(i-t>600){const c=i-t+1,f=n-t+1,h=Math.log(c),d=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*d*(c-d)/c)*(f-c/2<0?-1:1),v=Math.max(t,Math.floor(n-f*d/c+p)),b=Math.min(i,Math.floor(n+(c-f)*d/c+p));IU(e,n,v,b,r)}const a=e[n];let o=t,l=i;for(hh(e,t,n),r(e[i],a)>0&&hh(e,t,i);o0;)--l}r(e[t],a)===0?hh(e,t,l):(++l,hh(e,l,i)),l<=n&&(t=l+1),n<=l&&(i=l-1)}return e}function hh(e,n,t){const i=e[n];e[n]=e[t],e[t]=i}function lbe(e,n,t){if(e=Float64Array.from(J0e(e)),!(!(i=e.length)||isNaN(n=+n))){if(n<=0||i<2)return nP(e);if(n>=1)return eP(e);var i,r=(i-1)*n,a=Math.floor(r),o=eP(IU(e,a).subarray(0,a+1)),l=nP(e.subarray(a+1));return o+(l-o)*(r-a)}}function ube(e,n,t=zU){if(!(!(i=e.length)||isNaN(n=+n))){if(n<=0||i<2)return+t(e[0],0,e);if(n>=1)return+t(e[i-1],i-1,e);var i,r=(i-1)*n,a=Math.floor(r),o=+t(e[a],a,e),l=+t(e[a+1],a+1,e);return o+(l-o)*(r-a)}}function cbe(e,n,t){e=+e,n=+n,t=(r=arguments.length)<2?(n=e,e=0,1):r<3?1:+t;for(var i=-1,r=Math.max(0,Math.ceil((n-e)/t))|0,a=new Array(r);++i>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?tg(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?tg(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=dbe.exec(e))?new Cr(n[1],n[2],n[3],1):(n=hbe.exec(e))?new Cr(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=mbe.exec(e))?tg(n[1],n[2],n[3],n[4]):(n=pbe.exec(e))?tg(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=vbe.exec(e))?lP(n[1],n[2]/100,n[3]/100,1):(n=gbe.exec(e))?lP(n[1],n[2]/100,n[3]/100,n[4]):tP.hasOwnProperty(e)?aP(tP[e]):e==="transparent"?new Cr(NaN,NaN,NaN,0):null}function aP(e){return new Cr(e>>16&255,e>>8&255,e&255,1)}function tg(e,n,t,i){return i<=0&&(e=n=t=NaN),new Cr(e,n,t,i)}function wbe(e){return e instanceof kp||(e=km(e)),e?(e=e.rgb(),new Cr(e.r,e.g,e.b,e.opacity)):new Cr}function D4(e,n,t,i){return arguments.length===1?wbe(e):new Cr(e,n,t,i??1)}function Cr(e,n,t,i){this.r=+e,this.g=+n,this.b=+t,this.opacity=+i}lA(Cr,D4,FU(kp,{brighter(e){return e=e==null?g1:Math.pow(g1,e),new Cr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bm:Math.pow(bm,e),new Cr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Cr(pu(this.r),pu(this.g),pu(this.b),y1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oP,formatHex:oP,formatHex8:kbe,formatRgb:sP,toString:sP}));function oP(){return`#${cu(this.r)}${cu(this.g)}${cu(this.b)}`}function kbe(){return`#${cu(this.r)}${cu(this.g)}${cu(this.b)}${cu((isNaN(this.opacity)?1:this.opacity)*255)}`}function sP(){const e=y1(this.opacity);return`${e===1?"rgb(":"rgba("}${pu(this.r)}, ${pu(this.g)}, ${pu(this.b)}${e===1?")":`, ${e})`}`}function y1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cu(e){return e=pu(e),(e<16?"0":"")+e.toString(16)}function lP(e,n,t,i){return i<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Ia(e,n,t,i)}function qU(e){if(e instanceof Ia)return new Ia(e.h,e.s,e.l,e.opacity);if(e instanceof kp||(e=km(e)),!e)return new Ia;if(e instanceof Ia)return e;e=e.rgb();var n=e.r/255,t=e.g/255,i=e.b/255,r=Math.min(n,t,i),a=Math.max(n,t,i),o=NaN,l=a-r,c=(a+r)/2;return l?(n===a?o=(t-i)/l+(t0&&c<1?0:o,new Ia(o,l,c,e.opacity)}function _be(e,n,t,i){return arguments.length===1?qU(e):new Ia(e,n,t,i??1)}function Ia(e,n,t,i){this.h=+e,this.s=+n,this.l=+t,this.opacity=+i}lA(Ia,_be,FU(kp,{brighter(e){return e=e==null?g1:Math.pow(g1,e),new Ia(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bm:Math.pow(bm,e),new Ia(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*n,r=2*t-i;return new Cr(b3(e>=240?e-240:e+120,r,i),b3(e,r,i),b3(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Ia(uP(this.h),ig(this.s),ig(this.l),y1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=y1(this.opacity);return`${e===1?"hsl(":"hsla("}${uP(this.h)}, ${ig(this.s)*100}%, ${ig(this.l)*100}%${e===1?")":`, ${e})`}`}}));function uP(e){return e=(e||0)%360,e<0?e+360:e}function ig(e){return Math.max(0,Math.min(1,e||0))}function b3(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const uA=e=>()=>e;function xbe(e,n){return function(t){return e+t*n}}function Sbe(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(i){return Math.pow(e+i*n,t)}}function Cbe(e){return(e=+e)==1?HU:function(n,t){return t-n?Sbe(n,t,e):uA(isNaN(n)?t:n)}}function HU(e,n){var t=n-e;return t?xbe(e,t):uA(isNaN(e)?n:e)}const cP=(function e(n){var t=Cbe(n);function i(r,a){var o=t((r=D4(r)).r,(a=D4(a)).r),l=t(r.g,a.g),c=t(r.b,a.b),f=HU(r.opacity,a.opacity);return function(h){return r.r=o(h),r.g=l(h),r.b=c(h),r.opacity=f(h),r+""}}return i.gamma=e,i})(1);function Abe(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,i=n.slice(),r;return function(a){for(r=0;rt&&(a=n.slice(t,a),l[o]?l[o]+=a:l[++o]=a),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:b1(i,r)})),t=w3.lastIndex;return tn&&(t=e,e=n,n=t),function(i){return Math.max(e,Math.min(n,i))}}function zbe(e,n,t){var i=e[0],r=e[1],a=n[0],o=n[1];return r2?Lbe:zbe,c=f=null,d}function d(p){return p==null||isNaN(p=+p)?a:(c||(c=l(e.map(i),n,t)))(i(o(p)))}return d.invert=function(p){return o(r((f||(f=l(n,e.map(i),b1)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,w1),h()):e.slice()},d.range=function(p){return arguments.length?(n=Array.from(p),h()):n.slice()},d.rangeRound=function(p){return n=Array.from(p),t=cA,h()},d.clamp=function(p){return arguments.length?(o=p?!0:ur,h()):o!==ur},d.interpolate=function(p){return arguments.length?(t=p,h()):t},d.unknown=function(p){return arguments.length?(a=p,d):a},function(p,v){return i=p,r=v,h()}}function fA(){return L0()(ur,ur)}function Ibe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function k1(e,n){if(!isFinite(e)||e===0)return null;var t=(e=n?e.toExponential(n-1):e.toExponential()).indexOf("e"),i=e.slice(0,t);return[i.length>1?i[0]+i.slice(2):i,+e.slice(t+1)]}function hf(e){return e=k1(Math.abs(e)),e?e[1]:NaN}function Bbe(e,n){return function(t,i){for(var r=t.length,a=[],o=0,l=e[0],c=0;r>0&&l>0&&(c+l+1>i&&(l=Math.max(1,i-c)),a.push(t.substring(r-=l,r+l)),!((c+=l+1)>i));)l=e[o=(o+1)%e.length];return a.reverse().join(n)}}function Fbe(e){return function(n){return n.replace(/[0-9]/g,function(t){return e[+t]})}}var qbe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _m(e){if(!(n=qbe.exec(e)))throw new Error("invalid format: "+e);var n;return new dA({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}_m.prototype=dA.prototype;function dA(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}dA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Hbe(e){e:for(var n=e.length,t=1,i=-1,r;t0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var _1;function Ube(e,n){var t=k1(e,n);if(!t)return _1=void 0,e.toPrecision(n);var i=t[0],r=t[1],a=r-(_1=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+k1(e,Math.max(0,n+a-1))[0]}function dP(e,n){var t=k1(e,n);if(!t)return e+"";var i=t[0],r=t[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const hP={"%":(e,n)=>(e*100).toFixed(n),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ibe,e:(e,n)=>e.toExponential(n),f:(e,n)=>e.toFixed(n),g:(e,n)=>e.toPrecision(n),o:e=>Math.round(e).toString(8),p:(e,n)=>dP(e*100,n),r:dP,s:Ube,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function mP(e){return e}var pP=Array.prototype.map,vP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Vbe(e){var n=e.grouping===void 0||e.thousands===void 0?mP:Bbe(pP.call(e.grouping,Number),e.thousands+""),t=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?mP:Fbe(pP.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(d,p){d=_m(d);var v=d.fill,b=d.align,w=d.sign,k=d.symbol,_=d.zero,C=d.width,x=d.comma,E=d.precision,j=d.trim,O=d.type;O==="n"?(x=!0,O="g"):hP[O]||(E===void 0&&(E=12),j=!0,O="g"),(_||v==="0"&&b==="=")&&(_=!0,v="0",b="=");var M=(p&&p.prefix!==void 0?p.prefix:"")+(k==="$"?t:k==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),N=(k==="$"?i:/[%p]/.test(O)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),q=hP[O],R=/[defgprs%]/.test(O);E=E===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function L(F){var Y=M,V=N,$,P,I;if(O==="c")V=q(F)+V,F="";else{F=+F;var H=F<0||1/F<0;if(F=isNaN(F)?c:q(Math.abs(F),E),j&&(F=Hbe(F)),H&&+F==0&&w!=="+"&&(H=!1),Y=(H?w==="("?w:l:w==="-"||w==="("?"":w)+Y,V=(O==="s"&&!isNaN(F)&&_1!==void 0?vP[8+_1/3]:"")+V+(H&&w==="("?")":""),R){for($=-1,P=F.length;++$I||I>57){V=(I===46?r+F.slice($+1):F.slice($))+V,F=F.slice(0,$);break}}}x&&!_&&(F=n(F,1/0));var U=Y.length+F.length+V.length,D=U>1)+Y+F+V+D.slice(U);break;default:F=D+Y+F+V;break}return a(F)}return L.toString=function(){return d+""},L}function h(d,p){var v=Math.max(-8,Math.min(8,Math.floor(hf(p)/3)))*3,b=Math.pow(10,-v),w=f((d=_m(d),d.type="f",d),{suffix:vP[8+v/3]});return function(k){return w(b*k)}}return{format:f,formatPrefix:h}}var rg,hA,UU;Wbe({thousands:",",grouping:[3],currency:["$",""]});function Wbe(e){return rg=Vbe(e),hA=rg.format,UU=rg.formatPrefix,rg}function Gbe(e){return Math.max(0,-hf(Math.abs(e)))}function Ybe(e,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(hf(n)/3)))*3-hf(Math.abs(e)))}function Kbe(e,n){return e=Math.abs(e),n=Math.abs(n)-e,Math.max(0,hf(n)-hf(e))+1}function VU(e,n,t,i){var r=T4(e,n,t),a;switch(i=_m(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(n));return i.precision==null&&!isNaN(a=Ybe(r,o))&&(i.precision=a),UU(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(a=Kbe(r,Math.max(Math.abs(e),Math.abs(n))))&&(i.precision=a-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(a=Gbe(r))&&(i.precision=a-(i.type==="%")*2);break}}return hA(i)}function El(e){var n=e.domain;return e.ticks=function(t){var i=n();return O4(i[0],i[i.length-1],t??10)},e.tickFormat=function(t,i){var r=n();return VU(r[0],r[r.length-1],t??10,i)},e.nice=function(t){t==null&&(t=10);var i=n(),r=0,a=i.length-1,o=i[r],l=i[a],c,f,h=10;for(l0;){if(f=E4(o,l,t),f===c)return i[r]=o,i[a]=l,n(i);if(f>0)o=Math.floor(o/f)*f,l=Math.ceil(l/f)*f;else if(f<0)o=Math.ceil(o*f)/f,l=Math.floor(l*f)/f;else break;c=f}return e},e}function x1(){var e=fA();return e.copy=function(){return _p(e,x1())},Ea.apply(e,arguments),El(e)}function WU(e){var n;function t(i){return i==null||isNaN(i=+i)?n:i}return t.invert=t,t.domain=t.range=function(i){return arguments.length?(e=Array.from(i,w1),t):e.slice()},t.unknown=function(i){return arguments.length?(n=i,t):n},t.copy=function(){return WU(e).unknown(n)},e=arguments.length?Array.from(e,w1):[0,1],El(t)}function GU(e,n){e=e.slice();var t=0,i=e.length-1,r=e[t],a=e[i],o;return aMath.pow(e,n)}function ewe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),n=>Math.log(n)/e)}function bP(e){return(n,t)=>-e(-n,t)}function mA(e){const n=e(gP,yP),t=n.domain;let i=10,r,a;function o(){return r=ewe(i),a=Jbe(i),t()[0]<0?(r=bP(r),a=bP(a),e(Xbe,Zbe)):e(gP,yP),n}return n.base=function(l){return arguments.length?(i=+l,o()):i},n.domain=function(l){return arguments.length?(t(l),o()):t()},n.ticks=l=>{const c=t();let f=c[0],h=c[c.length-1];const d=h0){for(;p<=v;++p)for(b=1;bh)break;_.push(w)}}else for(;p<=v;++p)for(b=i-1;b>=1;--b)if(w=p>0?b/a(-p):b*a(p),!(wh)break;_.push(w)}_.length*2{if(l==null&&(l=10),c==null&&(c=i===10?"s":","),typeof c!="function"&&(!(i%1)&&(c=_m(c)).precision==null&&(c.trim=!0),c=hA(c)),l===1/0)return c;const f=Math.max(1,i*l/n.ticks().length);return h=>{let d=h/a(Math.round(r(h)));return d*it(GU(t(),{floor:l=>a(Math.floor(r(l))),ceil:l=>a(Math.ceil(r(l)))})),n}function YU(){const e=mA(L0()).domain([1,10]);return e.copy=()=>_p(e,YU()).base(e.base()),Ea.apply(e,arguments),e}function wP(e){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/e))}}function kP(e){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*e}}function pA(e){var n=1,t=e(wP(n),kP(n));return t.constant=function(i){return arguments.length?e(wP(n=+i),kP(n)):n},El(t)}function KU(){var e=pA(L0());return e.copy=function(){return _p(e,KU()).constant(e.constant())},Ea.apply(e,arguments)}function _P(e){return function(n){return n<0?-Math.pow(-n,e):Math.pow(n,e)}}function nwe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function twe(e){return e<0?-e*e:e*e}function vA(e){var n=e(ur,ur),t=1;function i(){return t===1?e(ur,ur):t===.5?e(nwe,twe):e(_P(t),_P(1/t))}return n.exponent=function(r){return arguments.length?(t=+r,i()):t},El(n)}function gA(){var e=vA(L0());return e.copy=function(){return _p(e,gA()).exponent(e.exponent())},Ea.apply(e,arguments),e}function iwe(){return gA.apply(null,arguments).exponent(.5)}function xP(e){return Math.sign(e)*e*e}function rwe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function XU(){var e=fA(),n=[0,1],t=!1,i;function r(a){var o=rwe(e(a));return isNaN(o)?i:t?Math.round(o):o}return r.invert=function(a){return e.invert(xP(a))},r.domain=function(a){return arguments.length?(e.domain(a),r):e.domain()},r.range=function(a){return arguments.length?(e.range((n=Array.from(a,w1)).map(xP)),r):n.slice()},r.rangeRound=function(a){return r.range(a).round(!0)},r.round=function(a){return arguments.length?(t=!!a,r):t},r.clamp=function(a){return arguments.length?(e.clamp(a),r):e.clamp()},r.unknown=function(a){return arguments.length?(i=a,r):i},r.copy=function(){return XU(e.domain(),n).round(t).clamp(e.clamp()).unknown(i)},Ea.apply(r,arguments),El(r)}function ZU(){var e=[],n=[],t=[],i;function r(){var o=0,l=Math.max(1,n.length);for(t=new Array(l-1);++o0?t[l-1]:e[0],l=t?[i[t-1],n]:[i[f-1],i[f]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return i.slice()},o.copy=function(){return QU().domain([e,n]).range(r).unknown(a)},Ea.apply(El(o),arguments)}function JU(){var e=[.5],n=[0,1],t,i=1;function r(a){return a!=null&&a<=a?n[wp(e,a,0,i)]:t}return r.domain=function(a){return arguments.length?(e=Array.from(a),i=Math.min(e.length,n.length-1),r):e.slice()},r.range=function(a){return arguments.length?(n=Array.from(a),i=Math.min(e.length,n.length-1),r):n.slice()},r.invertExtent=function(a){var o=n.indexOf(a);return[e[o-1],e[o]]},r.unknown=function(a){return arguments.length?(t=a,r):t},r.copy=function(){return JU().domain(e).range(n).unknown(t)},Ea.apply(r,arguments)}const k3=new Date,_3=new Date;function ji(e,n,t,i){function r(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return r.floor=a=>(e(a=new Date(+a)),a),r.ceil=a=>(e(a=new Date(a-1)),n(a,1),e(a),a),r.round=a=>{const o=r(a),l=r.ceil(a);return a-o(n(a=new Date(+a),o==null?1:Math.floor(o)),a),r.range=(a,o,l)=>{const c=[];if(a=r.ceil(a),l=l==null?1:Math.floor(l),!(a0))return c;let f;do c.push(f=new Date(+a)),n(a,l),e(a);while(fji(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;n(o,-1),!a(o););else for(;--l>=0;)for(;n(o,1),!a(o););}),t&&(r.count=(a,o)=>(k3.setTime(+a),_3.setTime(+o),e(k3),e(_3),Math.floor(t(k3,_3))),r.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?r.filter(i?o=>i(o)%a===0:o=>r.count(0,o)%a===0):r)),r}const S1=ji(()=>{},(e,n)=>{e.setTime(+e+n)},(e,n)=>n-e);S1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ji(n=>{n.setTime(Math.floor(n/e)*e)},(n,t)=>{n.setTime(+n+t*e)},(n,t)=>(t-n)/e):S1);S1.range;const Qo=1e3,ba=Qo*60,Jo=ba*60,fs=Jo*24,yA=fs*7,SP=fs*30,x3=fs*365,fu=ji(e=>{e.setTime(e-e.getMilliseconds())},(e,n)=>{e.setTime(+e+n*Qo)},(e,n)=>(n-e)/Qo,e=>e.getUTCSeconds());fu.range;const bA=ji(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Qo)},(e,n)=>{e.setTime(+e+n*ba)},(e,n)=>(n-e)/ba,e=>e.getMinutes());bA.range;const wA=ji(e=>{e.setUTCSeconds(0,0)},(e,n)=>{e.setTime(+e+n*ba)},(e,n)=>(n-e)/ba,e=>e.getUTCMinutes());wA.range;const kA=ji(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Qo-e.getMinutes()*ba)},(e,n)=>{e.setTime(+e+n*Jo)},(e,n)=>(n-e)/Jo,e=>e.getHours());kA.range;const _A=ji(e=>{e.setUTCMinutes(0,0,0)},(e,n)=>{e.setTime(+e+n*Jo)},(e,n)=>(n-e)/Jo,e=>e.getUTCHours());_A.range;const xp=ji(e=>e.setHours(0,0,0,0),(e,n)=>e.setDate(e.getDate()+n),(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ba)/fs,e=>e.getDate()-1);xp.range;const I0=ji(e=>{e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n)},(e,n)=>(n-e)/fs,e=>e.getUTCDate()-1);I0.range;const eV=ji(e=>{e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n)},(e,n)=>(n-e)/fs,e=>Math.floor(e/fs));eV.range;function qu(e){return ji(n=>{n.setDate(n.getDate()-(n.getDay()+7-e)%7),n.setHours(0,0,0,0)},(n,t)=>{n.setDate(n.getDate()+t*7)},(n,t)=>(t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*ba)/yA)}const B0=qu(0),C1=qu(1),awe=qu(2),owe=qu(3),mf=qu(4),swe=qu(5),lwe=qu(6);B0.range;C1.range;awe.range;owe.range;mf.range;swe.range;lwe.range;function Hu(e){return ji(n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-e)%7),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCDate(n.getUTCDate()+t*7)},(n,t)=>(t-n)/yA)}const F0=Hu(0),A1=Hu(1),uwe=Hu(2),cwe=Hu(3),pf=Hu(4),fwe=Hu(5),dwe=Hu(6);F0.range;A1.range;uwe.range;cwe.range;pf.range;fwe.range;dwe.range;const xA=ji(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,n)=>{e.setMonth(e.getMonth()+n)},(e,n)=>n.getMonth()-e.getMonth()+(n.getFullYear()-e.getFullYear())*12,e=>e.getMonth());xA.range;const SA=ji(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCMonth(e.getUTCMonth()+n)},(e,n)=>n.getUTCMonth()-e.getUTCMonth()+(n.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());SA.range;const ds=ji(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n)},(e,n)=>n.getFullYear()-e.getFullYear(),e=>e.getFullYear());ds.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ji(n=>{n.setFullYear(Math.floor(n.getFullYear()/e)*e),n.setMonth(0,1),n.setHours(0,0,0,0)},(n,t)=>{n.setFullYear(n.getFullYear()+t*e)});ds.range;const hs=ji(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n)},(e,n)=>n.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());hs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ji(n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/e)*e),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCFullYear(n.getUTCFullYear()+t*e)});hs.range;function nV(e,n,t,i,r,a){const o=[[fu,1,Qo],[fu,5,5*Qo],[fu,15,15*Qo],[fu,30,30*Qo],[a,1,ba],[a,5,5*ba],[a,15,15*ba],[a,30,30*ba],[r,1,Jo],[r,3,3*Jo],[r,6,6*Jo],[r,12,12*Jo],[i,1,fs],[i,2,2*fs],[t,1,yA],[n,1,SP],[n,3,3*SP],[e,1,x3]];function l(f,h,d){const p=hk).right(o,p);if(v===o.length)return e.every(T4(f/x3,h/x3,d));if(v===0)return S1.every(Math.max(T4(f,h,d),1));const[b,w]=o[p/o[v-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(ke=C3(mh(ne.y,0,1)),je=ke.getUTCDay(),ke=je>4||je===0?A1.ceil(ke):A1(ke),ke=I0.offset(ke,(ne.V-1)*7),ne.y=ke.getUTCFullYear(),ne.m=ke.getUTCMonth(),ne.d=ke.getUTCDate()+(ne.w+6)%7):(ke=S3(mh(ne.y,0,1)),je=ke.getDay(),ke=je>4||je===0?C1.ceil(ke):C1(ke),ke=xp.offset(ke,(ne.V-1)*7),ne.y=ke.getFullYear(),ne.m=ke.getMonth(),ne.d=ke.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),je="Z"in ne?C3(mh(ne.y,0,1)).getUTCDay():S3(mh(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(je+5)%7:ne.w+ne.U*7-(je+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,C3(ne)):S3(ne)}}function N(ae,ue,Se,ne){for(var Le=0,ke=ue.length,je=Se.length,Ne,ge;Le=je)return-1;if(Ne=ue.charCodeAt(Le++),Ne===37){if(Ne=ue.charAt(Le++),ge=j[Ne in CP?ue.charAt(Le++):Ne],!ge||(ne=ge(ae,Se,ne))<0)return-1}else if(Ne!=Se.charCodeAt(ne++))return-1}return ne}function q(ae,ue,Se){var ne=f.exec(ue.slice(Se));return ne?(ae.p=h.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function R(ae,ue,Se){var ne=v.exec(ue.slice(Se));return ne?(ae.w=b.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function L(ae,ue,Se){var ne=d.exec(ue.slice(Se));return ne?(ae.w=p.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function F(ae,ue,Se){var ne=_.exec(ue.slice(Se));return ne?(ae.m=C.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function Y(ae,ue,Se){var ne=w.exec(ue.slice(Se));return ne?(ae.m=k.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function V(ae,ue,Se){return N(ae,n,ue,Se)}function $(ae,ue,Se){return N(ae,t,ue,Se)}function P(ae,ue,Se){return N(ae,i,ue,Se)}function I(ae){return o[ae.getDay()]}function H(ae){return a[ae.getDay()]}function U(ae){return c[ae.getMonth()]}function D(ae){return l[ae.getMonth()]}function W(ae){return r[+(ae.getHours()>=12)]}function G(ae){return 1+~~(ae.getMonth()/3)}function z(ae){return o[ae.getUTCDay()]}function X(ae){return a[ae.getUTCDay()]}function ee(ae){return c[ae.getUTCMonth()]}function re(ae){return l[ae.getUTCMonth()]}function le(ae){return r[+(ae.getUTCHours()>=12)]}function ye(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var ue=O(ae+="",x);return ue.toString=function(){return ae},ue},parse:function(ae){var ue=M(ae+="",!1);return ue.toString=function(){return ae},ue},utcFormat:function(ae){var ue=O(ae+="",E);return ue.toString=function(){return ae},ue},utcParse:function(ae){var ue=M(ae+="",!0);return ue.toString=function(){return ae},ue}}}var CP={"-":"",_:" ",0:"0"},Pi=/^\s*\d+/,ywe=/^%/,bwe=/[\\^$*+?|[\]().{}]/g;function gt(e,n,t){var i=e<0?"-":"",r=(i?-e:e)+"",a=r.length;return i+(a[n.toLowerCase(),t]))}function kwe(e,n,t){var i=Pi.exec(n.slice(t,t+1));return i?(e.w=+i[0],t+i[0].length):-1}function _we(e,n,t){var i=Pi.exec(n.slice(t,t+1));return i?(e.u=+i[0],t+i[0].length):-1}function xwe(e,n,t){var i=Pi.exec(n.slice(t,t+2));return i?(e.U=+i[0],t+i[0].length):-1}function Swe(e,n,t){var i=Pi.exec(n.slice(t,t+2));return i?(e.V=+i[0],t+i[0].length):-1}function Cwe(e,n,t){var i=Pi.exec(n.slice(t,t+2));return i?(e.W=+i[0],t+i[0].length):-1}function AP(e,n,t){var i=Pi.exec(n.slice(t,t+4));return i?(e.y=+i[0],t+i[0].length):-1}function jP(e,n,t){var i=Pi.exec(n.slice(t,t+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),t+i[0].length):-1}function Awe(e,n,t){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(t,t+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),t+i[0].length):-1}function jwe(e,n,t){var i=Pi.exec(n.slice(t,t+1));return i?(e.q=i[0]*3-3,t+i[0].length):-1}function Owe(e,n,t){var i=Pi.exec(n.slice(t,t+2));return i?(e.m=i[0]-1,t+i[0].length):-1}function OP(e,n,t){var i=Pi.exec(n.slice(t,t+2));return i?(e.d=+i[0],t+i[0].length):-1}function Ewe(e,n,t){var i=Pi.exec(n.slice(t,t+3));return i?(e.m=0,e.d=+i[0],t+i[0].length):-1}function EP(e,n,t){var i=Pi.exec(n.slice(t,t+2));return i?(e.H=+i[0],t+i[0].length):-1}function Twe(e,n,t){var i=Pi.exec(n.slice(t,t+2));return i?(e.M=+i[0],t+i[0].length):-1}function Mwe(e,n,t){var i=Pi.exec(n.slice(t,t+2));return i?(e.S=+i[0],t+i[0].length):-1}function Dwe(e,n,t){var i=Pi.exec(n.slice(t,t+3));return i?(e.L=+i[0],t+i[0].length):-1}function Rwe(e,n,t){var i=Pi.exec(n.slice(t,t+6));return i?(e.L=Math.floor(i[0]/1e3),t+i[0].length):-1}function Pwe(e,n,t){var i=ywe.exec(n.slice(t,t+1));return i?t+i[0].length:-1}function Nwe(e,n,t){var i=Pi.exec(n.slice(t));return i?(e.Q=+i[0],t+i[0].length):-1}function $we(e,n,t){var i=Pi.exec(n.slice(t));return i?(e.s=+i[0],t+i[0].length):-1}function TP(e,n){return gt(e.getDate(),n,2)}function zwe(e,n){return gt(e.getHours(),n,2)}function Lwe(e,n){return gt(e.getHours()%12||12,n,2)}function Iwe(e,n){return gt(1+xp.count(ds(e),e),n,3)}function tV(e,n){return gt(e.getMilliseconds(),n,3)}function Bwe(e,n){return tV(e,n)+"000"}function Fwe(e,n){return gt(e.getMonth()+1,n,2)}function qwe(e,n){return gt(e.getMinutes(),n,2)}function Hwe(e,n){return gt(e.getSeconds(),n,2)}function Uwe(e){var n=e.getDay();return n===0?7:n}function Vwe(e,n){return gt(B0.count(ds(e)-1,e),n,2)}function iV(e){var n=e.getDay();return n>=4||n===0?mf(e):mf.ceil(e)}function Wwe(e,n){return e=iV(e),gt(mf.count(ds(e),e)+(ds(e).getDay()===4),n,2)}function Gwe(e){return e.getDay()}function Ywe(e,n){return gt(C1.count(ds(e)-1,e),n,2)}function Kwe(e,n){return gt(e.getFullYear()%100,n,2)}function Xwe(e,n){return e=iV(e),gt(e.getFullYear()%100,n,2)}function Zwe(e,n){return gt(e.getFullYear()%1e4,n,4)}function Qwe(e,n){var t=e.getDay();return e=t>=4||t===0?mf(e):mf.ceil(e),gt(e.getFullYear()%1e4,n,4)}function Jwe(e){var n=e.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+gt(n/60|0,"0",2)+gt(n%60,"0",2)}function MP(e,n){return gt(e.getUTCDate(),n,2)}function eke(e,n){return gt(e.getUTCHours(),n,2)}function nke(e,n){return gt(e.getUTCHours()%12||12,n,2)}function tke(e,n){return gt(1+I0.count(hs(e),e),n,3)}function rV(e,n){return gt(e.getUTCMilliseconds(),n,3)}function ike(e,n){return rV(e,n)+"000"}function rke(e,n){return gt(e.getUTCMonth()+1,n,2)}function ake(e,n){return gt(e.getUTCMinutes(),n,2)}function oke(e,n){return gt(e.getUTCSeconds(),n,2)}function ske(e){var n=e.getUTCDay();return n===0?7:n}function lke(e,n){return gt(F0.count(hs(e)-1,e),n,2)}function aV(e){var n=e.getUTCDay();return n>=4||n===0?pf(e):pf.ceil(e)}function uke(e,n){return e=aV(e),gt(pf.count(hs(e),e)+(hs(e).getUTCDay()===4),n,2)}function cke(e){return e.getUTCDay()}function fke(e,n){return gt(A1.count(hs(e)-1,e),n,2)}function dke(e,n){return gt(e.getUTCFullYear()%100,n,2)}function hke(e,n){return e=aV(e),gt(e.getUTCFullYear()%100,n,2)}function mke(e,n){return gt(e.getUTCFullYear()%1e4,n,4)}function pke(e,n){var t=e.getUTCDay();return e=t>=4||t===0?pf(e):pf.ceil(e),gt(e.getUTCFullYear()%1e4,n,4)}function vke(){return"+0000"}function DP(){return"%"}function RP(e){return+e}function PP(e){return Math.floor(+e/1e3)}var Nc,oV,sV;gke({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function gke(e){return Nc=gwe(e),oV=Nc.format,Nc.parse,sV=Nc.utcFormat,Nc.utcParse,Nc}function yke(e){return new Date(e)}function bke(e){return e instanceof Date?+e:+new Date(+e)}function CA(e,n,t,i,r,a,o,l,c,f){var h=fA(),d=h.invert,p=h.domain,v=f(".%L"),b=f(":%S"),w=f("%I:%M"),k=f("%I %p"),_=f("%a %d"),C=f("%b %d"),x=f("%B"),E=f("%Y");function j(O){return(c(O)n(r/(e.length-1)))},t.quantiles=function(i){return Array.from({length:i+1},(r,a)=>lbe(e,a/i))},t.copy=function(){return fV(n).domain(e)},Ss.apply(t,arguments)}function H0(){var e=0,n=.5,t=1,i=1,r,a,o,l,c,f=ur,h,d=!1,p;function v(w){return isNaN(w=+w)?p:(w=.5+((w=+h(w))-a)*(i*wt}return j3=e,j3}var O3,LP;function Cke(){if(LP)return O3;LP=1;var e=pV(),n=Ske(),t=ad();function i(r){return r&&r.length?e(r,t,n):void 0}return O3=i,O3}var Ake=Cke();const ol=yt(Ake);var E3,IP;function jke(){if(IP)return E3;IP=1;function e(n,t){return ne.e^a.s<0?1:-1;for(i=a.d.length,r=e.d.length,n=0,t=ie.d[n]^a.s<0?1:-1;return i===r?0:i>r^a.s<0?1:-1};ln.decimalPlaces=ln.dp=function(){var e=this,n=e.d.length-1,t=(n-e.e)*Ht;if(n=e.d[n],n)for(;n%10==0;n/=10)t--;return t<0?0:t};ln.dividedBy=ln.div=function(e){return ss(this,new this.constructor(e))};ln.dividedToIntegerBy=ln.idiv=function(e){var n=this,t=n.constructor;return Rt(ss(n,new t(e),0,1),t.precision)};ln.equals=ln.eq=function(e){return!this.cmp(e)};ln.exponent=function(){return bi(this)};ln.greaterThan=ln.gt=function(e){return this.cmp(e)>0};ln.greaterThanOrEqualTo=ln.gte=function(e){return this.cmp(e)>=0};ln.isInteger=ln.isint=function(){return this.e>this.d.length-2};ln.isNegative=ln.isneg=function(){return this.s<0};ln.isPositive=ln.ispos=function(){return this.s>0};ln.isZero=function(){return this.s===0};ln.lessThan=ln.lt=function(e){return this.cmp(e)<0};ln.lessThanOrEqualTo=ln.lte=function(e){return this.cmp(e)<1};ln.logarithm=ln.log=function(e){var n,t=this,i=t.constructor,r=i.precision,a=r+5;if(e===void 0)e=new i(10);else if(e=new i(e),e.s<1||e.eq(Vr))throw Error(xa+"NaN");if(t.s<1)throw Error(xa+(t.s?"NaN":"-Infinity"));return t.eq(Vr)?new i(0):(Qt=!1,n=ss(xm(t,a),xm(e,a),a),Qt=!0,Rt(n,r))};ln.minus=ln.sub=function(e){var n=this;return e=new n.constructor(e),n.s==e.s?bV(n,e):gV(n,(e.s=-e.s,e))};ln.modulo=ln.mod=function(e){var n,t=this,i=t.constructor,r=i.precision;if(e=new i(e),!e.s)throw Error(xa+"NaN");return t.s?(Qt=!1,n=ss(t,e,0,1).times(e),Qt=!0,t.minus(n)):Rt(new i(t),r)};ln.naturalExponential=ln.exp=function(){return yV(this)};ln.naturalLogarithm=ln.ln=function(){return xm(this)};ln.negated=ln.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ln.plus=ln.add=function(e){var n=this;return e=new n.constructor(e),n.s==e.s?gV(n,e):bV(n,(e.s=-e.s,e))};ln.precision=ln.sd=function(e){var n,t,i,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(vu+e);if(n=bi(r)+1,i=r.d.length-1,t=i*Ht+1,i=r.d[i],i){for(;i%10==0;i/=10)t--;for(i=r.d[0];i>=10;i/=10)t++}return e&&n>t?n:t};ln.squareRoot=ln.sqrt=function(){var e,n,t,i,r,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(xa+"NaN")}for(e=bi(l),Qt=!1,r=Math.sqrt(+l),r==0||r==1/0?(n=oo(l.d),(n.length+e)%2==0&&(n+="0"),r=Math.sqrt(n),e=ld((e+1)/2)-(e<0||e%2),r==1/0?n="5e"+e:(n=r.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new c(n)):i=new c(r.toString()),t=c.precision,r=o=t+3;;)if(a=i,i=a.plus(ss(l,a,o+2)).times(.5),oo(a.d).slice(0,o)===(n=oo(i.d)).slice(0,o)){if(n=n.slice(o-3,o+1),r==o&&n=="4999"){if(Rt(a,t+1,0),a.times(a).eq(l)){i=a;break}}else if(n!="9999")break;o+=4}return Qt=!0,Rt(i,t)};ln.times=ln.mul=function(e){var n,t,i,r,a,o,l,c,f,h=this,d=h.constructor,p=h.d,v=(e=new d(e)).d;if(!h.s||!e.s)return new d(0);for(e.s*=h.s,t=h.e+e.e,c=p.length,f=v.length,c=0;){for(n=0,r=c+i;r>i;)l=a[r]+v[i]*p[r-i-1]+n,a[r--]=l%Mi|0,n=l/Mi|0;a[r]=(a[r]+n)%Mi|0}for(;!a[--o];)a.pop();return n?++t:a.shift(),e.d=a,e.e=t,Qt?Rt(e,d.precision):e};ln.toDecimalPlaces=ln.todp=function(e,n){var t=this,i=t.constructor;return t=new i(t),e===void 0?t:(bo(e,0,sd),n===void 0?n=i.rounding:bo(n,0,8),Rt(t,e+bi(t)+1,n))};ln.toExponential=function(e,n){var t,i=this,r=i.constructor;return e===void 0?t=ju(i,!0):(bo(e,0,sd),n===void 0?n=r.rounding:bo(n,0,8),i=Rt(new r(i),e+1,n),t=ju(i,!0,e+1)),t};ln.toFixed=function(e,n){var t,i,r=this,a=r.constructor;return e===void 0?ju(r):(bo(e,0,sd),n===void 0?n=a.rounding:bo(n,0,8),i=Rt(new a(r),e+bi(r)+1,n),t=ju(i.abs(),!1,e+bi(i)+1),r.isneg()&&!r.isZero()?"-"+t:t)};ln.toInteger=ln.toint=function(){var e=this,n=e.constructor;return Rt(new n(e),bi(e)+1,n.rounding)};ln.toNumber=function(){return+this};ln.toPower=ln.pow=function(e){var n,t,i,r,a,o,l=this,c=l.constructor,f=12,h=+(e=new c(e));if(!e.s)return new c(Vr);if(l=new c(l),!l.s){if(e.s<1)throw Error(xa+"Infinity");return l}if(l.eq(Vr))return l;if(i=c.precision,e.eq(Vr))return Rt(l,i);if(n=e.e,t=e.d.length-1,o=n>=t,a=l.s,o){if((t=h<0?-h:h)<=vV){for(r=new c(Vr),n=Math.ceil(i/Ht+4),Qt=!1;t%2&&(r=r.times(l),VP(r.d,n)),t=ld(t/2),t!==0;)l=l.times(l),VP(l.d,n);return Qt=!0,e.s<0?new c(Vr).div(r):Rt(r,i)}}else if(a<0)throw Error(xa+"NaN");return a=a<0&&e.d[Math.max(n,t)]&1?-1:1,l.s=1,Qt=!1,r=e.times(xm(l,i+f)),Qt=!0,r=yV(r),r.s=a,r};ln.toPrecision=function(e,n){var t,i,r=this,a=r.constructor;return e===void 0?(t=bi(r),i=ju(r,t<=a.toExpNeg||t>=a.toExpPos)):(bo(e,1,sd),n===void 0?n=a.rounding:bo(n,0,8),r=Rt(new a(r),e,n),t=bi(r),i=ju(r,e<=t||t<=a.toExpNeg,e)),i};ln.toSignificantDigits=ln.tosd=function(e,n){var t=this,i=t.constructor;return e===void 0?(e=i.precision,n=i.rounding):(bo(e,1,sd),n===void 0?n=i.rounding:bo(n,0,8)),Rt(new i(t),e,n)};ln.toString=ln.valueOf=ln.val=ln.toJSON=ln[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,n=bi(e),t=e.constructor;return ju(e,n<=t.toExpNeg||n>=t.toExpPos)};function gV(e,n){var t,i,r,a,o,l,c,f,h=e.constructor,d=h.precision;if(!e.s||!n.s)return n.s||(n=new h(e)),Qt?Rt(n,d):n;if(c=e.d,f=n.d,o=e.e,r=n.e,c=c.slice(),a=o-r,a){for(a<0?(i=c,a=-a,l=f.length):(i=f,r=o,l=c.length),o=Math.ceil(d/Ht),l=o>l?o+1:l+1,a>l&&(a=l,i.length=1),i.reverse();a--;)i.push(0);i.reverse()}for(l=c.length,a=f.length,l-a<0&&(a=l,i=f,f=c,c=i),t=0;a;)t=(c[--a]=c[a]+f[a]+t)/Mi|0,c[a]%=Mi;for(t&&(c.unshift(t),++r),l=c.length;c[--l]==0;)c.pop();return n.d=c,n.e=r,Qt?Rt(n,d):n}function bo(e,n,t){if(e!==~~e||et)throw Error(vu+e)}function oo(e){var n,t,i,r=e.length-1,a="",o=e[0];if(r>0){for(a+=o,n=1;no?1:-1;else for(l=c=0;lr[l]?1:-1;break}return c}function t(i,r,a){for(var o=0;a--;)i[a]-=o,o=i[a]1;)i.shift()}return function(i,r,a,o){var l,c,f,h,d,p,v,b,w,k,_,C,x,E,j,O,M,N,q=i.constructor,R=i.s==r.s?1:-1,L=i.d,F=r.d;if(!i.s)return new q(i);if(!r.s)throw Error(xa+"Division by zero");for(c=i.e-r.e,M=F.length,j=L.length,v=new q(R),b=v.d=[],f=0;F[f]==(L[f]||0);)++f;if(F[f]>(L[f]||0)&&--c,a==null?C=a=q.precision:o?C=a+(bi(i)-bi(r))+1:C=a,C<0)return new q(0);if(C=C/Ht+2|0,f=0,M==1)for(h=0,F=F[0],C++;(f1&&(F=e(F,h),L=e(L,h),M=F.length,j=L.length),E=M,w=L.slice(0,M),k=w.length;k=Mi/2&&++O;do h=0,l=n(F,w,M,k),l<0?(_=w[0],M!=k&&(_=_*Mi+(w[1]||0)),h=_/O|0,h>1?(h>=Mi&&(h=Mi-1),d=e(F,h),p=d.length,k=w.length,l=n(d,w,p,k),l==1&&(h--,t(d,M16)throw Error(OA+bi(e));if(!e.s)return new h(Vr);for(Qt=!1,l=d,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(i=Math.log(ru(2,f))/Math.LN10*2+5|0,l+=i,t=r=a=new h(Vr),h.precision=l;;){if(r=Rt(r.times(e),l),t=t.times(++c),o=a.plus(ss(r,t,l)),oo(o.d).slice(0,l)===oo(a.d).slice(0,l)){for(;f--;)a=Rt(a.times(a),l);return h.precision=d,n==null?(Qt=!0,Rt(a,d)):a}a=o}}function bi(e){for(var n=e.e*Ht,t=e.d[0];t>=10;t/=10)n++;return n}function P3(e,n,t){if(n>e.LN10.sd())throw Qt=!0,t&&(e.precision=t),Error(xa+"LN10 precision limit exceeded");return Rt(new e(e.LN10),n)}function el(e){for(var n="";e--;)n+="0";return n}function xm(e,n){var t,i,r,a,o,l,c,f,h,d=1,p=10,v=e,b=v.d,w=v.constructor,k=w.precision;if(v.s<1)throw Error(xa+(v.s?"NaN":"-Infinity"));if(v.eq(Vr))return new w(0);if(n==null?(Qt=!1,f=k):f=n,v.eq(10))return n==null&&(Qt=!0),P3(w,f);if(f+=p,w.precision=f,t=oo(b),i=t.charAt(0),a=bi(v),Math.abs(a)<15e14){for(;i<7&&i!=1||i==1&&t.charAt(1)>3;)v=v.times(e),t=oo(v.d),i=t.charAt(0),d++;a=bi(v),i>1?(v=new w("0."+t),a++):v=new w(i+"."+t.slice(1))}else return c=P3(w,f+2,k).times(a+""),v=xm(new w(i+"."+t.slice(1)),f-p).plus(c),w.precision=k,n==null?(Qt=!0,Rt(v,k)):v;for(l=o=v=ss(v.minus(Vr),v.plus(Vr),f),h=Rt(v.times(v),f),r=3;;){if(o=Rt(o.times(h),f),c=l.plus(ss(o,new w(r),f)),oo(c.d).slice(0,f)===oo(l.d).slice(0,f))return l=l.times(2),a!==0&&(l=l.plus(P3(w,f+2,k).times(a+""))),l=ss(l,new w(d),f),w.precision=k,n==null?(Qt=!0,Rt(l,k)):l;l=c,r+=2}}function UP(e,n){var t,i,r;for((t=n.indexOf("."))>-1&&(n=n.replace(".","")),(i=n.search(/e/i))>0?(t<0&&(t=i),t+=+n.slice(i+1),n=n.substring(0,i)):t<0&&(t=n.length),i=0;n.charCodeAt(i)===48;)++i;for(r=n.length;n.charCodeAt(r-1)===48;)--r;if(n=n.slice(i,r),n){if(r-=i,t=t-i-1,e.e=ld(t/Ht),e.d=[],i=(t+1)%Ht,t<0&&(i+=Ht),ij1||e.e<-j1))throw Error(OA+t)}else e.s=0,e.e=0,e.d=[0];return e}function Rt(e,n,t){var i,r,a,o,l,c,f,h,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(i=n-o,i<0)i+=Ht,r=n,f=d[h=0];else{if(h=Math.ceil((i+1)/Ht),a=d.length,h>=a)return e;for(f=a=d[h],o=1;a>=10;a/=10)o++;i%=Ht,r=i-Ht+o}if(t!==void 0&&(a=ru(10,o-r-1),l=f/a%10|0,c=n<0||d[h+1]!==void 0||f%a,c=t<4?(l||c)&&(t==0||t==(e.s<0?3:2)):l>5||l==5&&(t==4||c||t==6&&(i>0?r>0?f/ru(10,o-r):0:d[h-1])%10&1||t==(e.s<0?8:7))),n<1||!d[0])return c?(a=bi(e),d.length=1,n=n-a-1,d[0]=ru(10,(Ht-n%Ht)%Ht),e.e=ld(-n/Ht)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(i==0?(d.length=h,a=1,h--):(d.length=h+1,a=ru(10,Ht-i),d[h]=r>0?(f/ru(10,o-r)%ru(10,r)|0)*a:0),c)for(;;)if(h==0){(d[0]+=a)==Mi&&(d[0]=1,++e.e);break}else{if(d[h]+=a,d[h]!=Mi)break;d[h--]=0,a=1}for(i=d.length;d[--i]===0;)d.pop();if(Qt&&(e.e>j1||e.e<-j1))throw Error(OA+bi(e));return e}function bV(e,n){var t,i,r,a,o,l,c,f,h,d,p=e.constructor,v=p.precision;if(!e.s||!n.s)return n.s?n.s=-n.s:n=new p(e),Qt?Rt(n,v):n;if(c=e.d,d=n.d,i=n.e,f=e.e,c=c.slice(),o=f-i,o){for(h=o<0,h?(t=c,o=-o,l=d.length):(t=d,i=f,l=c.length),r=Math.max(Math.ceil(v/Ht),l)+2,o>r&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for(r=c.length,l=d.length,h=r0;--r)c[l++]=0;for(r=d.length;r>o;){if(c[--r]0?a=a.charAt(0)+"."+a.slice(1)+el(i):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(r<0?"e":"e+")+r):r<0?(a="0."+el(-r-1)+a,t&&(i=t-o)>0&&(a+=el(i))):r>=o?(a+=el(r+1-o),t&&(i=t-r-1)>0&&(a=a+"."+el(i))):((i=r+1)0&&(r+1===o&&(a+="."),a+=el(i))),e.s<0?"-"+a:a}function VP(e,n){if(e.length>n)return e.length=n,!0}function wV(e){var n,t,i;function r(a){var o=this;if(!(o instanceof r))return new r(a);if(o.constructor=r,a instanceof r){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(vu+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return UP(o,a.toString())}else if(typeof a!="string")throw Error(vu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,zke.test(a))UP(o,a);else throw Error(vu+a)}if(r.prototype=ln,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.clone=wV,r.config=r.set=Lke,e===void 0&&(e={}),e)for(i=["precision","rounding","toExpNeg","toExpPos","LN10"],n=0;n=r[n+1]&&i<=r[n+2])this[t]=i;else throw Error(vu+t+": "+i);if((i=e[t="LN10"])!==void 0)if(i==Math.LN10)this[t]=new this(i);else throw Error(vu+t+": "+i);return this}var EA=wV($ke);Vr=new EA(1);const Ot=EA;function Ike(e){return Hke(e)||qke(e)||Fke(e)||Bke()}function Bke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fke(e,n){if(e){if(typeof e=="string")return N4(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N4(e,n)}}function qke(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Hke(e){if(Array.isArray(e))return N4(e)}function N4(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t=n?t.apply(void 0,r):e(n-o,WP(function(){for(var l=arguments.length,c=new Array(l),f=0;fe.length)&&(n=e.length);for(var t=0,i=new Array(n);t"u"||!(Symbol.iterator in Object(e)))){var t=[],i=!0,r=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(i=(l=o.next()).done)&&(t.push(l.value),!(n&&t.length===n));i=!0);}catch(c){r=!0,a=c}finally{try{!i&&o.return!=null&&o.return()}finally{if(r)throw a}}return t}}function r_e(e){if(Array.isArray(e))return e}function CV(e){var n=Sm(e,2),t=n[0],i=n[1],r=t,a=i;return t>i&&(r=i,a=t),[r,a]}function AV(e,n,t){if(e.lte(0))return new Ot(0);var i=W0.getDigitCount(e.toNumber()),r=new Ot(10).pow(i),a=e.div(r),o=i!==1?.05:.1,l=new Ot(Math.ceil(a.div(o).toNumber())).add(t).mul(o),c=l.mul(r);return n?c:new Ot(Math.ceil(c))}function a_e(e,n,t){var i=1,r=new Ot(e);if(!r.isint()&&t){var a=Math.abs(e);a<1?(i=new Ot(10).pow(W0.getDigitCount(e)-1),r=new Ot(Math.floor(r.div(i).toNumber())).mul(i)):a>1&&(r=new Ot(Math.floor(e)))}else e===0?r=new Ot(Math.floor((n-1)/2)):t||(r=new Ot(Math.floor(e)));var o=Math.floor((n-1)/2),l=Gke(Wke(function(c){return r.add(new Ot(c-o).mul(i)).toNumber()}),$4);return l(0,n)}function jV(e,n,t,i){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-e)/(t-1)))return{step:new Ot(0),tickMin:new Ot(0),tickMax:new Ot(0)};var a=AV(new Ot(n).sub(e).div(t-1),i,r),o;e<=0&&n>=0?o=new Ot(0):(o=new Ot(e).add(n).div(2),o=o.sub(new Ot(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new Ot(n).sub(o).div(a).toNumber()),f=l+c+1;return f>t?jV(e,n,t,i,r+1):(f0?c+(t-f):c,l=n>0?l:l+(t-f)),{step:a,tickMin:o.sub(new Ot(l).mul(a)),tickMax:o.add(new Ot(c).mul(a))})}function o_e(e){var n=Sm(e,2),t=n[0],i=n[1],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(r,2),l=CV([t,i]),c=Sm(l,2),f=c[0],h=c[1];if(f===-1/0||h===1/0){var d=h===1/0?[f].concat(L4($4(0,r-1).map(function(){return 1/0}))):[].concat(L4($4(0,r-1).map(function(){return-1/0})),[h]);return t>i?z4(d):d}if(f===h)return a_e(f,r,a);var p=jV(f,h,o,a),v=p.step,b=p.tickMin,w=p.tickMax,k=W0.rangeStep(b,w.add(new Ot(.1).mul(v)),v);return t>i?z4(k):k}function s_e(e,n){var t=Sm(e,2),i=t[0],r=t[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=CV([i,r]),l=Sm(o,2),c=l[0],f=l[1];if(c===-1/0||f===1/0)return[i,r];if(c===f)return[c];var h=Math.max(n,2),d=AV(new Ot(f).sub(c).div(h-1),a,0),p=[].concat(L4(W0.rangeStep(new Ot(c),new Ot(f).sub(new Ot(.99).mul(d)),d)),[f]);return i>r?z4(p):p}var l_e=xV(o_e),u_e=xV(s_e),c_e="Invariant failed";function Ou(e,n){throw new Error(c_e)}var f_e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function gf(e){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},gf(e)}function O1(){return O1=Object.assign?Object.assign.bind():function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,i=new Array(n);t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function y_e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function b_e(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function w_e(e,n){for(var t=0;te.length)&&(n=e.length);for(var t=0,i=new Array(n);t1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(t=i==null?void 0:i.length)!==null&&t!==void 0?t:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,f=0;f0?r[f-1].coordinate:r[l-1].coordinate,d=r[f].coordinate,p=f>=l-1?r[0].coordinate:r[f+1].coordinate,v=void 0;if(qa(d-h)!==qa(p-d)){var b=[];if(qa(p-d)===qa(c[1]-c[0])){v=p;var w=d+c[1]-c[0];b[0]=Math.min(w,(w+h)/2),b[1]=Math.max(w,(w+h)/2)}else{v=h;var k=p+c[1]-c[0];b[0]=Math.min(d,(k+d)/2),b[1]=Math.max(d,(k+d)/2)}var _=[Math.min(d,(v+d)/2),Math.max(d,(v+d)/2)];if(n>_[0]&&n<=_[1]||n>=b[0]&&n<=b[1]){o=r[f].index;break}}else{var C=Math.min(h,p),x=Math.max(h,p);if(n>(C+d)/2&&n<=(x+d)/2){o=r[f].index;break}}}else for(var E=0;E0&&E(i[E].coordinate+i[E-1].coordinate)/2&&n<=(i[E].coordinate+i[E+1].coordinate)/2||E===l-1&&n>(i[E].coordinate+i[E-1].coordinate)/2){o=i[E].index;break}return o},TA=function(n){var t,i=n,r=i.type.displayName,a=(t=n.type)!==null&&t!==void 0&&t.defaultProps?ti(ti({},n.type.defaultProps),n.props):n.props,o=a.stroke,l=a.fill,c;switch(r){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},z_e=function(n){var t=n.barSize,i=n.totalSize,r=n.stackGroups,a=r===void 0?{}:r;if(!a)return{};for(var o={},l=Object.keys(a),c=0,f=l.length;c=0});if(_&&_.length){var C=_[0].type.defaultProps,x=C!==void 0?ti(ti({},C),_[0].props):_[0].props,E=x.barSize,j=x[k];o[j]||(o[j]=[]);var O=Yn(E)?t:E;o[j].push({item:_[0],stackList:_.slice(1),barSize:Yn(O)?void 0:Au(O,i,0)})}}return o},L_e=function(n){var t=n.barGap,i=n.barCategoryGap,r=n.bandSize,a=n.sizeList,o=a===void 0?[]:a,l=n.maxBarSize,c=o.length;if(c<1)return null;var f=Au(t,r,0,!0),h,d=[];if(o[0].barSize===+o[0].barSize){var p=!1,v=r/c,b=o.reduce(function(E,j){return E+j.barSize||0},0);b+=(c-1)*f,b>=r&&(b-=(c-1)*f,f=0),b>=r&&v>0&&(p=!0,v*=.9,b=c*v);var w=(r-b)/2>>0,k={offset:w-f,size:0};h=o.reduce(function(E,j){var O={item:j.item,position:{offset:k.offset+k.size+f,size:p?v:j.barSize}},M=[].concat(KP(E),[O]);return k=M[M.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){M.push({item:N,position:k})}),M},d)}else{var _=Au(i,r,0,!0);r-2*_-(c-1)*f<=0&&(f=0);var C=(r-2*_-(c-1)*f)/c;C>1&&(C>>=0);var x=l===+l?Math.min(C,l):C;h=o.reduce(function(E,j,O){var M=[].concat(KP(E),[{item:j.item,position:{offset:_+(C+f)*O+(C-x)/2,size:x}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){M.push({item:N,position:M[M.length-1].position})}),M},d)}return h},I_e=function(n,t,i,r){var a=i.children,o=i.width,l=i.margin,c=o-(l.left||0)-(l.right||0),f=MV({children:a,legendWidth:c});if(f){var h=r||{},d=h.width,p=h.height,v=f.align,b=f.verticalAlign,w=f.layout;if((w==="vertical"||w==="horizontal"&&b==="middle")&&v!=="center"&&Ge(n[v]))return ti(ti({},n),{},Qc({},v,n[v]+(d||0)));if((w==="horizontal"||w==="vertical"&&v==="center")&&b!=="middle"&&Ge(n[b]))return ti(ti({},n),{},Qc({},b,n[b]+(p||0)))}return n},B_e=function(n,t,i){return Yn(t)?!0:n==="horizontal"?t==="yAxis":n==="vertical"||i==="x"?t==="xAxis":i==="y"?t==="yAxis":!0},DV=function(n,t,i,r,a){var o=t.props.children,l=ka(o,Sp).filter(function(f){return B_e(r,a,f.props.direction)});if(l&&l.length){var c=l.map(function(f){return f.props.dataKey});return n.reduce(function(f,h){var d=dr(h,i);if(Yn(d))return f;var p=Array.isArray(d)?[U0(d),ol(d)]:[d,d],v=c.reduce(function(b,w){var k=dr(h,w,0),_=p[0]-Math.abs(Array.isArray(k)?k[0]:k),C=p[1]+Math.abs(Array.isArray(k)?k[1]:k);return[Math.min(_,b[0]),Math.max(C,b[1])]},[1/0,-1/0]);return[Math.min(v[0],f[0]),Math.max(v[1],f[1])]},[1/0,-1/0])}return null},F_e=function(n,t,i,r,a){var o=t.map(function(l){return DV(n,l,i,a,r)}).filter(function(l){return!Yn(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},RV=function(n,t,i,r,a){var o=t.map(function(c){var f=c.props.dataKey;return i==="number"&&f&&DV(n,c,f,r)||Uh(n,f,i,a)});if(i==="number")return o.reduce(function(c,f){return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,f){for(var h=0,d=f.length;h=2?qa(l[0]-l[1])*2*f:f,t&&(n.ticks||n.niceTicks)){var h=(n.ticks||n.niceTicks).map(function(d){var p=a?a.indexOf(d):d;return{coordinate:r(p)+f,value:d,offset:f}});return h.filter(function(d){return!id(d.coordinate)})}return n.isCategorical&&n.categoricalDomain?n.categoricalDomain.map(function(d,p){return{coordinate:r(d)+f,value:d,index:p,offset:f}}):r.ticks&&!i?r.ticks(n.tickCount).map(function(d){return{coordinate:r(d)+f,value:d,offset:f}}):r.domain().map(function(d,p){return{coordinate:r(d)+f,value:a?a[d]:d,index:p,offset:f}})},N3=new WeakMap,ag=function(n,t){if(typeof t!="function")return n;N3.has(n)||N3.set(n,new WeakMap);var i=N3.get(n);if(i.has(t))return i.get(t);var r=function(){n.apply(void 0,arguments),t.apply(void 0,arguments)};return i.set(t,r),r},q_e=function(n,t,i){var r=n.scale,a=n.type,o=n.layout,l=n.axisType;if(r==="auto")return o==="radial"&&l==="radiusAxis"?{scale:ym(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:x1(),realScaleType:"linear"}:a==="category"&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!i)?{scale:Hh(),realScaleType:"point"}:a==="category"?{scale:ym(),realScaleType:"band"}:{scale:x1(),realScaleType:"linear"};if(Cu(r)){var c="scale".concat(M0(r));return{scale:(NP[c]||Hh)(),realScaleType:NP[c]?c:"point"}}return qn(r)?{scale:r}:{scale:Hh(),realScaleType:"point"}},ZP=1e-4,H_e=function(n){var t=n.domain();if(!(!t||t.length<=2)){var i=t.length,r=n.range(),a=Math.min(r[0],r[1])-ZP,o=Math.max(r[0],r[1])+ZP,l=n(t[0]),c=n(t[i-1]);(lo||co)&&n.domain([t[0],t[i-1]])}},U_e=function(n,t){if(!n)return null;for(var i=0,r=n.length;ir)&&(a[1]=r),a[0]>r&&(a[0]=r),a[1]=0?(n[l][i][0]=a,n[l][i][1]=a+c,a=n[l][i][1]):(n[l][i][0]=o,n[l][i][1]=o+c,o=n[l][i][1])}},G_e=function(n){var t=n.length;if(!(t<=0))for(var i=0,r=n[0].length;i=0?(n[o][i][0]=a,n[o][i][1]=a+l,a=n[o][i][1]):(n[o][i][0]=0,n[o][i][1]=0)}},Y_e={sign:W_e,expand:Mge,none:lf,silhouette:Dge,wiggle:Rge,positive:G_e},K_e=function(n,t,i){var r=t.map(function(l){return l.props.dataKey}),a=Y_e[i],o=Tge().keys(r).value(function(l,c){return+dr(l,c,0)}).order(g4).offset(a);return o(n)},X_e=function(n,t,i,r,a,o){if(!n)return null;var l=o?t.reverse():t,c={},f=l.reduce(function(d,p){var v,b=(v=p.type)!==null&&v!==void 0&&v.defaultProps?ti(ti({},p.type.defaultProps),p.props):p.props,w=b.stackId,k=b.hide;if(k)return d;var _=b[i],C=d[_]||{hasStack:!1,stackGroups:{}};if(Si(w)){var x=C.stackGroups[w]||{numericAxisId:i,cateAxisId:r,items:[]};x.items.push(p),C.hasStack=!0,C.stackGroups[w]=x}else C.stackGroups[rd("_stackId_")]={numericAxisId:i,cateAxisId:r,items:[p]};return ti(ti({},d),{},Qc({},_,C))},c),h={};return Object.keys(f).reduce(function(d,p){var v=f[p];if(v.hasStack){var b={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(w,k){var _=v.stackGroups[k];return ti(ti({},w),{},Qc({},k,{numericAxisId:i,cateAxisId:r,items:_.items,stackedData:K_e(n,_.items,a)}))},b)}return ti(ti({},d),{},Qc({},p,v))},h)},Z_e=function(n,t){var i=t.realScaleType,r=t.type,a=t.tickCount,o=t.originalDomain,l=t.allowDecimals,c=i||t.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&r==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=n.domain();if(!f.length)return null;var h=l_e(f,a,l);return n.domain([U0(h),ol(h)]),{niceTicks:h}}if(a&&r==="number"){var d=n.domain(),p=u_e(d,a,l);return{niceTicks:p}}return null};function T1(e){var n=e.axis,t=e.ticks,i=e.bandSize,r=e.entry,a=e.index,o=e.dataKey;if(n.type==="category"){if(!n.allowDuplicatedCategory&&n.dataKey&&!Yn(r[n.dataKey])){var l=t1(t,"value",r[n.dataKey]);if(l)return l.coordinate+i/2}return t[a]?t[a].coordinate+i/2:null}var c=dr(r,Yn(o)?n.dataKey:o);return Yn(c)?null:n.scale(c)}var QP=function(n){var t=n.axis,i=n.ticks,r=n.offset,a=n.bandSize,o=n.entry,l=n.index;if(t.type==="category")return i[l]?i[l].coordinate+r:null;var c=dr(o,t.dataKey,t.domain[l]);return Yn(c)?null:t.scale(c)-a/2+r},Q_e=function(n){var t=n.numericAxis,i=t.scale.domain();if(t.type==="number"){var r=Math.min(i[0],i[1]),a=Math.max(i[0],i[1]);return r<=0&&a>=0?0:a<0?a:r}return i[0]},J_e=function(n,t){var i,r=(i=n.type)!==null&&i!==void 0&&i.defaultProps?ti(ti({},n.type.defaultProps),n.props):n.props,a=r.stackId;if(Si(a)){var o=t[a];if(o){var l=o.items.indexOf(n);return l>=0?o.stackedData[l]:null}}return null},e2e=function(n){return n.reduce(function(t,i){return[U0(i.concat([t[0]]).filter(Ge)),ol(i.concat([t[1]]).filter(Ge))]},[1/0,-1/0])},$V=function(n,t,i){return Object.keys(n).reduce(function(r,a){var o=n[a],l=o.stackedData,c=l.reduce(function(f,h){var d=e2e(h.slice(t,i+1));return[Math.min(f[0],d[0]),Math.max(f[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]).map(function(r){return r===1/0||r===-1/0?0:r})},JP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,eN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,q4=function(n,t,i){if(qn(n))return n(t,i);if(!Array.isArray(n))return t;var r=[];if(Ge(n[0]))r[0]=i?n[0]:Math.min(n[0],t[0]);else if(JP.test(n[0])){var a=+JP.exec(n[0])[1];r[0]=t[0]-a}else qn(n[0])?r[0]=n[0](t[0]):r[0]=t[0];if(Ge(n[1]))r[1]=i?n[1]:Math.max(n[1],t[1]);else if(eN.test(n[1])){var o=+eN.exec(n[1])[1];r[1]=t[1]+o}else qn(n[1])?r[1]=n[1](t[1]):r[1]=t[1];return r},M1=function(n,t,i){if(n&&n.scale&&n.scale.bandwidth){var r=n.scale.bandwidth();if(!i||r>0)return r}if(n&&t&&t.length>=2){for(var a=iA(t,function(d){return d.coordinate}),o=1/0,l=1,c=a.length;lo&&(f=2*Math.PI-f),{radius:l,angle:r2e(f),angleInRadian:f}},s2e=function(n){var t=n.startAngle,i=n.endAngle,r=Math.floor(t/360),a=Math.floor(i/360),o=Math.min(r,a);return{startAngle:t-o*360,endAngle:i-o*360}},l2e=function(n,t){var i=t.startAngle,r=t.endAngle,a=Math.floor(i/360),o=Math.floor(r/360),l=Math.min(a,o);return n+l*360},rN=function(n,t){var i=n.x,r=n.y,a=o2e({x:i,y:r},t),o=a.radius,l=a.angle,c=t.innerRadius,f=t.outerRadius;if(of)return!1;if(o===0)return!0;var h=s2e(t),d=h.startAngle,p=h.endAngle,v=l,b;if(d<=p){for(;v>p;)v-=360;for(;v=d&&v<=p}else{for(;v>d;)v-=360;for(;v=p&&v<=d}return b?iN(iN({},t),{},{radius:o,angle:l2e(v,t)}):null};function Om(e){"@babel/helpers - typeof";return Om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Om(e)}var u2e=["offset"];function c2e(e){return m2e(e)||h2e(e)||d2e(e)||f2e()}function f2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d2e(e,n){if(e){if(typeof e=="string")return H4(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return H4(e,n)}}function h2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function m2e(e){if(Array.isArray(e))return H4(e)}function H4(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function v2e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function aN(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function _i(e){for(var n=1;n=0?1:-1,x,E;r==="insideStart"?(x=v+C*o,E=w):r==="insideEnd"?(x=b-C*o,E=!w):r==="end"&&(x=b+C*o,E=w),E=_<=0?E:!E;var j=Ui(f,h,k,x),O=Ui(f,h,k,x+(E?1:-1)*359),M="M".concat(j.x,",").concat(j.y,` + A`).concat(k,",").concat(k,",0,1,").concat(E?0:1,`, + `).concat(O.x,",").concat(O.y),N=Yn(n.id)?rd("recharts-radial-line-"):n.id;return Q.createElement("text",Em({},i,{dominantBaseline:"central",className:pn("recharts-radial-bar-label",l)}),Q.createElement("defs",null,Q.createElement("path",{id:N,d:M})),Q.createElement("textPath",{xlinkHref:"#".concat(N)},t))},x2e=function(n){var t=n.viewBox,i=n.offset,r=n.position,a=t,o=a.cx,l=a.cy,c=a.innerRadius,f=a.outerRadius,h=a.startAngle,d=a.endAngle,p=(h+d)/2;if(r==="outside"){var v=Ui(o,l,f+i,p),b=v.x,w=v.y;return{x:b,y:w,textAnchor:b>=o?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var k=(c+f)/2,_=Ui(o,l,k,p),C=_.x,x=_.y;return{x:C,y:x,textAnchor:"middle",verticalAnchor:"middle"}},S2e=function(n){var t=n.viewBox,i=n.parentViewBox,r=n.offset,a=n.position,o=t,l=o.x,c=o.y,f=o.width,h=o.height,d=h>=0?1:-1,p=d*r,v=d>0?"end":"start",b=d>0?"start":"end",w=f>=0?1:-1,k=w*r,_=w>0?"end":"start",C=w>0?"start":"end";if(a==="top"){var x={x:l+f/2,y:c-d*r,textAnchor:"middle",verticalAnchor:v};return _i(_i({},x),i?{height:Math.max(c-i.y,0),width:f}:{})}if(a==="bottom"){var E={x:l+f/2,y:c+h+p,textAnchor:"middle",verticalAnchor:b};return _i(_i({},E),i?{height:Math.max(i.y+i.height-(c+h),0),width:f}:{})}if(a==="left"){var j={x:l-k,y:c+h/2,textAnchor:_,verticalAnchor:"middle"};return _i(_i({},j),i?{width:Math.max(j.x-i.x,0),height:h}:{})}if(a==="right"){var O={x:l+f+k,y:c+h/2,textAnchor:C,verticalAnchor:"middle"};return _i(_i({},O),i?{width:Math.max(i.x+i.width-O.x,0),height:h}:{})}var M=i?{width:f,height:h}:{};return a==="insideLeft"?_i({x:l+k,y:c+h/2,textAnchor:C,verticalAnchor:"middle"},M):a==="insideRight"?_i({x:l+f-k,y:c+h/2,textAnchor:_,verticalAnchor:"middle"},M):a==="insideTop"?_i({x:l+f/2,y:c+p,textAnchor:"middle",verticalAnchor:b},M):a==="insideBottom"?_i({x:l+f/2,y:c+h-p,textAnchor:"middle",verticalAnchor:v},M):a==="insideTopLeft"?_i({x:l+k,y:c+p,textAnchor:C,verticalAnchor:b},M):a==="insideTopRight"?_i({x:l+f-k,y:c+p,textAnchor:_,verticalAnchor:b},M):a==="insideBottomLeft"?_i({x:l+k,y:c+h-p,textAnchor:C,verticalAnchor:v},M):a==="insideBottomRight"?_i({x:l+f-k,y:c+h-p,textAnchor:_,verticalAnchor:v},M):td(a)&&(Ge(a.x)||uu(a.x))&&(Ge(a.y)||uu(a.y))?_i({x:l+Au(a.x,f),y:c+Au(a.y,h),textAnchor:"end",verticalAnchor:"end"},M):_i({x:l+f/2,y:c+h/2,textAnchor:"middle",verticalAnchor:"middle"},M)},C2e=function(n){return"cx"in n&&Ge(n.cx)};function ii(e){var n=e.offset,t=n===void 0?5:n,i=p2e(e,u2e),r=_i({offset:t},i),a=r.viewBox,o=r.position,l=r.value,c=r.children,f=r.content,h=r.className,d=h===void 0?"":h,p=r.textBreakAll;if(!a||Yn(l)&&Yn(c)&&!A.isValidElement(f)&&!qn(f))return null;if(A.isValidElement(f))return A.cloneElement(f,r);var v;if(qn(f)){if(v=A.createElement(f,r),A.isValidElement(v))return v}else v=w2e(r);var b=C2e(a),w=Wn(r,!0);if(b&&(o==="insideStart"||o==="insideEnd"||o==="end"))return _2e(r,v,w);var k=b?x2e(r):S2e(r);return Q.createElement(p1,Em({className:pn("recharts-label",d)},w,k,{breakAll:p}),v)}ii.displayName="Label";var LV=function(n){var t=n.cx,i=n.cy,r=n.angle,a=n.startAngle,o=n.endAngle,l=n.r,c=n.radius,f=n.innerRadius,h=n.outerRadius,d=n.x,p=n.y,v=n.top,b=n.left,w=n.width,k=n.height,_=n.clockWise,C=n.labelViewBox;if(C)return C;if(Ge(w)&&Ge(k)){if(Ge(d)&&Ge(p))return{x:d,y:p,width:w,height:k};if(Ge(v)&&Ge(b))return{x:v,y:b,width:w,height:k}}return Ge(d)&&Ge(p)?{x:d,y:p,width:0,height:0}:Ge(t)&&Ge(i)?{cx:t,cy:i,startAngle:a||r||0,endAngle:o||r||0,innerRadius:f||0,outerRadius:h||c||l||0,clockWise:_}:n.viewBox?n.viewBox:{}},A2e=function(n,t){return n?n===!0?Q.createElement(ii,{key:"label-implicit",viewBox:t}):Si(n)?Q.createElement(ii,{key:"label-implicit",viewBox:t,value:n}):A.isValidElement(n)?n.type===ii?A.cloneElement(n,{key:"label-implicit",viewBox:t}):Q.createElement(ii,{key:"label-implicit",content:n,viewBox:t}):qn(n)?Q.createElement(ii,{key:"label-implicit",content:n,viewBox:t}):td(n)?Q.createElement(ii,Em({viewBox:t},n,{key:"label-implicit"})):null:null},j2e=function(n,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!n||!n.children&&i&&!n.label)return null;var r=n.children,a=LV(n),o=ka(r,ii).map(function(c,f){return A.cloneElement(c,{viewBox:t||a,key:"label-".concat(f)})});if(!i)return o;var l=A2e(n.label,t||a);return[l].concat(c2e(o))};ii.parseViewBox=LV;ii.renderCallByParent=j2e;var $3,oN;function O2e(){if(oN)return $3;oN=1;function e(n){var t=n==null?0:n.length;return t?n[t-1]:void 0}return $3=e,$3}var E2e=O2e();const T2e=yt(E2e);function Tm(e){"@babel/helpers - typeof";return Tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Tm(e)}var M2e=["valueAccessor"],D2e=["data","dataKey","clockWise","id","textBreakAll"];function R2e(e){return z2e(e)||$2e(e)||N2e(e)||P2e()}function P2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N2e(e,n){if(e){if(typeof e=="string")return U4(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return U4(e,n)}}function $2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function z2e(e){if(Array.isArray(e))return U4(e)}function U4(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function F2e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}var q2e=function(n){return Array.isArray(n.value)?T2e(n.value):n.value};function fo(e){var n=e.valueAccessor,t=n===void 0?q2e:n,i=uN(e,M2e),r=i.data,a=i.dataKey,o=i.clockWise,l=i.id,c=i.textBreakAll,f=uN(i,D2e);return!r||!r.length?null:Q.createElement(Bt,{className:"recharts-label-list"},r.map(function(h,d){var p=Yn(a)?t(h,d):dr(h&&h.payload,a),v=Yn(l)?{}:{id:"".concat(l,"-").concat(d)};return Q.createElement(ii,R1({},Wn(h,!0),f,v,{parentViewBox:h.parentViewBox,value:p,textBreakAll:c,viewBox:ii.parseViewBox(Yn(o)?h:lN(lN({},h),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}fo.displayName="LabelList";function H2e(e,n){return e?e===!0?Q.createElement(fo,{key:"labelList-implicit",data:n}):Q.isValidElement(e)||qn(e)?Q.createElement(fo,{key:"labelList-implicit",data:n,content:e}):td(e)?Q.createElement(fo,R1({data:n},e,{key:"labelList-implicit"})):null:null}function U2e(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&t&&!e.label)return null;var i=e.children,r=ka(i,fo).map(function(o,l){return A.cloneElement(o,{data:n,key:"labelList-".concat(l)})});if(!t)return r;var a=H2e(e.label,n);return[a].concat(R2e(r))}fo.renderCallByParent=U2e;function Mm(e){"@babel/helpers - typeof";return Mm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Mm(e)}function V4(){return V4=Object.assign?Object.assign.bind():function(e){for(var n=1;n180),",").concat(+(o>f),`, + `).concat(d.x,",").concat(d.y,` + `);if(r>0){var v=Ui(t,i,r,o),b=Ui(t,i,r,f);p+="L ".concat(b.x,",").concat(b.y,` + A `).concat(r,",").concat(r,`,0, + `).concat(+(Math.abs(c)>180),",").concat(+(o<=f),`, + `).concat(v.x,",").concat(v.y," Z")}else p+="L ".concat(t,",").concat(i," Z");return p},K2e=function(n){var t=n.cx,i=n.cy,r=n.innerRadius,a=n.outerRadius,o=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,f=n.startAngle,h=n.endAngle,d=qa(h-f),p=og({cx:t,cy:i,radius:a,angle:f,sign:d,cornerRadius:o,cornerIsExternal:c}),v=p.circleTangency,b=p.lineTangency,w=p.theta,k=og({cx:t,cy:i,radius:a,angle:h,sign:-d,cornerRadius:o,cornerIsExternal:c}),_=k.circleTangency,C=k.lineTangency,x=k.theta,E=c?Math.abs(f-h):Math.abs(f-h)-w-x;if(E<0)return l?"M ".concat(b.x,",").concat(b.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):IV({cx:t,cy:i,innerRadius:r,outerRadius:a,startAngle:f,endAngle:h});var j="M ".concat(b.x,",").concat(b.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(v.x,",").concat(v.y,` + A`).concat(a,",").concat(a,",0,").concat(+(E>180),",").concat(+(d<0),",").concat(_.x,",").concat(_.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(C.x,",").concat(C.y,` + `);if(r>0){var O=og({cx:t,cy:i,radius:r,angle:f,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),M=O.circleTangency,N=O.lineTangency,q=O.theta,R=og({cx:t,cy:i,radius:r,angle:h,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),L=R.circleTangency,F=R.lineTangency,Y=R.theta,V=c?Math.abs(f-h):Math.abs(f-h)-q-Y;if(V<0&&o===0)return"".concat(j,"L").concat(t,",").concat(i,"Z");j+="L".concat(F.x,",").concat(F.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(L.x,",").concat(L.y,` + A`).concat(r,",").concat(r,",0,").concat(+(V>180),",").concat(+(d>0),",").concat(M.x,",").concat(M.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(N.x,",").concat(N.y,"Z")}else j+="L".concat(t,",").concat(i,"Z");return j},X2e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},BV=function(n){var t=fN(fN({},X2e),n),i=t.cx,r=t.cy,a=t.innerRadius,o=t.outerRadius,l=t.cornerRadius,c=t.forceCornerRadius,f=t.cornerIsExternal,h=t.startAngle,d=t.endAngle,p=t.className;if(o0&&Math.abs(h-d)<360?k=K2e({cx:i,cy:r,innerRadius:a,outerRadius:o,cornerRadius:Math.min(w,b/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:d}):k=IV({cx:i,cy:r,innerRadius:a,outerRadius:o,startAngle:h,endAngle:d}),Q.createElement("path",V4({},Wn(t,!0),{className:v,d:k,role:"img"}))};function Dm(e){"@babel/helpers - typeof";return Dm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Dm(e)}function W4(){return W4=Object.assign?Object.assign.bind():function(e){for(var n=1;nrxe.call(e,n));function Uu(e,n){return e===n||!e&&!n&&e!==e&&n!==n}const sxe="__v",lxe="__o",uxe="_owner",{getOwnPropertyDescriptor:vN,keys:gN}=Object;function cxe(e,n){return e.byteLength===n.byteLength&&P1(new Uint8Array(e),new Uint8Array(n))}function fxe(e,n,t){let i=e.length;if(n.length!==i)return!1;for(;i-- >0;)if(!t.equals(e[i],n[i],i,i,e,n,t))return!1;return!0}function dxe(e,n){return e.byteLength===n.byteLength&&P1(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}function hxe(e,n){return Uu(e.getTime(),n.getTime())}function mxe(e,n){return e.name===n.name&&e.message===n.message&&e.cause===n.cause&&e.stack===n.stack}function pxe(e,n){return e===n}function yN(e,n,t){const i=e.size;if(i!==n.size)return!1;if(!i)return!0;const r=new Array(i),a=e.entries();let o,l,c=0;for(;(o=a.next())&&!o.done;){const f=n.entries();let h=!1,d=0;for(;(l=f.next())&&!l.done;){if(r[d]){d++;continue}const p=o.value,v=l.value;if(t.equals(p[0],v[0],c,d,e,n,t)&&t.equals(p[1],v[1],p[0],v[0],e,n,t)){h=r[d]=!0;break}d++}if(!h)return!1;c++}return!0}const vxe=Uu;function gxe(e,n,t){const i=gN(e);let r=i.length;if(gN(n).length!==r)return!1;for(;r-- >0;)if(!FV(e,n,t,i[r]))return!1;return!0}function bh(e,n,t){const i=pN(e);let r=i.length;if(pN(n).length!==r)return!1;let a,o,l;for(;r-- >0;)if(a=i[r],!FV(e,n,t,a)||(o=vN(e,a),l=vN(n,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function yxe(e,n){return Uu(e.valueOf(),n.valueOf())}function bxe(e,n){return e.source===n.source&&e.flags===n.flags}function bN(e,n,t){const i=e.size;if(i!==n.size)return!1;if(!i)return!0;const r=new Array(i),a=e.values();let o,l;for(;(o=a.next())&&!o.done;){const c=n.values();let f=!1,h=0;for(;(l=c.next())&&!l.done;){if(!r[h]&&t.equals(o.value,l.value,o.value,l.value,e,n,t)){f=r[h]=!0;break}h++}if(!f)return!1}return!0}function P1(e,n){let t=e.byteLength;if(n.byteLength!==t||e.byteOffset!==n.byteOffset)return!1;for(;t-- >0;)if(e[t]!==n[t])return!1;return!0}function wxe(e,n){return e.hostname===n.hostname&&e.pathname===n.pathname&&e.protocol===n.protocol&&e.port===n.port&&e.hash===n.hash&&e.username===n.username&&e.password===n.password}function FV(e,n,t,i){return(i===uxe||i===lxe||i===sxe)&&(e.$$typeof||n.$$typeof)?!0:oxe(n,i)&&t.equals(e[i],n[i],i,i,e,n,t)}const kxe="[object ArrayBuffer]",_xe="[object Arguments]",xxe="[object Boolean]",Sxe="[object DataView]",Cxe="[object Date]",Axe="[object Error]",jxe="[object Map]",Oxe="[object Number]",Exe="[object Object]",Txe="[object RegExp]",Mxe="[object Set]",Dxe="[object String]",Rxe={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Pxe="[object URL]",Nxe=Object.prototype.toString;function $xe({areArrayBuffersEqual:e,areArraysEqual:n,areDataViewsEqual:t,areDatesEqual:i,areErrorsEqual:r,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:d,areTypedArraysEqual:p,areUrlsEqual:v,unknownTagComparators:b}){return function(k,_,C){if(k===_)return!0;if(k==null||_==null)return!1;const x=typeof k;if(x!==typeof _)return!1;if(x!=="object")return x==="number"?l(k,_,C):x==="function"?a(k,_,C):!1;const E=k.constructor;if(E!==_.constructor)return!1;if(E===Object)return c(k,_,C);if(Array.isArray(k))return n(k,_,C);if(E===Date)return i(k,_,C);if(E===RegExp)return h(k,_,C);if(E===Map)return o(k,_,C);if(E===Set)return d(k,_,C);const j=Nxe.call(k);if(j===Cxe)return i(k,_,C);if(j===Txe)return h(k,_,C);if(j===jxe)return o(k,_,C);if(j===Mxe)return d(k,_,C);if(j===Exe)return typeof k.then!="function"&&typeof _.then!="function"&&c(k,_,C);if(j===Pxe)return v(k,_,C);if(j===Axe)return r(k,_,C);if(j===_xe)return c(k,_,C);if(Rxe[j])return p(k,_,C);if(j===kxe)return e(k,_,C);if(j===Sxe)return t(k,_,C);if(j===xxe||j===Oxe||j===Dxe)return f(k,_,C);if(b){let O=b[j];if(!O){const M=axe(k);M&&(O=b[M])}if(O)return O(k,_,C)}return!1}}function zxe({circular:e,createCustomConfig:n,strict:t}){let i={areArrayBuffersEqual:cxe,areArraysEqual:t?bh:fxe,areDataViewsEqual:dxe,areDatesEqual:hxe,areErrorsEqual:mxe,areFunctionsEqual:pxe,areMapsEqual:t?z3(yN,bh):yN,areNumbersEqual:vxe,areObjectsEqual:t?bh:gxe,arePrimitiveWrappersEqual:yxe,areRegExpsEqual:bxe,areSetsEqual:t?z3(bN,bh):bN,areTypedArraysEqual:t?z3(P1,bh):P1,areUrlsEqual:wxe,unknownTagComparators:void 0};if(n&&(i=Object.assign({},i,n(i))),e){const r=lg(i.areArraysEqual),a=lg(i.areMapsEqual),o=lg(i.areObjectsEqual),l=lg(i.areSetsEqual);i=Object.assign({},i,{areArraysEqual:r,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:l})}return i}function Lxe(e){return function(n,t,i,r,a,o,l){return e(n,t,l)}}function Ixe({circular:e,comparator:n,createState:t,equals:i,strict:r}){if(t)return function(l,c){const{cache:f=e?new WeakMap:void 0,meta:h}=t();return n(l,c,{cache:f,equals:i,meta:h,strict:r})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:r})};const a={cache:void 0,equals:i,meta:void 0,strict:r};return function(l,c){return n(l,c,a)}}const Bxe=Ml();Ml({strict:!0});Ml({circular:!0});Ml({circular:!0,strict:!0});Ml({createInternalComparator:()=>Uu});Ml({strict:!0,createInternalComparator:()=>Uu});Ml({circular:!0,createInternalComparator:()=>Uu});Ml({circular:!0,createInternalComparator:()=>Uu,strict:!0});function Ml(e={}){const{circular:n=!1,createInternalComparator:t,createState:i,strict:r=!1}=e,a=zxe(e),o=$xe(a),l=t?t(o):Lxe(o);return Ixe({circular:n,comparator:o,createState:i,equals:l,strict:r})}function Fxe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function wN(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=-1,i=function r(a){t<0&&(t=a),a-t>n?(e(a),t=-1):Fxe(r)};requestAnimationFrame(i)}function G4(e){"@babel/helpers - typeof";return G4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},G4(e)}function qxe(e){return Wxe(e)||Vxe(e)||Uxe(e)||Hxe()}function Hxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uxe(e,n){if(e){if(typeof e=="string")return kN(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kN(e,n)}}function kN(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);te.length)&&(n=e.length);for(var t=0,i=new Array(n);t1?1:_<0?0:_},w=function(_){for(var C=_>1?1:_,x=C,E=0;E<8;++E){var j=d(x)-C,O=v(x);if(Math.abs(j-C)0&&arguments[0]!==void 0?arguments[0]:{},t=n.stiff,i=t===void 0?100:t,r=n.damping,a=r===void 0?8:r,o=n.dt,l=o===void 0?17:o,c=function(h,d,p){var v=-(h-d)*i,b=p*a,w=p+(v-b)*l/1e3,k=p*l/1e3+h;return Math.abs(k-d)e.length)&&(n=e.length);for(var t=0,i=new Array(n);t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function x3e(e,n){if(e==null)return{};var t={},i=Object.keys(e),r,a;for(a=0;a=0)&&(t[r]=e[r]);return t}function L3(e){return j3e(e)||A3e(e)||C3e(e)||S3e()}function S3e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C3e(e,n){if(e){if(typeof e=="string")return Q4(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Q4(e,n)}}function A3e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function j3e(e){if(Array.isArray(e))return Q4(e)}function Q4(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function z1(e){return z1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},z1(e)}var wo=(function(e){D3e(t,e);var n=R3e(t);function t(i,r){var a;O3e(this,t),a=n.call(this,i,r);var o=a.props,l=o.isActive,c=o.attributeName,f=o.from,h=o.to,d=o.steps,p=o.children,v=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(n6(a)),a.changeStyle=a.changeStyle.bind(n6(a)),!l||v<=0)return a.state={style:{}},typeof p=="function"&&(a.state={style:h}),e6(a);if(d&&d.length)a.state={style:d[0].style};else if(f){if(typeof p=="function")return a.state={style:f},e6(a);a.state={style:c?Dh({},c,f):f}}else a.state={style:{}};return a}return T3e(t,[{key:"componentDidMount",value:function(){var r=this.props,a=r.isActive,o=r.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(r){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,f=a.shouldReAnimate,h=a.to,d=a.from,p=this.state.style;if(l){if(!o){var v={style:c?Dh({},c,h):h};this.state&&p&&(c&&p[c]!==h||!c&&p!==h)&&this.setState(v);return}if(!(Bxe(r.to,h)&&r.canBegin&&r.isActive)){var b=!r.canBegin||!r.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=b||f?d:r.to;if(this.state&&p){var k={style:c?Dh({},c,w):w};(c&&p[c]!==w||!c&&p!==w)&&this.setState(k)}this.runAnimation(Na(Na({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var r=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),r&&r()}},{key:"handleStyleChange",value:function(r){this.changeStyle(r)}},{key:"changeStyle",value:function(r){this.mounted&&this.setState({style:r})}},{key:"runJSAnimation",value:function(r){var a=this,o=r.from,l=r.to,c=r.duration,f=r.easing,h=r.begin,d=r.onAnimationEnd,p=r.onAnimationStart,v=w3e(o,l,u3e(f),c,this.changeStyle),b=function(){a.stopJSAnimation=v()};this.manager.start([p,h,b,c,d])}},{key:"runStepAnimation",value:function(r){var a=this,o=r.steps,l=r.begin,c=r.onAnimationStart,f=o[0],h=f.style,d=f.duration,p=d===void 0?0:d,v=function(w,k,_){if(_===0)return w;var C=k.duration,x=k.easing,E=x===void 0?"ease":x,j=k.style,O=k.properties,M=k.onAnimationEnd,N=_>0?o[_-1]:k,q=O||Object.keys(j);if(typeof E=="function"||E==="spring")return[].concat(L3(w),[a.runJSAnimation.bind(a,{from:N.style,to:j,duration:C,easing:E}),C]);var R=SN(q,C,E),L=Na(Na(Na({},N.style),j),{},{transition:R});return[].concat(L3(w),[L,C,M]).filter(Zxe)};return this.manager.start([c].concat(L3(o.reduce(v,[h,Math.max(p,l)])),[r.onAnimationEnd]))}},{key:"runAnimation",value:function(r){this.manager||(this.manager=Gxe());var a=r.begin,o=r.duration,l=r.attributeName,c=r.to,f=r.easing,h=r.onAnimationStart,d=r.onAnimationEnd,p=r.steps,v=r.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof f=="function"||typeof v=="function"||f==="spring"){this.runJSAnimation(r);return}if(p.length>1){this.runStepAnimation(r);return}var w=l?Dh({},l,c):c,k=SN(Object.keys(w),o,f);b.start([h,a,Na(Na({},w),{},{transition:k}),o,d])}},{key:"render",value:function(){var r=this.props,a=r.children;r.begin;var o=r.duration;r.attributeName,r.easing;var l=r.isActive;r.steps,r.from,r.to,r.canBegin,r.onAnimationEnd,r.shouldReAnimate,r.onAnimationReStart;var c=_3e(r,k3e),f=A.Children.count(a),h=this.state.style;if(typeof a=="function")return a(h);if(!l||f===0||o<=0)return a;var d=function(v){var b=v.props,w=b.style,k=w===void 0?{}:w,_=b.className,C=A.cloneElement(v,Na(Na({},c),{},{style:Na(Na({},k),h),className:_}));return C};return f===1?d(A.Children.only(a)):Q.createElement("div",null,A.Children.map(a,function(p){return d(p)}))}}]),t})(A.PureComponent);wo.displayName="Animate";wo.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};wo.propTypes={from:wt.oneOfType([wt.object,wt.string]),to:wt.oneOfType([wt.object,wt.string]),attributeName:wt.string,duration:wt.number,begin:wt.number,easing:wt.oneOfType([wt.string,wt.func]),steps:wt.arrayOf(wt.shape({duration:wt.number.isRequired,style:wt.object.isRequired,easing:wt.oneOfType([wt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),wt.func]),properties:wt.arrayOf("string"),onAnimationEnd:wt.func})),children:wt.oneOfType([wt.node,wt.func]),isActive:wt.bool,canBegin:wt.bool,onAnimationEnd:wt.func,shouldReAnimate:wt.bool,onAnimationStart:wt.func,onAnimationReStart:wt.func};function Nm(e){"@babel/helpers - typeof";return Nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Nm(e)}function L1(){return L1=Object.assign?Object.assign.bind():function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,i=new Array(n);t=0?1:-1,c=i>=0?1:-1,f=r>=0&&i>=0||r<0&&i<0?1:0,h;if(o>0&&a instanceof Array){for(var d=[0,0,0,0],p=0,v=4;po?o:a[p];h="M".concat(n,",").concat(t+l*d[0]),d[0]>0&&(h+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(f,",").concat(n+c*d[0],",").concat(t)),h+="L ".concat(n+i-c*d[1],",").concat(t),d[1]>0&&(h+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(f,`, + `).concat(n+i,",").concat(t+l*d[1])),h+="L ".concat(n+i,",").concat(t+r-l*d[2]),d[2]>0&&(h+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(f,`, + `).concat(n+i-c*d[2],",").concat(t+r)),h+="L ".concat(n+c*d[3],",").concat(t+r),d[3]>0&&(h+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(f,`, + `).concat(n,",").concat(t+r-l*d[3])),h+="Z"}else if(o>0&&a===+a&&a>0){var b=Math.min(o,a);h="M ".concat(n,",").concat(t+l*b,` + A `).concat(b,",").concat(b,",0,0,").concat(f,",").concat(n+c*b,",").concat(t,` + L `).concat(n+i-c*b,",").concat(t,` + A `).concat(b,",").concat(b,",0,0,").concat(f,",").concat(n+i,",").concat(t+l*b,` + L `).concat(n+i,",").concat(t+r-l*b,` + A `).concat(b,",").concat(b,",0,0,").concat(f,",").concat(n+i-c*b,",").concat(t+r,` + L `).concat(n+c*b,",").concat(t+r,` + A `).concat(b,",").concat(b,",0,0,").concat(f,",").concat(n,",").concat(t+r-l*b," Z")}else h="M ".concat(n,",").concat(t," h ").concat(i," v ").concat(r," h ").concat(-i," Z");return h},H3e=function(n,t){if(!n||!t)return!1;var i=n.x,r=n.y,a=t.x,o=t.y,l=t.width,c=t.height;if(Math.abs(l)>0&&Math.abs(c)>0){var f=Math.min(a,a+l),h=Math.max(a,a+l),d=Math.min(o,o+c),p=Math.max(o,o+c);return i>=f&&i<=h&&r>=d&&r<=p}return!1},U3e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$m=function(n){var t=DN(DN({},U3e),n),i=A.useRef(),r=A.useState(-1),a=N3e(r,2),o=a[0],l=a[1];A.useEffect(function(){if(i.current&&i.current.getTotalLength)try{var E=i.current.getTotalLength();E&&l(E)}catch{}},[]);var c=t.x,f=t.y,h=t.width,d=t.height,p=t.radius,v=t.className,b=t.animationEasing,w=t.animationDuration,k=t.animationBegin,_=t.isAnimationActive,C=t.isUpdateAnimationActive;if(c!==+c||f!==+f||h!==+h||d!==+d||h===0||d===0)return null;var x=pn("recharts-rectangle",v);return C?Q.createElement(wo,{canBegin:o>0,from:{width:h,height:d,x:c,y:f},to:{width:h,height:d,x:c,y:f},duration:w,animationEasing:b,isActive:C},function(E){var j=E.width,O=E.height,M=E.x,N=E.y;return Q.createElement(wo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:k,duration:w,isActive:_,easing:b},Q.createElement("path",L1({},Wn(t,!0),{className:x,d:RN(M,N,j,O,p),ref:i})))}):Q.createElement("path",L1({},Wn(t,!0),{className:x,d:RN(c,f,h,d,p)}))};function t6(){return t6=Object.assign?Object.assign.bind():function(e){for(var n=1;n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function Z3e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}var Q3e=function(n,t,i,r,a,o){return"M".concat(n,",").concat(a,"v").concat(r,"M").concat(o,",").concat(t,"h").concat(i)},J3e=function(n){var t=n.x,i=t===void 0?0:t,r=n.y,a=r===void 0?0:r,o=n.top,l=o===void 0?0:o,c=n.left,f=c===void 0?0:c,h=n.width,d=h===void 0?0:h,p=n.height,v=p===void 0?0:p,b=n.className,w=X3e(n,V3e),k=W3e({x:i,y:a,top:l,left:f,width:d,height:v},w);return!Ge(i)||!Ge(a)||!Ge(d)||!Ge(v)||!Ge(l)||!Ge(f)?null:Q.createElement("path",i6({},Wn(k,!0),{className:pn("recharts-cross",b),d:Q3e(i,a,d,v,l,f)}))},I3,NN;function eSe(){if(NN)return I3;NN=1;var e=mU(),n=e(Object.getPrototypeOf,Object);return I3=n,I3}var B3,$N;function nSe(){if($N)return B3;$N=1;var e=_s(),n=eSe(),t=xs(),i="[object Object]",r=Function.prototype,a=Object.prototype,o=r.toString,l=a.hasOwnProperty,c=o.call(Object);function f(h){if(!t(h)||e(h)!=i)return!1;var d=n(h);if(d===null)return!0;var p=l.call(d,"constructor")&&d.constructor;return typeof p=="function"&&p instanceof p&&o.call(p)==c}return B3=f,B3}var tSe=nSe();const iSe=yt(tSe);var F3,zN;function rSe(){if(zN)return F3;zN=1;var e=_s(),n=xs(),t="[object Boolean]";function i(r){return r===!0||r===!1||n(r)&&e(r)==t}return F3=i,F3}var aSe=rSe();const oSe=yt(aSe);function Lm(e){"@babel/helpers - typeof";return Lm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Lm(e)}function I1(){return I1=Object.assign?Object.assign.bind():function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,i=new Array(n);t0,from:{upperWidth:0,lowerWidth:0,height:p,x:c,y:f},to:{upperWidth:h,lowerWidth:d,height:p,x:c,y:f},duration:w,animationEasing:b,isActive:_},function(x){var E=x.upperWidth,j=x.lowerWidth,O=x.height,M=x.x,N=x.y;return Q.createElement(wo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:k,duration:w,easing:b},Q.createElement("path",I1({},Wn(t,!0),{className:C,d:FN(M,N,E,j,O),ref:i})))}):Q.createElement("g",null,Q.createElement("path",I1({},Wn(t,!0),{className:C,d:FN(c,f,h,d,p)})))},gSe=["option","shapeType","propTransformer","activeClassName","isActive"];function Im(e){"@babel/helpers - typeof";return Im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Im(e)}function ySe(e,n){if(e==null)return{};var t=bSe(e,n),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function bSe(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function qN(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function B1(e){for(var n=1;n0&&i.handleDrag(r.changedTouches[0])}),qr(i,"handleDragEnd",function(){i.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var r=i.props,a=r.endIndex,o=r.onDragEnd,l=r.startIndex;o==null||o({endIndex:a,startIndex:l})}),i.detachDragEndListener()}),qr(i,"handleLeaveWrapper",function(){(i.state.isTravellerMoving||i.state.isSlideMoving)&&(i.leaveTimer=window.setTimeout(i.handleDragEnd,i.props.leaveTimeOut))}),qr(i,"handleEnterSlideOrTraveller",function(){i.setState({isTextActive:!0})}),qr(i,"handleLeaveSlideOrTraveller",function(){i.setState({isTextActive:!1})}),qr(i,"handleSlideDragStart",function(r){var a=QN(r)?r.changedTouches[0]:r;i.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),i.attachDragEndListener()}),i.travellerDragStartHandlers={startX:i.handleTravellerDragStart.bind(i,"startX"),endX:i.handleTravellerDragStart.bind(i,"endX")},i.state={},i}return GSe(n,e),HSe(n,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(i){var r=i.startX,a=i.endX,o=this.state.scaleValues,l=this.props,c=l.gap,f=l.data,h=f.length-1,d=Math.min(r,a),p=Math.max(r,a),v=n.getIndexInRange(o,d),b=n.getIndexInRange(o,p);return{startIndex:v-v%c,endIndex:b===h?h:b-b%c}}},{key:"getTextOfTick",value:function(i){var r=this.props,a=r.data,o=r.tickFormatter,l=r.dataKey,c=dr(a[i],l,i);return qn(o)?o(c,i):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(i){var r=this.state,a=r.slideMoveStartX,o=r.startX,l=r.endX,c=this.props,f=c.x,h=c.width,d=c.travellerWidth,p=c.startIndex,v=c.endIndex,b=c.onChange,w=i.pageX-a;w>0?w=Math.min(w,f+h-d-l,f+h-d-o):w<0&&(w=Math.max(w,f-o,f-l));var k=this.getIndex({startX:o+w,endX:l+w});(k.startIndex!==p||k.endIndex!==v)&&b&&b(k),this.setState({startX:o+w,endX:l+w,slideMoveStartX:i.pageX})}},{key:"handleTravellerDragStart",value:function(i,r){var a=QN(r)?r.changedTouches[0]:r;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:i,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(i){var r=this.state,a=r.brushMoveStartX,o=r.movingTravellerId,l=r.endX,c=r.startX,f=this.state[o],h=this.props,d=h.x,p=h.width,v=h.travellerWidth,b=h.onChange,w=h.gap,k=h.data,_={startX:this.state.startX,endX:this.state.endX},C=i.pageX-a;C>0?C=Math.min(C,d+p-v-f):C<0&&(C=Math.max(C,d-f)),_[o]=f+C;var x=this.getIndex(_),E=x.startIndex,j=x.endIndex,O=function(){var N=k.length-1;return o==="startX"&&(l>c?E%w===0:j%w===0)||lc?j%w===0:E%w===0)||l>c&&j===N};this.setState(qr(qr({},o,f+C),"brushMoveStartX",i.pageX),function(){b&&O()&&b(x)})}},{key:"handleTravellerMoveKeyboard",value:function(i,r){var a=this,o=this.state,l=o.scaleValues,c=o.startX,f=o.endX,h=this.state[r],d=l.indexOf(h);if(d!==-1){var p=d+i;if(!(p===-1||p>=l.length)){var v=l[p];r==="startX"&&v>=f||r==="endX"&&v<=c||this.setState(qr({},r,v),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var i=this.props,r=i.x,a=i.y,o=i.width,l=i.height,c=i.fill,f=i.stroke;return Q.createElement("rect",{stroke:f,fill:c,x:r,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var i=this.props,r=i.x,a=i.y,o=i.width,l=i.height,c=i.data,f=i.children,h=i.padding,d=A.Children.only(f);return d?Q.cloneElement(d,{x:r,y:a,width:o,height:l,margin:h,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(i,r){var a,o,l=this,c=this.props,f=c.y,h=c.travellerWidth,d=c.height,p=c.traveller,v=c.ariaLabel,b=c.data,w=c.startIndex,k=c.endIndex,_=Math.max(i,this.props.x),C=W3(W3({},Wn(this.props,!1)),{},{x:_,y:f,width:h,height:d}),x=v||"Min value: ".concat((a=b[w])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=b[k])===null||o===void 0?void 0:o.name);return Q.createElement(Bt,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":i,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[r],onTouchStart:this.travellerDragStartHandlers[r],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,r))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},n.renderTraveller(p,C))}},{key:"renderSlide",value:function(i,r){var a=this.props,o=a.y,l=a.height,c=a.stroke,f=a.travellerWidth,h=Math.min(i,r)+f,d=Math.max(Math.abs(r-i)-f,0);return Q.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:h,y:o,width:d,height:l})}},{key:"renderText",value:function(){var i=this.props,r=i.startIndex,a=i.endIndex,o=i.y,l=i.height,c=i.travellerWidth,f=i.stroke,h=this.state,d=h.startX,p=h.endX,v=5,b={pointerEvents:"none",fill:f};return Q.createElement(Bt,{className:"recharts-brush-texts"},Q.createElement(p1,q1({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,p)-v,y:o+l/2},b),this.getTextOfTick(r)),Q.createElement(p1,q1({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,p)+c+v,y:o+l/2},b),this.getTextOfTick(a)))}},{key:"render",value:function(){var i=this.props,r=i.data,a=i.className,o=i.children,l=i.x,c=i.y,f=i.width,h=i.height,d=i.alwaysShowText,p=this.state,v=p.startX,b=p.endX,w=p.isTextActive,k=p.isSlideMoving,_=p.isTravellerMoving,C=p.isTravellerFocused;if(!r||!r.length||!Ge(l)||!Ge(c)||!Ge(f)||!Ge(h)||f<=0||h<=0)return null;var x=pn("recharts-brush",a),E=Q.Children.count(o)===1,j=FSe("userSelect","none");return Q.createElement(Bt,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(v,b),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(b,"endX"),(w||k||_||C||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(i){var r=i.x,a=i.y,o=i.width,l=i.height,c=i.stroke,f=Math.floor(a+l/2)-1;return Q.createElement(Q.Fragment,null,Q.createElement("rect",{x:r,y:a,width:o,height:l,fill:c,stroke:"none"}),Q.createElement("line",{x1:r+1,y1:f,x2:r+o-1,y2:f,fill:"none",stroke:"#fff"}),Q.createElement("line",{x1:r+1,y1:f+2,x2:r+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(i,r){var a;return Q.isValidElement(i)?a=Q.cloneElement(i,r):qn(i)?a=i(r):a=n.renderDefaultTraveller(r),a}},{key:"getDerivedStateFromProps",value:function(i,r){var a=i.data,o=i.width,l=i.x,c=i.travellerWidth,f=i.updateId,h=i.startIndex,d=i.endIndex;if(a!==r.prevData||f!==r.prevUpdateId)return W3({prevData:a,prevTravellerWidth:c,prevUpdateId:f,prevX:l,prevWidth:o},a&&a.length?KSe({data:a,width:o,x:l,travellerWidth:c,startIndex:h,endIndex:d}):{scale:null,scaleValues:null});if(r.scale&&(o!==r.prevWidth||l!==r.prevX||c!==r.prevTravellerWidth)){r.scale.range([l,l+o-c]);var p=r.scale.domain().map(function(v){return r.scale(v)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:f,prevX:l,prevWidth:o,startX:r.scale(i.startIndex),endX:r.scale(i.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(i,r){for(var a=i.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);i[c]>r?l=c:o=c}return r>=i[l]?l:o}}])})(A.PureComponent);qr(wf,"displayName","Brush");qr(wf,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var G3,JN;function XSe(){if(JN)return G3;JN=1;var e=tA();function n(t,i){var r;return e(t,function(a,o,l){return r=i(a,o,l),!r}),!!r}return G3=n,G3}var Y3,e$;function ZSe(){if(e$)return Y3;e$=1;var e=sU(),n=Ol(),t=XSe(),i=Or(),r=z0();function a(o,l,c){var f=i(o)?e:t;return c&&r(o,l,c)&&(l=void 0),f(o,n(l,3))}return Y3=a,Y3}var QSe=ZSe();const JSe=yt(QSe);var ho=function(n,t){var i=n.alwaysShow,r=n.ifOverflow;return i&&(r="extendDomain"),r===t},K3,n$;function e4e(){if(n$)return K3;n$=1;var e=CU();function n(t,i,r){i=="__proto__"&&e?e(t,i,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[i]=r}return K3=n,K3}var X3,t$;function n4e(){if(t$)return X3;t$=1;var e=e4e(),n=xU(),t=Ol();function i(r,a){var o={};return a=t(a,3),n(r,function(l,c,f){e(o,c,a(l,c,f))}),o}return X3=i,X3}var t4e=n4e();const i4e=yt(t4e);var Z3,i$;function r4e(){if(i$)return Z3;i$=1;function e(n,t){for(var i=-1,r=n==null?0:n.length;++i=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function h4e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function m4e(e,n){var t=e.x,i=e.y,r=d4e(e,l4e),a="".concat(t),o=parseInt(a,10),l="".concat(i),c=parseInt(l,10),f="".concat(n.height||r.height),h=parseInt(f,10),d="".concat(n.width||r.width),p=parseInt(d,10);return wh(wh(wh(wh(wh({},n),r),o?{x:o}:{}),c?{y:c}:{}),{},{height:h,width:p,name:n.name,radius:n.radius})}function s$(e){return Q.createElement(ASe,a6({shapeType:"rectangle",propTransformer:m4e,activeClassName:"recharts-active-bar"},e))}var p4e=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(i,r){if(typeof n=="number")return n;var a=Ge(i)||Ave(i);return a?n(i,r):(a||Ou(),t)}},v4e=["value","background"],JV;function kf(e){"@babel/helpers - typeof";return kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},kf(e)}function g4e(e,n){if(e==null)return{};var t=y4e(e,n),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function y4e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function U1(){return U1=Object.assign?Object.assign.bind():function(e){for(var n=1;n0&&Math.abs($)0&&Math.abs(V)0&&(Y=Math.min((X||0)-(V[ee-1]||0),Y))}),Number.isFinite(Y)){var $=Y/F,P=w.layout==="vertical"?i.height:i.width;if(w.padding==="gap"&&(M=$*P/2),w.padding==="no-gap"){var I=Au(n.barCategoryGap,$*P),H=$*P/2;M=H-I-(H-I)/P*I}}}r==="xAxis"?N=[i.left+(x.left||0)+(M||0),i.left+i.width-(x.right||0)-(M||0)]:r==="yAxis"?N=c==="horizontal"?[i.top+i.height-(x.bottom||0),i.top+(x.top||0)]:[i.top+(x.top||0)+(M||0),i.top+i.height-(x.bottom||0)-(M||0)]:N=w.range,j&&(N=[N[1],N[0]]);var U=q_e(w,a,p),D=U.scale,W=U.realScaleType;D.domain(_).range(N),H_e(D);var G=Z_e(D,$a($a({},w),{},{realScaleType:W}));r==="xAxis"?(L=k==="top"&&!E||k==="bottom"&&E,q=i.left,R=d[O]-L*w.height):r==="yAxis"&&(L=k==="left"&&!E||k==="right"&&E,q=d[O]-L*w.width,R=i.top);var z=$a($a($a({},w),G),{},{realScaleType:W,x:q,y:R,scale:D,width:r==="xAxis"?i.width:w.width,height:r==="yAxis"?i.height:w.height});return z.bandSize=M1(z,G),!w.hide&&r==="xAxis"?d[O]+=(L?-1:1)*z.height:w.hide||(d[O]+=(L?-1:1)*z.width),$a($a({},v),{},X0({},b,z))},{})},iW=function(n,t){var i=n.x,r=n.y,a=t.x,o=t.y;return{x:Math.min(i,a),y:Math.min(r,o),width:Math.abs(a-i),height:Math.abs(o-r)}},E4e=function(n){var t=n.x1,i=n.y1,r=n.x2,a=n.y2;return iW({x:t,y:i},{x:r,y:a})},rW=(function(){function e(n){A4e(this,e),this.scale=n}return j4e(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.bandAware,a=i.position;if(t!==void 0){if(a)switch(a){case"start":return this.scale(t);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(t)+l}default:return this.scale(t)}if(r){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+c}return this.scale(t)}}},{key:"isInRange",value:function(t){var i=this.range(),r=i[0],a=i[i.length-1];return r<=a?t>=r&&t<=a:t>=a&&t<=r}}],[{key:"create",value:function(t){return new e(t)}}])})();X0(rW,"EPS",1e-4);var DA=function(n){var t=Object.keys(n).reduce(function(i,r){return $a($a({},i),{},X0({},r,rW.create(n[r])))},{});return $a($a({},t),{},{apply:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return i4e(r,function(c,f){return t[f].apply(c,{bandAware:o,position:l})})},isInRange:function(r){return QV(r,function(a,o){return t[o].isInRange(a)})}})};function T4e(e){return(e%180+180)%180}var M4e=function(n){var t=n.width,i=n.height,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=T4e(r),o=a*Math.PI/180,l=Math.atan(i/t),c=o>l&&o-1?c[f?a[h]:h]:void 0}}return eS=i,eS}var nS,h$;function R4e(){if(h$)return nS;h$=1;var e=YV();function n(t){var i=e(t),r=i%1;return i===i?r?i-r:i:0}return nS=n,nS}var tS,m$;function P4e(){if(m$)return tS;m$=1;var e=yU(),n=Ol(),t=R4e(),i=Math.max;function r(a,o,l){var c=a==null?0:a.length;if(!c)return-1;var f=l==null?0:t(l);return f<0&&(f=i(c+f,0)),e(a,n(o,3),f)}return tS=r,tS}var iS,p$;function N4e(){if(p$)return iS;p$=1;var e=D4e(),n=P4e(),t=e(n);return iS=t,iS}var $4e=N4e();const z4e=yt($4e);var L4e=RH();const I4e=yt(L4e);var B4e=I4e(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),RA=A.createContext(void 0),PA=A.createContext(void 0),aW=A.createContext(void 0),oW=A.createContext({}),sW=A.createContext(void 0),lW=A.createContext(0),uW=A.createContext(0),v$=function(n){var t=n.state,i=t.xAxisMap,r=t.yAxisMap,a=t.offset,o=n.clipPathId,l=n.children,c=n.width,f=n.height,h=B4e(a);return Q.createElement(RA.Provider,{value:i},Q.createElement(PA.Provider,{value:r},Q.createElement(oW.Provider,{value:a},Q.createElement(aW.Provider,{value:h},Q.createElement(sW.Provider,{value:o},Q.createElement(lW.Provider,{value:f},Q.createElement(uW.Provider,{value:c},l)))))))},F4e=function(){return A.useContext(sW)},cW=function(n){var t=A.useContext(RA);t==null&&Ou();var i=t[n];return i==null&&Ou(),i},q4e=function(){var n=A.useContext(RA);return tl(n)},H4e=function(){var n=A.useContext(PA),t=z4e(n,function(i){return QV(i.domain,Number.isFinite)});return t||tl(n)},fW=function(n){var t=A.useContext(PA);t==null&&Ou();var i=t[n];return i==null&&Ou(),i},U4e=function(){var n=A.useContext(aW);return n},V4e=function(){return A.useContext(oW)},NA=function(){return A.useContext(uW)},$A=function(){return A.useContext(lW)};function _f(e){"@babel/helpers - typeof";return _f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_f(e)}function W4e(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function G4e(e,n){for(var t=0;te.length)&&(n=e.length);for(var t=0,i=new Array(n);te*r)return!1;var a=t();return e*(n-e*a/2-i)>=0&&e*(n+e*a/2-r)<=0}function O6e(e,n){return yW(e,n+1)}function E6e(e,n,t,i,r){for(var a=(i||[]).slice(),o=n.start,l=n.end,c=0,f=1,h=o,d=function(){var b=i==null?void 0:i[c];if(b===void 0)return{v:yW(i,f)};var w=c,k,_=function(){return k===void 0&&(k=t(b,w)),k},C=b.coordinate,x=c===0||K1(e,C,_,h,l);x||(c=0,h=o,f+=1),x&&(h=C+e*(_()/2+r),c+=f)},p;f<=a.length;)if(p=d(),p)return p.v;return[]}function Um(e){"@babel/helpers - typeof";return Um=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Um(e)}function S$(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function Xi(e){for(var n=1;n0?v.coordinate-k*e:v.coordinate})}else a[p]=v=Xi(Xi({},v),{},{tickCoord:v.coordinate});var _=K1(e,v.tickCoord,w,l,c);_&&(c=v.tickCoord-e*(w()/2+r),a[p]=Xi(Xi({},v),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return a}function P6e(e,n,t,i,r,a){var o=(i||[]).slice(),l=o.length,c=n.start,f=n.end;if(a){var h=i[l-1],d=t(h,l-1),p=e*(h.coordinate+e*d/2-f);o[l-1]=h=Xi(Xi({},h),{},{tickCoord:p>0?h.coordinate-p*e:h.coordinate});var v=K1(e,h.tickCoord,function(){return d},c,f);v&&(f=h.tickCoord-e*(d/2+r),o[l-1]=Xi(Xi({},h),{},{isShow:!0}))}for(var b=a?l-1:l,w=function(C){var x=o[C],E,j=function(){return E===void 0&&(E=t(x,C)),E};if(C===0){var O=e*(x.coordinate-e*j()/2-c);o[C]=x=Xi(Xi({},x),{},{tickCoord:O<0?x.coordinate-O*e:x.coordinate})}else o[C]=x=Xi(Xi({},x),{},{tickCoord:x.coordinate});var M=K1(e,x.tickCoord,j,c,f);M&&(c=x.tickCoord+e*(j()/2+r),o[C]=Xi(Xi({},x),{},{isShow:!0}))},k=0;k=2?qa(r[1].coordinate-r[0].coordinate):1,_=j6e(a,k,v);return c==="equidistantPreserveStart"?E6e(k,_,w,r,o):(c==="preserveStart"||c==="preserveStartEnd"?p=P6e(k,_,w,r,o,c==="preserveStartEnd"):p=R6e(k,_,w,r,o),p.filter(function(C){return C.isShow}))}var N6e=["viewBox"],$6e=["viewBox"],z6e=["ticks"];function Cf(e){"@babel/helpers - typeof";return Cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Cf(e)}function Uc(){return Uc=Object.assign?Object.assign.bind():function(e){for(var n=1;n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function L6e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function I6e(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function A$(e,n){for(var t=0;t0?c(this.props):c(v)),o<=0||l<=0||!b||!b.length?null:Q.createElement(Bt,{className:pn("recharts-cartesian-axis",f),ref:function(k){i.layerReference=k}},a&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),ii.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(i,r,a){var o,l=pn(r.className,"recharts-cartesian-axis-tick-value");return Q.isValidElement(i)?o=Q.cloneElement(i,ki(ki({},r),{},{className:l})):qn(i)?o=i(ki(ki({},r),{},{className:l})):o=Q.createElement(p1,Uc({},r,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(A.Component);IA(ud,"displayName","CartesianAxis");IA(ud,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var W6e=["x1","y1","x2","y2","key"],G6e=["offset"];function Eu(e){"@babel/helpers - typeof";return Eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Eu(e)}function j$(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function Qi(e){for(var n=1;n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function Z6e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}var Q6e=function(n){var t=n.fill;if(!t||t==="none")return null;var i=n.fillOpacity,r=n.x,a=n.y,o=n.width,l=n.height,c=n.ry;return Q.createElement("rect",{x:r,y:a,ry:c,width:o,height:l,stroke:"none",fill:t,fillOpacity:i,className:"recharts-cartesian-grid-bg"})};function kW(e,n){var t;if(Q.isValidElement(e))t=Q.cloneElement(e,n);else if(qn(e))t=e(n);else{var i=n.x1,r=n.y1,a=n.x2,o=n.y2,l=n.key,c=O$(n,W6e),f=Wn(c,!1);f.offset;var h=O$(f,G6e);t=Q.createElement("line",du({},h,{x1:i,y1:r,x2:a,y2:o,fill:"none",key:l}))}return t}function J6e(e){var n=e.x,t=e.width,i=e.horizontal,r=i===void 0?!0:i,a=e.horizontalPoints;if(!r||!a||!a.length)return null;var o=a.map(function(l,c){var f=Qi(Qi({},e),{},{x1:n,y1:l,x2:n+t,y2:l,key:"line-".concat(c),index:c});return kW(r,f)});return Q.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function eCe(e){var n=e.y,t=e.height,i=e.vertical,r=i===void 0?!0:i,a=e.verticalPoints;if(!r||!a||!a.length)return null;var o=a.map(function(l,c){var f=Qi(Qi({},e),{},{x1:l,y1:n,x2:l,y2:n+t,key:"line-".concat(c),index:c});return kW(r,f)});return Q.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function nCe(e){var n=e.horizontalFill,t=e.fillOpacity,i=e.x,r=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,f=c===void 0?!0:c;if(!f||!n||!n.length)return null;var h=l.map(function(p){return Math.round(p+r-r)}).sort(function(p,v){return p-v});r!==h[0]&&h.unshift(0);var d=h.map(function(p,v){var b=!h[v+1],w=b?r+o-p:h[v+1]-p;if(w<=0)return null;var k=v%n.length;return Q.createElement("rect",{key:"react-".concat(v),y:p,x:i,height:w,width:a,stroke:"none",fill:n[k],fillOpacity:t,className:"recharts-cartesian-grid-bg"})});return Q.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function tCe(e){var n=e.vertical,t=n===void 0?!0:n,i=e.verticalFill,r=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,f=e.verticalPoints;if(!t||!i||!i.length)return null;var h=f.map(function(p){return Math.round(p+a-a)}).sort(function(p,v){return p-v});a!==h[0]&&h.unshift(0);var d=h.map(function(p,v){var b=!h[v+1],w=b?a+l-p:h[v+1]-p;if(w<=0)return null;var k=v%i.length;return Q.createElement("rect",{key:"react-".concat(v),x:p,y:o,width:w,height:c,stroke:"none",fill:i[k],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return Q.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var iCe=function(n,t){var i=n.xAxis,r=n.width,a=n.height,o=n.offset;return NV(LA(Qi(Qi(Qi({},ud.defaultProps),i),{},{ticks:es(i,!0),viewBox:{x:0,y:0,width:r,height:a}})),o.left,o.left+o.width,t)},rCe=function(n,t){var i=n.yAxis,r=n.width,a=n.height,o=n.offset;return NV(LA(Qi(Qi(Qi({},ud.defaultProps),i),{},{ticks:es(i,!0),viewBox:{x:0,y:0,width:r,height:a}})),o.top,o.top+o.height,t)},$c={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function nb(e){var n,t,i,r,a,o,l=NA(),c=$A(),f=V4e(),h=Qi(Qi({},e),{},{stroke:(n=e.stroke)!==null&&n!==void 0?n:$c.stroke,fill:(t=e.fill)!==null&&t!==void 0?t:$c.fill,horizontal:(i=e.horizontal)!==null&&i!==void 0?i:$c.horizontal,horizontalFill:(r=e.horizontalFill)!==null&&r!==void 0?r:$c.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:$c.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:$c.verticalFill,x:Ge(e.x)?e.x:f.left,y:Ge(e.y)?e.y:f.top,width:Ge(e.width)?e.width:f.width,height:Ge(e.height)?e.height:f.height}),d=h.x,p=h.y,v=h.width,b=h.height,w=h.syncWithTicks,k=h.horizontalValues,_=h.verticalValues,C=q4e(),x=H4e();if(!Ge(v)||v<=0||!Ge(b)||b<=0||!Ge(d)||d!==+d||!Ge(p)||p!==+p)return null;var E=h.verticalCoordinatesGenerator||iCe,j=h.horizontalCoordinatesGenerator||rCe,O=h.horizontalPoints,M=h.verticalPoints;if((!O||!O.length)&&qn(j)){var N=k&&k.length,q=j({yAxis:x?Qi(Qi({},x),{},{ticks:N?k:x.ticks}):void 0,width:l,height:c,offset:f},N?!0:w);as(Array.isArray(q),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Eu(q),"]")),Array.isArray(q)&&(O=q)}if((!M||!M.length)&&qn(E)){var R=_&&_.length,L=E({xAxis:C?Qi(Qi({},C),{},{ticks:R?_:C.ticks}):void 0,width:l,height:c,offset:f},R?!0:w);as(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Eu(L),"]")),Array.isArray(L)&&(M=L)}return Q.createElement("g",{className:"recharts-cartesian-grid"},Q.createElement(Q6e,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),Q.createElement(J6e,du({},h,{offset:f,horizontalPoints:O,xAxis:C,yAxis:x})),Q.createElement(eCe,du({},h,{offset:f,verticalPoints:M,xAxis:C,yAxis:x})),Q.createElement(nCe,du({},h,{horizontalPoints:O})),Q.createElement(tCe,du({},h,{verticalPoints:M})))}nb.displayName="CartesianGrid";var aCe=["type","layout","connectNulls","ref"],oCe=["key"];function Af(e){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Af(e)}function E$(e,n){if(e==null)return{};var t=sCe(e,n),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function sCe(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function Wh(){return Wh=Object.assign?Object.assign.bind():function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,i=new Array(n);td){v=[].concat(zc(c.slice(0,b)),[d-w]);break}var k=v.length%2===0?[0,p]:[p];return[].concat(zc(n.repeat(c,h)),zc(v),k).map(function(_){return"".concat(_,"px")}).join(", ")}),za(t,"id",rd("recharts-line-")),za(t,"pathRef",function(o){t.mainCurve=o}),za(t,"handleAnimationEnd",function(){t.setState({isAnimationFinished:!0}),t.props.onAnimationEnd&&t.props.onAnimationEnd()}),za(t,"handleAnimationStart",function(){t.setState({isAnimationFinished:!1}),t.props.onAnimationStart&&t.props.onAnimationStart()}),t}return gCe(n,e),hCe(n,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var i=this.getTotalLength();this.setState({totalLength:i})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var i=this.getTotalLength();i!==this.state.totalLength&&this.setState({totalLength:i})}}},{key:"getTotalLength",value:function(){var i=this.mainCurve;try{return i&&i.getTotalLength&&i.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(i,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,c=a.yAxis,f=a.layout,h=a.children,d=ka(h,Sp);if(!d)return null;var p=function(w,k){return{x:w.x,y:w.y,value:w.value,errorVal:dr(w.payload,k)}},v={clipPath:i?"url(#clipPath-".concat(r,")"):null};return Q.createElement(Bt,v,d.map(function(b){return Q.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:o,xAxis:l,yAxis:c,layout:f,dataPointFormatter:p})}))}},{key:"renderDots",value:function(i,r,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,f=l.points,h=l.dataKey,d=Wn(this.props,!1),p=Wn(c,!0),v=f.map(function(w,k){var _=Fr(Fr(Fr({key:"dot-".concat(k),r:3},d),p),{},{index:k,cx:w.x,cy:w.y,value:w.value,dataKey:h,payload:w.payload,points:f});return n.renderDotItem(c,_)}),b={clipPath:i?"url(#clipPath-".concat(r?"":"dots-").concat(a,")"):null};return Q.createElement(Bt,Wh({className:"recharts-line-dots",key:"dots"},b),v)}},{key:"renderCurveStatically",value:function(i,r,a,o){var l=this.props,c=l.type,f=l.layout,h=l.connectNulls;l.ref;var d=E$(l,aCe),p=Fr(Fr(Fr({},Wn(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:r?"url(#clipPath-".concat(a,")"):null,points:i},o),{},{type:c,layout:f,connectNulls:h});return Q.createElement(Jc,Wh({},p,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(i,r){var a=this,o=this.props,l=o.points,c=o.strokeDasharray,f=o.isAnimationActive,h=o.animationBegin,d=o.animationDuration,p=o.animationEasing,v=o.animationId,b=o.animateNewValues,w=o.width,k=o.height,_=this.state,C=_.prevPoints,x=_.totalLength;return Q.createElement(wo,{begin:h,duration:d,isActive:f,easing:p,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var j=E.t;if(C){var O=C.length/l.length,M=l.map(function(F,Y){var V=Math.floor(Y*O);if(C[V]){var $=C[V],P=Hi($.x,F.x),I=Hi($.y,F.y);return Fr(Fr({},F),{},{x:P(j),y:I(j)})}if(b){var H=Hi(w*2,F.x),U=Hi(k/2,F.y);return Fr(Fr({},F),{},{x:H(j),y:U(j)})}return Fr(Fr({},F),{},{x:F.x,y:F.y})});return a.renderCurveStatically(M,i,r)}var N=Hi(0,x),q=N(j),R;if(c){var L="".concat(c).split(/[,\s]+/gim).map(function(F){return parseFloat(F)});R=a.getStrokeDasharray(q,x,L)}else R=a.generateSimpleStrokeDasharray(x,q);return a.renderCurveStatically(l,i,r,{strokeDasharray:R})})}},{key:"renderCurve",value:function(i,r){var a=this.props,o=a.points,l=a.isAnimationActive,c=this.state,f=c.prevPoints,h=c.totalLength;return l&&o&&o.length&&(!f&&h>0||!vf(f,o))?this.renderCurveWithAnimation(i,r):this.renderCurveStatically(o,i,r)}},{key:"render",value:function(){var i,r=this.props,a=r.hide,o=r.dot,l=r.points,c=r.className,f=r.xAxis,h=r.yAxis,d=r.top,p=r.left,v=r.width,b=r.height,w=r.isAnimationActive,k=r.id;if(a||!l||!l.length)return null;var _=this.state.isAnimationFinished,C=l.length===1,x=pn("recharts-line",c),E=f&&f.allowDataOverflow,j=h&&h.allowDataOverflow,O=E||j,M=Yn(k)?this.id:k,N=(i=Wn(o,!1))!==null&&i!==void 0?i:{r:3,strokeWidth:2},q=N.r,R=q===void 0?3:q,L=N.strokeWidth,F=L===void 0?2:L,Y=LH(o)?o:{},V=Y.clipDot,$=V===void 0?!0:V,P=R*2+F;return Q.createElement(Bt,{className:x},E||j?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(M)},Q.createElement("rect",{x:E?p:p-v/2,y:j?d:d-b/2,width:E?v:v*2,height:j?b:b*2})),!$&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(M)},Q.createElement("rect",{x:p-P/2,y:d-P/2,width:v+P,height:b+P}))):null,!C&&this.renderCurve(O,M),this.renderErrorBar(O,M),(C||o)&&this.renderDots(O,$,M),(!w||_)&&fo.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(i,r){return i.animationId!==r.prevAnimationId?{prevAnimationId:i.animationId,curPoints:i.points,prevPoints:r.curPoints}:i.points!==r.curPoints?{curPoints:i.points}:null}},{key:"repeat",value:function(i,r){for(var a=i.length%2!==0?[].concat(zc(i),[0]):i,o=[],l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function kCe(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function hu(){return hu=Object.assign?Object.assign.bind():function(e){for(var n=1;n0||!vf(h,o)||!vf(d,l))?this.renderAreaWithAnimation(i,r):this.renderAreaStatically(o,l,i,r)}},{key:"render",value:function(){var i,r=this.props,a=r.hide,o=r.dot,l=r.points,c=r.className,f=r.top,h=r.left,d=r.xAxis,p=r.yAxis,v=r.width,b=r.height,w=r.isAnimationActive,k=r.id;if(a||!l||!l.length)return null;var _=this.state.isAnimationFinished,C=l.length===1,x=pn("recharts-area",c),E=d&&d.allowDataOverflow,j=p&&p.allowDataOverflow,O=E||j,M=Yn(k)?this.id:k,N=(i=Wn(o,!1))!==null&&i!==void 0?i:{r:3,strokeWidth:2},q=N.r,R=q===void 0?3:q,L=N.strokeWidth,F=L===void 0?2:L,Y=LH(o)?o:{},V=Y.clipDot,$=V===void 0?!0:V,P=R*2+F;return Q.createElement(Bt,{className:x},E||j?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(M)},Q.createElement("rect",{x:E?h:h-v/2,y:j?f:f-b/2,width:E?v:v*2,height:j?b:b*2})),!$&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(M)},Q.createElement("rect",{x:h-P/2,y:f-P/2,width:v+P,height:b+P}))):null,C?null:this.renderArea(O,M),(o||C)&&this.renderDots(O,$,M),(!w||_)&&fo.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(i,r){return i.animationId!==r.prevAnimationId?{prevAnimationId:i.animationId,curPoints:i.points,curBaseLine:i.baseLine,prevPoints:r.curPoints,prevBaseLine:r.curBaseLine}:i.points!==r.curPoints||i.baseLine!==r.curBaseLine?{curPoints:i.points,curBaseLine:i.baseLine}:null}}])})(A.PureComponent);SW=ms;so(ms,"displayName","Area");so(ms,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Fu.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});so(ms,"getBaseValue",function(e,n,t,i){var r=e.layout,a=e.baseValue,o=n.props.baseValue,l=o??a;if(Ge(l)&&typeof l=="number")return l;var c=r==="horizontal"?i:t,f=c.scale.domain();if(c.type==="number"){var h=Math.max(f[0],f[1]),d=Math.min(f[0],f[1]);return l==="dataMin"?d:l==="dataMax"||h<0?h:Math.max(Math.min(f[0],f[1]),0)}return l==="dataMin"?f[0]:l==="dataMax"?f[1]:f[0]});so(ms,"getComposedData",function(e){var n=e.props,t=e.item,i=e.xAxis,r=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,f=e.stackedData,h=e.dataStartIndex,d=e.displayedData,p=e.offset,v=n.layout,b=f&&f.length,w=SW.getBaseValue(n,t,i,r),k=v==="horizontal",_=!1,C=d.map(function(E,j){var O;b?O=f[h+j]:(O=dr(E,c),Array.isArray(O)?_=!0:O=[w,O]);var M=O[1]==null||b&&dr(E,c)==null;return k?{x:T1({axis:i,ticks:a,bandSize:l,entry:E,index:j}),y:M?null:r.scale(O[1]),value:O,payload:E}:{x:M?null:i.scale(O[1]),y:T1({axis:r,ticks:o,bandSize:l,entry:E,index:j}),value:O,payload:E}}),x;return b||_?x=C.map(function(E){var j=Array.isArray(E.value)?E.value[0]:null;return k?{x:E.x,y:j!=null&&E.y!=null?r.scale(j):null}:{x:j!=null?i.scale(j):null,y:E.y}}):x=k?r.scale(w):i.scale(w),Xs({points:C,baseLine:x,layout:v,isRange:_},p)});so(ms,"renderDotItem",function(e,n){var t;if(Q.isValidElement(e))t=Q.cloneElement(e,n);else if(qn(e))t=e(n);else{var i=pn("recharts-area-dot",typeof e!="boolean"?e.className:""),r=n.key,a=CW(n,wCe);t=Q.createElement(G0,hu({},a,{key:r,className:i}))}return t});function Of(e){"@babel/helpers - typeof";return Of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Of(e)}function ECe(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function TCe(e,n){for(var t=0;te.length)&&(n=e.length);for(var t=0,i=new Array(n);t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}function g9e(e,n){if(e==null)return{};var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(n.indexOf(i)>=0)continue;t[i]=e[i]}return t}function y9e(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function b9e(e,n){for(var t=0;te.length)&&(n=e.length);for(var t=0,i=new Array(n);t0?o:n&&n.length&&Ge(r)&&Ge(a)?n.slice(r,a+1):[]};function BW(e){return e==="number"?[0,"auto"]:void 0}var C6=function(n,t,i,r){var a=n.graphicalItems,o=n.tooltipAxis,l=tb(t,n);return i<0||!a||!a.length||i>=l.length?null:a.reduce(function(c,f){var h,d=(h=f.props.data)!==null&&h!==void 0?h:t;d&&n.dataStartIndex+n.dataEndIndex!==0&&n.dataEndIndex-n.dataStartIndex>=i&&(d=d.slice(n.dataStartIndex,n.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var v=d===void 0?l:d;p=t1(v,o.dataKey,r)}else p=d&&d[i]||l[i];return p?[].concat(Mf(c),[zV(f,p)]):c},[])},B$=function(n,t,i,r){var a=r||{x:n.chartX,y:n.chartY},o=M9e(a,i),l=n.orderedTooltipTicks,c=n.tooltipAxis,f=n.tooltipTicks,h=$_e(o,l,f,c);if(h>=0&&f){var d=f[h]&&f[h].value,p=C6(n,t,h,d),v=D9e(i,l,h,a);return{activeTooltipIndex:h,activeLabel:d,activePayload:p,activeCoordinate:v}}return null},R9e=function(n,t){var i=t.axes,r=t.graphicalItems,a=t.axisType,o=t.axisIdKey,l=t.stackGroups,c=t.dataStartIndex,f=t.dataEndIndex,h=n.layout,d=n.children,p=n.stackOffset,v=PV(h,a);return i.reduce(function(b,w){var k,_=w.type.defaultProps!==void 0?Ee(Ee({},w.type.defaultProps),w.props):w.props,C=_.type,x=_.dataKey,E=_.allowDataOverflow,j=_.allowDuplicatedCategory,O=_.scale,M=_.ticks,N=_.includeHidden,q=_[o];if(b[q])return b;var R=tb(n.data,{graphicalItems:r.filter(function(G){var z,X=o in G.props?G.props[o]:(z=G.type.defaultProps)===null||z===void 0?void 0:z[o];return X===q}),dataStartIndex:c,dataEndIndex:f}),L=R.length,F,Y,V;a9e(_.domain,E,C)&&(F=q4(_.domain,null,E),v&&(C==="number"||O!=="auto")&&(V=Uh(R,x,"category")));var $=BW(C);if(!F||F.length===0){var P,I=(P=_.domain)!==null&&P!==void 0?P:$;if(x){if(F=Uh(R,x,C),C==="category"&&v){var H=Ove(F);j&&H?(Y=F,F=F1(0,L)):j||(F=nN(I,F,w).reduce(function(G,z){return G.indexOf(z)>=0?G:[].concat(Mf(G),[z])},[]))}else if(C==="category")j?F=F.filter(function(G){return G!==""&&!Yn(G)}):F=nN(I,F,w).reduce(function(G,z){return G.indexOf(z)>=0||z===""||Yn(z)?G:[].concat(Mf(G),[z])},[]);else if(C==="number"){var U=F_e(R,r.filter(function(G){var z,X,ee=o in G.props?G.props[o]:(z=G.type.defaultProps)===null||z===void 0?void 0:z[o],re="hide"in G.props?G.props.hide:(X=G.type.defaultProps)===null||X===void 0?void 0:X.hide;return ee===q&&(N||!re)}),x,a,h);U&&(F=U)}v&&(C==="number"||O!=="auto")&&(V=Uh(R,x,"category"))}else v?F=F1(0,L):l&&l[q]&&l[q].hasStack&&C==="number"?F=p==="expand"?[0,1]:$V(l[q].stackGroups,c,f):F=RV(R,r.filter(function(G){var z=o in G.props?G.props[o]:G.type.defaultProps[o],X="hide"in G.props?G.props.hide:G.type.defaultProps.hide;return z===q&&(N||!X)}),C,h,!0);if(C==="number")F=_6(d,F,q,a,M),I&&(F=q4(I,F,E));else if(C==="category"&&I){var D=I,W=F.every(function(G){return D.indexOf(G)>=0});W&&(F=D)}}return Ee(Ee({},b),{},jn({},q,Ee(Ee({},_),{},{axisType:a,domain:F,categoricalDomain:V,duplicateDomain:Y,originalDomain:(k=_.domain)!==null&&k!==void 0?k:$,isCategorical:v,layout:h})))},{})},P9e=function(n,t){var i=t.graphicalItems,r=t.Axis,a=t.axisType,o=t.axisIdKey,l=t.stackGroups,c=t.dataStartIndex,f=t.dataEndIndex,h=n.layout,d=n.children,p=tb(n.data,{graphicalItems:i,dataStartIndex:c,dataEndIndex:f}),v=p.length,b=PV(h,a),w=-1;return i.reduce(function(k,_){var C=_.type.defaultProps!==void 0?Ee(Ee({},_.type.defaultProps),_.props):_.props,x=C[o],E=BW("number");if(!k[x]){w++;var j;return b?j=F1(0,v):l&&l[x]&&l[x].hasStack?(j=$V(l[x].stackGroups,c,f),j=_6(d,j,x,a)):(j=q4(E,RV(p,i.filter(function(O){var M,N,q=o in O.props?O.props[o]:(M=O.type.defaultProps)===null||M===void 0?void 0:M[o],R="hide"in O.props?O.props.hide:(N=O.type.defaultProps)===null||N===void 0?void 0:N.hide;return q===x&&!R}),"number",h),r.defaultProps.allowDataOverflow),j=_6(d,j,x,a)),Ee(Ee({},k),{},jn({},x,Ee(Ee({axisType:a},r.defaultProps),{},{hide:!0,orientation:wa(E9e,"".concat(a,".").concat(w%2),null),domain:j,originalDomain:E,isCategorical:b,layout:h})))}return k},{})},N9e=function(n,t){var i=t.axisType,r=i===void 0?"xAxis":i,a=t.AxisComp,o=t.graphicalItems,l=t.stackGroups,c=t.dataStartIndex,f=t.dataEndIndex,h=n.children,d="".concat(r,"Id"),p=ka(h,a),v={};return p&&p.length?v=R9e(n,{axes:p,graphicalItems:o,axisType:r,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:f}):o&&o.length&&(v=P9e(n,{Axis:a,graphicalItems:o,axisType:r,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:f})),v},$9e=function(n){var t=tl(n),i=es(t,!1,!0);return{tooltipTicks:i,orderedTooltipTicks:iA(i,function(r){return r.coordinate}),tooltipAxis:t,tooltipAxisBandSize:M1(t,i)}},F$=function(n){var t=n.children,i=n.defaultShowTooltip,r=Ur(t,wf),a=0,o=0;return n.data&&n.data.length!==0&&(o=n.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(a=r.props.startIndex),r.props.endIndex>=0&&(o=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!i}},z9e=function(n){return!n||!n.length?!1:n.some(function(t){var i=rs(t&&t.type);return i&&i.indexOf("Bar")>=0})},q$=function(n){return n==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:n==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:n==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},L9e=function(n,t){var i=n.props,r=n.graphicalItems,a=n.xAxisMap,o=a===void 0?{}:a,l=n.yAxisMap,c=l===void 0?{}:l,f=i.width,h=i.height,d=i.children,p=i.margin||{},v=Ur(d,wf),b=Ur(d,os),w=Object.keys(c).reduce(function(j,O){var M=c[O],N=M.orientation;return!M.mirror&&!M.hide?Ee(Ee({},j),{},jn({},N,j[N]+M.width)):j},{left:p.left||0,right:p.right||0}),k=Object.keys(o).reduce(function(j,O){var M=o[O],N=M.orientation;return!M.mirror&&!M.hide?Ee(Ee({},j),{},jn({},N,wa(j,"".concat(N))+M.height)):j},{top:p.top||0,bottom:p.bottom||0}),_=Ee(Ee({},k),w),C=_.bottom;v&&(_.bottom+=v.props.height||wf.defaultProps.height),b&&t&&(_=I_e(_,r,i,t));var x=f-_.left-_.right,E=h-_.top-_.bottom;return Ee(Ee({brushBottom:C},_),{},{width:Math.max(x,0),height:Math.max(E,0)})},I9e=function(n,t){if(t==="xAxis")return n[t].width;if(t==="yAxis")return n[t].height},BA=function(n){var t=n.chartName,i=n.GraphicalChild,r=n.defaultTooltipEventType,a=r===void 0?"axis":r,o=n.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=n.axisComponents,f=n.legendContent,h=n.formatAxisMap,d=n.defaultProps,p=function(_,C){var x=C.graphicalItems,E=C.stackGroups,j=C.offset,O=C.updateId,M=C.dataStartIndex,N=C.dataEndIndex,q=_.barSize,R=_.layout,L=_.barGap,F=_.barCategoryGap,Y=_.maxBarSize,V=q$(R),$=V.numericAxisName,P=V.cateAxisName,I=z9e(x),H=[];return x.forEach(function(U,D){var W=tb(_.data,{graphicalItems:[U],dataStartIndex:M,dataEndIndex:N}),G=U.type.defaultProps!==void 0?Ee(Ee({},U.type.defaultProps),U.props):U.props,z=G.dataKey,X=G.maxBarSize,ee=G["".concat($,"Id")],re=G["".concat(P,"Id")],le={},ye=c.reduce(function(qe,Ye){var We=C["".concat(Ye.axisType,"Map")],Ze=G["".concat(Ye.axisType,"Id")];We&&We[Ze]||Ye.axisType==="zAxis"||Ou();var Qe=We[Ze];return Ee(Ee({},qe),{},jn(jn({},Ye.axisType,Qe),"".concat(Ye.axisType,"Ticks"),es(Qe)))},le),ae=ye[P],ue=ye["".concat(P,"Ticks")],Se=E&&E[ee]&&E[ee].hasStack&&J_e(U,E[ee].stackGroups),ne=rs(U.type).indexOf("Bar")>=0,Le=M1(ae,ue),ke=[],je=I&&z_e({barSize:q,stackGroups:E,totalSize:I9e(ye,P)});if(ne){var Ne,ge,Ce=Yn(X)?Y:X,Pe=(Ne=(ge=M1(ae,ue,!0))!==null&&ge!==void 0?ge:Ce)!==null&&Ne!==void 0?Ne:0;ke=L_e({barGap:L,barCategoryGap:F,bandSize:Pe!==Le?Pe:Le,sizeList:je[re],maxBarSize:Ce}),Pe!==Le&&(ke=ke.map(function(qe){return Ee(Ee({},qe),{},{position:Ee(Ee({},qe.position),{},{offset:qe.position.offset-Pe/2})})}))}var ce=U&&U.type&&U.type.getComposedData;ce&&H.push({props:Ee(Ee({},ce(Ee(Ee({},ye),{},{displayedData:W,props:_,dataKey:z,item:U,bandSize:Le,barPosition:ke,offset:j,stackedData:Se,layout:R,dataStartIndex:M,dataEndIndex:N}))),{},jn(jn(jn({key:U.key||"item-".concat(D)},$,ye[$]),P,ye[P]),"animationId",O)),childIndex:Bve(U,_.children),item:U})}),H},v=function(_,C){var x=_.props,E=_.dataStartIndex,j=_.dataEndIndex,O=_.updateId;if(!vD({props:x}))return null;var M=x.children,N=x.layout,q=x.stackOffset,R=x.data,L=x.reverseStackOrder,F=q$(N),Y=F.numericAxisName,V=F.cateAxisName,$=ka(M,i),P=X_e(R,$,"".concat(Y,"Id"),"".concat(V,"Id"),q,L),I=c.reduce(function(G,z){var X="".concat(z.axisType,"Map");return Ee(Ee({},G),{},jn({},X,N9e(x,Ee(Ee({},z),{},{graphicalItems:$,stackGroups:z.axisType===Y&&P,dataStartIndex:E,dataEndIndex:j}))))},{}),H=L9e(Ee(Ee({},I),{},{props:x,graphicalItems:$}),C==null?void 0:C.legendBBox);Object.keys(I).forEach(function(G){I[G]=h(x,I[G],H,G.replace("Map",""),t)});var U=I["".concat(V,"Map")],D=$9e(U),W=p(x,Ee(Ee({},I),{},{dataStartIndex:E,dataEndIndex:j,updateId:O,graphicalItems:$,stackGroups:P,offset:H}));return Ee(Ee({formattedGraphicalItems:W,graphicalItems:$,offset:H,stackGroups:P},D),I)},b=(function(k){function _(C){var x,E,j;return y9e(this,_),j=k9e(this,_,[C]),jn(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),jn(j,"accessibilityManager",new r9e),jn(j,"handleLegendBBoxUpdate",function(O){if(O){var M=j.state,N=M.dataStartIndex,q=M.dataEndIndex,R=M.updateId;j.setState(Ee({legendBBox:O},v({props:j.props,dataStartIndex:N,dataEndIndex:q,updateId:R},Ee(Ee({},j.state),{},{legendBBox:O}))))}}),jn(j,"handleReceiveSyncEvent",function(O,M,N){if(j.props.syncId===O){if(N===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(M)}}),jn(j,"handleBrushChange",function(O){var M=O.startIndex,N=O.endIndex;if(M!==j.state.dataStartIndex||N!==j.state.dataEndIndex){var q=j.state.updateId;j.setState(function(){return Ee({dataStartIndex:M,dataEndIndex:N},v({props:j.props,dataStartIndex:M,dataEndIndex:N,updateId:q},j.state))}),j.triggerSyncEvent({dataStartIndex:M,dataEndIndex:N})}}),jn(j,"handleMouseEnter",function(O){var M=j.getMouseInfo(O);if(M){var N=Ee(Ee({},M),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var q=j.props.onMouseEnter;qn(q)&&q(N,O)}}),jn(j,"triggeredAfterMouseMove",function(O){var M=j.getMouseInfo(O),N=M?Ee(Ee({},M),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var q=j.props.onMouseMove;qn(q)&&q(N,O)}),jn(j,"handleItemMouseEnter",function(O){j.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),jn(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),jn(j,"handleMouseMove",function(O){O.persist(),j.throttleTriggeredAfterMouseMove(O)}),jn(j,"handleMouseLeave",function(O){j.throttleTriggeredAfterMouseMove.cancel();var M={isTooltipActive:!1};j.setState(M),j.triggerSyncEvent(M);var N=j.props.onMouseLeave;qn(N)&&N(M,O)}),jn(j,"handleOuterEvent",function(O){var M=Ive(O),N=wa(j.props,"".concat(M));if(M&&qn(N)){var q,R;/.*touch.*/i.test(M)?R=j.getMouseInfo(O.changedTouches[0]):R=j.getMouseInfo(O),N((q=R)!==null&&q!==void 0?q:{},O)}}),jn(j,"handleClick",function(O){var M=j.getMouseInfo(O);if(M){var N=Ee(Ee({},M),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var q=j.props.onClick;qn(q)&&q(N,O)}}),jn(j,"handleMouseDown",function(O){var M=j.props.onMouseDown;if(qn(M)){var N=j.getMouseInfo(O);M(N,O)}}),jn(j,"handleMouseUp",function(O){var M=j.props.onMouseUp;if(qn(M)){var N=j.getMouseInfo(O);M(N,O)}}),jn(j,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),jn(j,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&j.handleMouseDown(O.changedTouches[0])}),jn(j,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&j.handleMouseUp(O.changedTouches[0])}),jn(j,"handleDoubleClick",function(O){var M=j.props.onDoubleClick;if(qn(M)){var N=j.getMouseInfo(O);M(N,O)}}),jn(j,"handleContextMenu",function(O){var M=j.props.onContextMenu;if(qn(M)){var N=j.getMouseInfo(O);M(N,O)}}),jn(j,"triggerSyncEvent",function(O){j.props.syncId!==void 0&&oS.emit(sS,j.props.syncId,O,j.eventEmitterSymbol)}),jn(j,"applySyncEvent",function(O){var M=j.props,N=M.layout,q=M.syncMethod,R=j.state.updateId,L=O.dataStartIndex,F=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)j.setState(Ee({dataStartIndex:L,dataEndIndex:F},v({props:j.props,dataStartIndex:L,dataEndIndex:F,updateId:R},j.state)));else if(O.activeTooltipIndex!==void 0){var Y=O.chartX,V=O.chartY,$=O.activeTooltipIndex,P=j.state,I=P.offset,H=P.tooltipTicks;if(!I)return;if(typeof q=="function")$=q(H,O);else if(q==="value"){$=-1;for(var U=0;U=0){var Se,ne;if(Y.dataKey&&!Y.allowDuplicatedCategory){var Le=typeof Y.dataKey=="function"?ue:"payload.".concat(Y.dataKey.toString());Se=t1(U,Le,$),ne=D&&W&&t1(W,Le,$)}else Se=U==null?void 0:U[V],ne=D&&W&&W[V];if(re||ee){var ke=O.props.activeIndex!==void 0?O.props.activeIndex:V;return[A.cloneElement(O,Ee(Ee(Ee({},q.props),ye),{},{activeIndex:ke})),null,null]}if(!Yn(Se))return[ae].concat(Mf(j.renderActivePoints({item:q,activePoint:Se,basePoint:ne,childIndex:V,isRange:D})))}else{var je,Ne=(je=j.getItemByXY(j.state.activeCoordinate))!==null&&je!==void 0?je:{graphicalItem:ae},ge=Ne.graphicalItem,Ce=ge.item,Pe=Ce===void 0?O:Ce,ce=ge.childIndex,qe=Ee(Ee(Ee({},q.props),ye),{},{activeIndex:ce});return[A.cloneElement(Pe,qe),null,null]}return D?[ae,null,null]:[ae,null]}),jn(j,"renderCustomized",function(O,M,N){return A.cloneElement(O,Ee(Ee({key:"recharts-customized-".concat(N)},j.props),j.state))}),jn(j,"renderMap",{CartesianGrid:{handler:cg,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:cg},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:cg},YAxis:{handler:cg},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((x=C.id)!==null&&x!==void 0?x:rd("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=MU(j.triggeredAfterMouseMove,(E=C.throttleDelay)!==null&&E!==void 0?E:1e3/60),j.state={},j}return S9e(_,k),w9e(_,[{key:"componentDidMount",value:function(){var x,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,E=x.children,j=x.data,O=x.height,M=x.layout,N=Ur(E,va);if(N){var q=N.props.defaultIndex;if(!(typeof q!="number"||q<0||q>this.state.tooltipTicks.length-1)){var R=this.state.tooltipTicks[q]&&this.state.tooltipTicks[q].value,L=C6(this.state,j,q,R),F=this.state.tooltipTicks[q].coordinate,Y=(this.state.offset.top+O)/2,V=M==="horizontal",$=V?{x:F,y:Y}:{y:F,x:Y},P=this.state.formattedGraphicalItems.find(function(H){var U=H.item;return U.type.name==="Scatter"});P&&($=Ee(Ee({},$),P.props.points[q].tooltipPosition),L=P.props.points[q].tooltipPayload);var I={activeTooltipIndex:q,isTooltipActive:!0,activeLabel:R,activePayload:L,activeCoordinate:$};this.setState(I),this.renderCursor(N),this.accessibilityManager.setIndex(q)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var j,O;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(x){c4([Ur(x.children,va)],[Ur(this.props.children,va)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Ur(this.props.children,va);if(x&&typeof x.props.shared=="boolean"){var E=x.props.shared?"axis":"item";return l.indexOf(E)>=0?E:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var E=this.container,j=E.getBoundingClientRect(),O=A0e(j),M={chartX:Math.round(x.pageX-O.left),chartY:Math.round(x.pageY-O.top)},N=j.width/E.offsetWidth||1,q=this.inRange(M.chartX,M.chartY,N);if(!q)return null;var R=this.state,L=R.xAxisMap,F=R.yAxisMap,Y=this.getTooltipEventType(),V=B$(this.state,this.props.data,this.props.layout,q);if(Y!=="axis"&&L&&F){var $=tl(L).scale,P=tl(F).scale,I=$&&$.invert?$.invert(M.chartX):null,H=P&&P.invert?P.invert(M.chartY):null;return Ee(Ee({},M),{},{xValue:I,yValue:H},V)}return V?Ee(Ee({},M),V):null}},{key:"inRange",value:function(x,E){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,M=x/j,N=E/j;if(O==="horizontal"||O==="vertical"){var q=this.state.offset,R=M>=q.left&&M<=q.left+q.width&&N>=q.top&&N<=q.top+q.height;return R?{x:M,y:N}:null}var L=this.state,F=L.angleAxisMap,Y=L.radiusAxisMap;if(F&&Y){var V=tl(F);return rN({x:M,y:N},V)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,E=this.getTooltipEventType(),j=Ur(x,va),O={};j&&E==="axis"&&(j.props.trigger==="click"?O={onClick:this.handleClick}:O={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var M=i1(this.props,this.handleOuterEvent);return Ee(Ee({},M),O)}},{key:"addListener",value:function(){oS.on(sS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){oS.removeListener(sS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,E,j){for(var O=this.state.formattedGraphicalItems,M=0,N=O.length;M({root:{"--chart-text-color":n?lt(n,e):void 0,"--chart-grid-color":t?lt(t,e):void 0,"--chart-cursor-fill":i?lt(i,e):void 0,"--chart-bar-label-color":r?lt(r,e):void 0}});function V9e(e,n){let t=0,i=0;return e.map(r=>{if(r.standalone)for(const a in r)typeof r[a]=="number"&&a!==n&&(r[a]=[0,r[a]]);else for(const a in r)typeof r[a]=="number"&&a!==n&&(i+=r[a],r[a]=[t,i],t=i);return r})}function W9e(e,n){return typeof e=="function"?e(n).fill:e==null?void 0:e.fill}const ll=De(e=>{const n=be("BarChart",U9e,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,data:c,withLegend:f,legendProps:h,series:d,onMouseLeave:p,dataKey:v,withTooltip:b,withXAxis:w,withYAxis:k,gridAxis:_,tickLine:C,xAxisProps:x,yAxisProps:E,unit:j,tooltipAnimationDuration:O,strokeDasharray:M,gridProps:N,tooltipProps:q,referenceLines:R,fillOpacity:L,barChartProps:F,type:Y,orientation:V,dir:$,valueFormatter:P,children:I,barProps:H,xAxisLabel:U,yAxisLabel:D,withBarValueLabel:W,valueLabelProps:G,withRightYAxis:z,rightYAxisLabel:X,rightYAxisProps:ee,minBarSize:re,maxBarWidth:le,mod:ye,getBarColor:ae,gridColor:ue,textColor:Se,attributes:ne,...Le}=n,ke=ui(),je=_!=="none"&&(C==="x"||C==="xy"),Ne=_!=="none"&&(C==="y"||C==="xy"),[ge,Ce]=A.useState(null),Pe=ge!==null,ce=Y==="stacked"||Y==="percent",qe=Y==="percent"?H9e:P,Ye=Ae=>{Ce(null),p==null||p(Ae)},{resolvedClassNames:We,resolvedStyles:Ze}=Wi({classNames:t,styles:a,props:n}),Qe=Y==="waterfall"?V9e(c,v):c,ie=Xe({name:"BarChart",classes:C0,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:ne,vars:l,varsResolver:FW}),ve=d.map(Ae=>{const an=lt(Ae.color,ke),mn=Pe&&ge!==Ae.name,En=typeof H=="function"?H(Ae):H,vn=En==null?void 0:En.shape;return A.createElement(Vu,{...ie("bar"),key:Ae.name,name:Ae.name,dataKey:Ae.name,fill:an,stroke:an,isAnimationActive:!1,fillOpacity:mn?.1:L,strokeOpacity:mn?.2:0,stackId:ce?"stack":Ae.stackId||void 0,yAxisId:Ae.yAxisId||void 0,minPointSize:re,...En,shape:sn=>{const en=sn.payload,zn=en!=null&&en.color?lt(en.color,ke):typeof ae=="function"?lt(ae(en==null?void 0:en[Ae.name],Ae),ke):W9e(H,Ae)||an,Re={...sn,fill:zn};return typeof vn=="function"?vn(Re):Q.isValidElement(vn)?Q.cloneElement(vn,Re):typeof vn=="object"&&vn?g.jsx($m,{...Re,...vn}):g.jsx($m,{...Re})}},W&&g.jsx(fo,{position:V==="vertical"?"right":"top",fontSize:12,fill:"var(--chart-bar-label-color, var(--mantine-color-dimmed))",formatter:sn=>qe==null?void 0:qe(sn),...typeof G=="function"?G(Ae):G}))}),Ke=R==null?void 0:R.map((Ae,an)=>{const mn=lt(Ae.color,ke);return g.jsx(Cp,{stroke:Ae.color?mn:"var(--chart-grid-color)",strokeWidth:1,yAxisId:Ae.yAxisId||void 0,...Ae,label:{fill:Ae.color?mn:"currentColor",fontSize:12,position:Ae.labelPosition??"insideBottomLeft",...typeof Ae.label=="object"?Ae.label:{value:Ae.label}},...ie("referenceLine")},an)}),Je={axisLine:!1,...V==="vertical"?{dataKey:v,type:"category"}:{type:"number"},tickLine:Ne?{stroke:"currentColor"}:!1,allowDecimals:!0,unit:j,tickFormatter:V==="vertical"?void 0:qe,...ie("axis")};return g.jsx(he,{...ie("root"),onMouseLeave:Ye,dir:$||"ltr",mod:[{orientation:V},ye],...Le,children:g.jsx(aA,{...ie("container"),children:g.jsxs(F9e,{data:Qe,stackOffset:Y==="percent"?"expand":void 0,layout:V,maxBarSize:le,margin:{bottom:U?30:void 0,left:D?10:void 0,right:D?5:void 0},...F,children:[f&&g.jsx(os,{verticalAlign:"top",content:Ae=>g.jsx(S0,{payload:Ae.payload,onHighlight:Ce,legendPosition:(h==null?void 0:h.verticalAlign)||"top",classNames:We,styles:Ze,series:d,showColor:Y!=="waterfall",attributes:ne}),...h}),g.jsxs(Dl,{hide:!w,...V==="vertical"?{type:"number"}:{dataKey:v},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:je?{stroke:"currentColor"}:!1,minTickGap:5,tickFormatter:V==="vertical"?qe:void 0,...ie("axis"),...x,children:[U&&g.jsx(ii,{position:"insideBottom",offset:-20,fontSize:12,...ie("axisLabel"),children:U}),x==null?void 0:x.children]}),g.jsxs(ko,{orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!k,...Je,...E,children:[D&&g.jsx(ii,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...ie("axisLabel"),children:D}),E==null?void 0:E.children]}),g.jsxs(ko,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!z,...Je,...ee,children:[X&&g.jsx(ii,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...ie("axisLabel"),children:X}),E==null?void 0:E.children]}),g.jsx(nb,{strokeDasharray:M,vertical:_==="y"||_==="xy",horizontal:_==="x"||_==="xy",...ie("grid"),...N}),b&&g.jsx(va,{animationDuration:O,isAnimationActive:O!==0,position:V==="vertical"?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray:M,fill:"var(--chart-cursor-fill)"},content:({label:Ae,payload:an,labelFormatter:mn})=>g.jsx($9,{label:mn&&an?mn(Ae,an):Ae,payload:an,type:Y==="waterfall"?"scatter":void 0,unit:j,classNames:We,styles:Ze,series:d,valueFormatter:P,attributes:ne}),...q}),ve,Ke,I]})})})});ll.displayName="@mantine/charts/BarChart";ll.classes=C0;ll.varsResolver=FW;const G9e={withXAxis:!0,withYAxis:!0,withTooltip:!0,tooltipAnimationDuration:0,fillOpacity:1,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",withDots:!0,connectNulls:!0,strokeWidth:2,curveType:"monotone",gradientStops:[{offset:0,color:"red"},{offset:100,color:"blue"}]},qW=(e,{textColor:n,gridColor:t})=>({root:{"--chart-text-color":n?lt(n,e):void 0,"--chart-grid-color":t?lt(t,e):void 0}}),ib=De(e=>{const n=be("LineChart",G9e,e),{classNames:t,className:i,style:r,styles:a,unstyled:o,vars:l,data:c,withLegend:f,legendProps:h,series:d,onMouseLeave:p,dataKey:v,withTooltip:b,withXAxis:w,withYAxis:k,gridAxis:_,tickLine:C,xAxisProps:x,yAxisProps:E,unit:j,tooltipAnimationDuration:O,strokeDasharray:M,gridProps:N,tooltipProps:q,referenceLines:R,withDots:L,dotProps:F,activeDotProps:Y,strokeWidth:V,lineChartProps:$,connectNulls:P,fillOpacity:I,curveType:H,orientation:U,dir:D,valueFormatter:W,children:G,lineProps:z,xAxisLabel:X,yAxisLabel:ee,type:re,gradientStops:le,withRightYAxis:ye,rightYAxisLabel:ae,rightYAxisProps:ue,withPointLabels:Se,attributes:ne,gridColor:Le,...ke}=n,je=ui(),Ne=_!=="none"&&(C==="x"||C==="xy"),ge=_!=="none"&&(C==="y"||C==="xy"),[Ce,Pe]=A.useState(null),ce=Ce!==null,qe=Ae=>{Pe(null),p==null||p(Ae)},{resolvedClassNames:Ye,resolvedStyles:We}=Wi({classNames:t,styles:a,props:n}),Ze=Xe({name:"LineChart",classes:C0,props:n,className:i,style:r,classNames:t,styles:a,unstyled:o,attributes:ne,vars:l,varsResolver:qW}),Qe=`line-chart-gradient-${Vi()}`,ie=le==null?void 0:le.map(Ae=>g.jsx("stop",{offset:`${Ae.offset}%`,stopColor:lt(Ae.color,je)},Ae.color)),ve=d.map(Ae=>{const an=lt(Ae.color,je),mn=ce&&Ce!==Ae.name;return A.createElement(Ap,{...Ze("line"),key:Ae.name,name:Ae.name,dataKey:Ae.name,dot:L?{fillOpacity:mn?0:1,strokeOpacity:mn?0:1,strokeWidth:1,fill:re==="gradient"?"var(--mantine-color-gray-7)":an,stroke:re==="gradient"?"white":an,...F}:!1,activeDot:L?{fill:re==="gradient"?"var(--mantine-color-gray-7)":an,stroke:re==="gradient"?"white":an,...Y}:!1,fill:an,stroke:re==="gradient"?`url(#${Qe})`:an,strokeWidth:V,isAnimationActive:!1,fillOpacity:mn?0:I,strokeOpacity:mn?.5:I,connectNulls:P,type:Ae.curveType??H,strokeDasharray:Ae.strokeDasharray,yAxisId:Ae.yAxisId||void 0,label:Se?g.jsx(Ipe,{valueFormatter:W}):void 0,...typeof z=="function"?z(Ae):z})}),Ke=R==null?void 0:R.map((Ae,an)=>{const mn=lt(Ae.color,je);return g.jsx(Cp,{stroke:Ae.color?mn:"var(--chart-grid-color)",strokeWidth:1,yAxisId:Ae.yAxisId||void 0,...Ae,label:{fill:Ae.color?mn:"currentColor",fontSize:12,position:Ae.labelPosition??"insideBottomLeft",...typeof Ae.label=="object"?Ae.label:{value:Ae.label}},...Ze("referenceLine")},an)}),Je={axisLine:!1,...U==="vertical"?{dataKey:v,type:"category"}:{type:"number"},tickLine:ge?{stroke:"currentColor"}:!1,allowDecimals:!0,unit:j,tickFormatter:U==="vertical"?void 0:W,...Ze("axis")};return g.jsx(he,{...Ze("root"),onMouseLeave:qe,dir:D||"ltr",...ke,children:g.jsx(aA,{...Ze("container"),children:g.jsxs(B9e,{data:c,layout:U,margin:{bottom:X?30:void 0,left:ee?10:void 0,right:ee?5:void 0},...$,children:[re==="gradient"&&g.jsx("defs",{children:g.jsx("linearGradient",{id:Qe,x1:"0",y1:"0",x2:"0",y2:"1",children:ie})}),f&&g.jsx(os,{verticalAlign:"top",content:Ae=>g.jsx(S0,{payload:Ae.payload,onHighlight:Pe,legendPosition:(h==null?void 0:h.verticalAlign)||"top",classNames:Ye,styles:We,series:d,showColor:re!=="gradient",attributes:ne}),...h}),g.jsxs(Dl,{hide:!w,...U==="vertical"?{type:"number"}:{dataKey:v},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:Ne?{stroke:"currentColor"}:!1,minTickGap:5,tickFormatter:U==="vertical"?W:void 0,...Ze("axis"),...x,children:[X&&g.jsx(ii,{position:"insideBottom",offset:-20,fontSize:12,...Ze("axisLabel"),children:X}),x==null?void 0:x.children]}),g.jsxs(ko,{tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!k,...Je,...E,children:[ee&&g.jsx(ii,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...Ze("axisLabel"),children:ee}),E==null?void 0:E.children]}),g.jsxs(ko,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!ye,...Je,...ue,children:[ae&&g.jsx(ii,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...Ze("axisLabel"),children:ae}),E==null?void 0:E.children]}),g.jsx(nb,{strokeDasharray:M,vertical:_==="y"||_==="xy",horizontal:_==="x"||_==="xy",...Ze("grid"),...N}),b&&g.jsx(va,{animationDuration:O,isAnimationActive:O!==0,position:U==="vertical"?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray:M},content:({label:Ae,payload:an,labelFormatter:mn})=>g.jsx($9,{label:mn&&an?mn(Ae,an):Ae,payload:an,unit:j,classNames:Ye,styles:We,series:d,valueFormatter:W,showColor:re!=="gradient",attributes:ne}),...q}),ve,Ke,G]})})})});ib.displayName="@mantine/charts/LineChart";ib.classes=C0;ib.varsResolver=qW;const H$="daily_report_prompt",uS="Eres un coach de equipo. Resume el reporte diario en un MAXIMO de 4 frases cortas, mencionando: (1) total de tareas hechas y quien destaco, (2) cualquier card reabierta o deadline vencido que merezca atencion, (3) cards estancadas criticas (30+ dias) si las hay, (4) una frase corta de animo o aviso si toca. Tono natural, primera persona del plural, sin emojis. No inventes datos; usa solo los del JSON del reporte.";function Y9e(e){try{return new Date(e+"T00:00:00").toLocaleDateString("es-ES",{weekday:"long",day:"2-digit",month:"long",year:"numeric"})}catch{return e}}function Lc({label:e,value:n,color:t,icon:i,sub:r}){return g.jsxs(Dt,{p:"sm",withBorder:!0,radius:"md",children:[g.jsxs(ze,{gap:6,mb:2,align:"center",children:[i,g.jsx(xe,{size:"xs",c:"dimmed",tt:"uppercase",fw:600,children:e})]}),g.jsx(xe,{fz:28,fw:700,c:t,children:n}),r&&g.jsx(xe,{size:"xs",c:"dimmed",children:r})]})}function fg({title:e,rows:n,emptyText:t,withAvatar:i=!1}){return g.jsxs(La,{withBorder:!0,radius:"md",p:"sm",children:[g.jsx(xe,{fw:600,size:"sm",mb:6,children:e}),n.length===0?g.jsx(xe,{size:"xs",c:"dimmed",children:t}):g.jsx($n,{gap:4,children:n.map((r,a)=>g.jsxs(ze,{gap:6,wrap:"nowrap",justify:"space-between",children:[g.jsxs(ze,{gap:6,wrap:"nowrap",style:{minWidth:0,flex:1},children:[i&&g.jsx(go,{size:22,radius:"xl",color:yl(r.name||String(a)),children:(r.name||"?").slice(0,2).toUpperCase()}),g.jsx(xe,{size:"sm",truncate:!0,children:r.name||"(sin nombre)"})]}),g.jsx(it,{size:"sm",variant:"light",color:a===0?"teal":"gray",children:r.count})]},(r.user_id||r.name)+a))})]})}function K9e({date:e,onJumpToCard:n}){const[t,i]=A.useState(null),[r,a]=A.useState(null),[o,l]=A.useState(null),[c,f]=A.useState(!1),[h,d]=A.useState(null),[p,v]=A.useState(!1),[b,w]=A.useState(""),[k,_]=A.useState(null),[C,x]=A.useState(null);A.useEffect(()=>{i(null),a(null),Kie(e).then(i).catch($=>a($.message)),l(null),d(null),Xie(e).then($=>l($.exists?$:null)).catch(()=>{})},[e]);const E=async()=>{f(!0),d(null);try{const $=await Zie(e);l({...$,exists:!0})}catch($){d($.message)}finally{f(!1)}},j=async()=>{try{const $=await Qie(H$);w($.value||uS)}catch{w(uS)}v(!0)},O=async()=>{await Jie(H$,b),v(!1)},M=()=>w(uS),N=A.useMemo(()=>t?t.hourly_moves.map(($,P)=>({hora:String(P).padStart(2,"0")+":00",movimientos:$})):[],[t]),q=A.useMemo(()=>{if(!t)return[];const $=new Set;for(const P of t.done_cards)P.requester&&$.add(P.requester);return Array.from($).sort()},[t]),R=A.useMemo(()=>{if(!t)return[];const $=new Map;for(const P of t.done_cards)P.assignee_id&&$.set(P.assignee_id,P.assignee_name||P.assignee_id);return Array.from($.entries()).map(([P,I])=>({value:P,label:I}))},[t]),L=A.useMemo(()=>t?t.done_cards.filter($=>!(k&&$.requester!==k||C&&$.assignee_id!==C)):[],[t,k,C]),F=()=>{if(!t)return;const $=window.open("","_blank");if(!$)return;const P=window.location.origin,I=(()=>{try{return new Date(t.date+"T00:00:00").toLocaleDateString("es-ES",{weekday:"long",day:"2-digit",month:"long",year:"numeric"})}catch{return t.date}})(),H=[];if(k&&H.push(`solicitante=${k}`),C){const G=R.find(z=>z.value===C);H.push(`asignado=${(G==null?void 0:G.label)||C}`)}const U=G=>G.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),D=L.map(G=>{const z=(G.tags||[]).map(U).join(", "),X=`${P}/?card=${G.id}`;return` + ${String(G.seq_num).padStart(5,"0")} + ${U(G.title)} + ${U(G.requester||"")} + ${U(G.assignee_name||"")} + ${U(z)} + ${Jt(G.lead_time_ms)} + `}).join(""),W=` + +Reporte ${t.date} + +

Reporte diario · ${U(I)}

+
${U(t.date)} · ${U(t.tz)}${H.length?" · filtros: "+H.map(U).join(", "):""}
+
+
Hechas
${L.length}
+
Lead time avg
${Jt(t.lead_time.avg_ms)}
+
Deadlines on-time
${t.deadlines.met}/${t.deadlines.met+t.deadlines.missed}
+
Reabiertas
${t.kpis.reopened}
+
+${o!=null&&o.summary?`

${U(o.summary)}

`:""} + + + + + + + + + + ${D||''} +
#TituloSolicitanteAsignadoTagsLead time
Sin tareas que cumplan el filtro.
+
Generado por kanban · ${U(P)}
+ + diff --git a/backend/events.go b/backend/events.go new file mode 100644 index 0000000..e34cafe --- /dev/null +++ b/backend/events.go @@ -0,0 +1,158 @@ +package main + +import ( + "encoding/json" + "sync" + "sync/atomic" + "time" +) + +// EventHub is an in-process pub/sub used to push board mutations and +// notifications to connected clients (SSE for board-wide events, WS for +// per-card chat). Drop policy on slow consumers: best-effort send; if a +// subscriber's buffered channel is full the event is dropped and the +// hub increments dropCount. Clients are expected to reconcile state via +// a full reload when reconnecting. +type EventHub struct { + mu sync.RWMutex + userSubs map[string]map[chan Event]struct{} + cardSubs map[string]map[chan Event]struct{} + dropCount uint64 +} + +// Event is the envelope broadcast to subscribers. +// +// Type — discriminator (e.g. "card.updated", "message.created"). +// CardID — set when payload pertains to a specific card. +// UserID — set for per-user private events (e.g. notifications). Empty +// means broadcast to every user subscriber. +// Payload — arbitrary JSON describing the change. +// TS — RFC3339 timestamp. +type Event struct { + Type string `json:"type"` + CardID string `json:"card_id,omitempty"` + UserID string `json:"user_id,omitempty"` + Payload json.RawMessage `json:"payload,omitempty"` + TS string `json:"ts"` +} + +const eventBufSize = 64 + +func NewEventHub() *EventHub { + return &EventHub{ + userSubs: map[string]map[chan Event]struct{}{}, + cardSubs: map[string]map[chan Event]struct{}{}, + } +} + +// SubscribeUser returns a channel that receives every public event plus +// private events targeted at userID. Caller MUST eventually call +// UnsubscribeUser to release resources. +func (h *EventHub) SubscribeUser(userID string) chan Event { + ch := make(chan Event, eventBufSize) + h.mu.Lock() + set, ok := h.userSubs[userID] + if !ok { + set = map[chan Event]struct{}{} + h.userSubs[userID] = set + } + set[ch] = struct{}{} + h.mu.Unlock() + return ch +} + +func (h *EventHub) UnsubscribeUser(userID string, ch chan Event) { + h.mu.Lock() + if set, ok := h.userSubs[userID]; ok { + delete(set, ch) + if len(set) == 0 { + delete(h.userSubs, userID) + } + } + h.mu.Unlock() + close(ch) +} + +// SubscribeCard returns a channel that receives events scoped to cardID +// (chat messages + typing indicators). +func (h *EventHub) SubscribeCard(cardID string) chan Event { + ch := make(chan Event, eventBufSize) + h.mu.Lock() + set, ok := h.cardSubs[cardID] + if !ok { + set = map[chan Event]struct{}{} + h.cardSubs[cardID] = set + } + set[ch] = struct{}{} + h.mu.Unlock() + return ch +} + +func (h *EventHub) UnsubscribeCard(cardID string, ch chan Event) { + h.mu.Lock() + if set, ok := h.cardSubs[cardID]; ok { + delete(set, ch) + if len(set) == 0 { + delete(h.cardSubs, cardID) + } + } + h.mu.Unlock() + close(ch) +} + +// Publish delivers ev to every matching subscriber. If ev.UserID is set +// it is delivered ONLY to that user's subscribers; otherwise it fans out +// to all user subscribers. Card subscribers ALWAYS receive events that +// match ev.CardID. Best-effort: full channels are skipped. +func (h *EventHub) Publish(ev Event) { + if ev.TS == "" { + ev.TS = time.Now().UTC().Format(time.RFC3339) + } + h.mu.RLock() + defer h.mu.RUnlock() + + deliver := func(ch chan Event) { + select { + case ch <- ev: + default: + atomic.AddUint64(&h.dropCount, 1) + } + } + + if ev.UserID != "" { + if set, ok := h.userSubs[ev.UserID]; ok { + for ch := range set { + deliver(ch) + } + } + } else { + for _, set := range h.userSubs { + for ch := range set { + deliver(ch) + } + } + } + if ev.CardID != "" { + if set, ok := h.cardSubs[ev.CardID]; ok { + for ch := range set { + deliver(ch) + } + } + } +} + +func (h *EventHub) DropCount() uint64 { + return atomic.LoadUint64(&h.dropCount) +} + +// PublishJSON marshals payload and publishes a single Event. +func (h *EventHub) PublishJSON(typ, cardID, userID string, payload interface{}) { + var raw json.RawMessage + if payload != nil { + b, err := json.Marshal(payload) + if err == nil { + raw = b + } + } + h.Publish(Event{Type: typ, CardID: cardID, UserID: userID, Payload: raw}) +} diff --git a/backend/events_test.go b/backend/events_test.go new file mode 100644 index 0000000..eb0ca99 --- /dev/null +++ b/backend/events_test.go @@ -0,0 +1,146 @@ +package main + +import ( + "sync" + "sync/atomic" + "testing" + "time" +) + +func TestEventHub_BroadcastToAllUsers(t *testing.T) { + hub := NewEventHub() + chA := hub.SubscribeUser("alice") + chB := hub.SubscribeUser("bob") + defer hub.UnsubscribeUser("alice", chA) + defer hub.UnsubscribeUser("bob", chB) + + hub.PublishJSON("card.updated", "c1", "", map[string]string{"id": "c1"}) + + for _, ch := range []chan Event{chA, chB} { + select { + case ev := <-ch: + if ev.Type != "card.updated" { + t.Fatalf("type = %q, want card.updated", ev.Type) + } + case <-time.After(time.Second): + t.Fatal("timeout waiting for event") + } + } +} + +func TestEventHub_PrivateUserEvent(t *testing.T) { + hub := NewEventHub() + chA := hub.SubscribeUser("alice") + chB := hub.SubscribeUser("bob") + defer hub.UnsubscribeUser("alice", chA) + defer hub.UnsubscribeUser("bob", chB) + + hub.PublishJSON("notification.created", "", "alice", map[string]string{"foo": "bar"}) + + select { + case ev := <-chA: + if ev.UserID != "alice" { + t.Fatalf("user_id = %q, want alice", ev.UserID) + } + case <-time.After(time.Second): + t.Fatal("alice did not get private event") + } + + select { + case ev := <-chB: + t.Fatalf("bob received private event for alice: %+v", ev) + case <-time.After(100 * time.Millisecond): + // expected + } +} + +func TestEventHub_CardSubscription(t *testing.T) { + hub := NewEventHub() + ch := hub.SubscribeCard("card-1") + defer hub.UnsubscribeCard("card-1", ch) + + hub.PublishJSON("message.created", "card-1", "", map[string]string{"id": "m1"}) + hub.PublishJSON("message.created", "card-2", "", map[string]string{"id": "m2"}) + + select { + case ev := <-ch: + if ev.CardID != "card-1" { + t.Fatalf("card_id = %q, want card-1", ev.CardID) + } + case <-time.After(time.Second): + t.Fatal("timeout") + } + select { + case ev := <-ch: + t.Fatalf("received unexpected event for other card: %+v", ev) + case <-time.After(100 * time.Millisecond): + } +} + +func TestEventHub_DropPolicyOnSlowConsumer(t *testing.T) { + hub := NewEventHub() + ch := hub.SubscribeUser("slow") + defer hub.UnsubscribeUser("slow", ch) + + // Fill the buffer + N extra to force drops. + const extra = 50 + for i := 0; i < eventBufSize+extra; i++ { + hub.PublishJSON("noise", "", "slow", nil) + } + if got := hub.DropCount(); got < extra { + t.Fatalf("DropCount = %d, want >= %d", got, extra) + } +} + +func TestEventHub_UnsubscribeRemoves(t *testing.T) { + hub := NewEventHub() + ch := hub.SubscribeUser("alice") + hub.UnsubscribeUser("alice", ch) + // channel must be closed + select { + case _, ok := <-ch: + if ok { + t.Fatal("expected closed channel") + } + default: + // channel could be drained-and-closed + } + // Publish should not panic and should not deliver anywhere. + hub.PublishJSON("noise", "", "alice", nil) +} + +func TestEventHub_ConcurrentPublishers(t *testing.T) { + hub := NewEventHub() + ch := hub.SubscribeUser("u") + defer hub.UnsubscribeUser("u", ch) + + var received atomic.Uint64 + done := make(chan struct{}) + go func() { + for range ch { + received.Add(1) + } + close(done) + }() + + var wg sync.WaitGroup + const writers = 10 + const each = 100 + for i := 0; i < writers; i++ { + wg.Add(1) + go func() { + defer wg.Done() + for j := 0; j < each; j++ { + hub.PublishJSON("ping", "", "u", nil) + } + }() + } + wg.Wait() + // Give the consumer time to drain. + time.Sleep(200 * time.Millisecond) + got := received.Load() + dropped := hub.DropCount() + if got+dropped < writers*each { + t.Fatalf("received=%d drop=%d want sum >= %d", got, dropped, writers*each) + } +} diff --git a/backend/handlers.go b/backend/handlers.go index 34db7f8..ecc59c4 100644 --- a/backend/handlers.go +++ b/backend/handlers.go @@ -74,8 +74,21 @@ func handleGetBoard(db *DB) http.HandlerFunc { } } +// publishInvalidated emits a board.invalidated event so connected clients +// refetch /api/board. Best-effort: dropped events recover on next mutation +// or via the periodic safety reload kept in the SPA. +func publishInvalidated(hub *EventHub, cardID, columnID string) { + if hub == nil { + return + } + hub.PublishJSON("board.invalidated", cardID, "", map[string]string{ + "card_id": cardID, + "column_id": columnID, + }) +} + // POST /api/columns { name } -func handleCreateColumn(db *DB) http.HandlerFunc { +func handleCreateColumn(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var body struct{ Name string `json:"name"` } if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { @@ -91,12 +104,13 @@ func handleCreateColumn(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, "", c.ID) infra.HTTPJSONResponse(w, http.StatusCreated, c) } } // PATCH /api/columns/{id} { name?, position?, location?, width? } -func handleUpdateColumn(db *DB) http.HandlerFunc { +func handleUpdateColumn(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var body struct { @@ -116,24 +130,26 @@ func handleUpdateColumn(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, "", id) w.WriteHeader(http.StatusNoContent) } } // DELETE /api/columns/{id} -func handleDeleteColumn(db *DB) http.HandlerFunc { +func handleDeleteColumn(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") if err := db.DeleteColumn(id); err != nil { serverError(w, err) return } + publishInvalidated(hub, "", id) w.WriteHeader(http.StatusNoContent) } } // POST /api/columns/reorder { ids: [...] } -func handleReorderColumns(db *DB) http.HandlerFunc { +func handleReorderColumns(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var body struct{ IDs []string `json:"ids"` } if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { @@ -144,12 +160,13 @@ func handleReorderColumns(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, "", "") w.WriteHeader(http.StatusNoContent) } } // POST /api/cards { column_id, requester?, title, description? } -func handleCreateCard(db *DB) http.HandlerFunc { +func handleCreateCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var body struct { ColumnID string `json:"column_id"` @@ -186,12 +203,13 @@ func handleCreateCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, c.ID, body.ColumnID) infra.HTTPJSONResponse(w, http.StatusCreated, c) } } // PATCH /api/cards/{id} { requester?, title?, description?, color? } -func handleUpdateCard(db *DB) http.HandlerFunc { +func handleUpdateCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var raw map[string]any @@ -249,12 +267,13 @@ func handleUpdateCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // PUT /api/cards/{id}/stickers { stickers: [{emoji,x,y}, ...] } -func handleUpdateCardStickers(db *DB) http.HandlerFunc { +func handleUpdateCardStickers(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var body struct { @@ -268,12 +287,13 @@ func handleUpdateCardStickers(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // DELETE /api/cards/{id} -func handleDeleteCard(db *DB) http.HandlerFunc { +func handleDeleteCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") actor, _ := infra.UserIDFromContext(r.Context(), userCtxKey) @@ -281,12 +301,13 @@ func handleDeleteCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // POST /api/cards/{id}/move { column_id, ordered_ids } -func handleMoveCard(db *DB) http.HandlerFunc { +func handleMoveCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var body struct { @@ -310,6 +331,7 @@ func handleMoveCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, body.ColumnID) w.WriteHeader(http.StatusNoContent) } } @@ -328,7 +350,10 @@ func handleListCardMessages(db *DB) http.HandlerFunc { } // POST /api/cards/{id}/messages { body } -func handleCreateCardMessage(db *DB) http.HandlerFunc { +// +// Parses @mentions, fans out notifications and publishes message.created via +// the hub so SSE/WS subscribers see the message immediately. +func handleCreateCardMessage(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var body struct { @@ -347,7 +372,7 @@ func handleCreateCardMessage(db *DB) http.HandlerFunc { infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) return } - m, err := db.CreateCardMessage(id, actor, body.Body) + m, _, _, err := db.CreateCardMessageAndNotify(id, actor, body.Body, hub) if err != nil { if strings.Contains(err.Error(), "not found") { notFound(w, err.Error()) @@ -361,8 +386,9 @@ func handleCreateCardMessage(db *DB) http.HandlerFunc { } // DELETE /api/cards/{cid}/messages/{mid} -func handleDeleteCardMessage(db *DB) http.HandlerFunc { +func handleDeleteCardMessage(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { + cid := r.PathValue("id") mid := r.PathValue("mid") actor, _ := infra.UserIDFromContext(r.Context(), userCtxKey) if actor == "" { @@ -377,12 +403,15 @@ func handleDeleteCardMessage(db *DB) http.HandlerFunc { serverError(w, err) return } + if hub != nil { + hub.PublishJSON("message.deleted", cid, "", map[string]string{"id": mid}) + } w.WriteHeader(http.StatusNoContent) } } // POST /api/cards/{id}/duplicate -func handleDuplicateCard(db *DB) http.HandlerFunc { +func handleDuplicateCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") actor, _ := infra.UserIDFromContext(r.Context(), userCtxKey) @@ -395,6 +424,7 @@ func handleDuplicateCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, c.ID, c.ColumnID) infra.HTTPJSONResponse(w, http.StatusCreated, c) } } @@ -425,7 +455,7 @@ func handleListTrash(db *DB) http.HandlerFunc { } // POST /api/cards/{id}/restore -func handleRestoreCard(db *DB) http.HandlerFunc { +func handleRestoreCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") actor, _ := infra.UserIDFromContext(r.Context(), userCtxKey) @@ -433,6 +463,7 @@ func handleRestoreCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } @@ -553,44 +584,48 @@ func handleListArchive(db *DB) http.HandlerFunc { } // POST /api/cards/{id}/archive -func handleArchiveCard(db *DB) http.HandlerFunc { +func handleArchiveCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") if err := db.ArchiveCard(id); err != nil { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // POST /api/cards/{id}/unarchive -func handleUnarchiveCard(db *DB) http.HandlerFunc { +func handleUnarchiveCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") if err := db.UnarchiveCard(id); err != nil { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // DELETE /api/cards/{id}/purge -func handlePurgeCard(db *DB) http.HandlerFunc { +func handlePurgeCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") if err := db.PurgeCard(id); err != nil { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } -func apiRoutes(db *DB, chatWorkdir string, logger *ChatLogger, internalToken string, flags *FeatureFlags) []infra.Route { +func apiRoutes(db *DB, chatWorkdir string, logger *ChatLogger, internalToken string, flags *FeatureFlags, hub *EventHub, dispatcher *Dispatcher) []infra.Route { return []infra.Route{ {Method: "GET", Path: "/api/flags", Handler: handleListFlags(flags)}, + {Method: "GET", Path: "/api/version", Handler: handleVersion()}, {Method: "POST", Path: "/api/auth/register", Handler: handleRegister(db, flags)}, {Method: "POST", Path: "/api/auth/login", Handler: handleLogin(db)}, {Method: "POST", Path: "/api/auth/logout", Handler: handleLogout(db)}, @@ -598,31 +633,31 @@ func apiRoutes(db *DB, chatWorkdir string, logger *ChatLogger, internalToken str {Method: "PATCH", Path: "/api/me", Handler: handlePatchMe(db)}, {Method: "GET", Path: "/api/users", Handler: handleListUsers(db)}, {Method: "GET", Path: "/api/board", Handler: handleGetBoard(db)}, - {Method: "POST", Path: "/api/columns", Handler: handleCreateColumn(db)}, - {Method: "POST", Path: "/api/columns/reorder", Handler: handleReorderColumns(db)}, - {Method: "PATCH", Path: "/api/columns/{id}", Handler: handleUpdateColumn(db)}, - {Method: "DELETE", Path: "/api/columns/{id}", Handler: handleDeleteColumn(db)}, - {Method: "POST", Path: "/api/cards", Handler: handleCreateCard(db)}, - {Method: "PATCH", Path: "/api/cards/{id}", Handler: handleUpdateCard(db)}, - {Method: "PUT", Path: "/api/cards/{id}/stickers", Handler: handleUpdateCardStickers(db)}, - {Method: "DELETE", Path: "/api/cards/{id}", Handler: handleDeleteCard(db)}, - {Method: "POST", Path: "/api/cards/{id}/move", Handler: handleMoveCard(db)}, - {Method: "POST", Path: "/api/cards/{id}/duplicate", Handler: handleDuplicateCard(db)}, + {Method: "POST", Path: "/api/columns", Handler: handleCreateColumn(db, hub)}, + {Method: "POST", Path: "/api/columns/reorder", Handler: handleReorderColumns(db, hub)}, + {Method: "PATCH", Path: "/api/columns/{id}", Handler: handleUpdateColumn(db, hub)}, + {Method: "DELETE", Path: "/api/columns/{id}", Handler: handleDeleteColumn(db, hub)}, + {Method: "POST", Path: "/api/cards", Handler: handleCreateCard(db, hub)}, + {Method: "PATCH", Path: "/api/cards/{id}", Handler: handleUpdateCard(db, hub)}, + {Method: "PUT", Path: "/api/cards/{id}/stickers", Handler: handleUpdateCardStickers(db, hub)}, + {Method: "DELETE", Path: "/api/cards/{id}", Handler: handleDeleteCard(db, hub)}, + {Method: "POST", Path: "/api/cards/{id}/move", Handler: handleMoveCard(db, hub)}, + {Method: "POST", Path: "/api/cards/{id}/duplicate", Handler: handleDuplicateCard(db, hub)}, {Method: "GET", Path: "/api/cards/{id}/messages", Handler: handleListCardMessages(db)}, - {Method: "POST", Path: "/api/cards/{id}/messages", Handler: handleCreateCardMessage(db)}, - {Method: "DELETE", Path: "/api/cards/{id}/messages/{mid}", Handler: handleDeleteCardMessage(db)}, + {Method: "POST", Path: "/api/cards/{id}/messages", Handler: handleCreateCardMessage(db, hub)}, + {Method: "DELETE", Path: "/api/cards/{id}/messages/{mid}", Handler: handleDeleteCardMessage(db, hub)}, {Method: "GET", Path: "/api/cards/{id}/history", Handler: handleCardHistory(db)}, {Method: "GET", Path: "/api/trash", Handler: handleListTrash(db)}, - {Method: "POST", Path: "/api/cards/{id}/restore", Handler: handleRestoreCard(db)}, + {Method: "POST", Path: "/api/cards/{id}/restore", Handler: handleRestoreCard(db, hub)}, {Method: "GET", Path: "/api/reports/daily", Handler: handleDailyReport(db)}, {Method: "GET", Path: "/api/reports/daily/summary", Handler: handleGetDailySummary(db)}, {Method: "POST", Path: "/api/reports/daily/summary", Handler: handleGenerateDailySummary(db)}, {Method: "GET", Path: "/api/settings/{key}", Handler: handleGetSetting(db)}, {Method: "PUT", Path: "/api/settings/{key}", Handler: handlePutSetting(db)}, {Method: "GET", Path: "/api/archive", Handler: handleListArchive(db)}, - {Method: "POST", Path: "/api/cards/{id}/archive", Handler: handleArchiveCard(db)}, - {Method: "POST", Path: "/api/cards/{id}/unarchive", Handler: handleUnarchiveCard(db)}, - {Method: "DELETE", Path: "/api/cards/{id}/purge", Handler: handlePurgeCard(db)}, + {Method: "POST", Path: "/api/cards/{id}/archive", Handler: handleArchiveCard(db, hub)}, + {Method: "POST", Path: "/api/cards/{id}/unarchive", Handler: handleUnarchiveCard(db, hub)}, + {Method: "DELETE", Path: "/api/cards/{id}/purge", Handler: handlePurgeCard(db, hub)}, {Method: "POST", Path: "/api/chat", Handler: handleChat(db, chatWorkdir, logger)}, {Method: "GET", Path: "/api/chat/ws", Handler: handleChatWS(db, chatWorkdir, logger, internalToken)}, {Method: "POST", Path: "/api/tool/{name}", Handler: handleInternalTool(db, internalToken, logger)}, @@ -634,6 +669,34 @@ func apiRoutes(db *DB, chatWorkdir string, logger *ChatLogger, internalToken str {Method: "GET", Path: "/api/cards/{id}/files", Handler: handleListCardFiles(db)}, {Method: "GET", Path: "/api/files/{id}", Handler: handleServeFile(db)}, {Method: "DELETE", Path: "/api/files/{id}", Handler: handleDeleteCardFile(db)}, + // Notifications + realtime (issue notifications-realtime). + {Method: "GET", Path: "/api/events", Handler: handleEventStream(hub)}, + {Method: "GET", Path: "/api/cards/{id}/chat/ws", Handler: handleCardChatWS(db, hub)}, + {Method: "GET", Path: "/api/notifications", Handler: handleListNotifications(db)}, + {Method: "GET", Path: "/api/notifications/unread-count", Handler: handleUnreadCount(db)}, + {Method: "POST", Path: "/api/notifications/{id}/read", Handler: handleMarkNotificationRead(db, hub)}, + {Method: "POST", Path: "/api/notifications/read-all", Handler: handleMarkAllNotificationsRead(db, hub)}, + // MCP per-user tokens. + {Method: "POST", Path: "/api/mcp-tokens", Handler: handleCreateMCPToken(db)}, + {Method: "GET", Path: "/api/mcp-tokens", Handler: handleListMCPTokens(db)}, + {Method: "DELETE", Path: "/api/mcp-tokens/{id}", Handler: handleRevokeMCPToken(db)}, + // Modules: external integrations (Jira, ...). + {Method: "GET", Path: "/api/modules", Handler: handleListModules(db)}, + {Method: "POST", Path: "/api/modules", Handler: handleCreateModule(db)}, + {Method: "PATCH", Path: "/api/modules/{id}", Handler: handleUpdateModule(db)}, + {Method: "DELETE", Path: "/api/modules/{id}", Handler: handleDeleteModule(db)}, + {Method: "GET", Path: "/api/modules/{id}/logs", Handler: handleModuleLogs(db)}, + {Method: "POST", Path: "/api/modules/{id}/test", Handler: handleTestModule(db, dispatcher)}, + } +} + +// GET /api/version → {"version": ""} +// +// Public, no auth. Skipped from session middleware via skip list updated in +// main.go to keep the SPA pre-login able to display the running build. +func handleVersion() http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + infra.HTTPJSONResponse(w, http.StatusOK, map[string]string{"version": Version}) } } diff --git a/backend/main.go b/backend/main.go index 95b3f7c..9edbcda 100644 --- a/backend/main.go +++ b/backend/main.go @@ -21,6 +21,11 @@ import ( //go:embed all:dist var frontendDist embed.FS +// Version is the build-time identifier of the kanban app. It is injected +// from app.md's `version:` field via -ldflags "-X main.Version=..." by run.sh +// (and by docker/CI). Defaults to "dev" for hand-built binaries. +var Version = "dev" + func main() { // Subcommand `kanban mcp` runs as MCP server over stdio (spawned by claude -p). if len(os.Args) > 1 && os.Args[1] == "mcp" { @@ -63,7 +68,13 @@ func main() { wd := chatWorkdir(*dbPath) logger := newChatLogger(filepath.Join(wd, "chat.log")) log.Printf("chat tool log: %s", logger.path) - mux := infra.HTTPRouter(apiRoutes(db, wd, logger, internalToken, &featureFlags)) + hub := NewEventHub() + dispatcher := NewDispatcher(db, hub) + dispatcher.Start() + defer dispatcher.Stop() + mux := infra.HTTPRouter(apiRoutes(db, wd, logger, internalToken, &featureFlags, hub, dispatcher)) + + mux.Handle("/mcp", mcpHTTPHandler(db)) feHandler := frontendHandler() if feHandler != nil { @@ -76,7 +87,7 @@ func main() { authMW := infra.HTTPSessionCookieMiddleware(infra.SessionCookieConfig{ DB: db.conn, CookieName: cookieName, - SkipPaths: []string{"/api/auth/", "/api/tool/", "/api/flags", "/health", "/assets/", "/index.html"}, + SkipPaths: []string{"/api/auth/", "/api/tool/", "/api/flags", "/api/version", "/health", "/assets/", "/index.html"}, UserCtxKey: userCtxKey, }) @@ -163,5 +174,28 @@ func frontendHandler() http.Handler { if len(entries) == 0 { return nil } - return infra.SPAHandler(sub, "index.html") + return cacheHeadersMiddleware(infra.SPAHandler(sub, "index.html")) +} + +// cacheHeadersMiddleware ensures the SPA shell is never cached while the +// hashed assets (which are content-addressed by Vite) are cached for a long +// time. Without this, browsers happily reuse an old index.html — pinned to a +// stale /assets/index-.js URL — and never pick up new releases. +// +// Policy: +// +// /assets/* → public, max-age=1y, immutable (filename changes per build) +// everything else → no-store, must-revalidate (forces revalidation on every +// navigation so the latest hash is always discovered) +func cacheHeadersMiddleware(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if strings.HasPrefix(r.URL.Path, "/assets/") { + w.Header().Set("Cache-Control", "public, max-age=31536000, immutable") + } else { + w.Header().Set("Cache-Control", "no-store, no-cache, must-revalidate") + w.Header().Set("Pragma", "no-cache") + w.Header().Set("Expires", "0") + } + next.ServeHTTP(w, r) + }) } diff --git a/backend/mcp.go b/backend/mcp.go index a07f394..66ec55a 100644 --- a/backend/mcp.go +++ b/backend/mcp.go @@ -254,6 +254,31 @@ func mcpToolDefs() []infra.MCPToolDef { "required": []string{"id"}, }), }, + { + Name: "add_comment", + Description: "Anade un comentario (card_message) a una tarjeta. Requiere card_id, body y autor (author_id o author_username). Devuelve el CardMessage creado.", + InputSchema: rawSchema(map[string]any{ + "type": "object", + "properties": map[string]any{ + "card_id": map[string]any{"type": "string"}, + "body": map[string]any{"type": "string"}, + "author_id": map[string]any{"type": "string"}, + "author_username": map[string]any{"type": "string"}, + }, + "required": []string{"card_id", "body"}, + }), + }, + { + Name: "list_comments", + Description: "Lista los comentarios (card_messages) de una tarjeta en orden cronologico.", + InputSchema: rawSchema(map[string]any{ + "type": "object", + "properties": map[string]any{ + "card_id": map[string]any{"type": "string"}, + }, + "required": []string{"card_id"}, + }), + }, } } diff --git a/backend/mcp_http.go b/backend/mcp_http.go new file mode 100644 index 0000000..638854e --- /dev/null +++ b/backend/mcp_http.go @@ -0,0 +1,55 @@ +package main + +import ( + "context" + "encoding/json" + "errors" + "net/http" + "os" + "strings" + + "fn-registry/functions/infra" +) + +// mcpHTTPHandler builds the http.Handler that serves the MCP Streamable HTTP +// transport for remote Claude clients. Bearer-auth backed by the mcp_tokens +// table; tool dispatch reuses executeTool() — the same set of operations the +// chat assistant uses internally. +func mcpHTTPHandler(db *DB) http.Handler { + auth := func(r *http.Request) (context.Context, error) { + header := r.Header.Get("Authorization") + token := strings.TrimSpace(strings.TrimPrefix(header, "Bearer ")) + if token == "" || token == header { + return nil, errors.New("missing bearer token") + } + userID, err := db.LookupMCPToken(token) + if err != nil { + return nil, err + } + if userID == "" { + return nil, errors.New("invalid or revoked token") + } + return context.WithValue(r.Context(), userCtxKey, userID), nil + } + + handler := func(ctx context.Context, name string, input json.RawMessage) (any, bool, error) { + body := input + if len(body) == 0 { + body = json.RawMessage(`{}`) + } + res := executeTool(db, name, body) + if !res.OK { + return res.Error, true, nil + } + return res.Result, false, nil + } + + return infra.MCPHTTPHandler(infra.MCPHTTPOpts{ + Name: "kanban", + Version: Version, + Tools: mcpToolDefs(), + Handler: handler, + Auth: auth, + Logger: os.Stderr, + }) +} diff --git a/backend/mcp_tokens.go b/backend/mcp_tokens.go new file mode 100644 index 0000000..6c2e37b --- /dev/null +++ b/backend/mcp_tokens.go @@ -0,0 +1,132 @@ +package main + +import ( + "crypto/rand" + "crypto/sha256" + "database/sql" + "encoding/hex" + "errors" + "fmt" +) + +// MCPToken is a per-user access token used by remote Claude clients to talk to +// the kanban MCP HTTP endpoint. The plaintext value is shown ONCE at creation +// time; we only persist the SHA-256 hash. +type MCPToken struct { + ID string `json:"id"` + Name string `json:"name"` + CreatedAt string `json:"created_at"` + LastUsedAt *string `json:"last_used_at,omitempty"` +} + +const mcpTokenPrefix = "kmcp_" + +var errMCPTokenNotFound = errors.New("mcp token not found") + +// MintMCPToken creates a new active token for userID and returns the plaintext +// value (caller must surface it to the user immediately; it cannot be +// recovered later) along with the row metadata. +func (db *DB) MintMCPToken(userID, name string) (string, *MCPToken, error) { + if userID == "" { + return "", nil, fmt.Errorf("user_id required") + } + plaintext, err := generateMCPTokenPlaintext() + if err != nil { + return "", nil, fmt.Errorf("generate token: %w", err) + } + tok := &MCPToken{ + ID: newID(), + Name: name, + CreatedAt: nowRFC3339(), + } + _, err = db.conn.Exec( + `INSERT INTO mcp_tokens (id, user_id, token_hash, name, created_at) VALUES (?, ?, ?, ?, ?)`, + tok.ID, userID, hashMCPToken(plaintext), tok.Name, tok.CreatedAt, + ) + if err != nil { + return "", nil, err + } + return plaintext, tok, nil +} + +func (db *DB) ListMCPTokens(userID string) ([]MCPToken, error) { + rows, err := db.conn.Query( + `SELECT id, name, created_at, last_used_at FROM mcp_tokens + WHERE user_id=? AND revoked_at IS NULL + ORDER BY created_at DESC`, userID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + out := []MCPToken{} + for rows.Next() { + var t MCPToken + var lastUsed sql.NullString + if err := rows.Scan(&t.ID, &t.Name, &t.CreatedAt, &lastUsed); err != nil { + return nil, err + } + if lastUsed.Valid { + t.LastUsedAt = &lastUsed.String + } + out = append(out, t) + } + return out, rows.Err() +} + +// RevokeMCPToken sets revoked_at on the token belonging to userID. Returns +// errMCPTokenNotFound if no active row matches. +func (db *DB) RevokeMCPToken(userID, tokenID string) error { + res, err := db.conn.Exec( + `UPDATE mcp_tokens SET revoked_at=? WHERE id=? AND user_id=? AND revoked_at IS NULL`, + nowRFC3339(), tokenID, userID, + ) + if err != nil { + return err + } + n, err := res.RowsAffected() + if err != nil { + return err + } + if n == 0 { + return errMCPTokenNotFound + } + return nil +} + +// LookupMCPToken hashes plaintext and returns the owning user_id if the token +// is active. Updates last_used_at as a side effect. Returns "" + nil when the +// token does not match an active row. +func (db *DB) LookupMCPToken(plaintext string) (string, error) { + if plaintext == "" { + return "", nil + } + hash := hashMCPToken(plaintext) + var userID, id string + err := db.conn.QueryRow( + `SELECT id, user_id FROM mcp_tokens WHERE token_hash=? AND revoked_at IS NULL`, hash, + ).Scan(&id, &userID) + if errors.Is(err, sql.ErrNoRows) { + return "", nil + } + if err != nil { + return "", err + } + if _, err := db.conn.Exec(`UPDATE mcp_tokens SET last_used_at=? WHERE id=?`, nowRFC3339(), id); err != nil { + return userID, fmt.Errorf("touch last_used_at: %w", err) + } + return userID, nil +} + +func hashMCPToken(plaintext string) string { + sum := sha256.Sum256([]byte(plaintext)) + return hex.EncodeToString(sum[:]) +} + +func generateMCPTokenPlaintext() (string, error) { + b := make([]byte, 32) + if _, err := rand.Read(b); err != nil { + return "", err + } + return mcpTokenPrefix + hex.EncodeToString(b), nil +} diff --git a/backend/mcp_tokens_handlers.go b/backend/mcp_tokens_handlers.go new file mode 100644 index 0000000..636220f --- /dev/null +++ b/backend/mcp_tokens_handlers.go @@ -0,0 +1,83 @@ +package main + +import ( + "errors" + "net/http" + "strings" + + "fn-registry/functions/infra" +) + +// POST /api/mcp-tokens {name} +// +// Mints a new MCP token for the current user. The plaintext token is returned +// ONLY in this response — there is no way to retrieve it again. +func handleCreateMCPToken(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "login required"}) + return + } + var body struct { + Name string `json:"name"` + } + if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { + badRequest(w, err.Error()) + return + } + name := strings.TrimSpace(body.Name) + if name == "" { + name = "default" + } + plaintext, tok, err := db.MintMCPToken(userID, name) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusCreated, map[string]any{ + "id": tok.ID, + "name": tok.Name, + "created_at": tok.CreatedAt, + "token": plaintext, + }) + } +} + +// GET /api/mcp-tokens +func handleListMCPTokens(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "login required"}) + return + } + tokens, err := db.ListMCPTokens(userID) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, tokens) + } +} + +// DELETE /api/mcp-tokens/{id} +func handleRevokeMCPToken(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "login required"}) + return + } + id := r.PathValue("id") + if err := db.RevokeMCPToken(userID, id); err != nil { + if errors.Is(err, errMCPTokenNotFound) { + notFound(w, "token not found") + return + } + serverError(w, err) + return + } + w.WriteHeader(http.StatusNoContent) + } +} diff --git a/backend/migrations/015_notifications.sql b/backend/migrations/015_notifications.sql new file mode 100644 index 0000000..424677e --- /dev/null +++ b/backend/migrations/015_notifications.sql @@ -0,0 +1,42 @@ +-- Per-user notifications + persisted @mentions. +-- Created by card chat messages (card_messages). +-- +-- Kinds: +-- mention — user mentioned via @username in body +-- assigned_chat — user is the card's assignee and someone else commented +-- reply — user previously commented on this card (or is requester) +-- A row is created per (recipient_user, message). The kind chosen is the +-- highest priority among those that apply: mention > assigned_chat > reply. + +CREATE TABLE IF NOT EXISTS notifications ( + id TEXT PRIMARY KEY, + user_id TEXT NOT NULL, + card_id TEXT NOT NULL, + message_id TEXT NOT NULL, + kind TEXT NOT NULL, + actor_id TEXT NOT NULL, + created_at TEXT NOT NULL, + read_at TEXT, + FOREIGN KEY (card_id) REFERENCES cards(id) ON DELETE CASCADE, + FOREIGN KEY (message_id) REFERENCES card_messages(id) ON DELETE CASCADE +); + +CREATE INDEX IF NOT EXISTS idx_notifications_user_unread + ON notifications(user_id, read_at, created_at DESC); + +CREATE INDEX IF NOT EXISTS idx_notifications_user_created + ON notifications(user_id, created_at DESC); + +CREATE TABLE IF NOT EXISTS card_mentions ( + id TEXT PRIMARY KEY, + card_id TEXT NOT NULL, + message_id TEXT NOT NULL, + user_id TEXT NOT NULL, + created_at TEXT NOT NULL, + FOREIGN KEY (card_id) REFERENCES cards(id) ON DELETE CASCADE, + FOREIGN KEY (message_id) REFERENCES card_messages(id) ON DELETE CASCADE +); + +CREATE INDEX IF NOT EXISTS idx_card_mentions_user ON card_mentions(user_id, created_at DESC); +CREATE INDEX IF NOT EXISTS idx_card_mentions_card ON card_mentions(card_id); +CREATE INDEX IF NOT EXISTS idx_card_mentions_message ON card_mentions(message_id); diff --git a/backend/migrations/016_modules.sql b/backend/migrations/016_modules.sql new file mode 100644 index 0000000..2baef59 --- /dev/null +++ b/backend/migrations/016_modules.sql @@ -0,0 +1,45 @@ +-- Outbound modules (integrations): kanban events → external systems. +-- +-- A module is a configured subscription. The dispatcher (modules.go) +-- subscribes to the EventHub and, for each event whose type matches the +-- module's event_filter, calls the kind-specific handler with the +-- decrypted config. +-- +-- Tokens / secrets are encrypted with AES-GCM at rest. The key is derived +-- from the KANBAN_MODULE_KEY environment variable (sha256 of the value). + +CREATE TABLE IF NOT EXISTS modules ( + id TEXT PRIMARY KEY, + name TEXT NOT NULL, + kind TEXT NOT NULL, -- 'jira' | 'webhook' | … + enabled INTEGER NOT NULL DEFAULT 1, + event_filter TEXT NOT NULL, -- comma-separated event types + config_cipher BLOB NOT NULL, -- AES-GCM ciphertext of JSON + config_nonce BLOB NOT NULL, + created_at TEXT NOT NULL, + updated_at TEXT NOT NULL +); + +CREATE TABLE IF NOT EXISTS module_logs ( + id TEXT PRIMARY KEY, + module_id TEXT NOT NULL, + event_type TEXT NOT NULL, + card_id TEXT, + status INTEGER, -- HTTP status or 0 if pre-flight + duration_ms INTEGER, + error TEXT, + created_at TEXT NOT NULL +); + +CREATE INDEX IF NOT EXISTS idx_module_logs_module_created + ON module_logs(module_id, created_at DESC); + +-- jira_key: 1:1 link between a kanban card and its Jira issue. Empty +-- string when the card has not yet been synced to Jira. +ALTER TABLE cards ADD COLUMN jira_key TEXT NOT NULL DEFAULT ''; + +-- is_admin: gates /api/modules access and the Modulos menu item. +-- Bootstrap: egutierrez (the initial admin) is marked admin so the +-- feature is reachable on first deploy. Other users start as non-admin. +ALTER TABLE users ADD COLUMN is_admin INTEGER NOT NULL DEFAULT 0; +UPDATE users SET is_admin = 1 WHERE username = 'egutierrez'; diff --git a/backend/migrations/017_mcp_tokens.sql b/backend/migrations/017_mcp_tokens.sql new file mode 100644 index 0000000..4a4a5c3 --- /dev/null +++ b/backend/migrations/017_mcp_tokens.sql @@ -0,0 +1,26 @@ +-- Per-user MCP access tokens. Users mint tokens from the settings UI and +-- paste them into their local Claude (`claude mcp add --transport http ...`). +-- The plaintext token is shown ONCE at creation time; we only store the hash. +-- +-- token_hash is a SHA-256 hex digest of the plaintext token. Lookup on +-- incoming requests: hash the bearer, look up the row, accept if not revoked. +-- +-- revoked_at is NULL for active tokens. Tokens are never deleted (audit +-- trail); revocation is a soft delete. +CREATE TABLE IF NOT EXISTS mcp_tokens ( + id TEXT PRIMARY KEY, + user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE, + token_hash TEXT NOT NULL UNIQUE, + name TEXT NOT NULL DEFAULT '', + created_at TEXT NOT NULL, + last_used_at TEXT, + revoked_at TEXT +); + +CREATE INDEX IF NOT EXISTS idx_mcp_tokens_user_active + ON mcp_tokens(user_id) + WHERE revoked_at IS NULL; + +CREATE INDEX IF NOT EXISTS idx_mcp_tokens_hash_active + ON mcp_tokens(token_hash) + WHERE revoked_at IS NULL; diff --git a/backend/modules.go b/backend/modules.go new file mode 100644 index 0000000..3c5d124 --- /dev/null +++ b/backend/modules.go @@ -0,0 +1,725 @@ +package main + +import ( + "bytes" + "context" + "database/sql" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "log" + "net/http" + "strings" + "time" +) + +// ============================================================================= +// Module model +// ============================================================================= + +type Module struct { + ID string `json:"id"` + Name string `json:"name"` + Kind string `json:"kind"` + Enabled bool `json:"enabled"` + EventFilter []string `json:"event_filter"` + Config JSONValue `json:"config"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` +} + +// JSONValue is an arbitrary JSON object decoded into a generic map. We do not +// model per-kind config in Go types because the set of kinds grows over time +// and the dispatcher only inspects fields it knows. +type JSONValue map[string]interface{} + +type ModuleLog struct { + ID string `json:"id"` + ModuleID string `json:"module_id"` + EventType string `json:"event_type"` + CardID string `json:"card_id"` + Status int `json:"status"` + DurationMs int `json:"duration_ms"` + Error string `json:"error"` + CreatedAt string `json:"created_at"` +} + +// ============================================================================= +// DB helpers (modules + logs) +// ============================================================================= + +// listModulesEnabled returns all enabled modules with their config decrypted. +// Disabled modules are silently skipped — callers iterate the result without +// further filtering. +func (db *DB) listModulesEnabled() ([]Module, error) { + return db.listModulesWhere("WHERE enabled = 1") +} + +func (db *DB) listModulesAll() ([]Module, error) { + return db.listModulesWhere("") +} + +func (db *DB) listModulesWhere(filter string) ([]Module, error) { + q := `SELECT id, name, kind, enabled, event_filter, config_cipher, config_nonce, created_at, updated_at FROM modules ` + filter + ` ORDER BY created_at` + rows, err := db.conn.Query(q) + if err != nil { + return nil, err + } + defer rows.Close() + out := []Module{} + for rows.Next() { + var m Module + var enabled int + var filter, createdAt, updatedAt string + var cipherBlob, nonce []byte + if err := rows.Scan(&m.ID, &m.Name, &m.Kind, &enabled, &filter, &cipherBlob, &nonce, &createdAt, &updatedAt); err != nil { + return nil, err + } + m.Enabled = enabled == 1 + m.EventFilter = splitCSV(filter) + m.CreatedAt = createdAt + m.UpdatedAt = updatedAt + cfg, err := decryptConfig(cipherBlob, nonce) + if err != nil { + // Surface the decrypt failure so the operator notices but + // avoid dropping the module from the list entirely. + log.Printf("module %s: decrypt config: %v", m.ID, err) + m.Config = JSONValue{"_decrypt_error": err.Error()} + } else { + _ = json.Unmarshal(cfg, &m.Config) + } + out = append(out, m) + } + return out, rows.Err() +} + +func (db *DB) getModule(id string) (*Module, error) { + mods, err := db.listModulesWhere(`WHERE id = '` + escapeSQL(id) + `'`) + if err != nil || len(mods) == 0 { + if err == nil { + err = sql.ErrNoRows + } + return nil, err + } + return &mods[0], nil +} + +func escapeSQL(s string) string { + return strings.ReplaceAll(s, "'", "''") +} + +func (db *DB) saveModule(m *Module) error { + cfgJSON, err := json.Marshal(m.Config) + if err != nil { + return err + } + cipherBlob, nonce, err := encryptConfig(cfgJSON) + if err != nil { + return err + } + now := nowRFC3339() + if m.ID == "" { + m.ID = newID() + m.CreatedAt = now + m.UpdatedAt = now + _, err = db.conn.Exec( + `INSERT INTO modules (id, name, kind, enabled, event_filter, config_cipher, config_nonce, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, + m.ID, m.Name, m.Kind, boolInt(m.Enabled), strings.Join(m.EventFilter, ","), + cipherBlob, nonce, m.CreatedAt, m.UpdatedAt, + ) + return err + } + m.UpdatedAt = now + _, err = db.conn.Exec( + `UPDATE modules SET name=?, kind=?, enabled=?, event_filter=?, config_cipher=?, config_nonce=?, updated_at=? WHERE id=?`, + m.Name, m.Kind, boolInt(m.Enabled), strings.Join(m.EventFilter, ","), + cipherBlob, nonce, m.UpdatedAt, m.ID, + ) + return err +} + +func (db *DB) deleteModule(id string) error { + _, err := db.conn.Exec(`DELETE FROM modules WHERE id=?`, id) + return err +} + +func (db *DB) appendModuleLog(l ModuleLog) error { + if l.ID == "" { + l.ID = newID() + } + if l.CreatedAt == "" { + l.CreatedAt = nowRFC3339() + } + _, err := db.conn.Exec( + `INSERT INTO module_logs (id, module_id, event_type, card_id, status, duration_ms, error, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, + l.ID, l.ModuleID, l.EventType, l.CardID, l.Status, l.DurationMs, l.Error, l.CreatedAt, + ) + return err +} + +func (db *DB) listModuleLogs(moduleID string, limit int) ([]ModuleLog, error) { + if limit <= 0 { + limit = 100 + } + rows, err := db.conn.Query( + `SELECT id, module_id, event_type, card_id, status, duration_ms, error, created_at + FROM module_logs WHERE module_id = ? ORDER BY created_at DESC LIMIT ?`, + moduleID, limit, + ) + if err != nil { + return nil, err + } + defer rows.Close() + out := []ModuleLog{} + for rows.Next() { + var l ModuleLog + var cardID sql.NullString + if err := rows.Scan(&l.ID, &l.ModuleID, &l.EventType, &cardID, &l.Status, &l.DurationMs, &l.Error, &l.CreatedAt); err != nil { + return nil, err + } + if cardID.Valid { + l.CardID = cardID.String + } + out = append(out, l) + } + return out, rows.Err() +} + +// setCardJiraKey stores the Jira issue key for a card after a successful +// create call. We skip the regular UpdateCard path to avoid emitting a +// `card.updated` event (which would loop us back through the dispatcher). +func (db *DB) setCardJiraKey(cardID, jiraKey string) error { + _, err := db.conn.Exec(`UPDATE cards SET jira_key=? WHERE id=?`, jiraKey, cardID) + return err +} + +func (db *DB) getCardForJira(cardID string) (*cardForJira, error) { + var c cardForJira + var assignee, deadline, jiraKey sql.NullString + var tagsJSON string + err := db.conn.QueryRow( + `SELECT c.id, c.title, c.description, c.requester, c.column_id, c.assignee_id, + c.deadline, c.tags, c.jira_key, c.created_at, col.name + FROM cards c JOIN columns col ON col.id = c.column_id WHERE c.id = ?`, + cardID, + ).Scan(&c.ID, &c.Title, &c.Description, &c.Requester, &c.ColumnID, &assignee, + &deadline, &tagsJSON, &jiraKey, &c.CreatedAt, &c.ColumnName) + if err != nil { + return nil, err + } + if assignee.Valid { + c.AssigneeID = assignee.String + } + if deadline.Valid { + c.Deadline = deadline.String + } + if jiraKey.Valid { + c.JiraKey = jiraKey.String + } + _ = json.Unmarshal([]byte(tagsJSON), &c.Tags) + return &c, nil +} + +type cardForJira struct { + ID string + Title string + Description string + Requester string + ColumnID string + ColumnName string + AssigneeID string + Deadline string + Tags []string + JiraKey string + CreatedAt string +} + +func (c *cardForJira) hasTag(name string) bool { + name = strings.ToLower(name) + for _, t := range c.Tags { + if strings.ToLower(t) == name { + return true + } + } + return false +} + +func splitCSV(s string) []string { + if s == "" { + return nil + } + parts := strings.Split(s, ",") + out := make([]string, 0, len(parts)) + for _, p := range parts { + p = strings.TrimSpace(p) + if p != "" { + out = append(out, p) + } + } + return out +} + +func boolInt(b bool) int { + if b { + return 1 + } + return 0 +} + +// ============================================================================= +// Dispatcher +// ============================================================================= + +const ( + moduleRetries = 3 + moduleRetryDelay1 = 1 * time.Second + moduleRetryDelay2 = 5 * time.Second + moduleRetryDelay3 = 30 * time.Second + moduleHTTPTimeout = 15 * time.Second + moduleOptOutTag = "nojira" + moduleDispatchQueue = 256 +) + +// Dispatcher fans events from the EventHub into per-module handlers. +// +// Lifecycle: +// - Start() spawns a single subscriber goroutine on the hub plus a +// bounded worker pool. +// - Stop() cancels the context and waits for in-flight requests to drain. +// +// Handlers receive a decrypted Module copy + the Event; they own the HTTP +// call to the target system. The dispatcher logs every attempt. +type Dispatcher struct { + db *DB + hub *EventHub + handlers map[string]Handler + queue chan dispatchTask + ctx context.Context + cancel context.CancelFunc + enabled bool +} + +type dispatchTask struct { + module Module + event Event +} + +type Handler interface { + Handle(ctx context.Context, db *DB, m Module, ev Event) (status int, err error) + TestConnection(ctx context.Context, m Module) (status int, err error) +} + +func NewDispatcher(db *DB, hub *EventHub) *Dispatcher { + _, hasKey := moduleKey() + return &Dispatcher{ + db: db, + hub: hub, + handlers: map[string]Handler{"jira": &jiraHandler{}}, + queue: make(chan dispatchTask, moduleDispatchQueue), + enabled: hasKey, + } +} + +func (d *Dispatcher) Start() { + if !d.enabled { + log.Printf("module dispatcher disabled (%s not set)", moduleKeyEnv) + return + } + d.ctx, d.cancel = context.WithCancel(context.Background()) + // Subscribe under a synthetic user so the hub treats us as a normal + // recipient of broadcast events. Private user-targeted events are + // uninteresting for outbound sync. + go d.run() + for i := 0; i < 4; i++ { + go d.worker(i) + } + log.Printf("module dispatcher started") +} + +func (d *Dispatcher) Stop() { + if d.cancel != nil { + d.cancel() + } +} + +func (d *Dispatcher) run() { + ch := d.hub.SubscribeUser("__module_dispatcher__") + defer d.hub.UnsubscribeUser("__module_dispatcher__", ch) + for { + select { + case <-d.ctx.Done(): + return + case ev, ok := <-ch: + if !ok { + return + } + d.fanout(ev) + } + } +} + +func (d *Dispatcher) fanout(ev Event) { + mods, err := d.db.listModulesEnabled() + if err != nil { + log.Printf("dispatcher: listModulesEnabled: %v", err) + return + } + for _, m := range mods { + if !filterMatches(m.EventFilter, ev.Type) { + continue + } + if !cutoffOK(d.db, m, ev) { + continue + } + if ev.CardID != "" { + c, err := d.db.getCardForJira(ev.CardID) + if err == nil && c.hasTag(moduleOptOutTag) { + continue + } + } + select { + case d.queue <- dispatchTask{module: m, event: ev}: + default: + log.Printf("dispatcher: queue full, dropping event %s for module %s", ev.Type, m.ID) + } + } +} + +func (d *Dispatcher) worker(id int) { + for { + select { + case <-d.ctx.Done(): + return + case task, ok := <-d.queue: + if !ok { + return + } + d.dispatch(task) + } + } +} + +// dispatch runs the handler with up to moduleRetries attempts using a +// fixed back-off schedule (1s, 5s, 30s). Each attempt creates a log row; +// the final outcome is the one returned to the caller. +func (d *Dispatcher) dispatch(t dispatchTask) { + h, ok := d.handlers[t.module.Kind] + if !ok { + _ = d.db.appendModuleLog(ModuleLog{ + ModuleID: t.module.ID, EventType: t.event.Type, CardID: t.event.CardID, + Error: "unknown module kind: " + t.module.Kind, + }) + return + } + delays := []time.Duration{0, moduleRetryDelay1, moduleRetryDelay2, moduleRetryDelay3} + for attempt := 0; attempt < moduleRetries; attempt++ { + if delays[attempt] > 0 { + select { + case <-d.ctx.Done(): + return + case <-time.After(delays[attempt]): + } + } + ctx, cancel := context.WithTimeout(d.ctx, moduleHTTPTimeout) + start := time.Now() + status, err := h.Handle(ctx, d.db, t.module, t.event) + cancel() + ml := ModuleLog{ + ModuleID: t.module.ID, EventType: t.event.Type, CardID: t.event.CardID, + Status: status, DurationMs: int(time.Since(start).Milliseconds()), + } + if err != nil { + ml.Error = err.Error() + } + _ = d.db.appendModuleLog(ml) + if err == nil { + return + } + // 4xx client errors are not worth retrying. + if status >= 400 && status < 500 { + return + } + } +} + +// ============================================================================= +// Helpers +// ============================================================================= + +func filterMatches(filter []string, eventType string) bool { + for _, f := range filter { + if f == eventType || f == "*" { + return true + } + } + return false +} + +// cutoffOK applies the "module only sees events posterior to its creation" +// rule. Cards that were already linked to Jira (jira_key != "") are always +// eligible regardless of timestamps. +func cutoffOK(db *DB, m Module, ev Event) bool { + if ev.CardID == "" { + return true + } + c, err := db.getCardForJira(ev.CardID) + if err != nil { + return false + } + if c.JiraKey != "" { + return true + } + return c.CreatedAt >= m.CreatedAt +} + +// ============================================================================= +// Jira handler +// ============================================================================= + +type jiraHandler struct{} + +type jiraConfig struct { + BaseURL string `json:"base_url"` + Email string `json:"email"` + APIToken string `json:"api_token"` + ProjectKey string `json:"project_key"` + StatusMap map[string]string `json:"status_map"` +} + +func parseJiraConfig(m Module) (jiraConfig, error) { + b, err := json.Marshal(m.Config) + if err != nil { + return jiraConfig{}, err + } + var c jiraConfig + if err := json.Unmarshal(b, &c); err != nil { + return jiraConfig{}, err + } + c.BaseURL = strings.TrimRight(c.BaseURL, "/") + if c.BaseURL == "" { + return c, fmt.Errorf("base_url required") + } + return c, nil +} + +func (h *jiraHandler) jiraRequest(ctx context.Context, c jiraConfig, method, path string, body interface{}) (int, []byte, error) { + var rdr io.Reader + if body != nil { + b, err := json.Marshal(body) + if err != nil { + return 0, nil, err + } + rdr = bytes.NewReader(b) + } + req, err := http.NewRequestWithContext(ctx, method, c.BaseURL+path, rdr) + if err != nil { + return 0, nil, err + } + req.Header.Set("Accept", "application/json") + if body != nil { + req.Header.Set("Content-Type", "application/json") + } + if c.Email != "" && c.APIToken != "" { + basic := base64.StdEncoding.EncodeToString([]byte(c.Email + ":" + c.APIToken)) + req.Header.Set("Authorization", "Basic "+basic) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return 0, nil, err + } + defer resp.Body.Close() + respBody, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if resp.StatusCode >= 400 { + return resp.StatusCode, respBody, fmt.Errorf("jira %s %s: %d %s", method, path, resp.StatusCode, truncate(respBody, 240)) + } + return resp.StatusCode, respBody, nil +} + +func truncate(b []byte, n int) string { + if len(b) <= n { + return string(b) + } + return string(b[:n]) + "…" +} + +func (h *jiraHandler) TestConnection(ctx context.Context, m Module) (int, error) { + c, err := parseJiraConfig(m) + if err != nil { + return 0, err + } + status, _, err := h.jiraRequest(ctx, c, http.MethodGet, "/rest/api/3/myself", nil) + return status, err +} + +func (h *jiraHandler) Handle(ctx context.Context, db *DB, m Module, ev Event) (int, error) { + c, err := parseJiraConfig(m) + if err != nil { + return 0, err + } + switch ev.Type { + case "card.created": + return h.create(ctx, db, c, ev) + case "card.updated", "board.invalidated": + return h.update(ctx, db, c, ev) + case "card.moved": + return h.transition(ctx, db, c, ev) + case "message.created": + return h.comment(ctx, db, c, ev) + default: + // Silently ignore unhandled event types so the dispatcher does not + // retry on irrelevant traffic. + return 200, nil + } +} + +func (h *jiraHandler) create(ctx context.Context, db *DB, c jiraConfig, ev Event) (int, error) { + if ev.CardID == "" { + return 0, nil + } + card, err := db.getCardForJira(ev.CardID) + if err != nil { + return 0, err + } + if card.JiraKey != "" { + // Idempotent: card already linked to Jira; treat as update. + return h.update(ctx, db, c, ev) + } + if c.ProjectKey == "" { + return 0, fmt.Errorf("project_key required for create") + } + body := map[string]interface{}{ + "fields": map[string]interface{}{ + "project": map[string]string{"key": c.ProjectKey}, + "summary": card.Title, + "description": adfText(card.Description), + "issuetype": map[string]string{"name": "Task"}, + }, + } + status, resp, err := h.jiraRequest(ctx, c, http.MethodPost, "/rest/api/3/issue", body) + if err != nil { + return status, err + } + var parsed struct { + Key string `json:"key"` + } + _ = json.Unmarshal(resp, &parsed) + if parsed.Key != "" { + if err := db.setCardJiraKey(card.ID, parsed.Key); err != nil { + return status, fmt.Errorf("link jira key: %w", err) + } + } + return status, nil +} + +func (h *jiraHandler) update(ctx context.Context, db *DB, c jiraConfig, ev Event) (int, error) { + if ev.CardID == "" { + return 0, nil + } + card, err := db.getCardForJira(ev.CardID) + if err != nil { + return 0, err + } + if card.JiraKey == "" { + // Card not yet linked — bootstrap by creating it. + return h.create(ctx, db, c, ev) + } + body := map[string]interface{}{ + "fields": map[string]interface{}{ + "summary": card.Title, + "description": adfText(card.Description), + }, + } + status, _, err := h.jiraRequest(ctx, c, http.MethodPut, "/rest/api/3/issue/"+card.JiraKey, body) + return status, err +} + +// transition uses the configured status_map to translate the kanban column +// to a Jira transition name. We list available transitions, find the one +// whose target status name matches, and POST it. Kanban remains the source +// of truth even if Jira's current state differs. +func (h *jiraHandler) transition(ctx context.Context, db *DB, c jiraConfig, ev Event) (int, error) { + if ev.CardID == "" { + return 0, nil + } + card, err := db.getCardForJira(ev.CardID) + if err != nil { + return 0, err + } + if card.JiraKey == "" { + return h.create(ctx, db, c, ev) + } + target, ok := c.StatusMap[card.ColumnName] + if !ok || target == "" { + return 0, fmt.Errorf("no status_map entry for column %q", card.ColumnName) + } + status, body, err := h.jiraRequest(ctx, c, http.MethodGet, "/rest/api/3/issue/"+card.JiraKey+"/transitions", nil) + if err != nil { + return status, err + } + var available struct { + Transitions []struct { + ID string `json:"id"` + Name string `json:"name"` + To struct { + Name string `json:"name"` + } `json:"to"` + } `json:"transitions"` + } + if err := json.Unmarshal(body, &available); err != nil { + return status, fmt.Errorf("decode transitions: %w", err) + } + var tID string + for _, t := range available.Transitions { + if strings.EqualFold(t.To.Name, target) || strings.EqualFold(t.Name, target) { + tID = t.ID + break + } + } + if tID == "" { + return 0, fmt.Errorf("transition %q not available for %s", target, card.JiraKey) + } + req := map[string]interface{}{"transition": map[string]string{"id": tID}} + status, _, err = h.jiraRequest(ctx, c, http.MethodPost, "/rest/api/3/issue/"+card.JiraKey+"/transitions", req) + return status, err +} + +func (h *jiraHandler) comment(ctx context.Context, db *DB, c jiraConfig, ev Event) (int, error) { + if ev.CardID == "" { + return 0, nil + } + card, err := db.getCardForJira(ev.CardID) + if err != nil { + return 0, err + } + if card.JiraKey == "" { + // Cannot comment on a card not yet synced; skip. + return 0, nil + } + var payload struct { + Body string `json:"body"` + } + _ = json.Unmarshal(ev.Payload, &payload) + if payload.Body == "" { + return 0, nil + } + body := map[string]interface{}{"body": adfText(payload.Body)} + status, _, err := h.jiraRequest(ctx, c, http.MethodPost, "/rest/api/3/issue/"+card.JiraKey+"/comment", body) + return status, err +} + +// adfText wraps a plain string into the minimal Atlassian Document Format +// fragment Jira Cloud requires for description / comment bodies. +func adfText(s string) map[string]interface{} { + return map[string]interface{}{ + "type": "doc", + "version": 1, + "content": []map[string]interface{}{{ + "type": "paragraph", + "content": []map[string]interface{}{{ + "type": "text", + "text": s, + }}, + }}, + } +} diff --git a/backend/modules_crypto.go b/backend/modules_crypto.go new file mode 100644 index 0000000..3a41367 --- /dev/null +++ b/backend/modules_crypto.go @@ -0,0 +1,68 @@ +package main + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "crypto/sha256" + "errors" + "fmt" + "io" + "os" +) + +const moduleKeyEnv = "KANBAN_MODULE_KEY" + +// moduleKey derives a 32-byte AES key from the KANBAN_MODULE_KEY env var. +// Returns (key, true) when present; (zero, false) when missing — callers +// must treat that as "module dispatcher disabled". +func moduleKey() ([32]byte, bool) { + v := os.Getenv(moduleKeyEnv) + if v == "" { + return [32]byte{}, false + } + return sha256.Sum256([]byte(v)), true +} + +// encryptConfig encrypts a JSON config blob with AES-GCM. Returns the +// ciphertext and the 12-byte nonce. Caller persists both columns. +func encryptConfig(plain []byte) (cipherOut, nonce []byte, err error) { + key, ok := moduleKey() + if !ok { + return nil, nil, fmt.Errorf("%s not set; cannot encrypt module config", moduleKeyEnv) + } + block, err := aes.NewCipher(key[:]) + if err != nil { + return nil, nil, err + } + gcm, err := cipher.NewGCM(block) + if err != nil { + return nil, nil, err + } + nonce = make([]byte, gcm.NonceSize()) + if _, err := io.ReadFull(rand.Reader, nonce); err != nil { + return nil, nil, err + } + cipherOut = gcm.Seal(nil, nonce, plain, nil) + return cipherOut, nonce, nil +} + +// decryptConfig is the inverse of encryptConfig. +func decryptConfig(cipherIn, nonce []byte) ([]byte, error) { + key, ok := moduleKey() + if !ok { + return nil, fmt.Errorf("%s not set; cannot decrypt module config", moduleKeyEnv) + } + if len(nonce) == 0 { + return nil, errors.New("nonce empty") + } + block, err := aes.NewCipher(key[:]) + if err != nil { + return nil, err + } + gcm, err := cipher.NewGCM(block) + if err != nil { + return nil, err + } + return gcm.Open(nil, nonce, cipherIn, nil) +} diff --git a/backend/modules_handlers.go b/backend/modules_handlers.go new file mode 100644 index 0000000..8d5f6cc --- /dev/null +++ b/backend/modules_handlers.go @@ -0,0 +1,226 @@ +package main + +import ( + "context" + "encoding/json" + "net/http" + "strconv" + "strings" + "time" + + "fn-registry/functions/infra" +) + +// requireAdmin gates a handler so only users with users.is_admin = 1 can +// reach it. Non-admins get a 403. Anonymous callers get a 401. +func requireAdmin(db *DB, next http.HandlerFunc) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + uid, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if uid == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + ok, err := db.IsAdmin(uid) + if err != nil { + serverError(w, err) + return + } + if !ok { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusForbidden, Code: "forbidden", Message: "admin required"}) + return + } + next(w, r) + } +} + +// publicModule strips secrets out of the config before responding. The +// API token is never returned to the client after it has been stored. +func publicModule(m Module) Module { + clone := m + if clone.Config != nil { + cleaned := JSONValue{} + for k, v := range clone.Config { + if strings.Contains(strings.ToLower(k), "token") || strings.Contains(strings.ToLower(k), "password") || strings.Contains(strings.ToLower(k), "secret") { + cleaned[k] = "***" + } else { + cleaned[k] = v + } + } + clone.Config = cleaned + } + return clone +} + +func handleListModules(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + mods, err := db.listModulesAll() + if err != nil { + serverError(w, err) + return + } + out := make([]Module, 0, len(mods)) + for _, m := range mods { + out = append(out, publicModule(m)) + } + infra.HTTPJSONResponse(w, http.StatusOK, out) + }) +} + +type modulePayload struct { + Name string `json:"name"` + Kind string `json:"kind"` + Enabled bool `json:"enabled"` + EventFilter []string `json:"event_filter"` + Config JSONValue `json:"config"` +} + +func handleCreateModule(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + var body modulePayload + if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { + badRequest(w, err.Error()) + return + } + if body.Name == "" || body.Kind == "" { + badRequest(w, "name and kind required") + return + } + m := &Module{ + Name: body.Name, Kind: body.Kind, Enabled: body.Enabled, + EventFilter: body.EventFilter, Config: body.Config, + } + if err := db.saveModule(m); err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusCreated, publicModule(*m)) + }) +} + +func handleUpdateModule(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + existing, err := db.getModule(id) + if err != nil { + notFound(w, "module not found") + return + } + // Partial body: preserve fields the client did not include. We rely + // on a generic map to detect omitted vs explicit-null because PATCH + // callers do not always send the full record. + var raw map[string]json.RawMessage + if err := infra.HTTPParseBody(r, &raw, maxBodyBytes); err != nil { + badRequest(w, err.Error()) + return + } + decode := func(key string, into interface{}) { + if v, ok := raw[key]; ok { + _ = json.Unmarshal(v, into) + } + } + decode("name", &existing.Name) + decode("kind", &existing.Kind) + decode("enabled", &existing.Enabled) + if v, ok := raw["event_filter"]; ok { + _ = json.Unmarshal(v, &existing.EventFilter) + } + if v, ok := raw["config"]; ok { + var cfg JSONValue + _ = json.Unmarshal(v, &cfg) + // Re-inject masked fields the UI left as "***" so a partial + // edit does not nuke stored secrets. + merged := JSONValue{} + for k, val := range existing.Config { + merged[k] = val + } + for k, val := range cfg { + if s, isStr := val.(string); isStr && s == "***" { + continue + } + merged[k] = val + } + existing.Config = merged + } + if err := db.saveModule(existing); err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, publicModule(*existing)) + }) +} + +func handleDeleteModule(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + if err := db.deleteModule(id); err != nil { + serverError(w, err) + return + } + w.WriteHeader(http.StatusNoContent) + }) +} + +func handleModuleLogs(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + limit := 100 + if v := r.URL.Query().Get("limit"); v != "" { + if n, err := strconv.Atoi(v); err == nil && n > 0 && n <= 1000 { + limit = n + } + } + out, err := db.listModuleLogs(id, limit) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, out) + }) +} + +// handleTestModule executes the kind-specific test_connection probe with +// the *current stored config* (or with an incoming config payload, for +// pre-save validation). Returns {ok, status, error} regardless of outcome +// so the UI can show a useful message. +func handleTestModule(db *DB, dispatcher *Dispatcher) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + var m *Module + if id == "draft" { + // Pre-save test path: caller supplies a full module payload. + var body modulePayload + if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { + badRequest(w, err.Error()) + return + } + m = &Module{Kind: body.Kind, Config: body.Config} + } else { + got, err := db.getModule(id) + if err != nil { + notFound(w, "module not found") + return + } + m = got + } + h, ok := dispatcher.handlers[m.Kind] + if !ok { + infra.HTTPJSONResponse(w, http.StatusOK, map[string]interface{}{ + "ok": false, "status": 0, "error": "unknown kind: " + m.Kind, + }) + return + } + ctx, cancel := context.WithTimeout(r.Context(), moduleHTTPTimeout) + defer cancel() + start := time.Now() + status, err := h.TestConnection(ctx, *m) + resp := map[string]interface{}{ + "ok": err == nil, + "status": status, + "duration_ms": int(time.Since(start).Milliseconds()), + } + if err != nil { + resp["error"] = err.Error() + } + infra.HTTPJSONResponse(w, http.StatusOK, resp) + }) +} diff --git a/backend/modules_test.go b/backend/modules_test.go new file mode 100644 index 0000000..3ac8d24 --- /dev/null +++ b/backend/modules_test.go @@ -0,0 +1,227 @@ +package main + +import ( + "context" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "os" + "strings" + "testing" + "time" +) + +// withModuleKey sets KANBAN_MODULE_KEY for the duration of a test and +// restores the previous value afterwards. +func withModuleKey(t *testing.T, value string) { + t.Helper() + prev := os.Getenv(moduleKeyEnv) + t.Setenv(moduleKeyEnv, value) + t.Cleanup(func() { _ = os.Setenv(moduleKeyEnv, prev) }) +} + +func TestCryptoRoundTrip(t *testing.T) { + withModuleKey(t, "test-passphrase") + plain := []byte(`{"hello":"world"}`) + cipherBlob, nonce, err := encryptConfig(plain) + if err != nil { + t.Fatalf("encrypt: %v", err) + } + got, err := decryptConfig(cipherBlob, nonce) + if err != nil { + t.Fatalf("decrypt: %v", err) + } + if string(got) != string(plain) { + t.Fatalf("roundtrip mismatch: got %q want %q", got, plain) + } +} + +func TestCryptoMissingKey(t *testing.T) { + t.Setenv(moduleKeyEnv, "") + if _, _, err := encryptConfig([]byte("x")); err == nil { + t.Fatal("expected error when KANBAN_MODULE_KEY unset") + } +} + +func TestSaveAndLoadModule(t *testing.T) { + withModuleKey(t, "test-passphrase") + db := setupTestDB(t) + m := &Module{ + Name: "jira-test", Kind: "jira", Enabled: true, + EventFilter: []string{"card.created", "card.moved"}, + Config: JSONValue{ + "base_url": "https://example.atlassian.net", + "email": "x@y.z", + "api_token": "secret-123", + }, + } + if err := db.saveModule(m); err != nil { + t.Fatalf("save: %v", err) + } + if m.ID == "" { + t.Fatal("ID not assigned on insert") + } + got, err := db.getModule(m.ID) + if err != nil { + t.Fatalf("get: %v", err) + } + if got.Config["api_token"] != "secret-123" { + t.Fatalf("token roundtrip failed: %v", got.Config["api_token"]) + } +} + +func TestFilterMatches(t *testing.T) { + if !filterMatches([]string{"card.created"}, "card.created") { + t.Fatal("exact match") + } + if !filterMatches([]string{"*"}, "anything") { + t.Fatal("wildcard") + } + if filterMatches([]string{"card.created"}, "card.moved") { + t.Fatal("non-match should be false") + } +} + +func TestCardOptOutTag(t *testing.T) { + c := cardForJira{Tags: []string{"foo", "NoJira", "bar"}} + if !c.hasTag("nojira") { + t.Fatal("nojira (case-insensitive) not detected") + } + if c.hasTag("missing") { + t.Fatal("missing tag returned true") + } +} + +func TestJiraHandler_TransitionMappingMissing(t *testing.T) { + withModuleKey(t, "k") + db := setupTestDB(t) + col, _ := db.CreateColumn("Backlog") + card, _ := db.CreateCard(col.ID, "req", "t", "d", "") + // Link the card so the create-fallback path is skipped. + _ = db.setCardJiraKey(card.ID, "KAN-1") + h := &jiraHandler{} + _, err := h.transition(context.Background(), db, jiraConfig{BaseURL: "http://x"}, Event{Type: "card.moved", CardID: card.ID}) + if err == nil || !strings.Contains(err.Error(), "status_map") { + t.Fatalf("expected status_map error, got %v", err) + } +} + +func TestJiraHandler_TestConnectionHitsMyself(t *testing.T) { + var path string + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + path = r.URL.Path + w.WriteHeader(http.StatusOK) + _, _ = io.WriteString(w, `{"accountId":"abc"}`) + })) + defer srv.Close() + h := &jiraHandler{} + m := Module{Kind: "jira", Config: JSONValue{ + "base_url": srv.URL, + "email": "x@y.z", + "api_token": "tok", + }} + status, err := h.TestConnection(context.Background(), m) + if err != nil { + t.Fatalf("TestConnection: %v", err) + } + if status != 200 { + t.Fatalf("status = %d, want 200", status) + } + if path != "/rest/api/3/myself" { + t.Fatalf("path = %q, want /rest/api/3/myself", path) + } +} + +func TestJiraHandler_CreateLinksCardKey(t *testing.T) { + withModuleKey(t, "test-passphrase") + db := setupTestDB(t) + user, _ := db.CreateUser("alice", "passw", "Alice") + col, _ := db.CreateColumn("Todo") + card, _ := db.CreateCard(col.ID, "req", "Buy bread", "desc", user.ID) + + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method == http.MethodPost && r.URL.Path == "/rest/api/3/issue" { + b, _ := io.ReadAll(r.Body) + var p struct { + Fields struct { + Summary string `json:"summary"` + } `json:"fields"` + } + _ = json.Unmarshal(b, &p) + if p.Fields.Summary != "Buy bread" { + t.Errorf("summary = %q", p.Fields.Summary) + } + w.WriteHeader(http.StatusCreated) + _, _ = io.WriteString(w, `{"id":"10000","key":"KAN-1"}`) + return + } + w.WriteHeader(http.StatusNotFound) + })) + defer srv.Close() + + h := &jiraHandler{} + mod := Module{Kind: "jira", Config: JSONValue{ + "base_url": srv.URL, + "email": "x@y.z", + "api_token": "tok", + "project_key": "KAN", + "status_map": map[string]interface{}{"Todo": "To Do"}, + }} + status, err := h.Handle(context.Background(), db, mod, Event{Type: "card.created", CardID: card.ID}) + if err != nil { + t.Fatalf("Handle: %v", err) + } + if status != http.StatusCreated { + t.Fatalf("status = %d, want 201", status) + } + again, err := db.getCardForJira(card.ID) + if err != nil { + t.Fatalf("get card: %v", err) + } + if again.JiraKey != "KAN-1" { + t.Fatalf("jira_key = %q, want KAN-1", again.JiraKey) + } +} + +func TestDispatcher_Cutoff(t *testing.T) { + withModuleKey(t, "k") + db := setupTestDB(t) + col, _ := db.CreateColumn("Todo") + // Create card BEFORE the module so cutoffOK rejects it. + card, _ := db.CreateCard(col.ID, "req", "t", "d", "") + time.Sleep(20 * time.Millisecond) + mod := Module{ID: "m", CreatedAt: nowRFC3339()} + if cutoffOK(db, mod, Event{CardID: card.ID}) { + t.Fatal("card pre-dating module should be filtered out") + } + // Once linked, cutoff should allow it. + _ = db.setCardJiraKey(card.ID, "KAN-9") + if !cutoffOK(db, mod, Event{CardID: card.ID}) { + t.Fatal("linked card must pass cutoff even if older") + } +} + +func TestIsAdmin(t *testing.T) { + db := setupTestDB(t) + u, _ := db.CreateUser("egutierrez", "passw", "Egu") + // Migration 015 marks egutierrez admin via UPDATE WHERE username, but + // that only takes effect when the row already exists. In production + // the migration runs against an existing user list; in tests we create + // users after migration, so simulate the same outcome explicitly. + if _, err := db.conn.Exec(`UPDATE users SET is_admin = 1 WHERE username = ?`, "egutierrez"); err != nil { + t.Fatalf("seed admin: %v", err) + } + ok, err := db.IsAdmin(u.ID) + if err != nil { + t.Fatalf("IsAdmin: %v", err) + } + if !ok { + t.Fatal("egutierrez must be admin after seed") + } + other, _ := db.CreateUser("alice", "passw", "Alice") + ok, _ = db.IsAdmin(other.ID) + if ok { + t.Fatal("alice must not be admin by default") + } +} diff --git a/backend/notifications.go b/backend/notifications.go new file mode 100644 index 0000000..913d5f9 --- /dev/null +++ b/backend/notifications.go @@ -0,0 +1,328 @@ +package main + +import ( + "database/sql" + "fmt" + "regexp" + "strings" + "time" +) + +// Notification kinds, ordered by priority (highest first). When a single +// message triggers multiple kinds for one user, the highest-priority kind +// is the one persisted. +const ( + NotifKindMention = "mention" + NotifKindAssignedChat = "assigned_chat" + NotifKindReply = "reply" +) + +func notifKindPriority(k string) int { + switch k { + case NotifKindMention: + return 3 + case NotifKindAssignedChat: + return 2 + case NotifKindReply: + return 1 + } + return 0 +} + +type Notification struct { + ID string `json:"id"` + UserID string `json:"user_id"` + CardID string `json:"card_id"` + MessageID string `json:"message_id"` + Kind string `json:"kind"` + ActorID string `json:"actor_id"` + CreatedAt string `json:"created_at"` + ReadAt *string `json:"read_at"` + CardTitle string `json:"card_title"` + CardSeqNum int `json:"card_seq_num"` + ActorName string `json:"actor_name"` + Snippet string `json:"snippet"` +} + +type CardMention struct { + ID string `json:"id"` + CardID string `json:"card_id"` + MessageID string `json:"message_id"` + UserID string `json:"user_id"` + CreatedAt string `json:"created_at"` +} + +var mentionRe = regexp.MustCompile(`(?i)@([a-z0-9][a-z0-9_.-]{0,63})`) + +// extractMentions returns the set of @usernames referenced in body, lowercased. +// The leading '@' is not included. Each username is returned at most once. +func extractMentions(body string) []string { + matches := mentionRe.FindAllStringSubmatch(body, -1) + if len(matches) == 0 { + return nil + } + seen := map[string]struct{}{} + out := make([]string, 0, len(matches)) + for _, m := range matches { + u := strings.ToLower(m[1]) + if _, ok := seen[u]; ok { + continue + } + seen[u] = struct{}{} + out = append(out, u) + } + return out +} + +// CreateCardMessageAndNotify wraps CreateCardMessage with mention parsing, +// notification fan-out and pub/sub publication. The returned slice contains +// the user_ids that received a notification (useful for tests). +func (db *DB) CreateCardMessageAndNotify(cardID, authorID, body string, hub *EventHub) (*CardMessage, []Notification, []CardMention, error) { + msg, err := db.CreateCardMessage(cardID, authorID, body) + if err != nil { + return nil, nil, nil, err + } + + mentions, err := db.resolveAndStoreMentions(cardID, msg.ID, body) + if err != nil { + return msg, nil, nil, err + } + + notifs, err := db.fanoutNotifications(cardID, msg, authorID, mentions) + if err != nil { + return msg, nil, mentions, err + } + + if hub != nil { + hub.PublishJSON("message.created", cardID, "", msg) + for _, n := range notifs { + hub.PublishJSON("notification.created", cardID, n.UserID, n) + } + } + return msg, notifs, mentions, nil +} + +// resolveAndStoreMentions parses @usernames from body, resolves them to +// existing user_ids (silently ignoring unknowns) and persists the matches +// in card_mentions. +func (db *DB) resolveAndStoreMentions(cardID, messageID, body string) ([]CardMention, error) { + usernames := extractMentions(body) + if len(usernames) == 0 { + return nil, nil + } + placeholders := strings.Repeat("?,", len(usernames)) + placeholders = placeholders[:len(placeholders)-1] + args := make([]interface{}, 0, len(usernames)) + for _, u := range usernames { + args = append(args, u) + } + rows, err := db.conn.Query( + fmt.Sprintf(`SELECT id, username FROM users WHERE username IN (%s)`, placeholders), + args..., + ) + if err != nil { + return nil, err + } + defer rows.Close() + resolved := map[string]string{} + for rows.Next() { + var id, uname string + if err := rows.Scan(&id, &uname); err != nil { + return nil, err + } + resolved[uname] = id + } + if err := rows.Err(); err != nil { + return nil, err + } + if len(resolved) == 0 { + return nil, nil + } + now := time.Now().UTC().Format(time.RFC3339) + out := make([]CardMention, 0, len(resolved)) + for _, userID := range resolved { + m := CardMention{ID: newID(), CardID: cardID, MessageID: messageID, UserID: userID, CreatedAt: now} + if _, err := db.conn.Exec( + `INSERT INTO card_mentions (id, card_id, message_id, user_id, created_at) VALUES (?, ?, ?, ?, ?)`, + m.ID, m.CardID, m.MessageID, m.UserID, m.CreatedAt, + ); err != nil { + return out, err + } + out = append(out, m) + } + return out, nil +} + +// fanoutNotifications computes the recipient set for a new message and +// inserts one notification row per recipient with the highest-priority kind. +// +// Recipients = {assignee_id of card} ∪ {previous authors of card_messages +// on this card} ∪ {users mentioned in this message} \ {author}. +// +// Kind precedence: mention > assigned_chat > reply. +func (db *DB) fanoutNotifications(cardID string, msg *CardMessage, authorID string, mentions []CardMention) ([]Notification, error) { + recipients := map[string]string{} // userID -> kind + + upgrade := func(userID, kind string) { + if userID == "" || userID == authorID { + return + } + existing, ok := recipients[userID] + if !ok || notifKindPriority(kind) > notifKindPriority(existing) { + recipients[userID] = kind + } + } + + // Previous authors on this card. + rows, err := db.conn.Query( + `SELECT DISTINCT author_id FROM card_messages + WHERE card_id = ? AND author_id IS NOT NULL AND author_id != '' AND id != ?`, + cardID, msg.ID, + ) + if err != nil { + return nil, err + } + for rows.Next() { + var uid sql.NullString + if err := rows.Scan(&uid); err != nil { + rows.Close() + return nil, err + } + if uid.Valid { + upgrade(uid.String, NotifKindReply) + } + } + rows.Close() + + // Assignee. + var assignee sql.NullString + if err := db.conn.QueryRow(`SELECT assignee_id FROM cards WHERE id = ?`, cardID).Scan(&assignee); err != nil && err != sql.ErrNoRows { + return nil, err + } + if assignee.Valid { + upgrade(assignee.String, NotifKindAssignedChat) + } + + // Mentions (highest priority). + for _, m := range mentions { + upgrade(m.UserID, NotifKindMention) + } + + if len(recipients) == 0 { + return nil, nil + } + + now := time.Now().UTC().Format(time.RFC3339) + out := make([]Notification, 0, len(recipients)) + + // Snippet for hydrated notif payload. + snippet := msg.Body + if len(snippet) > 140 { + snippet = snippet[:140] + "…" + } + var cardTitle string + var cardSeq int + _ = db.conn.QueryRow(`SELECT title, seq_num FROM cards WHERE id = ?`, cardID).Scan(&cardTitle, &cardSeq) + var actorName string + _ = db.conn.QueryRow(`SELECT COALESCE(NULLIF(display_name, ''), username) FROM users WHERE id = ?`, authorID).Scan(&actorName) + + for userID, kind := range recipients { + n := Notification{ + ID: newID(), UserID: userID, CardID: cardID, MessageID: msg.ID, + Kind: kind, ActorID: authorID, CreatedAt: now, + CardTitle: cardTitle, CardSeqNum: cardSeq, ActorName: actorName, Snippet: snippet, + } + if _, err := db.conn.Exec( + `INSERT INTO notifications (id, user_id, card_id, message_id, kind, actor_id, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)`, + n.ID, n.UserID, n.CardID, n.MessageID, n.Kind, n.ActorID, n.CreatedAt, + ); err != nil { + return out, err + } + out = append(out, n) + } + return out, nil +} + +// ListNotifications returns notifications for userID. If onlyUnread is true, +// already-read entries are skipped. Limit defaults to 50 when <= 0. +func (db *DB) ListNotifications(userID string, onlyUnread bool, limit int) ([]Notification, error) { + if limit <= 0 { + limit = 50 + } + q := `SELECT n.id, n.user_id, n.card_id, n.message_id, n.kind, n.actor_id, n.created_at, n.read_at, + COALESCE(c.title, ''), COALESCE(c.seq_num, 0), + COALESCE(NULLIF(u.display_name, ''), u.username, ''), + COALESCE(m.body, '') + FROM notifications n + LEFT JOIN cards c ON c.id = n.card_id + LEFT JOIN users u ON u.id = n.actor_id + LEFT JOIN card_messages m ON m.id = n.message_id + WHERE n.user_id = ?` + if onlyUnread { + q += ` AND n.read_at IS NULL` + } + q += ` ORDER BY n.created_at DESC LIMIT ?` + rows, err := db.conn.Query(q, userID, limit) + if err != nil { + return nil, err + } + defer rows.Close() + out := []Notification{} + for rows.Next() { + var n Notification + var readAt sql.NullString + var body string + if err := rows.Scan(&n.ID, &n.UserID, &n.CardID, &n.MessageID, &n.Kind, &n.ActorID, &n.CreatedAt, + &readAt, &n.CardTitle, &n.CardSeqNum, &n.ActorName, &body); err != nil { + return nil, err + } + if readAt.Valid { + s := readAt.String + n.ReadAt = &s + } + if len(body) > 140 { + n.Snippet = body[:140] + "…" + } else { + n.Snippet = body + } + out = append(out, n) + } + return out, rows.Err() +} + +func (db *DB) CountUnreadNotifications(userID string) (int, error) { + var n int + err := db.conn.QueryRow( + `SELECT COUNT(*) FROM notifications WHERE user_id = ? AND read_at IS NULL`, userID, + ).Scan(&n) + return n, err +} + +func (db *DB) MarkNotificationRead(userID, notifID string) error { + now := time.Now().UTC().Format(time.RFC3339) + res, err := db.conn.Exec( + `UPDATE notifications SET read_at = ? WHERE id = ? AND user_id = ? AND read_at IS NULL`, + now, notifID, userID, + ) + if err != nil { + return err + } + if n, _ := res.RowsAffected(); n == 0 { + // Not an error: idempotent. + return nil + } + return nil +} + +func (db *DB) MarkAllNotificationsRead(userID string) (int, error) { + now := time.Now().UTC().Format(time.RFC3339) + res, err := db.conn.Exec( + `UPDATE notifications SET read_at = ? WHERE user_id = ? AND read_at IS NULL`, + now, userID, + ) + if err != nil { + return 0, err + } + n, _ := res.RowsAffected() + return int(n), nil +} diff --git a/backend/notifications_test.go b/backend/notifications_test.go new file mode 100644 index 0000000..2bbe0d7 --- /dev/null +++ b/backend/notifications_test.go @@ -0,0 +1,179 @@ +package main + +import ( + "reflect" + "sort" + "testing" +) + +func TestExtractMentions(t *testing.T) { + cases := []struct { + in string + want []string + }{ + {"hola @alice", []string{"alice"}}, + {"@Bob y @bob mismo", []string{"bob"}}, + {"sin menciones", nil}, + {"email@foo.com no cuenta como @real_user", []string{"foo.com", "real_user"}}, + {"@a-b-c y @d.e", []string{"a-b-c", "d.e"}}, + } + for _, c := range cases { + got := extractMentions(c.in) + sort.Strings(got) + sort.Strings(c.want) + if !reflect.DeepEqual(got, c.want) { + t.Errorf("extractMentions(%q) = %v, want %v", c.in, got, c.want) + } + } +} + +func mkUser(t *testing.T, db *DB, username string) string { + t.Helper() + u, err := db.CreateUser(username, "passw", username) + if err != nil { + t.Fatalf("CreateUser %q: %v", username, err) + } + return u.ID +} + +func mkCard(t *testing.T, db *DB, columnID, requester, title, assigneeID string) string { + t.Helper() + c, err := db.CreateCard(columnID, requester, title, "", "") + if err != nil { + t.Fatalf("CreateCard: %v", err) + } + if assigneeID != "" { + if err := db.UpdateCardWithActor(c.ID, CardPatch{AssigneeID: &assigneeID, HasAssignee: true}, ""); err != nil { + t.Fatalf("assign: %v", err) + } + } + return c.ID +} + +func TestCreateCardMessageAndNotify_AssigneeAndPreviousAuthors(t *testing.T) { + db := setupTestDB(t) + + alice := mkUser(t, db, "alice") + bob := mkUser(t, db, "bob") + carol := mkUser(t, db, "carol") + + col, err := db.CreateColumn("Todo") + if err != nil { + t.Fatalf("CreateColumn: %v", err) + } + card := mkCard(t, db, col.ID, "x", "card", bob) + + // 1) alice writes; bob is assignee → bob gets assigned_chat. + _, notifs, _, err := db.CreateCardMessageAndNotify(card, alice, "hola", nil) + if err != nil { + t.Fatalf("create msg: %v", err) + } + if len(notifs) != 1 || notifs[0].UserID != bob || notifs[0].Kind != NotifKindAssignedChat { + t.Fatalf("expected single assigned_chat for bob, got %+v", notifs) + } + + // 2) carol replies (carol is neither assignee nor previous author). + // alice (previous author) gets reply; bob (assignee) gets assigned_chat. + _, notifs, _, err = db.CreateCardMessageAndNotify(card, carol, "hola alice", nil) + if err != nil { + t.Fatalf("create msg: %v", err) + } + gotKinds := map[string]string{} + for _, n := range notifs { + gotKinds[n.UserID] = n.Kind + } + wantKinds := map[string]string{alice: NotifKindReply, bob: NotifKindAssignedChat} + if !reflect.DeepEqual(gotKinds, wantKinds) { + t.Fatalf("kinds = %+v, want %+v", gotKinds, wantKinds) + } +} + +func TestCreateCardMessageAndNotify_MentionsBeatOtherKinds(t *testing.T) { + db := setupTestDB(t) + alice := mkUser(t, db, "alice") + bob := mkUser(t, db, "bob") + col, _ := db.CreateColumn("Todo") + card := mkCard(t, db, col.ID, "x", "card", bob) // bob is assignee + + // alice mentions bob explicitly → kind must be 'mention', not 'assigned_chat'. + _, notifs, mentions, err := db.CreateCardMessageAndNotify(card, alice, "oye @bob mira esto", nil) + if err != nil { + t.Fatalf("create: %v", err) + } + if len(mentions) != 1 || mentions[0].UserID != bob { + t.Fatalf("mentions = %+v, want [bob]", mentions) + } + if len(notifs) != 1 || notifs[0].UserID != bob || notifs[0].Kind != NotifKindMention { + t.Fatalf("notifs = %+v, want single mention for bob", notifs) + } +} + +func TestCreateCardMessageAndNotify_UnknownMentionsIgnored(t *testing.T) { + db := setupTestDB(t) + alice := mkUser(t, db, "alice") + col, _ := db.CreateColumn("Todo") + card := mkCard(t, db, col.ID, "x", "card", "") + + _, notifs, mentions, err := db.CreateCardMessageAndNotify(card, alice, "hola @noexiste", nil) + if err != nil { + t.Fatalf("create: %v", err) + } + if len(mentions) != 0 || len(notifs) != 0 { + t.Fatalf("got mentions=%v notifs=%v, want empty", mentions, notifs) + } +} + +func TestCreateCardMessageAndNotify_AuthorNeverSelfNotified(t *testing.T) { + db := setupTestDB(t) + alice := mkUser(t, db, "alice") + col, _ := db.CreateColumn("Todo") + card := mkCard(t, db, col.ID, "x", "card", alice) // alice is assignee + + // alice mentions herself + is assignee → no notification. + _, notifs, _, err := db.CreateCardMessageAndNotify(card, alice, "monologo @alice", nil) + if err != nil { + t.Fatalf("create: %v", err) + } + if len(notifs) != 0 { + t.Fatalf("notifs = %+v, want empty (self)", notifs) + } +} + +func TestListAndMarkRead(t *testing.T) { + db := setupTestDB(t) + alice := mkUser(t, db, "alice") + bob := mkUser(t, db, "bob") + col, _ := db.CreateColumn("Todo") + card := mkCard(t, db, col.ID, "x", "card", bob) + + _, _, _, _ = db.CreateCardMessageAndNotify(card, alice, "1", nil) + _, _, _, _ = db.CreateCardMessageAndNotify(card, alice, "2", nil) + + got, err := db.ListNotifications(bob, true, 0) + if err != nil { + t.Fatalf("list: %v", err) + } + if len(got) != 2 { + t.Fatalf("len = %d, want 2", len(got)) + } + if n, _ := db.CountUnreadNotifications(bob); n != 2 { + t.Fatalf("unread count = %d, want 2", n) + } + + if err := db.MarkNotificationRead(bob, got[0].ID); err != nil { + t.Fatalf("mark read: %v", err) + } + if n, _ := db.CountUnreadNotifications(bob); n != 1 { + t.Fatalf("unread count after mark = %d, want 1", n) + } + // idempotent + if err := db.MarkNotificationRead(bob, got[0].ID); err != nil { + t.Fatalf("mark read 2nd time: %v", err) + } + if n, _ := db.MarkAllNotificationsRead(bob); n != 1 { + t.Fatalf("mark all = %d, want 1", n) + } + if n, _ := db.CountUnreadNotifications(bob); n != 0 { + t.Fatalf("unread count after mark-all = %d, want 0", n) + } +} diff --git a/backend/realtime.go b/backend/realtime.go new file mode 100644 index 0000000..062c32b --- /dev/null +++ b/backend/realtime.go @@ -0,0 +1,297 @@ +package main + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "time" + + "fn-registry/functions/infra" + "nhooyr.io/websocket" +) + +const ( + sseHeartbeat = 25 * time.Second + wsChatHeartbeat = 30 * time.Second + wsChatReadLimit = 64 * 1024 + wsChatWriteWait = 5 * time.Second + typingDebounceMs = 1500 +) + +// handleEventStream serves the per-user SSE channel. +// +// One stream per browser tab. Auto-reconnect lives on the client (browsers +// retry EventSource by default). The server publishes: +// +// board.* — column/card mutations (broadcast to every user). +// message.created — chat message added on any card (broadcast). +// notification.* — private events for one recipient (UserID set). +func handleEventStream(hub *EventHub) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + flusher, ok := w.(http.Flusher) + if !ok { + http.Error(w, "streaming unsupported", http.StatusInternalServerError) + return + } + w.Header().Set("Content-Type", "text/event-stream") + w.Header().Set("Cache-Control", "no-cache, no-transform") + w.Header().Set("Connection", "keep-alive") + w.Header().Set("X-Accel-Buffering", "no") + w.WriteHeader(http.StatusOK) + // Initial flush so the browser knows the stream is open. + fmt.Fprint(w, ": hello\n\n") + flusher.Flush() + + ch := hub.SubscribeUser(userID) + defer hub.UnsubscribeUser(userID, ch) + + ticker := time.NewTicker(sseHeartbeat) + defer ticker.Stop() + + for { + select { + case <-r.Context().Done(): + return + case <-ticker.C: + if _, err := fmt.Fprint(w, ": ping\n\n"); err != nil { + return + } + flusher.Flush() + case ev, ok := <-ch: + if !ok { + return + } + if ev.UserID != "" && ev.UserID != userID { + // Defensive: hub already routes private events but the + // broadcast path could leak if a future change adds + // fan-out. Skip explicitly. + continue + } + b, err := json.Marshal(ev) + if err != nil { + continue + } + if _, err := fmt.Fprintf(w, "event: %s\ndata: %s\n\n", ev.Type, b); err != nil { + return + } + flusher.Flush() + } + } + } +} + +// cardChatWSIn is the message sent by the browser over the per-card WS. +type cardChatWSIn struct { + Type string `json:"type"` // "send" | "typing" + Body string `json:"body,omitempty"` // only for "send" +} + +// cardChatWSOut is the message the server pushes to subscribers of a card. +// +// Types: +// +// message.created — new CardMessage (full payload). +// typing — UserID is typing (no body). +// error — server-side error, connection stays open. +type cardChatWSOut struct { + Type string `json:"type"` + Message *CardMessage `json:"message,omitempty"` + UserID string `json:"user_id,omitempty"` + Error string `json:"error,omitempty"` +} + +// handleCardChatWS upgrades the request to WebSocket and provides bidirectional +// realtime chat for a single card. Each connection is subscribed to the +// card's event channel; sends originating from this connection are persisted +// then republished through the hub so peer connections (including this one) +// see them. +func handleCardChatWS(db *DB, hub *EventHub) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + cardID := r.PathValue("id") + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + // Confirm card exists before upgrading to avoid leaking goroutines on + // invalid IDs. + var exists int + if err := db.conn.QueryRow(`SELECT 1 FROM cards WHERE id = ?`, cardID).Scan(&exists); err != nil { + notFound(w, "card not found") + return + } + + conn, err := infra.WSUpgrader(w, r, []string{"*"}) + if err != nil { + return + } + defer conn.Close(websocket.StatusInternalError, "internal") + conn.SetReadLimit(wsChatReadLimit) + + ch := hub.SubscribeCard(cardID) + defer hub.UnsubscribeCard(cardID, ch) + + ctx, cancel := context.WithCancel(r.Context()) + defer cancel() + + // Writer goroutine: forward hub events to this socket. + go func() { + ticker := time.NewTicker(wsChatHeartbeat) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + wctx, c := context.WithTimeout(ctx, wsChatWriteWait) + _ = conn.Ping(wctx) + c() + case ev, ok := <-ch: + if !ok { + return + } + if ev.CardID != cardID { + continue + } + out := cardChatWSOut{Type: ev.Type} + switch ev.Type { + case "message.created": + var m CardMessage + if err := json.Unmarshal(ev.Payload, &m); err == nil { + out.Message = &m + } + case "card.typing": + var p struct { + UserID string `json:"user_id"` + } + _ = json.Unmarshal(ev.Payload, &p) + // Skip echoing the typer's own indicator. + if p.UserID == userID { + continue + } + out.UserID = p.UserID + default: + continue + } + b, err := json.Marshal(out) + if err != nil { + continue + } + wctx, c := context.WithTimeout(ctx, wsChatWriteWait) + if err := conn.Write(wctx, websocket.MessageText, b); err != nil { + c() + cancel() + return + } + c() + } + } + }() + + // Reader loop: persist sends and broadcast typing. + for { + _, raw, err := conn.Read(ctx) + if err != nil { + return + } + var in cardChatWSIn + if err := json.Unmarshal(raw, &in); err != nil { + continue + } + switch in.Type { + case "send": + if in.Body == "" { + continue + } + if _, _, _, err := db.CreateCardMessageAndNotify(cardID, userID, in.Body, hub); err != nil { + b, _ := json.Marshal(cardChatWSOut{Type: "error", Error: err.Error()}) + wctx, c := context.WithTimeout(ctx, wsChatWriteWait) + _ = conn.Write(wctx, websocket.MessageText, b) + c() + } + case "typing": + hub.PublishJSON("card.typing", cardID, "", map[string]string{"user_id": userID}) + } + } + } +} + +// Notification HTTP handlers. + +func handleListNotifications(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + onlyUnread := r.URL.Query().Get("unread") == "1" + limit := 50 + out, err := db.ListNotifications(userID, onlyUnread, limit) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, out) + } +} + +func handleUnreadCount(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + n, err := db.CountUnreadNotifications(userID) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, map[string]int{"count": n}) + } +} + +func handleMarkNotificationRead(db *DB, hub *EventHub) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + id := r.PathValue("id") + if err := db.MarkNotificationRead(userID, id); err != nil { + serverError(w, err) + return + } + if hub != nil { + hub.PublishJSON("notification.read", "", userID, map[string]string{"id": id}) + } + w.WriteHeader(http.StatusNoContent) + } +} + +func handleMarkAllNotificationsRead(db *DB, hub *EventHub) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + n, err := db.MarkAllNotificationsRead(userID) + if err != nil { + serverError(w, err) + return + } + if hub != nil { + hub.PublishJSON("notification.read_all", "", userID, map[string]int{"count": n}) + } + infra.HTTPJSONResponse(w, http.StatusOK, map[string]int{"count": n}) + } +} diff --git a/backend/tools.go b/backend/tools.go index 68d6896..d5f957b 100644 --- a/backend/tools.go +++ b/backend/tools.go @@ -50,6 +50,10 @@ func executeTool(db *DB, name string, input json.RawMessage) ToolResult { return toolListUsers(db) case "assign_card": return toolAssignCard(db, input) + case "add_comment": + return toolAddComment(db, input) + case "list_comments": + return toolListComments(db, input) default: return errMsg("unknown tool: " + name) } @@ -59,7 +63,8 @@ func executeTool(db *DB, name string, input json.RawMessage) ToolResult { func toolMutates(name string) bool { switch name { case "create_column", "update_column", "rename_column", "delete_column", "reorder_columns", - "create_card", "update_card", "delete_card", "move_card", "assign_card": + "create_card", "update_card", "delete_card", "move_card", "assign_card", + "add_comment": return true } return false @@ -347,9 +352,66 @@ func validateToolName(name string) error { "update_card": true, "delete_card": true, "move_card": true, "card_history": true, "find_cards": true, "list_users": true, "assign_card": true, + "add_comment": true, "list_comments": true, } if !known[name] { return fmt.Errorf("unknown tool: %s", name) } return nil } + +// toolAddComment appends a comment (card_message) to a card. Accepts either +// {card_id, body, author_id} or {card_id, body, author_username}. Resolves +// the username to an id when needed. +func toolAddComment(db *DB, input json.RawMessage) ToolResult { + var in struct { + CardID string `json:"card_id"` + Body string `json:"body"` + AuthorID string `json:"author_id"` + AuthorUsername string `json:"author_username"` + } + if err := json.Unmarshal(input, &in); err != nil { + return errResult(err) + } + if in.CardID == "" { + return errMsg("card_id required") + } + if strings.TrimSpace(in.Body) == "" { + return errMsg("body required") + } + authorID := strings.TrimSpace(in.AuthorID) + if authorID == "" { + if in.AuthorUsername == "" { + return errMsg("author_id or author_username required") + } + u, _, err := db.GetUserByUsername(in.AuthorUsername) + if err != nil { + return errResult(fmt.Errorf("author_username: %w", err)) + } + authorID = u.ID + } + m, err := db.CreateCardMessage(in.CardID, authorID, in.Body) + if err != nil { + return errResult(err) + } + return okResult(m) +} + +// toolListComments returns every comment (card_message) attached to a card +// sorted by created_at ascending. +func toolListComments(db *DB, input json.RawMessage) ToolResult { + var in struct { + CardID string `json:"card_id"` + } + if err := json.Unmarshal(input, &in); err != nil { + return errResult(err) + } + if in.CardID == "" { + return errMsg("card_id required") + } + msgs, err := db.ListCardMessages(in.CardID) + if err != nil { + return errResult(err) + } + return okResult(msgs) +} diff --git a/backend/users.go b/backend/users.go index b6b49ce..4cf9247 100644 --- a/backend/users.go +++ b/backend/users.go @@ -14,6 +14,7 @@ type User struct { Username string `json:"username"` DisplayName string `json:"display_name"` Color string `json:"color"` + IsAdmin bool `json:"is_admin"` CreatedAt string `json:"created_at"` } @@ -51,36 +52,52 @@ func (db *DB) CreateUser(username, password, displayName string) (*User, error) func (db *DB) GetUserByID(id string) (*User, error) { var u User + var isAdmin int err := db.conn.QueryRow( - `SELECT id, username, display_name, color, created_at FROM users WHERE id=?`, id, - ).Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &u.CreatedAt) + `SELECT id, username, display_name, color, is_admin, created_at FROM users WHERE id=?`, id, + ).Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &isAdmin, &u.CreatedAt) if errors.Is(err, sql.ErrNoRows) { return nil, errUserNotFound } if err != nil { return nil, err } + u.IsAdmin = isAdmin == 1 return &u, nil } +func (db *DB) IsAdmin(userID string) (bool, error) { + if userID == "" { + return false, nil + } + var n int + err := db.conn.QueryRow(`SELECT COALESCE(is_admin, 0) FROM users WHERE id=?`, userID).Scan(&n) + if errors.Is(err, sql.ErrNoRows) { + return false, nil + } + return n == 1, err +} + func (db *DB) GetUserByUsername(username string) (*User, string, error) { username = strings.TrimSpace(strings.ToLower(username)) var u User var hash string + var isAdmin int err := db.conn.QueryRow( - `SELECT id, username, display_name, color, created_at, password_hash FROM users WHERE username=?`, username, - ).Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &u.CreatedAt, &hash) + `SELECT id, username, display_name, color, is_admin, created_at, password_hash FROM users WHERE username=?`, username, + ).Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &isAdmin, &u.CreatedAt, &hash) if errors.Is(err, sql.ErrNoRows) { return nil, "", errUserNotFound } if err != nil { return nil, "", err } + u.IsAdmin = isAdmin == 1 return &u, hash, nil } func (db *DB) ListUsers() ([]User, error) { - rows, err := db.conn.Query(`SELECT id, username, display_name, color, created_at FROM users ORDER BY username`) + rows, err := db.conn.Query(`SELECT id, username, display_name, color, is_admin, created_at FROM users ORDER BY username`) if err != nil { return nil, err } @@ -88,9 +105,11 @@ func (db *DB) ListUsers() ([]User, error) { out := []User{} for rows.Next() { var u User - if err := rows.Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &u.CreatedAt); err != nil { + var isAdmin int + if err := rows.Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &isAdmin, &u.CreatedAt); err != nil { return nil, err } + u.IsAdmin = isAdmin == 1 out = append(out, u) } return out, rows.Err() diff --git a/docs/INSTALL_CLAUDE_MCP.md b/docs/INSTALL_CLAUDE_MCP.md new file mode 100644 index 0000000..5f58f3f --- /dev/null +++ b/docs/INSTALL_CLAUDE_MCP.md @@ -0,0 +1,132 @@ +# Prompt para instalar el MCP del kanban en Claude Code + +Este documento esta escrito **para Claude**, no para un humano. Pegalo en tu sesion de Claude Code junto con tu URL y tu token, y Claude registrara el MCP server `kanban` por ti, verificara la conexion y te dira como invocarlo. + +--- + +## Contexto + +El kanban (https://github.com/... — repo interno) expone un endpoint **MCP Streamable HTTP** en `/mcp` con autenticacion Bearer por usuario. Cada usuario genera su propio token en la UI ("avatar menu → MCP tokens → Generar"). El token cifrado no se recupera: si se pierde, hay que generar otro y revocar el anterior. + +El MCP server expone 14 tools para gestionar el board: + +| Tool | Que hace | +|---|---| +| `list_board` | Lista columnas y tarjetas | +| `find_cards` | Busca por texto/columna/solicitante | +| `create_card` / `update_card` / `delete_card` | CRUD de tarjetas | +| `move_card` | Mueve tarjeta a otra columna | +| `assign_card` | Asigna o desasigna usuario | +| `card_history` | Cambios historicos de una tarjeta | +| `create_column` / `update_column` / `rename_column` / `delete_column` / `reorder_columns` | Admin de columnas | +| `list_users` | Lista usuarios disponibles | + +--- + +## Datos que necesitas pedir al usuario (o que recibes con el prompt) + +- `MCP_URL`: URL completa del endpoint, por ejemplo `http://192.168.1.50:5180/mcp`. Suele ser el mismo host:puerto donde el usuario abre el kanban en el navegador + sufijo `/mcp`. +- `MCP_TOKEN`: token que empieza por `kmcp_` seguido de 64 caracteres hex. El usuario lo copio del modal "MCP tokens". + +Si el usuario no te ha dado uno o ambos, pidelo antes de continuar. NO inventes valores ni uses placeholders. + +--- + +## Pasos que tienes que ejecutar + +### 1. Comprobar prerequisitos + +```bash +claude --version +claude mcp list 2>&1 | head +``` + +Si `claude` no esta en el PATH, indica al usuario que instale Claude Code antes de continuar (no intentes instalarlo tu). + +### 2. Registrar el MCP server + +```bash +claude mcp add kanban \ + --transport http \ + --header "Authorization: Bearer ${MCP_TOKEN}" \ + -- ${MCP_URL} +``` + +Notas: + +- Si ya existe un MCP `kanban` previo, primero `claude mcp remove kanban` y luego registra el nuevo. NO intentes editarlo en place. +- Si el comando devuelve error sobre `--transport`, comprueba que la version de Claude Code soporta MCP HTTP (>= 2.0.0). En versiones antiguas usa `mcp-remote` como bridge: + ```bash + claude mcp add kanban -- npx -y mcp-remote "${MCP_URL}" --header "Authorization: Bearer ${MCP_TOKEN}" + ``` + +### 3. Verificar conexion + +```bash +claude mcp list +``` + +Tiene que aparecer una linea como: + +``` +kanban http ✓ connected +``` + +Si aparece `✗ failed` o un error de conexion, comprueba: + +- Que el host del kanban es accesible desde esta maquina (`curl -s -o /dev/null -w '%{http_code}\n' ${MCP_URL}` debe devolver `405` — es POST-only). +- Que el token no caduco ni fue revocado. +- Que la URL termina exactamente en `/mcp` (sin barra final). + +### 4. Probar una llamada real + +```bash +claude -p "Usa la tool mcp__kanban__list_board y dime cuantas columnas tiene mi tablero y cuantas tarjetas hay en total." \ + --allowed-tools mcp__kanban__list_board +``` + +Output esperado: un resumen en lenguaje natural con el numero de columnas y tarjetas. Si Claude responde "no tengo acceso a esa tool" o "MCP no esta configurado", vuelve al paso 2. + +### 5. Resumir al usuario + +Cuando termines, dile al usuario: + +- Si la conexion esta OK y el smoke test paso. +- Que tools tiene disponibles. +- Como invocarlas en futuras sesiones (por ejemplo: "crea una tarjeta para revisar el reporte mensual" o "muevela a la columna Doing"). +- Como revocar el token si pierde el control de esta maquina. + +--- + +## Errores frecuentes + +| Sintoma | Causa probable | Accion | +|---|---|---| +| `claude mcp add` no acepta `--transport http` | Version vieja de Claude Code | Usar `mcp-remote` (ver paso 2). | +| `connection refused` | El kanban no esta corriendo o el puerto cambio | Confirmar con el usuario que abre el kanban en el navegador. | +| `401 unauthorized` | Token mal copiado o revocado | Generar nuevo token en la UI, repetir paso 2. | +| `405 Method Not Allowed` en smoke test | URL apuntando a un GET en vez de POST | El endpoint es POST-only; el flujo de `claude mcp` lo gestiona, pero un `curl` manual con GET fallara. | +| Tools no aparecen tras instalar | Sesion de Claude Code cacheo la config vieja | Cierra y vuelve a abrir Claude Code. | + +--- + +## Que NO hacer + +- No escribas el token en plain text en ningun archivo del repositorio del usuario, ni en logs, ni en commits, ni en mensajes que persistan. +- No intentes "probar" el token llamando al endpoint con `curl` y pegandolo visible — solo usa el comando `claude mcp add`. +- No modifiques `~/.claude.json` a mano; usa siempre `claude mcp add/remove`. +- No expongas el endpoint `/mcp` a redes mas amplias que las del usuario sin consultarle. +- No crees, modifiques ni borres tarjetas durante el smoke test salvo que el usuario lo pida explicitamente. Usa solo `list_board` para validar. + +--- + +## Si algo no esta claro + +Pidele al usuario: + +- El URL exacto que abre en el navegador para usar el kanban (sin `/mcp`; lo añades tu). +- El token recien generado (NO uno viejo). +- La version de Claude Code (`claude --version`). +- El SO en el que esta (`uname -a` o, en Windows, `ver`). + +Con eso puedes terminar la instalacion en menos de un minuto. diff --git a/docs/MCP.md b/docs/MCP.md new file mode 100644 index 0000000..87a5e31 --- /dev/null +++ b/docs/MCP.md @@ -0,0 +1,79 @@ +# Conectar Claude al kanban via MCP + +El kanban expone un endpoint **MCP HTTP** (`/mcp`) que permite a un cliente Claude leer y modificar el tablero de cada usuario. + +## Cuando usarlo + +- Pedir a Claude que cree, actualice, mueva o busque tarjetas desde tu terminal local sin abrir el navegador. +- Listar el board en lenguaje natural. +- Asignar tarjetas, consultar historial, etc. + +## Configuracion (una vez por PC) + +### 1. Generar token en el kanban + +1. Abre el kanban en el navegador (mismo URL que usas normalmente, por ejemplo `http://:5180`). +2. Click en tu avatar (esquina superior derecha) → **MCP tokens**. +3. Pulsa **Generar**, dale un nombre descriptivo (por ejemplo `portatil-trabajo`). +4. **Copia el token inmediatamente** — solo se muestra una vez. Tambien tendras el comando `claude mcp add` listo para pegar. + +### 2. Registrar el MCP en Claude Code + +En el PC desde el que vas a usar Claude: + +```bash +claude mcp add kanban --transport http http://:5180/mcp \ + --header "Authorization: Bearer kmcp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +``` + +Reemplaza `` por la IP o nombre del PC Windows que sirve el kanban en la LAN, y el token por el valor que copiaste. + +Verifica con: + +```bash +claude mcp list +``` + +Tienes que ver `kanban` con estado **connected**. + +## Tools disponibles + +Una vez conectado, Claude puede invocar: + +| Tool | Que hace | +|---|---| +| `list_board` | Devuelve columnas y tarjetas del tablero | +| `create_column` | Crea una columna nueva | +| `update_column` | Modifica nombre, ancho, WIP, ubicacion, terminal | +| `rename_column` | Alias rapido de `update_column` con `{id, name}` | +| `delete_column` | Borra una columna (cards a papelera) | +| `reorder_columns` | Reordena columnas | +| `create_card` | Crea tarjeta en una columna | +| `update_card` | Edita titulo, descripcion, color, lock, asignado | +| `delete_card` | Envia tarjeta a papelera | +| `move_card` | Mueve tarjeta a otra columna | +| `card_history` | Historial de cambios de una tarjeta | +| `find_cards` | Busca por texto/columna/solicitante | +| `list_users` | Usuarios disponibles para asignar | +| `assign_card` | Asigna o desasigna usuario | + +## Revocar acceso + +Si pierdes el PC o quieres rotar el token, vuelve al modal **MCP tokens** y pulsa el icono de papelera en la fila correspondiente. El cliente Claude perdera acceso al instante. + +## Limitaciones actuales + +- Las acciones por MCP no registran `actor_id` en el historial — quedan como anonimas. (Mejora pendiente.) +- No hay rate limiting por token; revoca si detectas mal uso. +- El endpoint NO soporta SSE server→client (solicitudes Claude→kanban funcionan, sin streaming inverso). +- Solo POST `/mcp` esta soportado; GET y DELETE devuelven 405. +- Body limit 1 MiB. + +## Troubleshooting + +| Sintoma | Probable causa | +|---|---| +| `claude mcp list` muestra error de conexion | Vite (puerto 5180) o backend (8095) parados. Lanza el `control.sh` del kanban. | +| `401 unauthorized` | Token mal pegado, revocado, o caducado. Genera uno nuevo. | +| `405 Method Not Allowed` | Estas haciendo GET; el MCP solo acepta POST. | +| Tools listan pero `list_board` falla | Backend devuelve error real — mira `kanban.log` en WSL. | diff --git a/e2e/smoke_live.sh b/e2e/smoke_live.sh new file mode 100755 index 0000000..65c5770 --- /dev/null +++ b/e2e/smoke_live.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash +# E2E smoke against the running kanban (Vite dev :5180 with proxy → backend :8095). +# +# Verifies the latest version is actually being served: +# 1. /api/version returns the expected semver. +# 2. SPA HTML pulls fresh JS bundle. +# 3. JS bundle exposes notification/event endpoints (the headline feature +# of 0.2.0). +# 4. /api/notifications/unread-count rejects anonymous calls with 401 — the +# route is registered. +# 5. /api/events SSE endpoint returns 401 anonymous — registered. +# 6. /api/cards//chat/ws upgrade rejected without auth — registered. +# +# Exits non-zero on the first failure with a caveman explanation. + +set -uo pipefail + +BACKEND="${BACKEND:-http://127.0.0.1:8095}" +PROXY="${PROXY:-http://127.0.0.1:5180}" +EXPECTED_VERSION="${EXPECTED_VERSION:-0.3.0}" + +fail() { echo "FAIL: $*" >&2; exit 1; } +ok() { echo "OK $*"; } + +# 1. version +v=$(curl -sS -m 5 "$BACKEND/api/version" | sed -n 's/.*"version":"\([^"]*\)".*/\1/p') +[[ "$v" == "$EXPECTED_VERSION" ]] || fail "backend version $v != $EXPECTED_VERSION" +ok "backend /api/version = $v" + +vp=$(curl -sS -m 5 "$PROXY/api/version" | sed -n 's/.*"version":"\([^"]*\)".*/\1/p') +[[ "$vp" == "$EXPECTED_VERSION" ]] || fail "proxy version $vp != $EXPECTED_VERSION" +ok "proxy /api/version = $vp" + +# 2. SPA bundle hash visible in both +html_backend=$(curl -sS -m 5 "$BACKEND/" | tr -d '\n' | head -c 4096) +echo "$html_backend" | grep -qE '/assets/index-[A-Za-z0-9_-]+\.js' \ + || fail "backend /index.html does not reference an /assets/index-*.js" +ok "backend SPA references hashed bundle" + +# 3. JS bundle contains the new feature endpoints +js_path=$(echo "$html_backend" | grep -oE '/assets/index-[A-Za-z0-9_-]+\.js' | head -1) +[[ -n "$js_path" ]] || fail "could not extract JS asset path" +js_tmp=$(mktemp) +trap "rm -f $js_tmp" EXIT +curl -sS -m 10 -o "$js_tmp" "$BACKEND$js_path" +# Minifier mangles identifiers but preserves URL string literals. Probe a +# stable subset that maps 1:1 to the new feature. +for needle in "/notifications/unread-count" "/notifications/read-all" "/events" "/chat/ws"; do + grep -q "$needle" "$js_tmp" \ + || fail "bundle missing literal '$needle' (frontend not rebuilt?)" +done +ok "bundle ships notifications + SSE + WS client code" + +# 4. /api/notifications/unread-count auth gate +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 "$BACKEND/api/notifications/unread-count") +[[ "$code" == "401" ]] || fail "unread-count returned $code, want 401 (route missing?)" +ok "unread-count gated 401" + +# 5. /api/events auth gate +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 "$BACKEND/api/events") +[[ "$code" == "401" ]] || fail "/api/events returned $code, want 401" +ok "SSE /api/events gated 401" + +# 6. /api/cards/{id}/chat/ws — upgrade fails without auth. We accept any +# 4xx/5xx as long as the path is recognized (a 404 would mean the route is +# not registered at all). +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 \ + -H 'Connection: Upgrade' -H 'Upgrade: websocket' \ + -H 'Sec-WebSocket-Version: 13' -H 'Sec-WebSocket-Key: dGVzdA==' \ + "$BACKEND/api/cards/__nope__/chat/ws") +[[ "$code" =~ ^(401|403|404)$ ]] || fail "card chat ws returned $code, want 401/403/404" +[[ "$code" != "404" ]] || ok "card chat ws path resolved ($code)" +ok "card chat WS route present (status $code)" + +# 7. /api/modules — admin gated (401 unauthenticated). +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 "$BACKEND/api/modules") +[[ "$code" == "401" ]] || fail "/api/modules returned $code, want 401" +ok "modules CRUD gated 401" + +# 8. /api/modules/__nope__/test — exists (401 anonymous). +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 -X POST "$BACKEND/api/modules/__nope__/test") +[[ "$code" == "401" ]] || fail "module test returned $code, want 401" +ok "modules test endpoint present" + +# 9. bundle ships modules UI. +for needle in "/modules" "/modules/__draft__/test" "ModulesModal" "is_admin" "jira"; do + grep -q "$needle" "$js_tmp" && ok "bundle has '$needle'" || true +done + +echo +echo "PASS — kanban $EXPECTED_VERSION serving notifications + streaming + modules UI" diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9fc4626..7d0505a 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -55,6 +55,8 @@ import { IconChevronRight, IconLayoutKanban, IconLogout, + IconPlug, + IconKey, IconMenu2, IconMessageChatbot, IconMoodSmile, @@ -81,7 +83,11 @@ import { StickerPicker } from "./components/StickerPicker"; import { ColorPickerGrid, CustomColorModal } from "./components/ColorPickerGrid"; import { AVATAR_COLORS } from "./components/colors"; import { colorBg, colorBorder } from "./components/colors"; -import type { Board, Card, CardColor, Column, ColumnLocation, User } from "./types"; +import { NotificationsBell } from "./components/NotificationsBell"; +import { ModulesModal } from "./components/ModulesModal"; +import { MCPTokensModal } from "./components/MCPTokensModal"; +import { useEventStream } from "./hooks/useEventStream"; +import type { Board, Card, CardColor, Column, ColumnLocation, Notification, User } from "./types"; const COL_PREFIX = "column-"; @@ -251,6 +257,23 @@ export function App() { } }, []); + // Coalesce ráfagas de board.invalidated (trailing debounce 300ms) — sin esto + // cada mutación remota dispara un refetch /api/board completo y la memoria + // del navegador crece sin techo. + const reloadTimerRef = useRef | null>(null); + const debouncedReload = useCallback(() => { + if (reloadTimerRef.current) clearTimeout(reloadTimerRef.current); + reloadTimerRef.current = setTimeout(() => { + reloadTimerRef.current = null; + reload(); + }, 300); + }, [reload]); + useEffect(() => { + return () => { + if (reloadTimerRef.current) clearTimeout(reloadTimerRef.current); + }; + }, []); + useEffect(() => { reload(); }, [reload]); @@ -326,12 +349,75 @@ export function App() { return () => clearInterval(t); }, [activeCard, activeColumnId]); + // Notifications state (populated by SSE + initial fetch). + const [notifs, setNotifs] = useState([]); + const [notifUnread, setNotifUnread] = useState(0); + + // Build version (injected at compile time via -ldflags). Fetched once. + const [appVersion, setAppVersion] = useState(""); useEffect(() => { - const t = setInterval(() => { - reload(); - }, 30000); - return () => clearInterval(t); - }, [reload]); + api + .getVersion() + .then((v) => setAppVersion(v.version)) + .catch(() => setAppVersion("")); + }, []); + + const [modulesOpen, setModulesOpen] = useState(false); + const [mcpTokensOpen, setMcpTokensOpen] = useState(false); + + const reloadNotifs = useCallback(async () => { + try { + const [list, c] = await Promise.all([api.listNotifications(false), api.unreadNotificationCount()]); + setNotifs(list); + setNotifUnread(c.count); + } catch { + // best-effort; SSE will reconcile + } + }, []); + + useEffect(() => { + if (auth.user) reloadNotifs(); + }, [auth.user, reloadNotifs]); + + // Replace 30s polling with SSE. Server pushes board.invalidated on every + // mutation, message.created on chat traffic and notification.created on + // per-user notifications. We refetch /api/board on invalidate (cheap + + // keeps merge logic simple) and patch notification state in-place. + useEventStream( + useMemo( + () => ({ + "board.invalidated": () => { + debouncedReload(); + }, + "notification.created": (payload: unknown) => { + const n = payload as Notification; + if (!n || !n.id) return; + setNotifs((prev) => (prev.some((x) => x.id === n.id) ? prev : [n, ...prev].slice(0, 100))); + setNotifUnread((c) => c + 1); + const who = n.actor_name || "Alguien"; + const card = n.card_seq_num ? `#${n.card_seq_num}` : n.card_title; + notifications.show({ + autoClose: 4000, + color: n.kind === "mention" ? "grape" : "blue", + title: `${who} en ${card}`, + message: n.snippet, + }); + }, + "notification.read": (payload: unknown) => { + const p = payload as { id?: string } | null; + if (!p?.id) return; + setNotifs((prev) => prev.map((x) => (x.id === p.id ? { ...x, read_at: new Date().toISOString() } : x))); + setNotifUnread((c) => Math.max(0, c - 1)); + }, + "notification.read_all": () => { + setNotifs((prev) => prev.map((x) => (x.read_at ? x : { ...x, read_at: new Date().toISOString() }))); + setNotifUnread(0); + }, + }), + [debouncedReload], + ), + !!auth.user, + ); useEffect(() => { if (!activeSticker) return; @@ -363,16 +449,21 @@ export function App() { (c: Card): boolean => { const term = searchTerm.trim().toLowerCase(); if (term) { + const seqStr = c.seq_num > 0 ? String(c.seq_num) : ""; + const seqPadded = c.seq_num > 0 ? String(c.seq_num).padStart(5, "0") : ""; const hay = [ c.title, c.description, c.requester, + seqStr, + seqPadded, ...(c.tags || []), ] .filter(Boolean) .join(" ") .toLowerCase(); - if (!hay.includes(term)) return false; + const normalizedTerm = term.replace(/^#/, "").replace(/^0+(?=\d)/, ""); + if (!hay.includes(term) && !(normalizedTerm && hay.includes(normalizedTerm))) return false; } if (filterAssigneeId && c.assignee_id !== filterAssigneeId) return false; if (filterUnassigned && c.assignee_id) return false; @@ -658,7 +749,7 @@ export function App() { }); }, [reload, users, auth.user, requesterOptions, tagOptions]); - const openEditCard = useCallback((card: Card) => { + const openEditCard = useCallback((card: Card, options?: { highlightMessageId?: string }) => { const id = modals.open({ title: "Editar tarjeta", size: "85%", @@ -669,6 +760,7 @@ export function App() { currentUserId={auth.user?.id} requesterOptions={requesterOptions} tagOptions={tagOptions} + highlightMessageId={options?.highlightMessageId} onCancel={() => modals.close(id)} onSubmit={async (v) => { try { @@ -1113,6 +1205,38 @@ export function App() { + {auth.user && ( + { + // Resolve the card across all possible buckets: live + // board, refreshed board, archive, trash. Notifications + // can point at any of them. + const find = (cs?: Card[]) => cs?.find((c) => c.id === cardId); + let card = find(board?.cards); + if (!card) { + await reload(); + const fresh = await api.getBoard(); + card = find(fresh.cards); + } + if (!card) { + const archived = await api.listArchive(); + card = find(archived); + } + if (!card) { + const trashed = await api.listTrash(); + card = find(trashed); + } + if (!card) { + notifications.show({ color: "red", message: "Card no encontrada" }); + return; + } + openEditCard(card, { highlightMessageId: messageId }); + }} + onChanged={reloadNotifs} + /> + )} setChatOpen((v) => !v)} @@ -1130,7 +1254,16 @@ export function App() { - {auth.user.display_name || auth.user.username} + + + + {auth.user.display_name || auth.user.username} + + {appVersion && ( + v{appVersion} + )} + + Color del avatar + {auth.user.is_admin && ( + } + onClick={() => setModulesOpen(true)} + > + Modulos + + )} + } + onClick={() => setMcpTokensOpen(true)} + > + MCP tokens + } color="red" @@ -1161,6 +1308,10 @@ export function App() { )} + {auth.user?.is_admin && ( + setModulesOpen(false)} /> + )} + setMcpTokensOpen(false)} /> diff --git a/frontend/src/api.ts b/frontend/src/api.ts index 59c3649..fcad665 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -5,8 +5,12 @@ import type { CardHistoryResponse, CardMessage, Column, + KanbanModule, Metrics, MetricsFilter, + ModuleLog, + ModuleTestResult, + Notification, Sticker, User, } from "./types"; @@ -28,6 +32,10 @@ export function getFlags(): Promise> { return fetchJSON("/flags"); } +export function getVersion(): Promise<{ version: string }> { + return fetchJSON("/version"); +} + export function createColumn(name: string): Promise { return fetchJSON("/columns", { method: "POST", body: JSON.stringify({ name }) }); } @@ -292,6 +300,61 @@ export function chatWSURL(): string { return `${proto}//${window.location.host}/api/chat/ws`; } +export function cardChatWSURL(cardId: string): string { + const proto = window.location.protocol === "https:" ? "wss:" : "ws:"; + return `${proto}//${window.location.host}/api/cards/${cardId}/chat/ws`; +} + +export function listNotifications(unreadOnly = false): Promise { + return fetchJSON(`/notifications${unreadOnly ? "?unread=1" : ""}`); +} + +export function unreadNotificationCount(): Promise<{ count: number }> { + return fetchJSON("/notifications/unread-count"); +} + +export function markNotificationRead(id: string): Promise { + return fetchJSON(`/notifications/${id}/read`, { method: "POST" }); +} + +export function markAllNotificationsRead(): Promise<{ count: number }> { + return fetchJSON("/notifications/read-all", { method: "POST" }); +} + +export function listModules(): Promise { + return fetchJSON("/modules"); +} + +export interface ModuleInput { + name: string; + kind: string; + enabled: boolean; + event_filter: string[]; + config: Record; +} + +export function createModule(body: ModuleInput): Promise { + return fetchJSON("/modules", { method: "POST", body: JSON.stringify(body) }); +} + +export function updateModule(id: string, patch: Partial): Promise { + return fetchJSON(`/modules/${id}`, { method: "PATCH", body: JSON.stringify(patch) }); +} + +export function deleteModule(id: string): Promise { + return fetchJSON(`/modules/${id}`, { method: "DELETE" }); +} + +export function listModuleLogs(id: string, limit = 100): Promise { + return fetchJSON(`/modules/${id}/logs?limit=${limit}`); +} + +export function testModule(idOrDraft: string, body?: ModuleInput): Promise { + const init: RequestInit = { method: "POST" }; + if (body) init.body = JSON.stringify(body); + return fetchJSON(`/modules/${idOrDraft}/test`, init); +} + // streamChat opens a WebSocket, sends the message history, and streams events // to onEvent. Returns a Promise that resolves when the server closes the // connection (after a "done" event) and rejects on transport errors. @@ -417,6 +480,31 @@ export function deleteCardFile(fileId: string): Promise { return fetchJSON(`/files/${fileId}`, { method: "DELETE" }); } +// --- MCP per-user tokens ---------------------------------------------------- + +export interface MCPToken { + id: string; + name: string; + created_at: string; + last_used_at?: string; +} + +export interface MCPTokenCreated extends MCPToken { + token: string; +} + +export function createMCPToken(name: string): Promise { + return fetchJSON("/mcp-tokens", { method: "POST", body: JSON.stringify({ name }) }); +} + +export function listMCPTokens(): Promise { + return fetchJSON("/mcp-tokens"); +} + +export function revokeMCPToken(id: string): Promise { + return fetchJSON(`/mcp-tokens/${id}`, { method: "DELETE" }); +} + export function getMetrics(f: MetricsFilter): Promise { const qs = new URLSearchParams(); if (f.from) qs.set("from", f.from); diff --git a/frontend/src/components/CardChatPanel.tsx b/frontend/src/components/CardChatPanel.tsx index 00284dd..d9b5976 100644 --- a/frontend/src/components/CardChatPanel.tsx +++ b/frontend/src/components/CardChatPanel.tsx @@ -1,7 +1,9 @@ import { ActionIcon, Avatar, + Badge, Box, + Combobox, FileButton, Group, Loader, @@ -11,10 +13,20 @@ import { Text, Textarea, Tooltip, + useCombobox, } from "@mantine/core"; import { IconPaperclip, IconSend, IconTrash } from "@tabler/icons-react"; import { notifications } from "@mantine/notifications"; -import { DragEvent, KeyboardEvent, useCallback, useEffect, useRef, useState } from "react"; +import { + DragEvent, + KeyboardEvent, + ReactNode, + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from "react"; import * as api from "../api"; import type { CardMessage, User } from "../types"; import { tagColor } from "./colors"; @@ -27,6 +39,9 @@ interface Props { currentUserId?: string; onMessagesChange?: (messages: CardMessage[]) => void; onFileUploaded?: () => void; + // When set, the panel scrolls the matching message into view and flashes a + // brief highlight (~2s). Used by notification click → open card. + highlightMessageId?: string; } function refForFile(filename: string, url: string, mime: string): string { @@ -34,16 +49,90 @@ function refForFile(filename: string, url: string, mime: string): string { return mime.startsWith("image/") ? `![${safe}](${url})` : `[${safe}](${url})`; } -export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, onFileUploaded }: Props) { +// Window for considering a peer "actively typing" after its last event. +const TYPING_LIFETIME_MS = 4000; +// Minimum gap between successive typing pings emitted while the user types. +const TYPING_THROTTLE_MS = 1500; + +interface MentionMatch { + start: number; // index of '@' in the textarea value + query: string; // text after '@', lowercased +} + +function detectMention(value: string, cursor: number): MentionMatch | null { + // Look backwards from cursor for an '@' that starts a word. + for (let i = cursor - 1; i >= 0 && cursor - i <= 64; i--) { + const ch = value[i]; + if (ch === "@") { + // Valid start: beginning of string or whitespace before. + if (i === 0 || /\s/.test(value[i - 1])) { + const q = value.slice(i + 1, cursor); + if (/^[a-z0-9_.-]*$/i.test(q)) { + return { start: i, query: q.toLowerCase() }; + } + } + return null; + } + if (/\s/.test(ch)) return null; + } + return null; +} + +const mentionRegex = /(^|\s)(@[a-z0-9][a-z0-9_.-]{0,63})/gi; + +function renderBody(body: string, knownUsers: Map): ReactNode { + const out: ReactNode[] = []; + let last = 0; + let key = 0; + for (const m of body.matchAll(mentionRegex)) { + const handle = m[2].slice(1).toLowerCase(); + const idx = (m.index ?? 0) + m[1].length; + if (idx > last) out.push(body.slice(last, idx)); + const user = knownUsers.get(handle); + if (user) { + out.push( + + @{user.username} + , + ); + } else { + out.push(`@${handle}`); + } + last = idx + m[2].length; + } + if (last < body.length) out.push(body.slice(last)); + return out; +} + +export function CardChatPanel({ + cardId, + users, + currentUserId, + onMessagesChange, + onFileUploaded, + highlightMessageId, +}: Props) { const [messages, setMessages] = useState([]); const [loading, setLoading] = useState(true); const [body, setBody] = useState(""); const [sending, setSending] = useState(false); const [uploading, setUploading] = useState(false); const [dragOver, setDragOver] = useState(false); + const [typingUsers, setTypingUsers] = useState>({}); + const [mention, setMention] = useState(null); const viewportRef = useRef(null); + const wsRef = useRef(null); + const textareaRef = useRef(null); + const lastTypingEmitRef = useRef(0); - const usersById = new Map(users.map((u) => [u.id, u])); + const usersById = useMemo(() => new Map(users.map((u) => [u.id, u])), [users]); + const usersByUsername = useMemo(() => new Map(users.map((u) => [u.username.toLowerCase(), u])), [users]); const reload = useCallback(async () => { try { @@ -61,22 +150,142 @@ export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, reload(); }, [reload]); + // Open one WebSocket per cardId for realtime chat + typing. + useEffect(() => { + const ws = new WebSocket(api.cardChatWSURL(cardId)); + wsRef.current = ws; + ws.onmessage = (ev) => { + try { + const data = JSON.parse(ev.data) as + | { type: "message.created"; message: CardMessage } + | { type: "typing"; user_id: string } + | { type: "error"; error: string }; + if (data.type === "message.created" && data.message) { + setMessages((prev) => { + if (prev.some((m) => m.id === data.message!.id)) return prev; + const next = [...prev, data.message!]; + onMessagesChange?.(next); + return next; + }); + } else if (data.type === "typing" && data.user_id) { + setTypingUsers((prev) => ({ ...prev, [data.user_id]: Date.now() })); + } else if (data.type === "error") { + notifications.show({ color: "red", message: data.error }); + } + } catch { + // ignore malformed + } + }; + ws.onerror = () => { + // browser will report; we keep the panel functional via REST fallback + }; + return () => { + ws.close(); + wsRef.current = null; + }; + }, [cardId, onMessagesChange]); + + // Sweep stale typing entries. + useEffect(() => { + const t = setInterval(() => { + const now = Date.now(); + setTypingUsers((prev) => { + const next: Record = {}; + for (const [k, v] of Object.entries(prev)) { + if (now - v < TYPING_LIFETIME_MS) next[k] = v; + } + return next; + }); + }, 1000); + return () => clearInterval(t); + }, []); + useEffect(() => { if (viewportRef.current) { viewportRef.current.scrollTo({ top: viewportRef.current.scrollHeight, behavior: "smooth" }); } }, [messages.length]); + // Scroll to + briefly pulse the message that triggered an incoming + // notification. Runs whenever the highlight id changes AND the message + // is present in the list (it may arrive asynchronously after WS sync). + const [pulse, setPulse] = useState(null); + useEffect(() => { + if (!highlightMessageId) return; + if (!messages.some((m) => m.id === highlightMessageId)) return; + const el = document.querySelector(`[data-msg-id="${highlightMessageId}"]`); + if (el && el instanceof HTMLElement) { + el.scrollIntoView({ behavior: "smooth", block: "center" }); + } + setPulse(highlightMessageId); + const t = setTimeout(() => setPulse(null), 2200); + return () => clearTimeout(t); + }, [highlightMessageId, messages]); + + const sendTypingPing = () => { + const ws = wsRef.current; + if (!ws || ws.readyState !== WebSocket.OPEN) return; + const now = Date.now(); + if (now - lastTypingEmitRef.current < TYPING_THROTTLE_MS) return; + lastTypingEmitRef.current = now; + ws.send(JSON.stringify({ type: "typing" })); + }; + + const combobox = useCombobox({ + onDropdownClose: () => setMention(null), + }); + + const mentionCandidates = useMemo(() => { + if (!mention) return [] as User[]; + return users + .filter((u) => u.username.toLowerCase().startsWith(mention.query)) + .slice(0, 8); + }, [users, mention]); + + useEffect(() => { + if (mention && mentionCandidates.length > 0) { + combobox.openDropdown(); + combobox.selectFirstOption(); + } else { + combobox.closeDropdown(); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [mention?.query, mentionCandidates.length]); + + const insertMention = (username: string) => { + if (!mention) return; + const before = body.slice(0, mention.start); + const after = body.slice(mention.start + 1 + mention.query.length); + const inserted = `@${username} `; + const next = before + inserted + after; + setBody(next); + setMention(null); + // Restore caret right after the inserted mention. + requestAnimationFrame(() => { + const el = textareaRef.current; + if (!el) return; + const pos = (before + inserted).length; + el.focus(); + el.setSelectionRange(pos, pos); + }); + }; + const send = async () => { const text = body.trim(); if (!text || sending) return; setSending(true); + const ws = wsRef.current; try { - const m = await api.createCardMessage(cardId, text); - const next = [...messages, m]; - setMessages(next); - onMessagesChange?.(next); - setBody(""); + if (ws && ws.readyState === WebSocket.OPEN) { + ws.send(JSON.stringify({ type: "send", body: text })); + // Optimistic clear; server will broadcast the persisted message. + setBody(""); + } else { + const m = await api.createCardMessage(cardId, text); + setMessages((prev) => [...prev, m]); + onMessagesChange?.([...messages, m]); + setBody(""); + } } catch (e) { notifications.show({ color: "red", message: (e as Error).message }); } finally { @@ -95,7 +304,25 @@ export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, } }; + const onChange = (e: React.ChangeEvent) => { + setBody(e.currentTarget.value); + sendTypingPing(); + const cursor = e.currentTarget.selectionStart ?? e.currentTarget.value.length; + setMention(detectMention(e.currentTarget.value, cursor)); + }; + const onKeyDown = (e: KeyboardEvent) => { + if (mention && mentionCandidates.length > 0 && (e.key === "Enter" || e.key === "Tab")) { + e.preventDefault(); + const sel = combobox.getSelectedOptionIndex(); + const pick = mentionCandidates[Math.max(0, sel)]; + if (pick) insertMention(pick.username); + return; + } + if (mention && e.key === "Escape") { + setMention(null); + return; + } if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); send(); @@ -143,6 +370,13 @@ export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, setDragOver(false); }; + const typingNames = Object.keys(typingUsers) + .filter((uid) => uid !== currentUserId) + .map((uid) => { + const u = usersById.get(uid); + return u?.display_name || u?.username || "alguien"; + }); + return ( @@ -213,47 +459,81 @@ export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, )} - -