@puddle-code/cli 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -4
- package/dist/index.js +3 -2
- package/dist/public/assets/{Dashboard-BM1e1IRo.js → Dashboard-DvfD1Uxd.js} +1 -1
- package/dist/public/assets/{EditorTabClose-CNtFdbsv.js → EditorTabClose-DPUwByWC.js} +1 -1
- package/dist/public/assets/{LazyTerminal-DUhe0i1g.js → LazyTerminal-D1waFhzd.js} +2 -2
- package/dist/public/assets/{ModelRefcount-Cyy3E7YD.js → ModelRefcount-DOvazO_q.js} +1 -1
- package/dist/public/assets/PaneEditorBody-LBdwF6MH.js +553 -0
- package/dist/public/assets/{SettingsDialog-CNrX86pI.js → SettingsDialog-Wz8QQE8s.js} +1 -1
- package/dist/public/assets/{Terminal-B2mNzf_l.js → Terminal-DGmjc3oH.js} +2 -2
- package/dist/public/assets/Workspace-BV1fbSwH.js +8 -0
- package/dist/public/assets/abnfDiagram-VCTEODGH-DrU7IXaw.js +1 -0
- package/dist/public/assets/arc-BjSQqbzd.js +1 -0
- package/dist/public/assets/architecture-7GRP2DOG-D_jntaTV.js +1 -0
- package/dist/public/assets/architectureDiagram-5GKGNRK7-t9ELRICA.js +36 -0
- package/dist/public/assets/array-BifhSqXX.js +1 -0
- package/dist/public/assets/blockDiagram-I7D4REHJ-YdSPz_k5.js +129 -0
- package/dist/public/assets/{buffer-store-REUK09wT.js → buffer-store-ChloppLb.js} +3 -3
- package/dist/public/assets/c4Diagram-7LVT6UL2-CUOQ2rbu.js +38 -0
- package/dist/public/assets/channel-VzmaFbZX.js +1 -0
- package/dist/public/assets/chunk-2E4U76K2-Co6b1Y97.js +2 -0
- package/dist/public/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/dist/public/assets/chunk-4HAMMTFA-BZ51_p7P.js +62 -0
- package/dist/public/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/dist/public/assets/chunk-75Z2AOVW-kxCDxh6q.js +2 -0
- package/dist/public/assets/chunk-CLGD4ZFX-pSu1f4n0.js +1 -0
- package/dist/public/assets/chunk-DU6HZSFF-CCNUFaQT.js +125 -0
- package/dist/public/assets/chunk-F27PBJKO-Cmu9YLxN.js +1 -0
- package/dist/public/assets/chunk-FOHPRMQF-CdD2_EOh.js +161 -0
- package/dist/public/assets/chunk-GMAD6QVW-CYrdWVZ3.js +72 -0
- package/dist/public/assets/chunk-GVQU2GXP-eDWbw8E-.js +1 -0
- package/dist/public/assets/chunk-IMKFNOWR-BGpQKF0M.js +231 -0
- package/dist/public/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/dist/public/assets/chunk-L3NEJ4N5-BWoXa-mv.js +1 -0
- package/dist/public/assets/chunk-LNGE3PJU-DNNNwF8Y.js +34 -0
- package/dist/public/assets/chunk-OSK3NFVY-DgJh1Aoq.js +10 -0
- package/dist/public/assets/chunk-P2QGCYS3-CkK7MDIt.js +1 -0
- package/dist/public/assets/chunk-POPQ4Y6H-CgNwSzsJ.js +1 -0
- package/dist/public/assets/chunk-PWAF6VOD-D1QREJv6.js +1 -0
- package/dist/public/assets/chunk-SHT3W25Y-CW83WuuF.js +168 -0
- package/dist/public/assets/chunk-SVP7TREG-D70EFjSd.js +88 -0
- package/dist/public/assets/chunk-TICWLB2K-BdLyZiK8.js +206 -0
- package/dist/public/assets/chunk-TLUHSLCS-B7jq2TOO.js +2 -0
- package/dist/public/assets/chunk-XXDRQBXY-BuE3VzE_.js +1 -0
- package/dist/public/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/dist/public/assets/classDiagram-ZZMXUADV-CYpW3ppG.js +1 -0
- package/dist/public/assets/classDiagram-v2-VYDZK3BY-CYpW3ppG.js +1 -0
- package/dist/public/assets/{context-menu-c8LcYf-D.js → context-menu-DdR40Rbj.js} +1 -1
- package/dist/public/assets/cose-bilkent-JH36ORCC-aAQk09y5.js +1 -0
- package/dist/public/assets/{cssMode-NZqvaXck.js → cssMode-B00rw8A0.js} +1 -1
- package/dist/public/assets/cynefin-OW5HDTMX-CVPxUP3o.js +1 -0
- package/dist/public/assets/cynefinDiagram-5FMLGOSQ-Eoj-svLE.js +62 -0
- package/dist/public/assets/cytoscape.esm-Dic2qDnk.js +321 -0
- package/dist/public/assets/dagre-CNOzUhxk.js +1 -0
- package/dist/public/assets/dagre-GXQ25YYZ-B05PrdkZ.js +4 -0
- package/dist/public/assets/defaultLocale-C8Fc0cco.js +1 -0
- package/dist/public/assets/diagram-S7CK7UJ4-DcxmHlO1.js +30 -0
- package/dist/public/assets/diagram-UQ7AKVKN-DmVSn0-1.js +41 -0
- package/dist/public/assets/diagram-VSXAHHWV-BGultN_5.js +3 -0
- package/dist/public/assets/diagram-VX7I27RA-i6gsnYil.js +24 -0
- package/dist/public/assets/diagram-Z3DM3KII-Dk2VW9nr.js +24 -0
- package/dist/public/assets/dist-D9sYb5Oa.js +1 -0
- package/dist/public/assets/{drafts-CHfAOffT.js → drafts-qwBQG11i.js} +1 -1
- package/dist/public/assets/ebnfDiagram-PWID7BFC-ZRpPOgCS.js +1 -0
- package/dist/public/assets/erDiagram-RLTQ6QDP-C_a1ewl3.js +99 -0
- package/dist/public/assets/eventmodeling-NTZA5JFV-B1CPh3nL.js +1 -0
- package/dist/public/assets/{file-links-DJ4ZSTa-.js → file-links-C7CI8Lax.js} +1 -1
- package/dist/public/assets/flowDiagram-HODETNUW-B4hsNbjc.js +1 -0
- package/dist/public/assets/ganttDiagram-EL5Y4UJY-BQSJiQPw.js +292 -0
- package/dist/public/assets/gitGraph-4MIJSDKK-DnzqjUZ8.js +1 -0
- package/dist/public/assets/gitGraphDiagram-WWUBYQGX-DqIRXgnV.js +106 -0
- package/dist/public/assets/graphlib-DS17s2tU.js +1 -0
- package/dist/public/assets/{htmlMode-Dj8iZBJ7.js → htmlMode-BH-IJbVV.js} +1 -1
- package/dist/public/assets/index-B1vArJLa.css +2 -0
- package/dist/public/assets/{index-Bh-CbzNs.js → index-C3xMIZxV.js} +3 -3
- package/dist/public/assets/info-A6RAGUB7-D-Rg6JUN.js +1 -0
- package/dist/public/assets/infoDiagram-27XIBGKW-D2WlI0b3.js +2 -0
- package/dist/public/assets/init-D6jRqBbL.js +1 -0
- package/dist/public/assets/ishikawaDiagram-5VMMS53U-DrJpdpRY.js +70 -0
- package/dist/public/assets/journeyDiagram-3NMN7TZE-DbbEx7ZS.js +139 -0
- package/dist/public/assets/{jsonMode-DGMOJ1wP.js → jsonMode-C_Y7Ct9w.js} +1 -1
- package/dist/public/assets/kanban-definition-UXKFOSKX-CjQ2Pird.js +89 -0
- package/dist/public/assets/katex-B7rAX3Vi.js +257 -0
- package/dist/public/assets/line-Y9535-xV.js +1 -0
- package/dist/public/assets/linear-B7l8qgEw.js +1 -0
- package/dist/public/assets/media-refresh-store-ODee1w5o.js +1 -0
- package/dist/public/assets/mermaid-parser.core-CHfO7_QP.js +7 -0
- package/dist/public/assets/mermaid.core-Czw_C2pz.js +11 -0
- package/dist/public/assets/mindmap-definition-YA3MSWOX-192tJvHd.js +96 -0
- package/dist/public/assets/ordinal-hYBb2elL.js +1 -0
- package/dist/public/assets/packet-AYTQ26CC-CTuDVT1l.js +1 -0
- package/dist/public/assets/path-BWPyau1x.js +1 -0
- package/dist/public/assets/pegDiagram-XKGWAZYB-DKWuJLBr.js +1 -0
- package/dist/public/assets/pie-WAS4IAKB-hKIvAklj.js +1 -0
- package/dist/public/assets/pieDiagram-E7YTZNPT-CNnu3Gqt.js +39 -0
- package/dist/public/assets/purify.es-sLXpNpJ5.js +3 -0
- package/dist/public/assets/quadrantDiagram-AXDQQJYC-BDfukVAC.js +7 -0
- package/dist/public/assets/radar-RG4KPBEZ-znNmLflQ.js +1 -0
- package/dist/public/assets/railroad-74A4TZTK-B4mnaNAW.js +1 -0
- package/dist/public/assets/railroad-abnf-HS5TGJTU-CfsGG-fR.js +1 -0
- package/dist/public/assets/railroad-ebnf-LZEXJU2U-BmUL54vf.js +1 -0
- package/dist/public/assets/railroad-peg-WCYAUIDC-BNoPIdtK.js +1 -0
- package/dist/public/assets/railroadDiagram-O6MQD6OU-BjW5Goxg.js +1 -0
- package/dist/public/assets/requirementDiagram-BXWQKSXE-WZ7qYbwG.js +84 -0
- package/dist/public/assets/rough.esm-CSKSodPl.js +1 -0
- package/dist/public/assets/sankeyDiagram-P5KCCOFB-xfsRJbYV.js +40 -0
- package/dist/public/assets/sequenceDiagram-WJ2MYXX4-CnXOIvsD.js +162 -0
- package/dist/public/assets/{session-seed-sdkQigYG.js → session-seed-5E77o40l.js} +1 -1
- package/dist/public/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- package/dist/public/assets/src-_wZywoZs.js +1 -0
- package/dist/public/assets/stateDiagram-D77RDMKH-BC-kRyi8.js +1 -0
- package/dist/public/assets/stateDiagram-v2-MP3YSRHH-3Xfb1SN8.js +1 -0
- package/dist/public/assets/swimlanes-42K2YHIH-DImnagTG.js +1 -0
- package/dist/public/assets/swimlanesDiagram-VR7AAH4N-isFys79B.js +8 -0
- package/dist/public/assets/timeline-definition-24CTP7MA-DxXJ2EnM.js +120 -0
- package/dist/public/assets/treeView-Q6P3EWNA-BWIPDCZv.js +1 -0
- package/dist/public/assets/treemap-WGGIJYW6-BcfuZ8Jf.js +1 -0
- package/dist/public/assets/{tsMode-DRA0sEgo.js → tsMode-BvtDJzua.js} +1 -1
- package/dist/public/assets/{use-find-controls-BN4SzWfk.js → use-find-controls-r60pZ7_h.js} +1 -1
- package/dist/public/assets/vennDiagram-4TSXK5OY-CObuiC8v.js +34 -0
- package/dist/public/assets/wardley-WFR3VGLG-M4SNYgeF.js +1 -0
- package/dist/public/assets/wardleyDiagram-VM6X3IG4-CijOXrVJ.js +78 -0
- package/dist/public/assets/xychartDiagram-S5SC5T6Z-DYuJKDDP.js +7 -0
- package/dist/public/index.html +3 -3
- package/package.json +1 -1
- package/dist/public/assets/PaneEditorBody-TJhlQjZL.js +0 -548
- package/dist/public/assets/Workspace-CG6XSaGb.js +0 -8
- package/dist/public/assets/index-RKRvjeap.css +0 -2
- package/dist/public/assets/media-refresh-store-Df-ybzK5.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsDialog-
|
|
2
|
-
import{r as e,t}from"./rolldown-runtime-QTnfLwEv.js";import{t as n}from"./react-CZI7_Jkm.js";import{n as r,r as i,t as a}from"./createLucideIcon-C6JENrH3.js";import{t as o}from"./preload-helper-Czpn1I53.js";import{C as s,S as c,T as l,d as u,i as d,m as f,n as p,o as m,v as h,w as g,x as _}from"./api-BBFo3oc-.js";import{A as v,C as y,D as b,E as x,O as S,T as ee,_ as C,a as te,c as ne,d as re,f as ie,g as ae,h as oe,i as se,k as ce,l as le,m as ue,n as w,o as T,p as de,r as fe,s as pe,t as me,u as he,v as E,x as ge,y as _e}from"./dialog-DI1-uj7G.js";import{_ as ve,a as ye,b as be,c as xe,f as Se,g as Ce,h as we,l as Te,m as Ee,o as De,r as Oe,s as ke,t as Ae,u as je,v as Me,y as Ne}from"./LazyTerminal-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsDialog-Wz8QQE8s.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-CZI7_Jkm.js","assets/createLucideIcon-C6JENrH3.js","assets/api-BBFo3oc-.js","assets/dialog-DI1-uj7G.js","assets/x-C-HTKvar.js","assets/LazyTerminal-D1waFhzd.js","assets/preload-helper-Czpn1I53.js","assets/session-seed-5E77o40l.js","assets/chevron-down-DPOlcAF_.js","assets/dist-CKuo36qW.js","assets/Dashboard-DvfD1Uxd.js","assets/context-menu-DdR40Rbj.js","assets/Workspace-BV1fbSwH.js","assets/media-refresh-store-ODee1w5o.js","assets/file-links-C7CI8Lax.js","assets/drafts-qwBQG11i.js","assets/buffer-logic-BAkSBQT7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e,t}from"./rolldown-runtime-QTnfLwEv.js";import{t as n}from"./react-CZI7_Jkm.js";import{n as r,r as i,t as a}from"./createLucideIcon-C6JENrH3.js";import{t as o}from"./preload-helper-Czpn1I53.js";import{C as s,S as c,T as l,d as u,i as d,m as f,n as p,o as m,v as h,w as g,x as _}from"./api-BBFo3oc-.js";import{A as v,C as y,D as b,E as x,O as S,T as ee,_ as C,a as te,c as ne,d as re,f as ie,g as ae,h as oe,i as se,k as ce,l as le,m as ue,n as w,o as T,p as de,r as fe,s as pe,t as me,u as he,v as E,x as ge,y as _e}from"./dialog-DI1-uj7G.js";import{_ as ve,a as ye,b as be,c as xe,f as Se,g as Ce,h as we,l as Te,m as Ee,o as De,r as Oe,s as ke,t as Ae,u as je,v as Me,y as Ne}from"./LazyTerminal-D1waFhzd.js";import{n as D}from"./x-C-HTKvar.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Pe=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}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,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,ie());else{var t=n(l);t!==null&&se(x,t.startTime-e)}}var S=!1,ee=-1,C=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<C)}function re(){if(g=!1,S){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(ee),ee=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&se(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ie():S=!1}}}var ie;if(typeof y==`function`)ie=function(){y(re)};else if(typeof MessageChannel<`u`){var ae=new MessageChannel,oe=ae.port2;ae.port1.onmessage=re,ie=function(){oe.postMessage(null)}}else ie=function(){_(re,0)};function se(t,n){ee=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(ee),ee=-1):h=!0,se(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ie()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Fe=t(((e,t)=>{t.exports=Pe()})),Ie=t((e=>{var t=Fe(),r=n(),a=i();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),ee=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.iterator;function se(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var ce=Symbol.for(`react.client.reference`);function le(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case C:return`Suspense`;case te:return`SuspenseList`;case ie:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case ee:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var ue=Array.isArray,w=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],pe=-1;function me(e){return{current:e}}function he(e){0>pe||(e.current=fe[pe],fe[pe]=null,pe--)}function E(e,t){pe++,fe[pe]=e.current,e.current=t}var ge=me(null),_e=me(null),ve=me(null),ye=me(null);function be(e,t){switch(E(ve,t),E(_e,e),E(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}he(ge),E(ge,e)}function xe(){he(ge),he(_e),he(ve)}function Se(e){e.memoizedState!==null&&E(ye,e);var t=ge.current,n=Ud(t,e.type);t!==n&&(E(_e,e),E(ge,n))}function Ce(e){_e.current===e&&(he(ge),he(_e)),ye.current===e&&(he(ye),$f._currentValue=de)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+we+e+Te}var De=!1;function Oe(e,t){if(!e||De)return``;De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
5
|
`),l=s.split(`
|
|
@@ -7,4 +7,4 @@ import{r as e,t}from"./rolldown-runtime-QTnfLwEv.js";import{t as n}from"./react-
|
|
|
7
7
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ee(n):``}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee(`Lazy`);case 13:return e.child!==t&&t!==null?Ee(`Suspense Fallback`):Ee(`Suspense`);case 19:return Ee(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Ee(`Activity`);default:return``}}function Ae(e){try{var t=``,n=null;do t+=ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
8
|
Error generating stack: `+e.message+`
|
|
9
9
|
`+e.stack}}var je=Object.prototype.hasOwnProperty,Me=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,D=t.unstable_shouldYield,Pe=t.unstable_requestPaint,Ie=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,He=t.unstable_IdlePriority,Ue=t.log,We=t.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 at(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&<(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=T.p;return e===0?(e=window.event,e===void 0?32:hp(e.type)):e}function ht(e,t){var n=T.p;try{return T.p=e,t()}finally{T.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,O=`__reactContainer$`+gt,yt=`__reactEvents$`+gt,bt=`__reactListeners$`+gt,xt=`__reactHandles$`+gt,St=`__reactResources$`+gt,Ct=`__reactMarker$`+gt;function wt(e){delete e[_t],delete e[vt],delete e[yt],delete e[bt],delete e[xt]}function Tt(e){var t=e[_t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[O]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[_t])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function Et(e){if(e=e[_t]||e[O]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ot(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function kt(e){e[Ct]=!0}var At=new Set,jt={};function Mt(e,t){Nt(e,t),Nt(e+`Capture`,t)}function Nt(e,t){for(jt[e]=t,e=0;e<t.length;e++)At.add(t[e])}var Pt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Ft={},It={};function Lt(e){return je.call(It,e)?!0:je.call(Ft,e)?!1:Pt.test(e)?It[e]=!0:(Ft[e]=!0,!1)}function Rt(e,t,n){if(Lt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function zt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Bt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Vt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ht(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ut(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wt(e){if(!e._valueTracker){var t=Ht(e)?`checked`:`value`;e._valueTracker=Ut(e,t,``+e[t])}}function Gt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ht(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Kt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var qt=/[\n"\\]/g;function k(e){return e.replace(qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function A(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Vt(t)):e.value!==``+Vt(t)&&(e.value=``+Vt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):j(e,o,Vt(n)):j(e,o,Vt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Vt(s):e.removeAttribute(`name`)}function Jt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Wt(e);return}n=n==null?``:``+Vt(n),t=t==null?n:``+Vt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Wt(e)}function j(e,t,n){t===`number`&&Kt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Yt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Vt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Xt(e,t,n){if(t!=null&&(t=``+Vt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Vt(n)}function Zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(ue(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=Vt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Wt(e)}function Qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $t=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function en(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||$t.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function tn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&en(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&en(e,a,t[a])}function nn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var rn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),an=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function on(e){return an.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function sn(){}var cn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var M=null,N=null;function un(e){var t=Et(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(A(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+k(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[vt]||null;if(!i)throw Error(o(90));A(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Gt(r)}break a;case`textarea`:Xt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Yt(e,!!n.multiple,t,!1)}}}var dn=!1;function fn(e,t,n){if(dn)return e(t,n);dn=!0;try{return e(t)}finally{if(dn=!1,(M!==null||N!==null)&&(Su(),M&&(t=M,e=N,N=M=null,un(t),e)))for(t=0;t<e.length;t++)un(e[t])}}function pn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var mn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),hn=!1;if(mn)try{var P={};Object.defineProperty(P,"passive",{get:function(){hn=!0}}),window.addEventListener(`test`,P,P),window.removeEventListener(`test`,P,P)}catch{hn=!1}var gn=null,_n=null,vn=null;function yn(){if(vn)return vn;var e,t=_n,n=t.length,r,i=`value`in gn?gn.value:gn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return vn=i.slice(e,1<r?1-r:void 0)}function bn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function xn(){return!0}function Sn(){return!1}function Cn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?xn:Sn,this.isPropagationStopped=Sn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=xn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),t}var wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tn=Cn(wn),En=m({},wn,{view:0,detail:0}),Dn=Cn(En),On,kn,An,jn=m({},En,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==An&&(An&&e.type===`mousemove`?(On=e.screenX-An.screenX,kn=e.screenY-An.screenY):kn=On=0,An=e),On)},movementY:function(e){return`movementY`in e?e.movementY:kn}}),Mn=Cn(jn),Nn=Cn(m({},jn,{dataTransfer:0})),Pn=Cn(m({},En,{relatedTarget:0})),Fn=Cn(m({},wn,{animationName:0,elapsedTime:0,pseudoElement:0})),In=Cn(m({},wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Ln=Cn(m({},wn,{data:0})),Rn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},zn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Bn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Vn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bn[e])?!!t[e]:!1}function Hn(){return Vn}var Un=Cn(m({},En,{key:function(e){if(e.key){var t=Rn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hn,charCode:function(e){return e.type===`keypress`?bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Wn=Cn(m({},jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Gn=Cn(m({},En,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hn})),Kn=Cn(m({},wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),qn=Cn(m({},jn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Jn=Cn(m({},wn,{newState:0,oldState:0})),Yn=[9,13,27,32],Xn=mn&&`CompositionEvent`in window,Zn=null;mn&&`documentMode`in document&&(Zn=document.documentMode);var Qn=mn&&`TextEvent`in window&&!Zn,$n=mn&&(!Xn||Zn&&8<Zn&&11>=Zn),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Xn&&nr(e,t)?(e=yn(),vn=_n=gn=null,ir=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return $n&&t.locale!==`ko`?null:t.data;default:return null}}var sr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!sr[e.type]:t===`textarea`}function lr(e,t,n,r){M?N?N.push(r):N=[r]:M=r,t=Od(t,`onChange`),0<t.length&&(n=new Tn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ur=null,dr=null;function fr(e){xd(e,0)}function pr(e){if(Gt(Dt(e)))return e}function mr(e,t){if(e===`change`)return t}var hr=!1;if(mn){var gr;if(mn){var _r=`oninput`in document;if(!_r){var vr=document.createElement(`div`);vr.setAttribute(`oninput`,`return;`),_r=typeof vr.oninput==`function`}gr=_r}else gr=!1;hr=gr&&(!document.documentMode||9<document.documentMode)}function yr(){ur&&(ur.detachEvent(`onpropertychange`,br),dr=ur=null)}function br(e){if(e.propertyName===`value`&&pr(dr)){var t=[];lr(t,dr,e,ln(e)),fn(fr,t)}}function xr(e,t,n){e===`focusin`?(yr(),ur=t,dr=n,ur.attachEvent(`onpropertychange`,br)):e===`focusout`&&yr()}function Sr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return pr(dr)}function Cr(e,t){if(e===`click`)return pr(t)}function wr(e,t){if(e===`input`||e===`change`)return pr(t)}function Tr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Er=typeof Object.is==`function`?Object.is:Tr;function Dr(e,t){if(Er(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!je.call(t,i)||!Er(e[i],t[i]))return!1}return!0}function Or(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kr(e,t){var n=Or(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Or(n)}}function Ar(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ar(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kt(e.document)}return t}function Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Nr=mn&&`documentMode`in document&&11>=document.documentMode,Pr=null,Fr=null,Ir=null,Lr=!1;function Rr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lr||Pr==null||Pr!==Kt(r)||(r=Pr,`selectionStart`in r&&Mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ir&&Dr(Ir,r)||(Ir=r,r=Od(Fr,`onSelect`),0<r.length&&(t=new Tn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Pr)))}function zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Br={animationend:zr(`Animation`,`AnimationEnd`),animationiteration:zr(`Animation`,`AnimationIteration`),animationstart:zr(`Animation`,`AnimationStart`),transitionrun:zr(`Transition`,`TransitionRun`),transitionstart:zr(`Transition`,`TransitionStart`),transitioncancel:zr(`Transition`,`TransitionCancel`),transitionend:zr(`Transition`,`TransitionEnd`)},Vr={},Hr={};mn&&(Hr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Br.animationend.animation,delete Br.animationiteration.animation,delete Br.animationstart.animation),`TransitionEvent`in window||delete Br.transitionend.transition);function Ur(e){if(Vr[e])return Vr[e];if(!Br[e])return e;var t=Br[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Hr)return Vr[e]=t[n];return e}var Wr=Ur(`animationend`),Gr=Ur(`animationiteration`),Kr=Ur(`animationstart`),qr=Ur(`transitionrun`),Jr=Ur(`transitionstart`),Yr=Ur(`transitioncancel`),Xr=Ur(`transitionend`),Zr=new Map,Qr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Qr.push(`scrollEnd`);function $r(e,t){Zr.set(e,t),Mt(t,[e])}var ei=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ti=[],ni=0,ri=0;function ii(){for(var e=ni,t=ri=ni=0;t<e;){var n=ti[t];ti[t++]=null;var r=ti[t];ti[t++]=null;var i=ti[t];ti[t++]=null;var a=ti[t];if(ti[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ci(n,i,a)}}function ai(e,t,n,r){ti[ni++]=e,ti[ni++]=t,ti[ni++]=n,ti[ni++]=r,ri|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function oi(e,t,n,r){return ai(e,t,n,r),li(e)}function si(e,t){return ai(e,null,null,t),li(e)}function ci(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function li(e){if(50<pu)throw pu=0,mu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ui={};function di(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fi(e,t,n,r){return new di(e,t,n,r)}function pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mi(e,t){var n=e.alternate;return n===null?(n=fi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function hi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function gi(e,t,n,r,i,a){var s=0;if(r=e,typeof e==`function`)pi(e)&&(s=1);else if(typeof e==`string`)s=Wf(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ie:return e=fi(31,n,t,i),e.elementType=ie,e.lanes=a,e;case v:return _i(n.children,i,a,t);case y:s=8,i|=24;break;case b:return e=fi(12,n,t,i|2),e.elementType=b,e.lanes=a,e;case C:return e=fi(13,n,t,i),e.elementType=C,e.lanes=a,e;case te:return e=fi(19,n,t,i),e.elementType=te,e.lanes=a,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case ee:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=fi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function _i(e,t,n,r){return e=fi(7,e,r,t),e.lanes=n,e}function vi(e,t,n){return e=fi(6,e,null,t),e.lanes=n,e}function yi(e){var t=fi(18,null,null,0);return t.stateNode=e,t}function bi(e,t,n){return t=fi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xi=new WeakMap;function Si(e,t){if(typeof e==`object`&&e){var n=xi.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},xi.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var Ci=[],wi=0,Ti=null,Ei=0,Di=[],Oi=0,ki=null,Ai=1,ji=``;function Mi(e,t){Ci[wi++]=Ei,Ci[wi++]=Ti,Ti=e,Ei=t}function Ni(e,t,n){Di[Oi++]=Ai,Di[Oi++]=ji,Di[Oi++]=ki,ki=e;var r=Ai;e=ji;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ai=1<<32-Je(t)+i|n<<i|r,ji=a+e}else Ai=1<<a|n<<i|r,ji=e}function Pi(e){e.return!==null&&(Mi(e,1),Ni(e,1,0))}function Fi(e){for(;e===Ti;)Ti=Ci[--wi],Ci[wi]=null,Ei=Ci[--wi],Ci[wi]=null;for(;e===ki;)ki=Di[--Oi],Di[Oi]=null,ji=Di[--Oi],Di[Oi]=null,Ai=Di[--Oi],Di[Oi]=null}function Ii(e,t){Di[Oi++]=Ai,Di[Oi++]=ji,Di[Oi++]=ki,Ai=t.id,ji=t.overflow,ki=e}var Li=null,F=null,I=!1,Ri=null,zi=!1,Bi=Error(o(519));function Vi(e){throw qi(Si(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:X(`cancel`,t),X(`close`,t);break;case`iframe`:case`object`:case`embed`:X(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)X(yd[n],t);break;case`source`:X(`error`,t);break;case`img`:case`image`:case`link`:X(`error`,t),X(`load`,t);break;case`details`:X(`toggle`,t);break;case`input`:X(`invalid`,t),Jt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:X(`invalid`,t);break;case`textarea`:X(`invalid`,t),Zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Pd(t.textContent,n)?(r.popover!=null&&(X(`beforetoggle`,t),X(`toggle`,t)),r.onScroll!=null&&X(`scroll`,t),r.onScrollEnd!=null&&X(`scrollend`,t),r.onClick!=null&&(t.onclick=sn),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Li=e.return;Li;)switch(Li.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Li=Li.return}}function Wi(e){if(e!==Li)return!1;if(!I)return Ui(e),I=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Wd(e.type,e.memoizedProps)),n=!n),n&&F&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));F=df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));F=df(e)}else t===27?(t=F,Qd(e.type)?(e=uf,uf=null,F=e):F=t):F=Li?lf(e.stateNode.nextSibling):null;return!0}function Gi(){F=Li=null,I=!1}function Ki(){var e=Ri;return e!==null&&($l===null?$l=e:$l.push.apply($l,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=me(null),Yi=null,Xi=null;function Zi(e,t,n){E(Ji,t._currentValue),t._currentValue=n}function Qi(e){e._currentValue=Ji.current,he(Ji)}function $i(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ea(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),$i(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),$i(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function ta(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;Er(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===ye.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[$f]:e.push($f))}i=i.return}e!==null&&ea(t,e,n,r),t.flags|=262144}function na(e){for(e=e.firstContext;e!==null;){if(!Er(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){Yi=e,Xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ia(e){return oa(Yi,e)}function aa(e,t){return Yi===null&&ra(e),oa(e,t)}function oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xi===null){if(e===null)throw Error(o(308));Xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xi=Xi.next=t;return n}var sa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ca=t.unstable_scheduleCallback,la=t.unstable_NormalPriority,ua={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function da(){return{controller:new sa,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&ca(la,function(){e.controller.abort()})}var pa=null,ma=0,ha=0,ga=null;function _a(e,t){if(pa===null){var n=pa=[];ma=0,ha=pd(),ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ma++,t.then(va,va),t}function va(){if(--ma===0&&pa!==null){ga!==null&&(ga.status=`fulfilled`);var e=pa;pa=null,ha=0,ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ya(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ba=w.S;w.S=function(e,t){nu=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&_a(e,t),ba!==null&&ba(e,t)};var xa=me(null);function Sa(){var e=xa.current;return e===null?W.pooledCache:e}function Ca(e,t){t===null?E(xa,xa.current):E(xa,t.pool)}function wa(){var e=Sa();return e===null?null:{parent:ua._currentValue,pool:e}}var Ta=Error(o(460)),Ea=Error(o(474)),Da=Error(o(542)),Oa={then:function(){}};function ka(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Aa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(sn,sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Pa(e),e;default:if(typeof t.status==`string`)t.then(sn,sn);else{if(e=W,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Pa(e),e}throw Ma=t,Ta}}function ja(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ma=e,Ta):e}}var Ma=null;function Na(){if(Ma===null)throw Error(o(459));var e=Ma;return Ma=null,e}function Pa(e){if(e===Ta||e===Da)throw Error(o(483))}var Fa=null,Ia=0;function La(e){var t=Ia;return Ia+=1,Fa===null&&(Fa=[]),Aa(Fa,e,t)}function Ra(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function za(e,t){throw t.$$typeof===h?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ba(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=mi(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=vi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===re&&ja(a)===t.type)?(t=i(t,n.props),Ra(t,n),t.return=e,t):(t=gi(n.type,n.key,n.props,null,e.mode,r),Ra(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=bi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=_i(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=vi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=gi(t.type,t.key,t.props,null,e.mode,n),Ra(n,t),n.return=e,n;case _:return t=bi(t,e.mode,n),t.return=e,t;case re:return t=ja(t),f(e,t,n)}if(ue(t)||se(t))return t=_i(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,La(t),n);if(t.$$typeof===S)return f(e,aa(e,t),n);za(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case re:return n=ja(n),p(e,t,n,r)}if(ue(n)||se(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,La(n),r);if(n.$$typeof===S)return p(e,t,aa(e,n),r);za(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=ja(r),m(e,t,n,r,i)}if(ue(r)||se(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,La(r),i);if(r.$$typeof===S)return m(e,t,n,aa(t,r),i);za(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),I&&Mi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return I&&Mi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),I&&Mi(i,h),l}function y(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),I&&Mi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return I&&Mi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),I&&Mi(i,g),u}function b(e,r,a,c){if(typeof a==`object`&&a&&a.type===v&&a.key===null&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case g:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&ja(l)===r.type){n(e,r.sibling),c=i(r,a.props),Ra(c,a),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}a.type===v?(c=_i(a.props.children,e.mode,c,a.key),c.return=e,e=c):(c=gi(a.type,a.key,a.props,null,e.mode,c),Ra(c,a),c.return=e,e=c)}return s(e);case _:a:{for(l=a.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=bi(a,e.mode,c),c.return=e,e=c}return s(e);case re:return a=ja(a),b(e,r,a,c)}if(ue(a))return h(e,r,a,c);if(se(a)){if(l=se(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),y(e,r,a,c)}if(typeof a.then==`function`)return b(e,r,La(a),c);if(a.$$typeof===S)return b(e,r,aa(e,a),c);za(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=vi(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ia=0;var i=b(e,t,n,r);return Fa=null,i}catch(t){if(t===Ta||t===Da)throw t;var a=fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Va=Ba(!0),Ha=Ba(!1),Ua=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ga(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,U&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=li(e),ci(e,null,n),t}return ai(e,r,t,n),li(e)}function Ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}function Ya(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xa=!1;function Za(){if(Xa){var e=ga;if(e!==null)throw e}}function Qa(e,t,n,r){Xa=!1;var i=e.updateQueue;Ua=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(K&f)===f:(r&f)===f){f!==0&&f===ha&&(Xa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ua=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ql|=o,e.lanes=o,e.memoizedState=d}}function $a(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)$a(n[e],t)}var to=me(null),no=me(0);function ro(e,t){e=Kl,E(no,e),E(to,t),Kl=e|t.baseLanes}function io(){E(no,Kl),E(to,to.current)}function ao(){Kl=no.current,he(to),he(no)}var oo=me(null),so=null;function co(e){var t=e.alternate;E(mo,mo.current&1),E(oo,e),so===null&&(t===null||to.current!==null||t.memoizedState!==null)&&(so=e)}function lo(e){E(mo,mo.current),E(oo,e),so===null&&(so=e)}function uo(e){e.tag===22?(E(mo,mo.current),E(oo,e),so===null&&(so=e)):fo(e)}function fo(){E(mo,mo.current),E(oo,oo.current)}function po(e){he(oo),so===e&&(so=null),he(mo)}var mo=me(0);function ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||sf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var go=0,L=null,R=null,_o=null,vo=!1,yo=!1,bo=!1,xo=0,So=0,Co=null,wo=0;function z(){throw Error(o(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Er(e[n],t[n]))return!1;return!0}function Eo(e,t,n,r,i,a){return go=a,L=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w.H=e===null||e.memoizedState===null?Hs:Us,bo=!1,a=n(r,i),bo=!1,yo&&(a=Oo(t,n,r,i)),Do(e),a}function Do(e){w.H=Vs;var t=R!==null&&R.next!==null;if(go=0,_o=R=L=null,vo=!1,So=0,Co=null,t)throw Error(o(300));e===null||oc||(e=e.dependencies,e!==null&&na(e)&&(oc=!0))}function Oo(e,t,n,r){L=e;var i=0;do{if(yo&&(Co=null),So=0,yo=!1,25<=i)throw Error(o(301));if(i+=1,_o=R=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}w.H=Ws,a=t(n,r)}while(yo);return a}function ko(){var e=w.H,t=e.useState()[0];return t=typeof t.then==`function`?Fo(t):t,e=e.useState()[0],(R===null?null:R.memoizedState)!==e&&(L.flags|=1024),t}function Ao(){var e=xo!==0;return xo=0,e}function jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mo(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}go=0,_o=R=L=null,yo=!1,So=xo=0,Co=null}function No(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?L.memoizedState=_o=e:_o=_o.next=e,_o}function B(){if(R===null){var e=L.alternate;e=e===null?null:e.memoizedState}else e=R.next;var t=_o===null?L.memoizedState:_o.next;if(t!==null)_o=t,R=e;else{if(e===null)throw L.alternate===null?Error(o(467)):Error(o(310));R=e,e={memoizedState:R.memoizedState,baseState:R.baseState,baseQueue:R.baseQueue,queue:R.queue,next:null},_o===null?L.memoizedState=_o=e:_o=_o.next=e}return _o}function Po(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=So;return So+=1,Co===null&&(Co=[]),e=Aa(Co,e,t),t=L,(_o===null?t.memoizedState:_o.next)===null&&(t=t.alternate,w.H=t===null||t.memoizedState===null?Hs:Us),e}function Io(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Fo(e);if(e.$$typeof===S)return ia(e)}throw Error(o(438,String(e)))}function Lo(e){var t=null,n=L.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=L.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Po(),L.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ae;return t.index++,n}function Ro(e,t){return typeof t==`function`?t(e):t}function zo(e){return Bo(B(),R,e)}function Bo(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(go&f)===f:(K&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ha&&(d=!0);else if((go&p)===p){u=u.next,p===ha&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,L.lanes|=p,ql|=p;f=u.action,bo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,L.lanes|=f,ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!Er(a,e.memoizedState)&&(oc=!0,d&&(n=ga,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Vo(e){var t=B(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Er(a,t.memoizedState)||(oc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Ho(e,t,n){var r=L,i=B(),a=I;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!Er((R||i).memoizedState,n);if(s&&(i.memoizedState=n,oc=!0),i=i.queue,ps(Go.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||_o!==null&&_o.memoizedState.tag&1){if(r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,i,n,t),null),W===null)throw Error(o(349));a||go&127||Uo(r,t,n)}return n}function Uo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=L.updateQueue,t===null?(t=Po(),L.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wo(e,t,n,r){t.value=n,t.getSnapshot=r,Ko(t)&&qo(e)}function Go(e,t,n){return n(function(){Ko(t)&&qo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Er(e,n)}catch{return!0}}function qo(e){var t=si(e,2);t!==null&&_u(t,e,2)}function Jo(e){var t=No();if(typeof e==`function`){var n=e;if(e=n(),bo){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:e},t}function Yo(e,t,n,r){return e.baseState=n,Bo(e,R,typeof r==`function`?r:Ro)}function Xo(e,t,n,r,i){if(Rs(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};w.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Zo(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Zo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=w.T,o={};w.T=o;try{var s=n(i,r),c=w.S;c!==null&&c(o,s),Qo(e,t,s)}catch(n){es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),w.T=a}}else try{a=n(i,r),Qo(e,t,a)}catch(n){es(e,t,n)}}function Qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){$o(e,t,n)},function(n){return es(e,t,n)}):$o(e,t,n)}function $o(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zo(e,n)))}function es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(I){var n=W.formState;if(n!==null){a:{var r=L;if(I){if(F){b:{for(var i=F,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=lf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){F=lf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=No(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Fs.bind(null,L,r),r.dispatch=n,r=Jo(!1),a=Ls.bind(null,L,!1,r.queue),r=No(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Xo.bind(null,L,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(B(),R,e)}function as(e,t,n){if(t=Bo(e,t,ns)[0],e=zo(Ro)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Fo(t)}catch(e){throw e===Ta?Da:e}else r=t;t=B();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(L.flags|=2048,cs(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=B(),n=R;if(n!==null)return as(t,n,e);B(),t=t.memoizedState,n=B();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function cs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=L.updateQueue,t===null&&(t=Po(),L.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ls(){return B().memoizedState}function us(e,t,n,r){var i=No();L.flags|=e,i.memoizedState=cs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ds(e,t,n,r){var i=B();r=r===void 0?null:r;var a=i.memoizedState.inst;R!==null&&r!==null&&To(r,R.memoizedState.deps)?i.memoizedState=cs(t,a,n,r):(L.flags|=e,i.memoizedState=cs(1|t,a,n,r))}function fs(e,t){us(8390656,8,e,t)}function ps(e,t){ds(2048,8,e,t)}function ms(e){L.flags|=4;var t=L.updateQueue;if(t===null)t=Po(),L.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function hs(e){var t=B().memoizedState;return ms({ref:t,nextImpl:e}),function(){if(U&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function gs(e,t){return ds(4,2,e,t)}function _s(e,t){return ds(4,4,e,t)}function vs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ys(e,t,n){n=n==null?null:n.concat([e]),ds(4,4,vs.bind(null,t,e),n)}function bs(){}function xs(e,t){var n=B();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&To(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ss(e,t){var n=B();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&To(t,r[1]))return r[0];if(r=e(),bo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Cs(e,t,n){return n===void 0||go&1073741824&&!(K&261930)?e.memoizedState=t:(e.memoizedState=n,e=gu(),L.lanes|=e,ql|=e,n)}function ws(e,t,n,r){return Er(n,t)?n:to.current===null?!(go&42)||go&1073741824&&!(K&261930)?(oc=!0,e.memoizedState=n):(e=gu(),L.lanes|=e,ql|=e,t):(e=Cs(e,n,r),Er(e,t)||(oc=!0),e)}function Ts(e,t,n,r,i){var a=T.p;T.p=a!==0&&8>a?a:8;var o=w.T,s={};w.T=s,Ls(e,!1,t,n);try{var c=i(),l=w.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,ya(c,r),hu(e)):Is(e,t,r,hu(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},hu())}finally{T.p=a,o!==null&&s.types!==null&&(o.types=s.types),w.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=Os(e).queue;Ts(e,i,t,de,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:de},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},hu())}function As(){return ia($f)}function js(){return B().memoizedState}function Ms(){return B().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=hu();e=Ka(n);var r=qa(t,e,n);r!==null&&(_u(r,t,n),Ja(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=hu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=oi(e,t,n,r),n!==null&&(_u(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,hu())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Er(s,o))return ai(e,t,i,0),W===null&&ii(),!1}catch{}if(n=oi(e,t,i,r),n!==null)return _u(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(o(479))}else t=oi(e,n,r,2),t!==null&&_u(t,e,2)}function Rs(e){var t=e.alternate;return e===L||t!==null&&t===L}function zs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var Vs={readContext:ia,use:Io,useCallback:z,useContext:z,useEffect:z,useImperativeHandle:z,useLayoutEffect:z,useInsertionEffect:z,useMemo:z,useReducer:z,useRef:z,useState:z,useDebugValue:z,useDeferredValue:z,useTransition:z,useSyncExternalStore:z,useId:z,useHostTransitionStatus:z,useFormState:z,useActionState:z,useOptimistic:z,useMemoCache:z,useCacheRefresh:z};Vs.useEffectEvent=z;var Hs={readContext:ia,use:Io,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(bo){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(bo){qe(!0);try{n(t)}finally{qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ps.bind(null,L,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,L,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(No(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,L,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=L,i=No();if(I){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),W===null)throw Error(o(349));K&127||Uo(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,fs(Go.bind(null,r,a,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,a,n,t),null),n},useId:function(){var e=No(),t=W.identifierPrefix;if(I){var n=ji,r=Ai;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:As,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=No();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ls.bind(null,L,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return No().memoizedState=Ns.bind(null,L)},useEffectEvent:function(e){var t=No(),n={impl:e};return t.memoizedState=n,function(){if(U&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Us={readContext:ia,use:Io,useCallback:xs,useContext:ia,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:zo,useRef:ls,useState:function(){return zo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){return ws(B(),R.memoizedState,e,t)},useTransition:function(){var e=zo(Ro)[0],t=B().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Yo(B(),R,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Us.useEffectEvent=hs;var Ws={readContext:ia,use:Io,useCallback:xs,useContext:ia,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Vo,useRef:ls,useState:function(){return Vo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){var n=B();return R===null?Cs(n,e,t):ws(n,R.memoizedState,e,t)},useTransition:function(){var e=Vo(Ro)[0],t=B().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=B();return R===null?(n.baseState=e,[e,n.queue.dispatch]):Yo(n,R,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Ws.useEffectEvent=hs;function Gs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ks={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ka(r);i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(_u(t,e,r),Ja(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ka(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(_u(t,e,r),Ja(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hu(),r=Ka(n);r.tag=2,t!=null&&(r.callback=t),t=qa(e,r,n),t!==null&&(_u(t,e,n),Ja(t,e,n))}};function qs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Dr(n,r)||!Dr(i,a):!0}function Js(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ks.enqueueReplaceState(t,t.state,null)}function Ys(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Xs(e){ei(e)}function Zs(e){console.error(e)}function Qs(e){ei(e)}function $s(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function tc(e,t,n){return n=Ka(n),n.tag=3,n.payload={element:null},n.callback=function(){$s(e,t)},n}function nc(e){return e=Ka(e),e.tag=3,e}function rc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ec(t,n,r),typeof i!=`function`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ic(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ta(t,n,i,!0),n=oo.current,n!==null){switch(n.tag){case 31:case 13:return so===null?ku():n.alternate===null&&J===0&&(J=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Oa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,i)),!1;case 22:return n.flags|=65536,r===Oa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),qu(e,r,i)),!1}throw Error(o(435,n.tag))}return qu(e,r,i),ku(),!1}if(I)return t=oo.current,t===null?(r!==Bi&&(t=Error(o(423),{cause:r}),qi(Si(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Si(r,n),i=tc(e.stateNode,r,i),Ya(e,i),J!==4&&(J=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Bi&&(e=Error(o(422),{cause:r}),qi(Si(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=Si(a,n),Ql===null?Ql=[a]:Ql.push(a),J!==4&&(J=2),t===null)return!0;r=Si(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=tc(n.stateNode,r,e),Ya(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(au===null||!au.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=nc(i),rc(i,e,n,r),Ya(n,i),!1}n=n.return}while(n!==null);return!1}var ac=Error(o(461)),oc=!1;function sc(e,t,n,r){t.child=e===null?Ha(t,null,n,r):Va(t,e.child,n,r)}function cc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ra(t),r=Eo(e,t,n,o,a,i),s=Ao(),e!==null&&!oc?(jo(e,t,i),Mc(e,t,i)):(I&&s&&Pi(t),t.flags|=1,sc(e,t,r,i),t.child)}function lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,uc(e,t,a,r,i)):(e=gi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Nc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Dr:n,n(o,r)&&e.ref===t.ref)return Mc(e,t,i)}return t.flags|=1,e=mi(a,r),e.ref=t.ref,e.return=t,t.child=e}function uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Dr(a,r)&&e.ref===t.ref)if(oc=!1,t.pendingProps=r=a,Nc(e,i))e.flags&131072&&(oc=!0);else return t.lanes=e.lanes,Mc(e,t,i)}return vc(e,t,n,r,i)}function dc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ca(t,a===null?null:a.cachePool),a===null?io():ro(t,a),uo(t);else return r=t.lanes=536870912,pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ca(t,null),io(),fo(t)):(Ca(t,a.cachePool),ro(t,a),fo(t),t.memoizedState=null);return sc(e,t,i,n),t.child}function fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function pc(e,t,n,r,i){var a=Sa();return a=a===null?null:{parent:ua._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ca(t,null),io(),uo(t),e!==null&&ta(e,t,r,!0),t.childLanes=i,null}function mc(e,t){return t=Dc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function hc(e,t,n){return Va(t,e.child,null,n),e=mc(t,t.pendingProps),e.flags|=2,po(t),t.memoizedState=null,e}function gc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(I){if(r.mode===`hidden`)return e=mc(t,r),t.lanes=536870912,fc(null,e);if(lo(t),(e=F)?(e=af(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ki===null?null:{id:Ai,overflow:ji},retryLane:536870912,hydrationErrors:null},n=yi(e),n.return=t,t.child=n,Li=t,F=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return mc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(lo(t),i)if(t.flags&256)t.flags&=-257,t=hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(oc||ta(e,t,n,!1),i=(n&e.childLanes)!==0,oc||i){if(r=W,r!==null&&(s=dt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,si(e,s),_u(r,e,s),ac;ku(),t=hc(e,t,n)}else e=a.treeContext,F=lf(s.nextSibling),Li=t,I=!0,Ri=null,zi=!1,e!==null&&Ii(t,e),t=mc(t,r),t.flags|=4096;return t}return e=mi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _c(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function vc(e,t,n,r,i){return ra(t),n=Eo(e,t,n,r,void 0,i),r=Ao(),e!==null&&!oc?(jo(e,t,i),Mc(e,t,i)):(I&&r&&Pi(t),t.flags|=1,sc(e,t,n,i),t.child)}function yc(e,t,n,r,i,a){return ra(t),t.updateQueue=null,n=Oo(t,r,n,i),Do(e),r=Ao(),e!==null&&!oc?(jo(e,t,a),Mc(e,t,a)):(I&&r&&Pi(t),t.flags|=1,sc(e,t,n,a),t.child)}function bc(e,t,n,r,i){if(ra(t),t.stateNode===null){var a=ui,o=n.contextType;typeof o==`object`&&o&&(a=ia(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ks,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Wa(t),o=n.contextType,a.context=typeof o==`object`&&o?ia(o):ui,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Gs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ks.enqueueReplaceState(a,a.state,null),Qa(t,r,a,i),Za(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ys(n,s);a.props=c;var l=a.context,u=n.contextType;o=ui,typeof u==`object`&&u&&(o=ia(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Js(t,a,r,o),Ua=!1;var f=t.memoizedState;a.state=f,Qa(t,r,a,i),Za(),l=t.memoizedState,s||f!==l||Ua?(typeof d==`function`&&(Gs(t,n,d,r),l=t.memoizedState),(c=Ua||qs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ga(e,t),o=t.memoizedProps,u=Ys(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ui,typeof l==`object`&&l&&(c=ia(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Js(t,a,r,c),Ua=!1,f=t.memoizedState,a.state=f,Qa(t,r,a,i),Za();var p=t.memoizedState;o!==d||f!==p||Ua||e!==null&&e.dependencies!==null&&na(e.dependencies)?(typeof s==`function`&&(Gs(t,n,s,r),p=t.memoizedState),(u=Ua||qs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&na(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,_c(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Va(t,e.child,null,i),t.child=Va(t,null,n,i)):sc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Mc(e,t,i),e}function xc(e,t,n,r){return Gi(),t.flags|=256,sc(e,t,n,r),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:wa()}}function wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Xl),e}function Tc(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!=0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(mo.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(I){if(i?co(t):fo(t),(e=F)?(e=af(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ki===null?null:{id:Ai,overflow:ji},retryLane:536870912,hydrationErrors:null},n=yi(e),n.return=t,t.child=n,Li=t,F=null)):e=null,e===null)throw Vi(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(fo(t),i=t.mode,c=Dc({mode:`hidden`,children:c},i),r=_i(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(null,r)):(co(t),Ec(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(a)t.flags&256?(co(t),t.flags&=-257,t=Oc(e,t,n)):t.memoizedState===null?(fo(t),c=r.fallback,i=t.mode,r=Dc({mode:`visible`,children:r.children},i),c=_i(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Va(t,e.child,null,n),r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,t=fc(null,r)):(fo(t),t.child=e.child,t.flags|=128,t=null);else if(co(t),sf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(o(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=Oc(e,t,n)}else if(oc||ta(e,t,n,!1),s=(n&e.childLanes)!==0,oc||s){if(s=W,s!==null&&(r=dt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,si(e,r),_u(s,e,r),ac;of(c)||ku(),t=Oc(e,t,n)}else of(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,F=lf(c.nextSibling),Li=t,I=!0,Ri=null,zi=!1,e!==null&&Ii(t,e),t=Ec(t,r.children),t.flags|=4096);return t}return i?(fo(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=mi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=_i(c,i,n,null),c.flags|=2):c=mi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,fc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Cc(n):(i=c.cachePool,i===null?i=wa():(l=ua._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(e.child,r)):(co(t),n=e.child,e=n.sibling,n=mi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Ec(e,t){return t=Dc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Dc(e,t){return e=fi(22,e,null,t),e.lanes=0,e}function Oc(e,t,n){return Va(t,e.child,null,n),e=Ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$i(e.return,t,n)}function Ac(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function jc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=mo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,E(mo,o),sc(e,t,r,n),r=I?Ei:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kc(e,n,t);else if(e.tag===19)kc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ho(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ac(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ac(t,!0,n,null,a,r);break;case`together`:Ac(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Mc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ql|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=mi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=mi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&na(e))):!0}function Pc(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),Zi(t,ua,e.memoizedState.cache),Gi();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:Zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(co(t),e=Mc(e,t,n),e===null?null:e.sibling):Tc(e,t,n):(co(t),t.flags|=128,null);co(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return jc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),E(mo,mo.current),r)break;return null;case 22:return t.lanes=0,dc(e,t,n,t.pendingProps);case 24:Zi(t,ua,e.memoizedState.cache)}return Mc(e,t,n)}function Fc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)oc=!0;else{if(!Nc(e,n)&&!(t.flags&128))return oc=!1,Pc(e,t,n);oc=!!(e.flags&131072)}else oc=!1,I&&t.flags&1048576&&Ni(t,Ei,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ja(t.elementType),t.type=e,typeof e==`function`)pi(e)?(r=Ys(e,r),t.tag=1,t=bc(null,t,e,r,n)):(t.tag=0,t=vc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===ee){t.tag=11,t=cc(null,t,e,r,n);break a}else if(i===ne){t.tag=14,t=lc(null,t,e,r,n);break a}}throw t=le(e)||e,Error(o(306,t,``))}}return t;case 0:return vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Ys(r,t.pendingProps),bc(e,t,r,i,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,Ga(e,t),Qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Zi(t,ua,r),r!==a.cache&&ea(t,[ua],n,!0),Za(),r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=xc(e,t,r,n);break a}else if(r!==i){i=Si(Error(o(424)),t),qi(i),t=xc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(F=lf(e.firstChild),Li=t,I=!0,Ri=null,zi=!0,n=Ha(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===i){t=Mc(e,t,n);break a}sc(e,t,r,n)}t=t.child}return t;case 26:return _c(e,t),e===null?(n=Af(t.type,null,t.pendingProps,null))?t.memoizedState=n:I||(n=t.type,e=t.pendingProps,r=Vd(ve.current).createElement(n),r[_t]=t,r[vt]=e,Q(r,n,e),kt(r),t.stateNode=r):t.memoizedState=Af(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&I&&(r=t.stateNode=pf(t.type,t.pendingProps,ve.current),Li=t,zi=!0,i=F,Qd(t.type)?(uf=i,F=lf(r.firstChild)):F=i),sc(e,t,t.pendingProps.children,n),_c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((i=r=F)&&(r=nf(r,t.type,t.pendingProps,zi),r===null?i=!1:(t.stateNode=r,Li=t,F=lf(r.firstChild),zi=!1,i=!0)),i||Vi(t)),Se(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,Wd(i,a)?r=null:s!==null&&Wd(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Eo(e,t,ko,null,null,n),$f._currentValue=i),_c(e,t),sc(e,t,r,n),t.child;case 6:return e===null&&I&&((e=n=F)&&(n=rf(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Li=t,F=null,e=!0)),e||Vi(t)),null;case 13:return Tc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Va(t,null,r,n):sc(e,t,r,n),t.child;case 11:return cc(e,t,t.type,t.pendingProps,n);case 7:return sc(e,t,t.pendingProps,n),t.child;case 8:return sc(e,t,t.pendingProps.children,n),t.child;case 12:return sc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Zi(t,t.type,r.value),sc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,ra(t),i=ia(i),r=r(i),t.flags|=1,sc(e,t,r,n),t.child;case 14:return lc(e,t,t.type,t.pendingProps,n);case 15:return uc(e,t,t.type,t.pendingProps,n);case 19:return jc(e,t,n);case 31:return gc(e,t,n);case 22:return dc(e,t,n,t.pendingProps);case 24:return ra(t),r=ia(ua),e===null?(i=Sa(),i===null&&(i=W,a=da(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},Wa(t),Zi(t,ua,i)):((e.lanes&n)!==0&&(Ga(e,t),Qa(t,null,null,n),Za()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,Zi(t,ua,r),r!==i.cache&&ea(t,[ua],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Zi(t,ua,r))),sc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Ic(e){e.flags|=4}function Lc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Eu())e.flags|=8192;else throw Ma=Oa,Ea}else e.flags&=-16777217}function Rc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Gf(t))if(Eu())e.flags|=8192;else throw Ma=Oa,Ea}function zc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,Zl|=t)}function Bc(e,t){if(!I)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function V(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Vc(e,t,n){var r=t.pendingProps;switch(Fi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return V(t),null;case 1:return V(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qi(ua),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Ic(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),V(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(Ic(t),a===null?(V(t),Lc(t,i,null,r,n)):(V(t),Rc(t,a))):a?a===e.memoizedState?(V(t),t.flags&=-16777217):(Ic(t),V(t),Rc(t,a)):(e=e.memoizedProps,e!==r&&Ic(t),V(t),Lc(t,i,e,r,n)),null;case 27:if(Ce(t),n=ve.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return V(t),null}e=ge.current,Wi(t)?Hi(t,e):(e=pf(i,r,n),t.stateNode=e,Ic(t))}return V(t),null;case 5:if(Ce(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return V(t),null}if(a=ge.current,Wi(t))Hi(t,a);else{var s=Vd(ve.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[_t]=t,a[vt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(Q(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ic(t)}}return V(t),Lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=ve.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Li,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Pd(e.nodeValue,n)),e||Vi(t,!0)}else e=Vd(e).createTextNode(r),e[_t]=t,t.stateNode=e}return V(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[_t]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(po(t),t):(po(t),null);if(t.flags&128)throw Error(o(558))}return V(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[_t]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),i=!1}else i=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(po(t),t):(po(t),null)}return po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),zc(t,t.updateQueue),V(t),null);case 4:return xe(),e===null&&wd(t.stateNode.containerInfo),V(t),null;case 10:return Qi(t.type),V(t),null;case 19:if(he(mo),r=t.memoizedState,r===null)return V(t),null;if(i=(t.flags&128)!=0,a=r.rendering,a===null)if(i)Bc(r,!1);else{if(J!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=ho(e),a!==null){for(t.flags|=128,Bc(r,!1),e=a.updateQueue,t.updateQueue=e,zc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)hi(n,e),n=n.sibling;return E(mo,mo.current&1|2),I&&Mi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>ru&&(t.flags|=128,i=!0,Bc(r,!1),t.lanes=4194304)}else{if(!i)if(e=ho(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,zc(t,e),Bc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!a.alternate&&!I)return V(t),null}else 2*Ie()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,i=!0,Bc(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}return r.tail===null?(V(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,n=mo.current,E(mo,i?n&1|2:n&1),I&&Mi(t,r.treeForkCount),e);case 22:case 23:return po(t),ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(V(t),t.subtreeFlags&6&&(t.flags|=8192)):V(t),n=t.updateQueue,n!==null&&zc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&he(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),V(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Hc(e,t){switch(Fi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(po(t),t.alternate===null)throw Error(o(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return he(mo),null;case 4:return xe(),null;case 10:return Qi(t.type),null;case 22:case 23:return po(t),ao(),e!==null&&he(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function Uc(e,t){switch(Fi(t),t.tag){case 3:Qi(ua),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&po(t);break;case 13:po(t);break;case 19:he(mo);break;case 10:Qi(t.type);break;case 22:case 23:po(t),ao(),e!==null&&he(xa);break;case 24:Qi(ua)}}function Wc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Y(t,t.return,e)}}function Gc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Y(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Y(t,t.return,e)}}function Kc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{eo(t,n)}catch(t){Y(e,e.return,t)}}}function qc(e,t,n){n.props=Ys(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Y(e,t,n)}}function Jc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Y(e,t,n)}}function Yc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Y(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Y(e,t,n)}else n.current=null}function Xc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Y(e,e.return,t)}}function Zc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[vt]=t}catch(t){Y(e,e.return,t)}}function Qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function $c(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Q(t,r,n),t[_t]=e,t[vt]=n}catch(t){Y(e,e.return,t)}}var rl=!1,il=!1,al=!1,ol=typeof WeakSet==`function`?WeakSet:Set,sl=null;function cl(e,t){if(e=e.containerInfo,zd=cp,e=jr(e),Mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==a||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===a&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},cp=!1,sl=t;sl!==null;)if(t=sl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,sl=e;else for(;sl!==null;){switch(t=sl,a=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var h=Ys(n.type,i);e=r.getSnapshotBeforeUpdate(h,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Y(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,sl=e;break}sl=t.return}}function ll(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Cl(e,n),r&4&&Wc(5,n);break;case 1:if(Cl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Y(n,n.return,e)}else{var i=Ys(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Y(n,n.return,e)}}r&64&&Kc(n),r&512&&Jc(n,n.return);break;case 3:if(Cl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{eo(e,t)}catch(e){Y(n,n.return,e)}}break;case 27:t===null&&r&4&&nl(n);case 26:case 5:Cl(e,n),t===null&&r&4&&Xc(n),r&512&&Jc(n,n.return);break;case 12:Cl(e,n);break;case 31:Cl(e,n),r&4&&ml(e,n);break;case 13:Cl(e,n),r&4&&hl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),cf(e,n))));break;case 22:if(r=n.memoizedState!==null||rl,!r){t=t!==null&&t.memoizedState!==null||il,i=rl;var a=il;rl=r,(il=t)&&!a?Tl(e,n,(n.subtreeFlags&8772)!=0):Cl(e,n),rl=i,il=a}break;case 30:break;default:Cl(e,n)}}function ul(e){var t=e.alternate;t!==null&&(e.alternate=null,ul(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var H=null,dl=!1;function fl(e,t,n){for(n=n.child;n!==null;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:il||Yc(n,t),fl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:il||Yc(n,t);var r=H,i=dl;Qd(n.type)&&(H=n.stateNode,dl=!1),fl(e,t,n),mf(n.stateNode),H=r,dl=i;break;case 5:il||Yc(n,t);case 6:if(r=H,i=dl,H=null,fl(e,t,n),H=r,dl=i,H!==null)if(dl)try{(H.nodeType===9?H.body:H.nodeName===`HTML`?H.ownerDocument.body:H).removeChild(n.stateNode)}catch(e){Y(n,t,e)}else try{H.removeChild(n.stateNode)}catch(e){Y(n,t,e)}break;case 18:H!==null&&(dl?(e=H,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Pp(e)):$d(H,n.stateNode));break;case 4:r=H,i=dl,H=n.stateNode.containerInfo,dl=!0,fl(e,t,n),H=r,dl=i;break;case 0:case 11:case 14:case 15:Gc(2,n,t),il||Gc(4,n,t),fl(e,t,n);break;case 1:il||(Yc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&qc(n,t,r)),fl(e,t,n);break;case 21:fl(e,t,n);break;case 22:il=(r=il)||n.memoizedState!==null,fl(e,t,n),il=r;break;default:fl(e,t,n)}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pp(e)}catch(e){Y(t,t.return,e)}}}function hl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pp(e)}catch(e){Y(t,t.return,e)}}function gl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ol),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ol),t;default:throw Error(o(435,e.tag))}}function _l(e,t){var n=gl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function vl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Qd(c.type)){H=c.stateNode,dl=!1;break a}break;case 5:H=c.stateNode,dl=!1;break a;case 3:case 4:H=c.stateNode.containerInfo,dl=!0;break a}c=c.return}if(H===null)throw Error(o(160));pl(a,s,i),H=null,dl=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bl(t,e),t=t.sibling}var yl=null;function bl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vl(t,e),xl(e),r&4&&(Gc(3,e,e.return),Wc(3,e),Gc(5,e,e.return));break;case 1:vl(t,e),xl(e),r&512&&(il||n===null||Yc(n,n.return)),r&64&&rl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=yl;if(vl(t,e),xl(e),r&512&&(il||n===null||Yc(n,n.return)),r&4){var a=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:a=i.getElementsByTagName(`title`)[0],(!a||a[Ct]||a[_t]||a.namespaceURI===`http://www.w3.org/2000/svg`||a.hasAttribute(`itemprop`))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector(`head > title`))),Q(a,r,n),a[_t]=e,kt(a),r=a;break a;case`link`:var s=Hf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&a.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&a.getAttribute(`title`)===(n.title==null?null:n.title)&&a.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}a=i.createElement(r),Q(a,r,n),i.head.appendChild(a);break;case`meta`:if(s=Hf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`content`)===(n.content==null?null:``+n.content)&&a.getAttribute(`name`)===(n.name==null?null:n.name)&&a.getAttribute(`property`)===(n.property==null?null:n.property)&&a.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}a=i.createElement(r),Q(a,r,n),i.head.appendChild(a);break;default:throw Error(o(468,r))}a[_t]=e,kt(a),r=a}e.stateNode=r}else Uf(i,e.type,e.stateNode);else e.stateNode=Lf(i,r,e.memoizedProps);else a===r?r===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps):(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?Uf(i,e.type,e.stateNode):Lf(i,r,e.memoizedProps))}break;case 27:vl(t,e),xl(e),r&512&&(il||n===null||Yc(n,n.return)),n!==null&&r&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(vl(t,e),xl(e),r&512&&(il||n===null||Yc(n,n.return)),e.flags&32){i=e.stateNode;try{Qt(i,``)}catch(t){Y(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Zc(e,i,n===null?i:n.memoizedProps)),r&1024&&(al=!0);break;case 6:if(vl(t,e),xl(e),r&4){if(e.stateNode===null)throw Error(o(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Y(e,e.return,t)}}break;case 3:if(Vf=null,i=yl,yl=_f(t.containerInfo),vl(t,e),yl=i,xl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pp(t.containerInfo)}catch(t){Y(e,e.return,t)}al&&(al=!1,Sl(e));break;case 4:r=yl,yl=_f(e.stateNode.containerInfo),vl(t,e),xl(e),yl=r;break;case 12:vl(t,e),xl(e);break;case 31:vl(t,e),xl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 13:vl(t,e),xl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tu=Ie()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=rl,d=il;if(rl=u||i,il=d||l,vl(t,e),il=d,rl=u,xl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||rl||il||wl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)s=a.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Y(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Y(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?ef(m,!0):ef(l.stateNode,!1)}catch(e){Y(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,_l(e,n))));break;case 19:vl(t,e),xl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 30:break;case 21:break;default:vl(t,e),xl(e)}}function xl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Qc(r)){n=r;break}r=r.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode;tl(e,$c(e),i);break;case 5:var a=n.stateNode;n.flags&32&&(Qt(a,``),n.flags&=-33),tl(e,$c(e),a);break;case 3:case 4:var s=n.stateNode.containerInfo;el(e,$c(e),s);break;default:throw Error(o(161))}}catch(t){Y(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Cl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ll(e,t.alternate,t),t=t.sibling}function wl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gc(4,t,t.return),wl(t);break;case 1:Yc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&qc(t,t.return,n),wl(t);break;case 27:mf(t.stateNode);case 26:case 5:Yc(t,t.return),wl(t);break;case 22:t.memoizedState===null&&wl(t);break;case 30:wl(t);break;default:wl(t)}e=e.sibling}}function Tl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Tl(i,a,n),Wc(4,a);break;case 1:if(Tl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Y(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)$a(c[i],s)}catch(e){Y(r,r.return,e)}}n&&o&64&&Kc(a),Jc(a,a.return);break;case 27:nl(a);case 26:case 5:Tl(i,a,n),n&&r===null&&o&4&&Xc(a),Jc(a,a.return);break;case 12:Tl(i,a,n);break;case 31:Tl(i,a,n),n&&o&4&&ml(i,a);break;case 13:Tl(i,a,n),n&&o&4&&hl(i,a);break;case 22:a.memoizedState===null&&Tl(i,a,n),Jc(a,a.return);break;case 30:break;default:Tl(i,a,n)}t=t.sibling}}function El(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&fa(n))}function Dl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e))}function Ol(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kl(e,t,n,r),t=t.sibling}function kl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ol(e,t,n,r),i&2048&&Wc(9,t);break;case 1:Ol(e,t,n,r);break;case 3:Ol(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e)));break;case 12:if(i&2048){Ol(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Y(t,t.return,e)}}else Ol(e,t,n,r);break;case 31:Ol(e,t,n,r);break;case 13:Ol(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Ol(e,t,n,r):(a._visibility|=2,Al(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Ol(e,t,n,r):jl(e,t),i&2048&&El(o,t);break;case 24:Ol(e,t,n,r),i&2048&&Dl(t.alternate,t);break;default:Ol(e,t,n,r)}}function Al(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Al(a,o,s,c,i),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Al(a,o,s,c,i)):u._visibility&2?Al(a,o,s,c,i):jl(a,o),i&&l&2048&&El(o.alternate,o);break;case 24:Al(a,o,s,c,i),i&&l&2048&&Dl(o.alternate,o);break;default:Al(a,o,s,c,i)}t=t.sibling}}function jl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:jl(n,r),i&2048&&El(r.alternate,r);break;case 24:jl(n,r),i&2048&&Dl(r.alternate,r);break;default:jl(n,r)}t=t.sibling}}var Ml=8192;function Nl(e,t,n){if(e.subtreeFlags&Ml)for(e=e.child;e!==null;)Pl(e,t,n),e=e.sibling}function Pl(e,t,n){switch(e.tag){case 26:Nl(e,t,n),e.flags&Ml&&e.memoizedState!==null&&Kf(n,yl,e.memoizedState,e.memoizedProps);break;case 5:Nl(e,t,n);break;case 3:case 4:var r=yl;yl=_f(e.stateNode.containerInfo),Nl(e,t,n),yl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ml,Ml=16777216,Nl(e,t,n),Ml=r):Nl(e,t,n));break;default:Nl(e,t,n)}}function Fl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,zl(r,e)}Fl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ll(e),e=e.sibling}function Ll(e){switch(e.tag){case 0:case 11:case 15:Il(e),e.flags&2048&&Gc(9,e,e.return);break;case 3:Il(e);break;case 12:Il(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Rl(e)):Il(e);break;default:Il(e)}}function Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,zl(r,e)}Fl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gc(8,t,t.return),Rl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Rl(t));break;default:Rl(t)}e=e.sibling}}function zl(e,t){for(;sl!==null;){var n=sl;switch(n.tag){case 0:case 11:case 15:Gc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,sl=r;else a:for(n=e;sl!==null;){r=sl;var i=r.sibling,a=r.return;if(ul(r),r===n){sl=null;break a}if(i!==null){i.return=a,sl=i;break a}sl=a}}}var Bl={getCacheForType:function(e){var t=ia(ua),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ia(ua).controller.signal}},Vl=typeof WeakMap==`function`?WeakMap:Map,U=0,W=null,G=null,K=0,q=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,J=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=null,$l=null,eu=!1,tu=0,nu=0,ru=1/0,iu=null,au=null,ou=0,su=null,cu=null,lu=0,uu=0,du=null,fu=null,pu=0,mu=null;function hu(){return U&2&&K!==0?K&-K:w.T===null?mt():pd()}function gu(){if(Xl===0)if(!(K&536870912)||I){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),Xl=e}else Xl=536870912;return e=oo.current,e!==null&&(e.flags|=32),Xl}function _u(e,t,n){(e===W&&(q===2||q===9)||e.cancelPendingCommit!==null)&&(wu(e,0),xu(e,K,Xl,!1)),st(e,n),(!(U&2)||e!==W)&&(e===W&&(!(U&2)&&(Jl|=n),J===4&&xu(e,K,Xl,!1)),ad(e))}function vu(e,t,n){if(U&6)throw Error(o(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||rt(e,t),i=r?Mu(e,t):Au(e,t,!0),a=r;do{if(i===0){Wl&&!r&&xu(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!bu(n)){i=Au(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=Ql;var l=c.current.memoizedState.isDehydrated;if(l&&(wu(c,s).flags|=256),s=Au(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=a,Jl|=a,i=4;break a}a=$l,$l=i,a!==null&&($l===null?$l=a:$l.push.apply($l,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){wu(e,0),xu(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:xu(r,t,Xl,!Ul);break a;case 2:$l=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=tu+300-Ie(),10<i)){if(xu(r,t,Xl,!Ul),nt(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=qd(yu.bind(null,r,n,$l,iu,eu,t,Xl,Jl,Zl,Ul,a,`Throttled`,-0,0),i);break a}yu(r,n,$l,iu,eu,t,Xl,Jl,Zl,Ul,a,null,-0,0)}}break}while(1);ad(e)}function yu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sn},Pl(t,a,d);var m=(a&62914560)===a?tu-Ie():(a&4194048)===a?nu-Ie():0;if(m=Jf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(zu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),xu(e,a,o,!l);return}}zu(e,t,a,n,r,i,o,s,c)}function bu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Er(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xu(e,t,n,r){t&=~Yl,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&<(e,n,t)}function Su(){return U&6?!0:(od(0,!1),!1)}function Cu(){if(G!==null){if(q===0)var e=G.return;else e=G,Xi=Yi=null,Mo(e),Fa=null,Ia=0,e=G;for(;e!==null;)Uc(e.alternate,e),e=e.return;G=null}}function wu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Cu(),W=e,G=n=mi(e.current,null),K=t,q=0,Hl=null,Ul=!1,Wl=rt(e,t),Gl=!1,Zl=Xl=Yl=Jl=ql=J=0,$l=Ql=null,eu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Je(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,ii(),n}function Tu(e,t){L=null,w.H=Vs,t===Ta||t===Da?(t=Na(),q=3):t===Ea?(t=Na(),q=4):q=t===ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,G===null&&(J=1,$s(e,Si(t,e.current)))}function Eu(){var e=oo.current;return e===null?!0:(K&4194048)===K?so===null:(K&62914560)===K||K&536870912?e===so:!1}function Du(){var e=w.H;return w.H=Vs,e===null?Vs:e}function Ou(){var e=w.A;return w.A=Bl,e}function ku(){J=4,Ul||(K&4194048)!==K&&oo.current!==null||(Wl=!0),!(ql&134217727)&&!(Jl&134217727)||W===null||xu(W,K,Xl,!1)}function Au(e,t,n){var r=U;U|=2;var i=Du(),a=Ou();(W!==e||K!==t)&&(iu=null,wu(e,t)),t=!1;var o=J;a:do try{if(q!==0&&G!==null){var s=G,c=Hl;switch(q){case 8:Cu(),o=6;break a;case 3:case 2:case 9:case 6:oo.current===null&&(t=!0);var l=q;if(q=0,Hl=null,Iu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=q,q=0,Hl=null,Iu(e,s,c,l)}}ju(),o=J;break}catch(t){Tu(e,t)}while(1);return t&&e.shellSuspendCounter++,Xi=Yi=null,U=r,w.H=i,w.A=a,G===null&&(W=null,K=0,ii()),o}function ju(){for(;G!==null;)Pu(G)}function Mu(e,t){var n=U;U|=2;var r=Du(),i=Ou();W!==e||K!==t?(iu=null,ru=Ie()+500,wu(e,t)):Wl=rt(e,t);a:do try{if(q!==0&&G!==null){t=G;var a=Hl;b:switch(q){case 1:q=0,Hl=null,Iu(e,t,a,1);break;case 2:case 9:if(ka(a)){q=0,Hl=null,Fu(t);break}t=function(){q!==2&&q!==9||W!==e||(q=7),ad(e)},a.then(t,t);break a;case 3:q=7;break a;case 4:q=5;break a;case 7:ka(a)?(q=0,Hl=null,Fu(t)):(q=0,Hl=null,Iu(e,t,a,7));break;case 5:var s=null;switch(G.tag){case 26:s=G.memoizedState;case 5:case 27:var c=G;if(s?Gf(s):c.stateNode.complete){q=0,Hl=null;var l=c.sibling;if(l!==null)G=l;else{var u=c.return;u===null?G=null:(G=u,Lu(u))}break b}}q=0,Hl=null,Iu(e,t,a,5);break;case 6:q=0,Hl=null,Iu(e,t,a,6);break;case 8:Cu(),J=6;break a;default:throw Error(o(462))}}Nu();break}catch(t){Tu(e,t)}while(1);return Xi=Yi=null,w.H=r,w.A=i,U=n,G===null?(W=null,K=0,ii(),J):0}function Nu(){for(;G!==null&&!D();)Pu(G)}function Pu(e){var t=Fc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Lu(e):G=t}function Fu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=yc(n,t,t.pendingProps,t.type,void 0,K);break;case 11:t=yc(n,t,t.pendingProps,t.type.render,t.ref,K);break;case 5:Mo(t);default:Uc(n,t),t=G=hi(t,Kl),t=Fc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Lu(e):G=t}function Iu(e,t,n,r){Xi=Yi=null,Mo(t),Fa=null,Ia=0;var i=t.return;try{if(ic(e,i,t,n,K)){J=1,$s(e,Si(n,e.current)),G=null;return}}catch(t){if(i!==null)throw G=i,t;J=1,$s(e,Si(n,e.current)),G=null;return}t.flags&32768?(I||r===1?e=!0:Wl||K&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ru(t,e)):Lu(t)}function Lu(e){var t=e;do{if(t.flags&32768){Ru(t,Ul);return}e=t.return;var n=Vc(t.alternate,t,Kl);if(n!==null){G=n;return}if(t=t.sibling,t!==null){G=t;return}G=t=e}while(t!==null);J===0&&(J=5)}function Ru(e,t){do{var n=Hc(e.alternate,e);if(n!==null){n.flags&=32767,G=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){G=e;return}G=e=n}while(e!==null);J=6,G=null}function zu(e,t,n,r,i,a,s,c,l){e.cancelPendingCommit=null;do Wu();while(ou!==0);if(U&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(a=t.lanes|t.childLanes,a|=ri,ct(e,n,a,s,c,l),e===W&&(G=W=null,K=0),cu=t,su=e,lu=n,uu=a,du=i,fu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Be,function(){return Gu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=w.T,w.T=null,i=T.p,T.p=2,s=U,U|=4;try{cl(e,t,n)}finally{U=s,T.p=i,w.T=r}}ou=1,Bu(),Vu(),Hu()}}function Bu(){if(ou===1){ou=0;var e=su,t=cu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=w.T,w.T=null;var r=T.p;T.p=2;var i=U;U|=4;try{bl(t,e);var a=Bd,o=jr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ar(s.ownerDocument.documentElement,s)){if(c!==null&&Mr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=kr(s,h),v=kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}cp=!!zd,Bd=zd=null}finally{U=i,T.p=r,w.T=n}}e.current=t,ou=2}}function Vu(){if(ou===2){ou=0;var e=su,t=cu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=w.T,w.T=null;var r=T.p;T.p=2;var i=U;U|=4;try{ll(e,t.alternate,t)}finally{U=i,T.p=r,w.T=n}}ou=3}}function Hu(){if(ou===4||ou===3){ou=0,Pe();var e=su,t=cu,n=lu,r=fu;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Uu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),pt(n),t=t.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=w.T,i=T.p,T.p=2,w.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{w.T=t,T.p=i}}lu&3&&Wu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===mu?pu++:(pu=0,mu=e):pu=0,od(0,!1)}}function Uu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fa(t)))}function Wu(){return Bu(),Vu(),Hu(),Gu()}function Gu(){if(ou!==5)return!1;var e=su,t=uu;uu=0;var n=pt(lu),r=w.T,i=T.p;try{T.p=32>n?32:n,w.T=null,n=du,du=null;var a=su,s=lu;if(ou=0,cu=su=null,lu=0,U&6)throw Error(o(331));var c=U;if(U|=4,Ll(a.current),kl(a,a.current,s,n),U=c,od(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,a)}catch{}return!0}finally{T.p=i,w.T=r,Uu(e,t)}}function Ku(e,t,n){t=Si(n,t),t=tc(e.stateNode,t,2),e=qa(e,t,2),e!==null&&(st(e,2),ad(e))}function Y(e,t,n){if(e.tag===3)Ku(e,e,n);else for(;t!==null;){if(t.tag===3){Ku(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=Si(n,e),n=nc(2),r=qa(t,n,2),r!==null&&(rc(n,r,t,e),st(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Vl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,W===e&&(K&n)===n&&(J===4||J===3&&(K&62914560)===K&&300>Ie()-tu?!(U&2)&&wu(e,0):Yl|=n,Zl===K&&(Zl=0)),ad(e)}function Yu(e,t){t===0&&(t=at()),e=si(e,t),e!==null&&(st(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),Yu(e,n)}function Qu(e,t){return Me(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=K,a=nt(r,r===W?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,dd(r,a));r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&Kd()&&(e=id);for(var t=Ie(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}ou!==0&&ou!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=W,n=K,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(q===2||q===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),pt(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=ud.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var r=K;return r=nt(e,e===W?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vu(e,r,t),ld(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Wu())return null;vu(e,t,!0)}function fd(){Xd(function(){U&6?Me(Re,sd):cd()})}function pd(){if(id===0){var e=ha;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:on(``+e)}function hd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function gd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=md((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Tn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);Ds(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),Ds(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<Qr.length;_d++){var vd=Qr[_d];$r(vd.toLowerCase(),`on`+(vd[0].toUpperCase()+vd.slice(1)))}$r(Wr,`onAnimationEnd`),$r(Gr,`onAnimationIteration`),$r(Kr,`onAnimationStart`),$r(`dblclick`,`onDoubleClick`),$r(`focusin`,`onFocus`),$r(`focusout`,`onBlur`),$r(qr,`onTransitionRun`),$r(Jr,`onTransitionStart`),$r(Yr,`onTransitionCancel`),$r(Xr,`onTransitionEnd`),Nt(`onMouseEnter`,[`mouseout`,`mouseover`]),Nt(`onMouseLeave`,[`mouseout`,`mouseover`]),Nt(`onPointerEnter`,[`pointerout`,`pointerover`]),Nt(`onPointerLeave`,[`pointerout`,`pointerover`]),Mt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Mt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Mt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Mt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var yd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),bd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(yd));function xd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ei(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ei(e)}i.currentTarget=null,a=c}}}}function X(e,t){var n=t[yt];n===void 0&&(n=t[yt]=new Set);var r=e+`__bubble`;n.has(r)||(Td(t,e,2,!1),n.add(r))}function Sd(e,t,n){var r=0;t&&(r|=4),Td(n,e,r,t)}var Cd=`_reactListening`+Math.random().toString(36).slice(2);function wd(e){if(!e[Cd]){e[Cd]=!0,At.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||Sd(t,!1,e),Sd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cd]||(t[Cd]=!0,Sd(`selectionchange`,!1,t))}}function Td(e,t,n,r){switch(hp(t)){case 2:var i=lp;break;case 8:i=up;break;default:i=dp}n=i.bind(null,t,n,e),i=void 0,!hn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ed(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Tt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}fn(function(){var r=a,i=ln(n),o=[];a:{var s=Zr.get(e);if(s!==void 0){var l=Tn,u=e;switch(e){case`keypress`:if(bn(n)===0)break a;case`keydown`:case`keyup`:l=Un;break;case`focusin`:u=`focus`,l=Pn;break;case`focusout`:u=`blur`,l=Pn;break;case`beforeblur`:case`afterblur`:l=Pn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Mn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Nn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Gn;break;case Wr:case Gr:case Kr:l=Fn;break;case Xr:l=Kn;break;case`scroll`:case`scrollend`:l=Dn;break;case`wheel`:l=qn;break;case`copy`:case`cut`:case`paste`:l=In;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Wn;break;case`toggle`:case`beforetoggle`:l=Jn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=pn(m,p),g!=null&&d.push(Dd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==cn&&(u=n.relatedTarget||n.fromElement)&&(Tt(u)||u[O]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?Tt(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Mn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Wn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:Dt(l),h=u==null?s:Dt(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,Tt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=kd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ad(o,s,l,d,!1),u!==null&&f!==null&&Ad(o,f,u,d,!0)}}a:{if(s=r?Dt(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=mr;else if(cr(s))if(hr)v=wr;else{v=Sr;var y=xr}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&nn(r.elementType)&&(v=mr):v=Cr;if(v&&=v(e,r)){lr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&j(s,`number`,s.value)}switch(y=r?Dt(r):window,e){case`focusin`:(cr(y)||y.contentEditable===`true`)&&(Pr=y,Fr=r,Ir=null);break;case`focusout`:Ir=Fr=Pr=null;break;case`mousedown`:Lr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Lr=!1,Rr(o,n,i);break;case`selectionchange`:if(Nr)break;case`keydown`:case`keyup`:Rr(o,n,i)}var b;if(Xn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else ir?nr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&($n&&n.locale!==`ko`&&(ir||x!==`onCompositionStart`?x===`onCompositionEnd`&&ir&&(b=yn()):(gn=i,_n=`value`in gn?gn.value:gn.textContent,ir=!0)),y=Od(r,x),0<y.length&&(x=new Ln(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=rr(n),b!==null&&(x.data=b)))),(b=Qn?ar(e,n):or(e,n))&&(x=Od(r,`onBeforeInput`),0<x.length&&(y=new Ln(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),gd(o,e,r,n,i)}xd(o,t)})}function Dd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Od(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=pn(e,n),i!=null&&r.unshift(Dd(e,i,a)),i=pn(e,t),i!=null&&r.push(Dd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function kd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ad(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=pn(n,a),l!=null&&o.unshift(Dd(n,l,c))):i||(l=pn(n,a),l!=null&&o.push(Dd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var jd=/\r\n?/g,Md=/\u0000|\uFFFD/g;function Nd(e){return(typeof e==`string`?e:``+e).replace(jd,`
|
|
10
|
-
`).replace(Md,``)}function Pd(e,t){return t=Nd(t),Nd(e)===t}function Z(e,t,n,r,i,a){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Qt(e,``+r);break;case`className`:zt(e,`class`,r);break;case`tabIndex`:zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:zt(e,n,r);break;case`style`:tn(e,r,a);break;case`data`:if(t!==`object`){zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof a==`function`&&(n===`formAction`?(t!==`input`&&Z(e,t,`name`,i.name,i,null),Z(e,t,`formEncType`,i.formEncType,i,null),Z(e,t,`formMethod`,i.formMethod,i,null),Z(e,t,`formTarget`,i.formTarget,i,null)):(Z(e,t,`encType`,i.encType,i,null),Z(e,t,`method`,i.method,i,null),Z(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=on(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:X(`beforetoggle`,e),X(`toggle`,e),Rt(e,`popover`,r);break;case`xlinkActuate`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Rt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=rn.get(n)||n,Rt(e,n,r))}}function Fd(e,t,n,r,i,a){switch(n){case`style`:tn(e,r,a);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Qt(e,``+r);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!jt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),a=e[vt]||null,a=a==null?null:a[n],typeof a==`function`&&e.removeEventListener(t,a,i),typeof r==`function`)){typeof a!=`function`&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Rt(e,n,r)}}}function Q(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:X(`error`,e),X(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:Z(e,t,a,s,n,null)}}i&&Z(e,t,`srcSet`,n.srcSet,n,null),r&&Z(e,t,`src`,n.src,n,null);return;case`input`:X(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:Z(e,t,r,d,n,null)}}Jt(e,a,c,l,u,s,i,!1);return;case`select`:for(i in X(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Z(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&Yt(e,!!r,n,!0):Yt(e,!!r,t,!1);return;case`textarea`:for(s in X(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:Z(e,t,s,c,n,null)}Zt(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Z(e,t,l,r,n,null)}return;case`dialog`:X(`beforetoggle`,e),X(`toggle`,e),X(`cancel`,e),X(`close`,e);break;case`iframe`:case`object`:X(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)X(yd[r],e);break;case`image`:X(`error`,e),X(`load`,e);break;case`details`:X(`toggle`,e);break;case`embed`:case`source`:case`link`:X(`error`,e),X(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:Z(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Z(e,t,c,r,n,null))}function Id(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Z(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:a=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&Z(e,t,p,m,r,f)}}A(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||Z(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:p=a;break;case`defaultValue`:c=a;break;case`multiple`:s=a;default:a!==l&&Z(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Yt(e,!!n,n?[]:``,!1):Yt(e,!!n,t,!0)):Yt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Z(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&Z(e,t,s,i,r,a)}Xt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Z(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Z(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Z(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:Z(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Z(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Z(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ld(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Ud(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Wd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e===Gd?!1:(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&mf(e.ownerDocument.body);n=i}while(n);Pp(t)}function ef(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:tf(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pf(e,t,n){switch(t=Vd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vf=T.d;T.d={f:yf,r:bf,D:Cf,C:wf,L:Tf,m:Ef,X:Of,S:Df,M:kf};function yf(){var e=vf.f(),t=Su();return e||t}function bf(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):vf.r(e)}var xf=typeof document>`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=k(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Q(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+k(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+k(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+k(n.imageSizes)+`"]`)):i+=`[href="`+k(e)+`"]`;var a=i;switch(t){case`style`:a=jf(e);break;case`script`:a=Ff(e)}hf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Mf(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Q(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+k(r)+`"][href="`+k(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!hf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Q(r,`link`,e),kt(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=Ot(r).hoistableStyles,a=jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Mf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);kt(c),Q(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=Ot(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),kt(a),Q(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=Ot(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),kt(a),Q(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t,n,r){var i=(i=ve.current)?_f(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=jf(n.href),n=Ot(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var a=Ot(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Mf(e)))&&!a._p&&(s.instance=a,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),a||Pf(i,e,n,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=Ot(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function jf(e){return`href="`+k(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Q(t,`link`,n),kt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+k(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+k(n.href)+`"]`);if(r)return t.instance=r,kt(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),kt(r),Q(r,`style`,i),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=jf(n.href);var a=e.querySelector(Mf(i));if(a)return t.state.loading|=4,t.instance=a,kt(a),a;r=Nf(n),(i=hf.get(i))&&zf(r,i),a=(e.ownerDocument||e).createElement(`link`),kt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Q(a,`link`,r),t.state.loading|=4,Rf(a,n.precedence,e),t.instance=a;case`script`:return a=Ff(n.src),(i=e.querySelector(If(a)))?(t.instance=i,kt(i),i):(r=n,(i=hf.get(a))&&(r=m({},n),Bf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),kt(i),Q(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Vf=null;function Hf(e,t,n){if(Vf===null){var r=new Map,i=Vf=new Map;i.set(n,r)}else i=Vf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Uf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Wf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=jf(r.href),a=t.querySelector(Mf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,kt(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),kt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Q(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Yf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var $f={$$typeof:S,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function ep(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function tp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ep(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=fi(3,null,null,t),e.current=a,a.stateNode=e,t=da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Wa(a),e}function np(e){return e?(e=ui,e):ui}function rp(e,t,n,r,i,a){i=np(i),r.context===null?r.context=i:r.pendingContext=i,r=Ka(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=qa(e,r,t),n!==null&&(_u(n,e,t),Ja(n,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ap(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=si(e,67108864);t!==null&&_u(t,e,67108864),ap(e,67108864)}}function sp(e){if(e.tag===13||e.tag===31){var t=hu();t=ft(t);var n=si(e,t);n!==null&&_u(n,e,t),ap(e,t)}}var cp=!0;function lp(e,t,n,r){var i=w.T;w.T=null;var a=T.p;try{T.p=2,dp(e,t,n,r)}finally{T.p=a,w.T=i}}function up(e,t,n,r){var i=w.T;w.T=null;var a=T.p;try{T.p=8,dp(e,t,n,r)}finally{T.p=a,w.T=i}}function dp(e,t,n,r){if(cp){var i=fp(r);if(i===null)Ed(e,t,r,pp,n),wp(e,r);else if(Ep(i,e,t,n,r))r.stopPropagation();else if(wp(e,r),t&4&&-1<Cp.indexOf(e)){for(;i!==null;){var a=Et(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}ad(a),!(U&6)&&(ru=Ie()+500,od(0,!1))}}break;case 31:case 13:s=si(a,2),s!==null&&_u(s,a,2),Su(),ap(a,2)}if(a=fp(r),a===null&&Ed(e,t,r,pp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ed(e,t,r,null,n)}}function fp(e){return e=ln(e),mp(e)}var pp=null;function mp(e){if(pp=null,e=Tt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pp=e,null}function hp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var gp=!1,_p=null,vp=null,yp=null,bp=new Map,xp=new Map,Sp=[],Cp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function wp(e,t){switch(e){case`focusin`:case`focusout`:_p=null;break;case`dragenter`:case`dragleave`:vp=null;break;case`mouseover`:case`mouseout`:yp=null;break;case`pointerover`:case`pointerout`:bp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:xp.delete(t.pointerId)}}function Tp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Et(t),t!==null&&op(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ep(e,t,n,r,i){switch(t){case`focusin`:return _p=Tp(_p,e,t,n,r,i),!0;case`dragenter`:return vp=Tp(vp,e,t,n,r,i),!0;case`mouseover`:return yp=Tp(yp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return bp.set(a,Tp(bp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,xp.set(a,Tp(xp.get(a)||null,e,t,n,r,i)),!0}return!1}function Dp(e){var t=Tt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,ht(e.priority,function(){sp(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,ht(e.priority,function(){sp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Op(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=Et(n),t!==null&&op(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Op(e)&&n.delete(t)}function Ap(){gp=!1,_p!==null&&Op(_p)&&(_p=null),vp!==null&&Op(vp)&&(vp=null),yp!==null&&Op(yp)&&(yp=null),bp.forEach(kp),xp.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,gp||(gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(mp(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Pp(e){function t(t){return jp(t,e)}_p!==null&&jp(_p,e),vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp.forEach(t),xp.forEach(t);for(var n=0;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sp.length&&(n=Sp[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(mp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;rp(n,hu(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rp(e.current,2,null,e,null,null),Su(),t[O]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sp.length&&t!==0&&t<Sp[n].priority;n++);Sp.splice(n,0,e),n===0&&Dp(e)}};var Rp=r.version;if(Rp!==`19.2.7`)throw Error(o(527,Rp,`19.2.7`));T.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:w,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{Ge=Bp.inject(zp),Ke=Bp}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(o(299));var n=!1,r=``,i=Xs,a=Zs,c=Qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=tp(e,1,!1,null,null,n,r,null,i,a,c,Fp),e[O]=t.current,wd(e),new Ip(t)}})),Le=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ie()})),Re=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ze=new class extends Re{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Be={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ve=new class{#e=Be;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function He(e){setTimeout(e,0)}var Ue=typeof window>`u`||`Deno`in globalThis;function We(){}function Ge(e,t){return typeof e==`function`?e(t):e}function Ke(e){return typeof e==`number`&&e>=0&&e!==1/0}function qe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Je(e,t){return typeof e==`function`?e(t):e}function Ye(e,t){return typeof e==`function`?e(t):e}function Xe(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Qe(o,t.options))return!1}else if(!et(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ze(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if($e(t.options.mutationKey)!==$e(a))return!1}else if(!et(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Qe(e,t){return(t?.queryKeyHashFn||$e)(e)}function $e(e){return JSON.stringify(e,(e,t)=>at(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function et(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>et(e[n],t[n])):!1}var tt=Object.prototype.hasOwnProperty;function nt(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=it(e)&&it(t);if(!r&&!(at(e)&&at(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:tt.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=nt(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function rt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function it(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function at(e){if(!ot(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ot(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ot(e){return Object.prototype.toString.call(e)===`[object Object]`}function st(e){return new Promise(t=>{Ve.setTimeout(t,e)})}function ct(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:nt(e,t)}function lt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ut(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var dt=Symbol();function ft(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===dt?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function pt(e,t){return typeof e==`function`?e(...t):!!e}function mt(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ht=(()=>{let e=()=>Ue;return{isServer(){return e()},setIsServer(t){e=t}}})();function gt(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var _t=He;function vt(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=_t,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var O=vt(),yt=new class extends Re{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function bt(e){return Math.min(1e3*2**e,3e4)}function xt(e){return(e??`online`)!==`online`||yt.isOnline()}var St=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ct(e){let t=!1,n=0,r,i=gt(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new St(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ze.isFocused()&&(e.networkMode===`always`||yt.isOnline())&&e.canRun(),u=()=>xt(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ht.isServer()?0:3),o=e.retryDelay??bt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),st(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var wt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ke(this.gcTime)&&(this.#e=Ve.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ht.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Ve.clearTimeout(this.#e),this.#e=void 0)}};function Tt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{mt(e,()=>t.signal,()=>n=!0)},u=ft(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ut:lt;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Dt:Et,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Et(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Et(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Dt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ot(e,t){return t?Et(e,t)!=null:!1}function kt(e,t){return!t||!e.getPreviousPageParam?!1:Dt(e,t)!=null}var At=class extends wt{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Nt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Nt(this.options);e.data!==void 0&&(this.setState(Mt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ct(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(We).catch(We):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ye(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dt||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Je(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!qe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ft(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Tt(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ct({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof St&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof St){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...jt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Mt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),O.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function jt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Mt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Nt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Pt=class extends Re{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=gt(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),It(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Lt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Lt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Ye(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!rt(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Rt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Ye(this.options.enabled,this.#t)!==Ye(t.enabled,this.#t)||Je(this.options.staleTime,this.#t)!==Je(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Ye(this.options.enabled,this.#t)!==Ye(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Bt(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(We)),t}#g(){this.#b();let e=Je(this.options.staleTime,this.#t);if(ht.isServer()||this.#r.isStale||!Ke(e))return;let t=qe(this.#r.dataUpdatedAt,e)+1;this.#d=Ve.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(ht.isServer()||Ye(this.options.enabled,this.#t)===!1||!Ke(this.#p)||this.#p===0)&&(this.#f=Ve.setInterval(()=>{(this.options.refetchIntervalInBackground||ze.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Ve.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Ve.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&It(e,t),o=i&&Rt(e,n,t,r);(a||o)&&(l={...l,...jt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=ct(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=ct(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:zt(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Ye(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=gt();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!rt(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){O.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ft(e,t){return Ye(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&Ye(t.retryOnMount,e)===!1)}function It(e,t){return Ft(e,t)||e.state.data!==void 0&&Lt(e,t,t.refetchOnMount)}function Lt(e,t,n){if(Ye(t.enabled,e)!==!1&&Je(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&zt(e,t)}return!1}function Rt(e,t,n,r){return(e!==t||Ye(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&zt(e,n)}function zt(e,t){return Ye(t.enabled,e)!==!1&&e.isStaleByTime(Je(t.staleTime,e))}function Bt(e,t){return!rt(e.getCurrentResult(),t)}var Vt=class extends wt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ht(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ct({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),O.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ht(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ut=class extends Re{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Vt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Wt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){O.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ze(t,e))}findAll(e={}){return this.getAll().filter(t=>Ze(e,t))}notify(e){O.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return O.batch(()=>Promise.all(e.map(e=>e.continue().catch(We))))}};function Wt(e){return e.options.scope?.id}var Gt=class extends Re{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),rt(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&$e(t.mutationKey)!==$e(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ht();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){O.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Kt=class extends Re{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Qe(r,t),a=this.get(i);return a||(a=new At({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){O.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Xe(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Xe(e,t)):t}notify(e){O.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){O.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){O.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Kt,this.#t=e.mutationCache||new Ut,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ze.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=yt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Je(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ge(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return O.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;O.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return O.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=O.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(We).catch(We)}invalidateQueries(e,t={}){return O.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=O.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(We)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(We)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Je(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(We).catch(We)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(We).catch(We)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return yt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set($e(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{et(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set($e(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{et(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Qe(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===dt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},k=e(n(),1),A=r(),Jt=k.createContext(void 0),j=e=>{let t=k.useContext(Jt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Yt=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,A.jsx)(Jt.Provider,{value:e,children:t})),Xt=k.createContext(!1),Zt=()=>k.useContext(Xt);Xt.Provider;function Qt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $t=k.createContext(Qt()),en=()=>k.useContext($t),tn=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?pt(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},nn=e=>{k.useEffect(()=>{e.clearReset()},[e])},rn=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||pt(n,[e.error,r])),an=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},on=(e,t)=>e.isLoading&&e.isFetching&&!t,sn=(e,t)=>e?.suspense&&t.isPending,cn=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ln(e,t,n){let r=Zt(),i=en(),a=j(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,an(o),tn(o,i,s),nn(i);let l=!a.getQueryCache().get(o.queryHash),[u]=k.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(k.useSyncExternalStore(k.useCallback(e=>{let t=f?u.subscribe(O.batchCalls(e)):We;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),k.useEffect(()=>{u.setOptions(o)},[o,u]),sn(o,d))throw cn(o,u,i);if(rn({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!ht.isServer()&&on(d,r)&&(l?cn(o,u,i):s?.promise)?.catch(We).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function M(e,t){return ln(e,Pt,t)}function N(e,t){let n=j(t),[r]=k.useState(()=>new Gt(n,e));k.useEffect(()=>{r.setOptions(e)},[r,e]);let i=k.useSyncExternalStore(k.useCallback(e=>r.subscribe(O.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=k.useCallback((e,t)=>{r.mutate(e,t).catch(We)},[r]);if(i.error&&pt(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var un=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,dn=/^[\\/]{2}/;function fn(e,t){return t+e.replace(/\\/g,`/`)}var pn=`popstate`;function mn(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function hn(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return yn(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:bn(t)}return Sn(t,n,null,e)}function P(e,t){if(e===!1||e==null)throw Error(t)}function gn(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function _n(){return Math.random().toString(36).substring(2,10)}function vn(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function yn(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?xn(t):t,state:n,key:t&&t.key||r||_n(),mask:i}}function bn({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function xn(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Sn(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=mn(e)?e:yn(h.location,e,t);n&&n(r,e),l=u()+1;let d=vn(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=mn(e)?e:yn(h.location,e,t);n&&n(r,e),l=u();let i=vn(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Cn(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(pn,d),c=e,()=>{i.removeEventListener(pn,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Cn(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),P(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:bn(t);return i=i.replace(/ $/,`%20`),!n&&dn.test(i)&&(i=r+i),new URL(i,r)}function wn(e,t,n=`/`){return Tn(e,t,n,!1)}function Tn(e,t,n,r,i){let a=qn((typeof t==`string`?xn(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Dn(e),s=null,c=Kn(a);for(let e=0;s==null&&e<o.length;++e)s=Hn(o[e],c,r);return s}function En(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function Dn(e){let t=On(e);return An(t),t}function On(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;P(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=tr([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(P(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),On(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Bn(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Gn(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of kn(e.path))a(e,t,!0,n)}),t}function kn(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=kn(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function An(e){e.sort((e,t)=>e.score===t.score?Vn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var jn=/^:[\w-]+$/,Mn=/^:[\w-]+/,Nn=3.5,Pn=3,Fn=2,In=1,Ln=10,Rn=-2,zn=e=>e===`*`;function Bn(e,t){let n=e.split(`/`),r=n.length;return n.some(zn)&&(r+=Rn),t&&(r+=Fn),n.filter(e=>!zn(e)).reduce((e,t)=>e+(jn.test(t)?Pn:Mn.test(t)?Nn:t===``?In:Ln),r)}function Vn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Hn(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Wn(u,l,s.matcher,s.compiledParams):Un(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Un({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:tr([a,d.pathname]),pathnameBase:rr(tr([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=tr([a,d.pathnameBase]))}return o}function Un(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Gn(e.path,e.caseSensitive,e.end);return Wn(e,t,n,r)}function Wn(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Gn(e,t=!1,n=!0){gn(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Kn(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return gn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function qn(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Jn(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?xn(e):e,a;return n?(n=er(n),a=n.startsWith(`/`)?Yn(n.substring(1),`/`):Yn(n,t)):a=t,{pathname:a,search:ir(r),hash:ar(i)}}function Yn(e,t){let n=nr(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Xn(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Qn(e){let t=Zn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function $n(e,t,n,r=!1){let i;typeof e==`string`?i=xn(e):(i={...e},P(!i.pathname||!i.pathname.includes(`?`),Xn(`?`,`pathname`,`search`,i)),P(!i.pathname||!i.pathname.includes(`#`),Xn(`#`,`pathname`,`hash`,i)),P(!i.search||!i.search.includes(`#`),Xn(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Jn(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var er=e=>e.replace(/[\\/]{2,}/g,`/`),tr=e=>er(e.join(`/`)),nr=e=>e.replace(/\/+$/,``),rr=e=>nr(e).replace(/^\/*/,`/`),ir=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ar=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,or=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function sr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function cr(e){return tr(e.map(e=>e.route.path).filter(Boolean))||`/`}var lr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ur(e,t){let n=e;if(typeof n!=`string`||!un.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(lr)try{let e=new URL(window.location.href),r=dn.test(n)?new URL(fn(n,e.protocol)):new URL(n),a=qn(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{gn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var dr=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(dr);var fr=[`GET`,...dr];new Set(fr);var pr=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function mr(e){try{return pr.includes(new URL(e).protocol)}catch{return!1}}var hr=k.createContext(null);hr.displayName=`DataRouter`;var gr=k.createContext(null);gr.displayName=`DataRouterState`;var _r=k.createContext(!1);function vr(){return k.useContext(_r)}var yr=k.createContext({isTransitioning:!1});yr.displayName=`ViewTransition`;var br=k.createContext(new Map);br.displayName=`Fetchers`;var xr=k.createContext(null);xr.displayName=`Await`;var Sr=k.createContext(null);Sr.displayName=`Navigation`;var Cr=k.createContext(null);Cr.displayName=`Location`;var wr=k.createContext({outlet:null,matches:[],isDataRoute:!1});wr.displayName=`Route`;var Tr=k.createContext(null);Tr.displayName=`RouteError`;var Er=`REACT_ROUTER_ERROR`,Dr=`REDIRECT`,Or=`ROUTE_ERROR_RESPONSE`;function kr(e){if(e.startsWith(`${Er}:${Dr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ar(e){if(e.startsWith(`${Er}:${Or}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new or(t.status,t.statusText,t.data)}catch{}}function jr(e,{relative:t}={}){P(Mr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=k.useContext(Sr),{hash:i,pathname:a,search:o}=Br(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:tr([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Mr(){return k.useContext(Cr)!=null}function Nr(){return P(Mr(),`useLocation() may be used only in the context of a <Router> component.`),k.useContext(Cr).location}var Pr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Fr(){let{isDataRoute:e}=k.useContext(wr);return e?ai():Ir()}function Ir(){P(Mr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=k.useContext(hr),{basename:t,navigator:n}=k.useContext(Sr),{matches:r}=k.useContext(wr),{pathname:i}=Nr(),a=JSON.stringify(Qn(r)),o=k.useRef(!1);return k.useLayoutEffect(()=>{o.current=!0}),k.useCallback((r,s={})=>{if(gn(o.current,Pr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=$n(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:tr([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Lr=k.createContext(null);function Rr(e){let t=k.useContext(wr).outlet;return k.useMemo(()=>t&&k.createElement(Lr.Provider,{value:e},t),[t,e])}function zr(){let{matches:e}=k.useContext(wr);return e[e.length-1]?.params??{}}function Br(e,{relative:t}={}){let{matches:n}=k.useContext(wr),{pathname:r}=Nr(),i=JSON.stringify(Qn(n));return k.useMemo(()=>$n(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Vr(e,t){return Hr(e,t)}function Hr(e,t,n){P(Mr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=k.useContext(Sr),{matches:i}=k.useContext(wr),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=Nr(),l;if(t){let e=typeof t==`string`?xn(t):t;P(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):wn(e,{pathname:d}),p=Yr(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:tr([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:tr([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?k.createElement(Cr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Ur(){let e=ii(),t=sr(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return k.createElement(k.Fragment,null,k.createElement(`h2`,null,`Unexpected Application Error!`),k.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?k.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Wr=k.createElement(Ur,null),Gr=class extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=_r;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ar(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:k.createElement(wr.Provider,{value:this.props.routeContext},k.createElement(Tr.Provider,{value:e,children:this.props.component}));return this.context?k.createElement(qr,{error:e},t):t}},Kr=new WeakMap;function qr({children:e,error:t}){let{basename:n}=k.useContext(Sr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=kr(t.digest);if(e){let r=Kr.get(t);if(r)throw r;let i=ur(e.location,n),a=i.absoluteURL||i.to;if(mr(a))throw Error(`Invalid redirect location`);if(lr&&!Kr.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Kr.set(t,n),n}return k.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Jr({routeContext:e,match:t,children:n}){let r=k.useContext(hr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement(wr.Provider,{value:e},n)}function Yr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);P(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:cr(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Wr,o&&(s<0&&c===0?(si(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?k.createElement(n.route.Component,null):n.route.element?n.route.element:e,k.createElement(Jr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?k.createElement(Gr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Xr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zr(e){let t=k.useContext(hr);return P(t,Xr(e)),t}function Qr(e){let t=k.useContext(gr);return P(t,Xr(e)),t}function $r(e){let t=k.useContext(wr);return P(t,Xr(e)),t}function ei(e){let t=$r(e),n=t.matches[t.matches.length-1];return P(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ti(){return ei(`useRouteId`)}function ni(){let e=Qr(`useNavigation`);return k.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function ri(){let{matches:e,loaderData:t}=Qr(`useMatches`);return k.useMemo(()=>e.map(e=>En(e,t)),[e,t])}function ii(){let e=k.useContext(Tr),t=Qr(`useRouteError`),n=ei(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ai(){let{router:e}=Zr(`useNavigate`),t=ei(`useNavigate`),n=k.useRef(!1);return k.useLayoutEffect(()=>{n.current=!0}),k.useCallback(async(r,i={})=>{gn(n.current,Pr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var oi={};function si(e,t,n){!t&&!oi[e]&&(oi[e]=!0,gn(!1,n))}k.memo(ci);function ci({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Hr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function li(e){return Rr(e.context)}function ui(e){P(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function di({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){P(!Mr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=k.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=xn(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=k.useMemo(()=>{let e=qn(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return gn(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:k.createElement(Sr.Provider,{value:c},k.createElement(Cr.Provider,{children:t,value:h}))}function fi({children:e,location:t}){return Vr(pi(e),t)}k.Component;function pi(e,t=[]){let n=[];return k.Children.forEach(e,(e,r)=>{if(!k.isValidElement(e))return;let i=[...t,r];if(e.type===k.Fragment){n.push.apply(n,pi(e.props.children,i));return}P(e.type===ui,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;P(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=pi(a.children,i)),n.push(o)}),n}var mi=`application/x-www-form-urlencoded`;function hi(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function gi(e){return hi(e)&&e.tagName.toLowerCase()===`button`}function _i(e){return hi(e)&&e.tagName.toLowerCase()===`form`}function vi(e){return hi(e)&&e.tagName.toLowerCase()===`input`}function yi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bi(e,t){return e.button===0&&(!t||t===`_self`)&&!yi(e)}var xi=null;function Si(){if(xi===null)try{new FormData(document.createElement(`form`),0),xi=!1}catch{xi=!0}return xi}var Ci=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function wi(e){return e!=null&&!Ci.has(e)?(gn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mi}"`),null):e}function Ti(e,t){let n,r,i,a,o;if(_i(e)){let o=e.getAttribute(`action`);r=o?qn(o,t):null,n=e.getAttribute(`method`)||`get`,i=wi(e.getAttribute(`enctype`))||mi,a=new FormData(e)}else if(gi(e)||vi(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?qn(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=wi(e.getAttribute(`formenctype`))||wi(o.getAttribute(`enctype`))||mi,a=new FormData(o,e),!Si()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(hi(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=mi,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function Ei(e,t){if(e===!1||e==null)throw Error(t)}var Di={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Oi=/[&><\u2028\u2029]/g;function ki(e){return e.replace(Oi,e=>Di[e])}function Ai(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname.endsWith(`/`)?n.pathname=`${n.pathname}_.${t}`:n.pathname=`${n.pathname}.${t}`,n}async function ji(e,t){if(e.id in t)return t[e.id];try{let n=await o(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Mi(e){return e!=null&&typeof e.page==`string`}function Ni(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Pi(e,t,n){return I((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ji(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ni).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Fi(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ii(e,t,{includeHydrateFallback:n}={}){return Li(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Li(e){return[...new Set(e)]}function F(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function I(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Mi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(F(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ri(){let e=k.useContext(hr);return Ei(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function zi(){let e=k.useContext(gr);return Ei(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Bi=k.createContext(void 0);Bi.displayName=`FrameworkContext`;function Vi(){let e=k.useContext(Bi);return Ei(e,`You must render this element inside a <HydratedRouter> element`),e}function Hi(e,t){let n=k.useContext(Bi),[r,i]=k.useState(!1),[a,o]=k.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=k.useRef(null);k.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),k.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ui(s,p),onBlur:Ui(c,m),onMouseEnter:Ui(l,p),onMouseLeave:Ui(u,m),onTouchStart:Ui(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ui(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Wi({page:e,...t}){let n=vr(),{nonce:r}=Vi(),{router:i}=Ri(),a=k.useMemo(()=>wn(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?k.createElement(Ki,{page:e,matches:a,...t}):k.createElement(qi,{page:e,matches:a,...t})):null}function Gi(e){let{manifest:t,routeModules:n}=Vi(),[r,i]=k.useState([]);return k.useEffect(()=>{let r=!1;return Pi(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ki({page:e,matches:t,...n}){let r=Nr(),i=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Ai(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return k.createElement(k.Fragment,null,i.map(e=>k.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function qi({page:e,matches:t,...n}){let r=Nr(),{manifest:i,routeModules:a}=Vi(),{loaderData:o,matches:s}=zi(),c=k.useMemo(()=>Fi(e,t,s,i,r,`data`),[e,t,s,i,r]),l=k.useMemo(()=>Fi(e,t,s,i,r,`assets`),[e,t,s,i,r]),u=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];!t||!t.hasLoader||(!c.some(t=>t.route.id===e.route.id)&&e.route.id in o&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let l=Ai(e,`data`);return s&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[o,r,i,c,t,e,a]),d=k.useMemo(()=>Ii(l,i),[l,i]),f=Gi(l);return k.createElement(k.Fragment,null,u.map(e=>k.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>k.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>k.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ji(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Yi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Yi&&(window.__reactRouterVersion=`8.2.0`)}catch{}function Xi({basename:e,children:t,useTransitions:n,window:r}){let i=k.useRef(null);i.current??=hn({window:r,v5Compat:!0});let a=i.current,[o,s]=k.useState({action:a.action,location:a.location}),c=k.useCallback(e=>{n===!1?s(e):k.startTransition(()=>s(e))},[n]);return k.useLayoutEffect(()=>a.listen(c),[a,c]),k.createElement(di,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Zi({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=k.useState({action:n.action,location:n.location}),o=k.useCallback(e=>{r===!1?a(e):k.startTransition(()=>a(e))},[r]);return k.useLayoutEffect(()=>n.listen(o),[n,o]),k.createElement(di,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Zi.displayName=`unstable_HistoryRouter`;var Qi=k.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=k.useContext(Sr),v=typeof l==`string`&&un.test(l),y=ur(l,h);l=y.to;let b=jr(l,{relative:r}),x=Nr(),S=null;if(o){let e=$n(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:tr([h,e.pathname])),S=g.createHref(e)}let[ee,C,te]=Hi(n,p),ne=aa(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function re(t){e&&e(t),t.defaultPrevented||ne(t)}let ie=!(y.isExternal||i),ae=k.createElement(`a`,{...p,...te,href:(ie?S:void 0)||y.absoluteURL||b,onClick:ie?re:e,ref:Ji(m,C),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return ee&&!v?k.createElement(k.Fragment,null,ae,k.createElement(Wi,{page:b})):ae});Qi.displayName=`Link`;var $i=k.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Br(a,{relative:c.relative}),d=Nr(),f=k.useContext(gr),{navigator:p,basename:m}=k.useContext(Sr),h=f!=null&&ha(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=qn(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},ee=b?e:void 0,C;C=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let te=typeof i==`function`?i(S):i;return k.createElement(Qi,{...c,"aria-current":ee,className:C,ref:l,style:te,to:a,viewTransition:o},typeof s==`function`?s(S):s)});$i.displayName=`NavLink`;var ea=k.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=k.useContext(Sr),g=ca(),_=la(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&un.test(s);return k.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?k.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});ea.displayName=`Form`;function ta({getKey:e,storageKey:t,...n}){let r=k.useContext(Bi),{basename:i}=k.useContext(Sr),a=Nr(),o=ri();pa({getKey:e,storageKey:t});let s=k.useMemo(()=>{if(!r||!e)return null;let t=fa(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),k.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${ki(JSON.stringify(t||ua))}, ${ki(JSON.stringify(s))})`}})}ta.displayName=`ScrollRestoration`;function na(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ra(e){let t=k.useContext(hr);return P(t,na(e)),t}function ia(e){let t=k.useContext(gr);return P(t,na(e)),t}function aa(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Fr(),d=Nr(),f=Br(e,{relative:o});return k.useCallback(p=>{if(bi(p,t)){p.preventDefault();let t=n===void 0?bn(d)===bn(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?k.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var oa=0,sa=()=>`__${String(++oa)}__`;function ca(){let{router:e}=ra(`useSubmit`),{basename:t}=k.useContext(Sr),n=ti(),r=e.fetch,i=e.navigate;return k.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ti(e,t);a.navigate===!1?await r(a.fetcherKey||sa(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function la(e,{relative:t}={}){let{basename:n}=k.useContext(Sr),r=k.useContext(wr);P(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Br(e||`.`,{relative:t})},o=Nr();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:tr([n,a.pathname])),bn(a)}var ua=`react-router-scroll-positions`,da={};function fa(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:qn(e.pathname,n)||e.pathname},t)),i??=e.key,i}function pa({getKey:e,storageKey:t}={}){let{router:n}=ra(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=ia(`useScrollRestoration`),{basename:a}=k.useContext(Sr),o=Nr(),s=ri(),c=ni();k.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),ma(k.useCallback(()=>{if(c.state===`idle`){let t=fa(o,s,a,e);da[t]=window.scrollY}try{sessionStorage.setItem(t||ua,JSON.stringify(da))}catch(e){gn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(k.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||ua);e&&(da=JSON.parse(e))}catch{}},[t]),k.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(da,()=>window.scrollY,e?(t,n)=>fa(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),k.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{gn(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function ma(e,t){let{capture:n}=t||{};k.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ha(e,{relative:t}={}){let n=k.useContext(yr);P(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ra(`useViewTransitionState`),i=Br(e,{relative:t});if(!n.isTransitioning)return!1;let a=qn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=qn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Un(i.pathname,o)!=null||Un(i.pathname,a)!=null}var ga=Le(),_a=class extends k.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidUpdate(e){this.state.error!==null&&e.resetOn!==this.props.resetOn&&this.setState({error:null})}componentDidCatch(e,t){console.error(`Puddle: the ${this.props.scope} crashed`,e,t.componentStack)}render(){let{error:e}=this.state;return e===null?this.props.children:(0,A.jsxs)(`div`,{className:`flex h-full min-h-40 flex-col items-center justify-center gap-4 px-8 py-10 text-center`,children:[(0,A.jsxs)(`p`,{className:`text-sm text-fg`,children:[`The `,this.props.scope,` stopped rendering.`]}),(0,A.jsx)(`p`,{className:`max-w-lg font-mono text-2xs leading-relaxed text-interrupted`,children:e.message||String(e)}),(0,A.jsx)(`p`,{className:`max-w-sm text-2xs leading-relaxed text-fg-muted`,children:`Your sessions and their worktrees are on the daemon and untouched; the layout is saved. The console has the full stack.`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>this.setState({error:null}),className:`text-2xs font-medium text-fg-gold transition-colors hover:underline`,children:`Try again`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:`Reload`})]})]})}},va=[`dark`,`light`],ya=`puddle.theme`,ba=`system`,xa=`dark`,Sa=new Set;function Ca(){return window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function wa(e){return e===`system`?Ca():e}function Ta(){let e=localStorage.getItem(ya);return e===`system`||va.includes(e??``)?e:ba}function Ea(){let e=document.documentElement.dataset.theme;return va.includes(e??``)?e:xa}function Da(e){localStorage.setItem(ya,e);let t=wa(e);document.documentElement.dataset.theme=t;for(let e of Sa)e(t);return t}function Oa(){Da(Ta()),window.matchMedia(`(prefers-color-scheme: light)`).addEventListener(`change`,()=>{Ta()===`system`&&Da(`system`)})}function ka(e){return Sa.add(e),()=>Sa.delete(e)}function Aa(e){let t=/^#([0-9a-fA-F]{3,4})$/.exec(e);return t?.[1]?`#${[...t[1]].map(e=>e+e).join(``)}`:e}function ja(){let e=getComputedStyle(document.documentElement);return t=>Aa(e.getPropertyValue(t).trim())}var Ma=4.5;function Na(e){return{background:e(`--bg-base`),foreground:e(`--text-primary`),cursor:e(`--accent`),cursorAccent:e(`--bg-base`),selectionBackground:e(`--selection`),black:e(`--ansi-black`),red:e(`--ansi-red`),green:e(`--ansi-green`),yellow:e(`--ansi-yellow`),blue:e(`--ansi-blue`),magenta:e(`--ansi-magenta`),cyan:e(`--ansi-cyan`),white:e(`--ansi-white`),brightBlack:e(`--ansi-bright-black`),brightRed:e(`--ansi-bright-red`),brightGreen:e(`--ansi-bright-green`),brightYellow:e(`--ansi-bright-yellow`),brightBlue:e(`--ansi-bright-blue`),brightMagenta:e(`--ansi-bright-magenta`),brightCyan:e(`--ansi-bright-cyan`),brightWhite:e(`--ansi-bright-white`)}}function Pa(){return Na(ja())}function Fa(e){return{theme:Na(e),minimumContrastRatio:Ma}}function Ia(){return Fa(ja())}function La(e){return e.replace(`#`,``)}function Ra(e,t){return{base:t===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:La(e(`--text-muted`)),fontStyle:`italic`},{token:`string`,foreground:La(e(`--ansi-green`))},{token:`number`,foreground:La(e(`--ansi-yellow`))},{token:`keyword`,foreground:La(e(`--ansi-blue`))},{token:`type`,foreground:La(e(`--ansi-cyan`))},{token:`function`,foreground:La(e(`--ansi-magenta`))}],colors:{"editor.background":e(`--bg-base`),"editor.foreground":e(`--text-primary`),"editor.selectionBackground":e(`--selection`),"editor.lineHighlightBackground":e(`--bg-surface`),"editorCursor.foreground":e(`--accent`),"editorLineNumber.foreground":e(`--text-muted`),"editorLineNumber.activeForeground":e(`--text-secondary`),"editorWidget.background":e(`--bg-elevated`),"editorWidget.border":e(`--border`),focusBorder:e(`--focus-ring`),"diffEditor.insertedTextBackground":e(`--diff-added`),"diffEditor.removedTextBackground":e(`--diff-removed`)}}}function za(){return Ra(ja(),Ea())}function Ba(){return(0,A.jsx)(g,{theme:(0,k.useSyncExternalStore)(ka,Ea),position:`bottom-right`,toastOptions:{style:{background:`var(--bg-elevated)`,border:`none`,boxShadow:`0 8px 30px rgb(0 0 0 / 0.25)`,color:`var(--text-primary)`},classNames:{description:`whitespace-pre-wrap break-words font-mono text-2xs leading-snug max-h-40 overflow-y-auto`}}})}var Va=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ha=`VisuallyHidden`,Ua=k.forwardRef((e,t)=>(0,A.jsx)(y.span,{...e,ref:t,style:{...Va,...e.style}}));Ua.displayName=Ha;var Wa=Ua,[Ga,Ka]=b(`Tooltip`,[Ne]),qa=Ne(),Ja=`TooltipProvider`,Ya=700,Xa=`tooltip.open`,[Za,Qa]=Ga(Ja),$a=e=>{let{__scopeTooltip:t,delayDuration:n=Ya,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=k.useRef(!0),s=k.useRef(!1),c=k.useRef(0);return k.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,A.jsx)(Za,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:k.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:k.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:k.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};$a.displayName=Ja;var eo=`Tooltip`,[to,no]=Ga(eo),ro=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Qa(eo,e.__scopeTooltip),l=qa(t),[u,d]=k.useState(null),f=_e(),p=k.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=k.useRef(!1),[_,v]=ae({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Xa))):c.onClose(),a?.(e)},caller:eo}),y=k.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=k.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=k.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=k.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return k.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,A.jsx)(Me,{...l,children:(0,A.jsx)(to,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:k.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};ro.displayName=eo;var io=`TooltipTrigger`,ao=k.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=no(io,n),a=Qa(io,n),o=qa(n),s=ce(t,k.useRef(null),i.onTriggerChange),c=k.useRef(!1),l=k.useRef(!1),u=k.useCallback(()=>c.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,A.jsx)(we,{asChild:!0,...o,children:(0,A.jsx)(y.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:v(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:v(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:v(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:v(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:v(e.onBlur,i.onClose),onClick:v(e.onClick,i.onClose)})})});ao.displayName=io;var oo=`TooltipPortal`,[so,co]=Ga(oo,{forceMount:void 0}),lo=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=no(oo,t);return(0,A.jsx)(so,{scope:t,forceMount:n,children:(0,A.jsx)(C,{present:n||a.open,children:(0,A.jsx)(E,{asChild:!0,container:i,children:r})})})};lo.displayName=oo;var uo=`TooltipContent`,fo=k.forwardRef((e,t)=>{let n=co(uo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=no(uo,e.__scopeTooltip);return(0,A.jsx)(C,{present:r||o.open,children:o.disableHoverableContent?(0,A.jsx)(L,{side:i,...a,ref:t}):(0,A.jsx)(po,{side:i,...a,ref:t})})}),po=k.forwardRef((e,t)=>{let n=no(uo,e.__scopeTooltip),r=Qa(uo,e.__scopeTooltip),i=k.useRef(null),a=ce(t,i),[o,s]=k.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=k.useCallback(()=>{s(null),d(!1)},[d]),p=k.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=yo(r,vo(r,n.getBoundingClientRect())),a=bo(t.getBoundingClientRect()),o=So([...i,...a]);s(o),d(!0)},[d]);return k.useEffect(()=>()=>f(),[f]),k.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),k.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!xo(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,A.jsx)(L,{...e,ref:a})}),[mo,ho]=Ga(eo,{isInside:!1}),go=x(`TooltipContent`),L=k.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=no(uo,n),l=qa(n),{onClose:u}=c;return k.useEffect(()=>(document.addEventListener(Xa,u),()=>document.removeEventListener(Xa,u)),[u]),k.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,A.jsx)(ge,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,A.jsxs)(ve,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,A.jsx)(go,{children:r}),(0,A.jsx)(mo,{scope:n,isInside:!0,children:(0,A.jsx)(Wa,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});fo.displayName=uo;var R=`TooltipArrow`,_o=k.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=qa(n);return ho(R,n).isInside?null:(0,A.jsx)(Ce,{...i,...r,ref:t})});_o.displayName=R;function vo(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function yo(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bo(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function xo(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function So(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Co(t)}function Co(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var wo=$a,z=ro,To=ao,Eo=lo,Do=fo,Oo=wo,ko=z,Ao=To;function jo({className:e,sideOffset:t=4,...n}){return(0,A.jsx)(Eo,{children:(0,A.jsx)(Do,{sideOffset:t,className:D(`z-50 overflow-hidden rounded-md bg-elevated px-2 py-1 text-xs text-fg shadow-lg`,e),...n})})}function Mo(){let[e,t]=(0,k.useState)(``);return(0,A.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-ground`,children:(0,A.jsxs)(`div`,{className:`flex w-full max-w-md flex-col gap-10 px-8 pb-24`,children:[(0,A.jsx)(`h1`,{className:`font-mono text-2xl font-semibold text-fg`,children:`Puddle`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3 text-sm leading-relaxed text-fg-secondary`,children:[(0,A.jsx)(`p`,{children:`This page needs the daemon's access token.`}),(0,A.jsxs)(`p`,{children:[`Launch the UI with `,(0,A.jsx)(`span`,{className:`font-mono text-accent`,children:`puddle launch`}),` and it arrives automatically — or paste it from`,` `,(0,A.jsx)(`span`,{className:`font-mono text-accent`,children:`~/.puddle/token`}),` on the machine running puddled.`]})]}),(0,A.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:t=>{t.preventDefault(),e.trim()&&c.set(e.trim())},children:[(0,A.jsx)(Te,{placeholder:`paste token`,value:e,onChange:e=>t(e.target.value),className:`h-10 font-mono`,autoFocus:!0}),(0,A.jsx)(oe,{type:`submit`,size:`lg`,className:`self-start px-6`,disabled:!e.trim(),children:`Connect`})]})]})})}var No=e(i(),1),B=[{id:`system`,label:`System`},{id:`rangefinder`,label:`Rangefinder`},{id:`drafting`,label:`Drafting`},{id:`invert`,label:`Invert`}],Po=`system`;function Fo(e){return B.some(t=>t.id===e)?e:Po}var Io={uiFontSize:16,cursorPackage:Po,terminalFontSize:13,editorFontSize:14,density:`compact`,terminalScrollback:2e4,editorTabSize:2,editorWordWrap:!1,editorLinkSshHost:``,projectBasedLayout:!0,showAllProjectSessions:!0},Lo=`puddle.client-settings`,Ro=new Set,zo=null;function Bo(e){let t={...e};return t.projectBasedLayout===void 0&&t.showAllProjectSessions!==void 0&&(t.projectBasedLayout=!t.showAllProjectSessions),t.showAllProjectSessions===void 0&&t.projectBasedLayout!==void 0&&(t.showAllProjectSessions=!t.projectBasedLayout),t}function Vo(e){return e.terminalScrollback===5e3?{...e,terminalScrollback:Io.terminalScrollback}:e}function Ho(){if(zo)return zo;let e={};try{e=JSON.parse(localStorage.getItem(Lo)??`{}`)}catch{}let t={...Io,...Vo(Bo(e))};return zo={...t,cursorPackage:Fo(t.cursorPackage)},zo}function Uo(e){document.documentElement.style.setProperty(`--ui-font-size`,`${e.uiFontSize}px`),document.documentElement.dataset.density=e.density,document.documentElement.dataset.cursorPackage=e.cursorPackage}function Wo(){return Ho()}function Go(e){let t={...Ho(),...e};zo={...t,cursorPackage:Fo(t.cursorPackage)},localStorage.setItem(Lo,JSON.stringify(zo)),Uo(zo);for(let e of Ro)e()}function Ko(){Uo(Ho())}function qo(){return(0,k.useSyncExternalStore)(e=>(Ro.add(e),()=>Ro.delete(e)),()=>Ho())}var Jo=`a, button, [role="button"], [role="slider"], input, select, textarea, summary, label, [onclick], .cursor-pointer`,Yo=`.monaco-editor`;function Xo(e,t){return e?.closest(Yo)&&!e.closest(t)?`text`:e?.closest(Jo)?`interactive`:`default`}function Zo(e,t=`.no-custom-caret`){(0,k.useEffect)(()=>{let n=e.current;if(!n)return;let r=window.matchMedia(`(pointer: fine)`),i=()=>{n.style.opacity=`0`},a=e=>{if(e.pointerType===`touch`||!r.matches){i();return}n.style.transform=`translate3d(${e.clientX}px, ${e.clientY}px, 0) translate(-50%, -50%)`;let a=e.target instanceof Element?e.target:null;if(a instanceof HTMLIFrameElement){i();return}n.style.opacity=`1`;let o=a?.closest(Yo),s=Xo(a,t),c=s===`text`,l=s===`interactive`,u=c;if(c&&o){let e=getComputedStyle(o);n.style.setProperty(`--custom-cursor-caret-height`,`${Math.round(Number.parseFloat(e.fontSize)*1.3)}px`)}else if(!l&&a&&!a.closest(t)&&Array.from(a.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())){let e=getComputedStyle(a);e.userSelect!==`none`&&(u=!0,n.style.setProperty(`--custom-cursor-caret-height`,`${Math.round(Number.parseFloat(e.fontSize)*1.3)}px`))}n.classList.toggle(`is-interactive`,l),n.classList.toggle(`is-text`,u)};return window.addEventListener(`pointermove`,a,{passive:!0}),document.documentElement.addEventListener(`pointerleave`,i),window.addEventListener(`blur`,i),()=>{window.removeEventListener(`pointermove`,a),document.documentElement.removeEventListener(`pointerleave`,i),window.removeEventListener(`blur`,i)}},[t,e])}var Qo=[`top`,`right`,`bottom`,`left`];function $o(){let e=(0,k.useRef)(null);return Zo(e),(0,A.jsx)(`div`,{ref:e,className:`custom-cursor drafting-cursor`,"aria-hidden":`true`,children:Qo.map(e=>(0,A.jsx)(`span`,{className:`drafting-cursor-tick`,"data-side":e},e))})}function es(){let e=(0,k.useRef)(null);return Zo(e),(0,A.jsx)(`div`,{ref:e,className:`custom-cursor invert-cursor`,"aria-hidden":`true`})}var ts=`h1, h2, h3, h4, h5, h6, .no-rangefinder-caret`,ns=40.5,rs=4.05,is=rs*Math.sqrt(3)/2;function as(){let e=[],t=[],n=ns/2,r=Math.ceil(n/is)+1,i=e=>Math.round(e*100)/100,a=e=>`M${e.map(([e,t])=>`${i(e)} ${i(t)}`).join(`L`)}Z`;for(let i=-r;i<r;i+=1){let o=n+i*is,s=o+is,c=(i%2+2)%2*(rs/2);for(let i=-r;i<r;i+=1){let r=n+i*rs+c,l=[[r+rs/2,o],[r,s],[r+rs,s]],u=[[r+rs/2,o],[r+3*rs/2,o],[r+rs,s]],d=e=>{let t=e.map(([e])=>e),n=e.map(([,e])=>e);return Math.max(...t)>0&&Math.min(...t)<ns&&Math.max(...n)>0&&Math.min(...n)<ns};d(l)&&e.push(a(l)),d(u)&&t.push(a(u))}}return{light:e.join(``),dark:t.join(``)}}var os=as();function ss(){let e=(0,k.useRef)(null);return Zo(e,ts),(0,A.jsx)(`div`,{ref:e,className:`custom-cursor rangefinder-cursor`,"aria-hidden":`true`,children:(0,A.jsxs)(`svg`,{className:`rangefinder-cursor-facets`,viewBox:`0 0 ${ns} ${ns}`,focusable:`false`,children:[(0,A.jsx)(`path`,{className:`rangefinder-cursor-facet-light`,d:os.light}),(0,A.jsx)(`path`,{className:`rangefinder-cursor-facet-dark`,d:os.dark})]})})}function cs(){let{cursorPackage:e}=qo(),t=null;switch(e){case`rangefinder`:t=(0,A.jsx)(ss,{});break;case`drafting`:t=(0,A.jsx)($o,{});break;case`invert`:t=(0,A.jsx)(es,{});break;case`system`:return null}return(0,No.createPortal)(t,document.body)}var ls=12,us=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{us=!0}),window.addEventListener(`blur`,()=>{us=!1}),ze.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function ds(e){return()=>us?e:e*ls}function fs(){return M({queryKey:[`profiles`],queryFn:()=>p(`GET`,`/api/profiles`)})}function ps(e){return M({queryKey:[`profile-settings`,e],queryFn:()=>p(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function ms(e){return M({queryKey:[`accounts`,e],queryFn:()=>p(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function hs(e){return M({queryKey:[`account-usage`,e],queryFn:()=>p(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function gs(){return M({queryKey:[`repos`],queryFn:()=>p(`GET`,`/api/repos`)})}function _s(e,t=!0){return M({queryKey:[`projects`,e??`all`],queryFn:()=>p(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function vs(e){return M({queryKey:[`project`,e],queryFn:()=>p(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function ys(e){return p(`POST`,`/api/projects/${e}/conversations/refresh`)}function bs(e){return M({queryKey:[`sessions`,e],queryFn:()=>p(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var xs={queryKey:[`sessions`,`all`],queryFn:()=>p(`GET`,`/api/sessions`)};function Ss(e=!0){return M({...xs,enabled:e})}function Cs(e){return e.fetchQuery(xs)}function ws(){return M({queryKey:[`config`],queryFn:()=>p(`GET`,`/api/config`)})}function Ts(e){return M({queryKey:[`repo-branches`,e],queryFn:()=>p(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function Es(e){return M({queryKey:[`repo-worktrees`,e],queryFn:()=>p(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:1e4})}function Ds(e,t){let n=j();return N({mutationFn:t=>p(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function Os(e,t){let n=j();return N({mutationFn:({name:t,confirm:n})=>{let r=new URLSearchParams({name:t});return n&&r.set(`confirm`,`1`),p(`DELETE`,`/api/repos/${e}/branches?${r.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function ks(e){return M({queryKey:[`fs-dirs`,e],queryFn:()=>p(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function As(){return M({queryKey:[`version`],queryFn:()=>p(`GET`,`/api/version`),staleTime:1/0})}function js(){return M({queryKey:[`host`],queryFn:()=>p(`GET`,`/api/host`),staleTime:1/0})}function Ms(e){return e?e.displayName||e.hostname:void 0}function Ns(){return M({queryKey:[`agents`],queryFn:()=>p(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function Ps(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function Fs(e){let t=j();return N({mutationFn:t=>p(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function Is(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function Ls(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function Rs(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function zs(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function Bs(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function Vs(){return N({mutationFn:e=>p(`POST`,`/api/accounts/${e}/login`)})}function Hs(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Us(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Ws(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Gs(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function Ks(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/projects/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function qs(e,t){return M({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>p(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Js(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Ys(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Xs(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Zs(e,t){return M({queryKey:[`layouts`,e,t??`none`],queryFn:()=>p(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Qs(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function $s(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function ec(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function tc(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function nc(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/sessions`,e),onSuccess:t=>tc(e,t)})}function rc(e){let t=j();return N({mutationFn:t=>p(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>tc(t,e)})}function ic(){let e=j();return N({mutationFn:({sessionId:e,accountId:t})=>p(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>tc(e,t)})}function ac(){let e=j();return N({mutationFn:({sessionId:e,accountId:t})=>p(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{tc(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function oc(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>tc(e,t)})}function sc(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>tc(e,t)})}function cc(){let e=j();return N({mutationFn:({sessionId:e,title:t})=>p(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>tc(e,t)})}function lc(){let e=j();return N({mutationFn:e=>p(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function uc(e){try{return await p(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function dc(e,t){return p(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function fc(e,t){return M({queryKey:[`ports`,e],queryFn:()=>p(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:ds(5e3),refetchIntervalInBackground:!1})}function pc(e,t){return M({queryKey:[`session-env`,e],queryFn:()=>p(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:ds(5e3),refetchIntervalInBackground:!1})}function mc(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var hc=a(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),gc=a(`bike`,[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]),_c=a(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),vc=a(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),yc=a(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),bc=a(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),xc=a(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),Sc=a(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Cc=a(`cake`,[[`path`,{d:`M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8`,key:`1w3rig`}],[`path`,{d:`M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1`,key:`n2jgmb`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}],[`path`,{d:`M7 8v3`,key:`1qtyvj`}],[`path`,{d:`M12 8v3`,key:`hwp4zt`}],[`path`,{d:`M17 8v3`,key:`1i6e5u`}],[`path`,{d:`M7 4h.01`,key:`1bh4kh`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M17 4h.01`,key:`1upcoc`}]]),wc=a(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Tc=a(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),Ec=a(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),Dc=a(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Oc=a(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),kc=a(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Ac=a(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),jc=a(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Mc=a(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),Nc=a(`crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Pc=a(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),Fc=a(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),Ic=a(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),Lc=a(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),Rc=a(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),zc=a(`flower-2`,[[`path`,{d:`M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1`,key:`3pnvol`}],[`circle`,{cx:`12`,cy:`8`,r:`2`,key:`1822b1`}],[`path`,{d:`M12 10v12`,key:`6ubwww`}],[`path`,{d:`M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z`,key:`9hd38g`}],[`path`,{d:`M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z`,key:`ufn41s`}]]),Bc=a(`flower`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5`,key:`14wa3c`}],[`path`,{d:`M12 7.5V9`,key:`1oy5b0`}],[`path`,{d:`M7.5 12H9`,key:`eltsq1`}],[`path`,{d:`M16.5 12H15`,key:`vk5kw4`}],[`path`,{d:`M12 16.5V15`,key:`k7eayi`}],[`path`,{d:`m8 8 1.88 1.88`,key:`nxy4qf`}],[`path`,{d:`M14.12 9.88 16 8`,key:`1lst6k`}],[`path`,{d:`m8 16 1.88-1.88`,key:`h2eex1`}],[`path`,{d:`M14.12 14.12 16 16`,key:`uqkrx3`}]]),V=a(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Vc=a(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Hc=a(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),Uc=a(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),Wc=a(`ghost`,[[`path`,{d:`M9 10h.01`,key:`qbtxuw`}],[`path`,{d:`M15 10h.01`,key:`1qmjsl`}],[`path`,{d:`M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z`,key:`uwwb07`}]]),Gc=a(`gift`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]),Kc=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),qc=a(`guitar`,[[`path`,{d:`m11.9 12.1 4.514-4.514`,key:`109xqo`}],[`path`,{d:`M20.1 2.3a1 1 0 0 0-1.4 0l-1.114 1.114A2 2 0 0 0 17 4.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 17.828 7h1.344a2 2 0 0 0 1.414-.586L21.7 5.3a1 1 0 0 0 0-1.4z`,key:`txyc8t`}],[`path`,{d:`m6 16 2 2`,key:`16qmzd`}],[`path`,{d:`M8.23 9.85A3 3 0 0 1 11 8a5 5 0 0 1 5 5 3 3 0 0 1-1.85 2.77l-.92.38A2 2 0 0 0 12 18a4 4 0 0 1-4 4 6 6 0 0 1-6-6 4 4 0 0 1 4-4 2 2 0 0 0 1.85-1.23z`,key:`1de1vg`}]]),Jc=a(`headphones`,[[`path`,{d:`M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3`,key:`1xhozi`}]]),Yc=a(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),Xc=a(`ice-cream-cone`,[[`path`,{d:`m7 11 4.08 10.35a1 1 0 0 0 1.84 0L17 11`,key:`1v6356`}],[`path`,{d:`M17 7A5 5 0 0 0 7 7`,key:`151p3v`}],[`path`,{d:`M17 7a2 2 0 0 1 0 4H7a2 2 0 0 1 0-4`,key:`1sdaij`}]]),Zc=a(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Qc=a(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),$c=a(`leaf`,[[`path`,{d:`M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z`,key:`nnexq3`}],[`path`,{d:`M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12`,key:`mt58a7`}]]),el=a(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),tl=a(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),nl=a(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),rl=a(`mountain-snow`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}],[`path`,{d:`M4.14 15.08c2.62-1.57 5.24-1.43 7.86.42 2.74 1.94 5.49 2 8.23.19`,key:`1pvmmp`}]]),il=a(`mountain`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]),al=a(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),ol=a(`notebook-pen`,[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]),sl=a(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),cl=a(`paw-print`,[[`circle`,{cx:`11`,cy:`4`,r:`2`,key:`vol9p0`}],[`circle`,{cx:`18`,cy:`8`,r:`2`,key:`17gozi`}],[`circle`,{cx:`20`,cy:`16`,r:`2`,key:`1v9bxh`}],[`path`,{d:`M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z`,key:`1ydw1z`}]]),ll=a(`pizza`,[[`path`,{d:`m12 14-1 1`,key:`11onhr`}],[`path`,{d:`m13.75 18.25-1.25 1.42`,key:`1yisr3`}],[`path`,{d:`M17.775 5.654a15.68 15.68 0 0 0-12.121 12.12`,key:`1qtqk6`}],[`path`,{d:`M18.8 9.3a1 1 0 0 0 2.1 7.7`,key:`fbbbr2`}],[`path`,{d:`M21.964 20.732a1 1 0 0 1-1.232 1.232l-18-5a1 1 0 0 1-.695-1.232A19.68 19.68 0 0 1 15.732 2.037a1 1 0 0 1 1.232.695z`,key:`1hyfdd`}]]),ul=a(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),H=a(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),dl=a(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),fl=a(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),pl=a(`rainbow`,[[`path`,{d:`M22 17a10 10 0 0 0-20 0`,key:`ozegv`}],[`path`,{d:`M6 17a6 6 0 0 1 12 0`,key:`5giftw`}],[`path`,{d:`M10 17a2 2 0 0 1 4 0`,key:`gnsikk`}]]),ml=a(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),hl=a(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),gl=a(`sailboat`,[[`path`,{d:`M10 2v15`,key:`1qf71f`}],[`path`,{d:`M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z`,key:`1pxcvx`}],[`path`,{d:`M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z`,key:`5oog16`}]]),_l=a(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),vl=a(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),yl=a(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),bl=a(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),xl=a(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]),Sl=a(`snail`,[[`path`,{d:`M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0`,key:`hneq2s`}],[`circle`,{cx:`10`,cy:`13`,r:`8`,key:`194lz3`}],[`path`,{d:`M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6`,key:`ixqyt7`}],[`path`,{d:`M18 3 19.1 5.2`,key:`9tjm43`}],[`path`,{d:`M22 3 20.9 5.2`,key:`j3odrs`}]]),Cl=a(`snowflake`,[[`path`,{d:`m10 20-1.25-2.5L6 18`,key:`18frcb`}],[`path`,{d:`M10 4 8.75 6.5 6 6`,key:`7mghy3`}],[`path`,{d:`m14 20 1.25-2.5L18 18`,key:`1chtki`}],[`path`,{d:`m14 4 1.25 2.5L18 6`,key:`1b4wsy`}],[`path`,{d:`m17 21-3-6h-4`,key:`15hhxa`}],[`path`,{d:`m17 3-3 6 1.5 3`,key:`11697g`}],[`path`,{d:`M2 12h6.5L10 9`,key:`kv9z4n`}],[`path`,{d:`m20 10-1.5 2 1.5 2`,key:`1swlpi`}],[`path`,{d:`M22 12h-6.5L14 15`,key:`1mxi28`}],[`path`,{d:`m4 10 1.5 2L4 14`,key:`k9enpj`}],[`path`,{d:`m7 21 3-6-1.5-3`,key:`j8hb9u`}],[`path`,{d:`m7 3 3 6h4`,key:`1otusx`}]]),wl=a(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Tl=a(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),El=a(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Dl=a(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Ol=a(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),kl=a(`tent`,[[`path`,{d:`M3.5 21 14 3`,key:`1szst5`}],[`path`,{d:`M20.5 21 10 3`,key:`1310c3`}],[`path`,{d:`M15.5 21 12 15l-3.5 6`,key:`1ddtfw`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}]]),Al=a(`train-front`,[[`path`,{d:`M8 3.1V7a4 4 0 0 0 8 0V3.1`,key:`1v71zp`}],[`path`,{d:`m9 15-1-1`,key:`1yrq24`}],[`path`,{d:`m15 15 1-1`,key:`1t0d6s`}],[`path`,{d:`M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z`,key:`1p0hjs`}],[`path`,{d:`m8 19-2 3`,key:`13i0xs`}],[`path`,{d:`m16 19 2 3`,key:`xo31yx`}]]),jl=a(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ml=a(`tree-pine`,[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]),Nl=a(`trees`,[[`path`,{d:`M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z`,key:`1l6gj6`}],[`path`,{d:`M7 16v6`,key:`1a82de`}],[`path`,{d:`M13 19v3`,key:`13sx9i`}],[`path`,{d:`M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5`,key:`1sj9kv`}]]),Pl=a(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),Fl=a(`turtle`,[[`path`,{d:`m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z`,key:`1lbbv7`}],[`path`,{d:`M4.82 7.9 8 10`,key:`m9wose`}],[`path`,{d:`M15.18 7.9 12 10`,key:`p8dp2u`}],[`path`,{d:`M16.93 10H20a2 2 0 0 1 0 4H2`,key:`12nsm7`}]]),Il=a(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Ll=a(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]),Rl=a(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),zl=[{name:`mountain`,Icon:il},{name:`mountain-snow`,Icon:rl},{name:`tree-pine`,Icon:Ml},{name:`trees`,Icon:Nl},{name:`leaf`,Icon:$c},{name:`flower`,Icon:Bc},{name:`flower-2`,Icon:zc},{name:`sprout`,Icon:Tl},{name:`sun`,Icon:Ol},{name:`moon`,Icon:nl},{name:`star`,Icon:Dl},{name:`cloud`,Icon:Dc},{name:`snowflake`,Icon:Cl},{name:`zap`,Icon:Rl},{name:`flame`,Icon:Rc},{name:`droplet`,Icon:Fc},{name:`rainbow`,Icon:pl},{name:`wind`,Icon:Ll},{name:`bird`,Icon:_c},{name:`fish`,Icon:Lc},{name:`cat`,Icon:Ec},{name:`dog`,Icon:Pc},{name:`rabbit`,Icon:fl},{name:`turtle`,Icon:Fl},{name:`bug`,Icon:Sc},{name:`snail`,Icon:Sl},{name:`paw-print`,Icon:cl},{name:`feather`,Icon:Ic},{name:`rocket`,Icon:hl},{name:`anchor`,Icon:hc},{name:`compass`,Icon:kc},{name:`map`,Icon:el},{name:`tent`,Icon:kl},{name:`camera`,Icon:wc},{name:`music`,Icon:al},{name:`headphones`,Icon:Jc},{name:`palette`,Icon:sl},{name:`brush`,Icon:xc},{name:`pencil`,Icon:De},{name:`book`,Icon:yc},{name:`book-open`,Icon:vc},{name:`coffee`,Icon:Oc},{name:`pizza`,Icon:ll},{name:`ice-cream-cone`,Icon:Xc},{name:`cake`,Icon:Cc},{name:`gift`,Icon:Gc},{name:`gamepad-2`,Icon:Hc},{name:`puzzle`,Icon:dl},{name:`bike`,Icon:gc},{name:`car`,Icon:Tc},{name:`plane`,Icon:ul},{name:`ship`,Icon:xl},{name:`sailboat`,Icon:gl},{name:`train-front`,Icon:Al},{name:`heart`,Icon:Yc},{name:`sparkles`,Icon:wl},{name:`crown`,Icon:Nc},{name:`gem`,Icon:Uc},{name:`trophy`,Icon:Pl},{name:`ghost`,Icon:Wc},{name:`bot`,Icon:bc},{name:`globe`,Icon:Kc},{name:`guitar`,Icon:qc}],Bl=Object.fromEntries(zl.map(e=>[e.name,e.Icon])),Vl={navy:`text-fg`,gold:`text-fg-gold`,blue:`text-icon-blue`,green:`text-icon-green`,amber:`text-icon-amber`,red:`text-icon-red`,violet:`text-icon-violet`,cyan:`text-icon-cyan`,accent:`text-accent`};function U(e){return e&&Vl[e]||``}function W({icon:e,colour:t,className:n}){let r=D(`size-4 shrink-0`,t?U(t):`text-fg-muted`,n);return(0,A.jsx)(e&&Bl[e]||Il,{className:r})}var G=s(`puddle.profile-id`);function K(){let e=(0,k.useSyncExternalStore)(G.subscribe,G.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function q(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),G.set(e)}function Hl(){let e=fs(),t=Ps(),[n,r]=(0,k.useState)(``),[i,a]=(0,k.useState)(f),o=()=>{n.trim()&&t.mutate({name:n.trim(),branch_prefix:i.trim()},{onSuccess:e=>q(e.id)})},s=(e.data?.length??0)>0;return(0,A.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-ground`,children:(0,A.jsxs)(`div`,{className:`flex w-full max-w-md flex-col gap-10 px-8 pb-16`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,A.jsx)(`h1`,{className:`font-mono text-2xl font-semibold text-fg`,children:`Puddle`}),(0,A.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:`Who is working?`})]}),s&&(0,A.jsx)(`div`,{className:`flex flex-col`,children:e.data.map(e=>(0,A.jsxs)(`button`,{onClick:()=>q(e.id),className:`flex items-center gap-3 rounded-md px-3 py-2.5 text-left transition-colors hover:bg-elevated active:bg-border/70`,children:[(0,A.jsx)(W,{icon:e.icon,colour:e.icon_colour,className:`size-5`}),(0,A.jsx)(`span`,{className:D(`text-base`,U(e.icon_colour)||`text-fg`),children:e.name}),e.branch_prefix&&(0,A.jsxs)(`span`,{className:`ml-auto text-2xs text-fg-muted`,children:[e.branch_prefix,`…`]})]},e.id))}),(0,A.jsxs)(`form`,{className:`flex flex-col gap-5`,onSubmit:e=>{e.preventDefault(),o()},children:[s&&(0,A.jsx)(`p`,{className:`text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:`or create a profile`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(xe,{htmlFor:`profile-name`,children:`Name`}),(0,A.jsx)(Te,{id:`profile-name`,placeholder:`e.g. alice`,value:n,onChange:e=>r(e.target.value),className:`h-10`,autoFocus:!s})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(xe,{htmlFor:`branch-prefix`,children:`Branch prefix`}),(0,A.jsx)(Te,{id:`branch-prefix`,placeholder:`no prefix`,value:i,onChange:e=>a(e.target.value),className:`h-10`})]}),t.error&&(0,A.jsx)(`p`,{className:`text-xs text-danger`,children:t.error.message}),(0,A.jsx)(oe,{type:`submit`,size:`lg`,className:`self-start px-6`,disabled:!n.trim()||t.isPending,children:`Create profile`})]})]})})}function Ul({initial:e,maxLength:t,className:n,onCommit:r,onCancel:i}){let[a,o]=(0,k.useState)(e);return(0,A.jsx)(`input`,{autoFocus:!0,value:a,maxLength:t,onFocus:e=>e.currentTarget.select(),onChange:e=>o(e.target.value),onBlur:()=>r(a),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?r(a):e.key===`Escape`&&i()},className:D(`bg-transparent outline-none`,n)})}function Wl(e){return{onClick:e=>{e.detail===2&&e.preventDefault()},onDoubleClick:t=>{t.preventDefault(),e()}}}var Gl=null;function Kl(e){return Gl=e,()=>{Gl===e&&(Gl=null)}}function J(){Gl?.()}var ql=new Set;function Jl(e){let t=/^#settings\/([\w-]+)$/.exec(e);return t?t[1]:null}var Yl=Jl(window.location.hash);function Xl(){let e=Yl?`#settings/${Yl}`:``;window.location.hash!==e&&history.replaceState(null,``,window.location.pathname+window.location.search+e)}function Zl(e){if(e!==Yl){Yl=e;for(let e of ql)e()}queueMicrotask(Xl)}window.addEventListener(`hashchange`,()=>Zl(Jl(window.location.hash))),window.addEventListener(`popstate`,()=>Zl(Jl(window.location.hash)));function Ql(){return(0,k.useSyncExternalStore)(e=>(ql.add(e),()=>{ql.delete(e)}),()=>Yl)}function $l(e=`appearance`){Zl(e)}function eu(){Zl(null)}function tu(){return window.puddleDesktop}function nu(){let[e,t]=(0,k.useState)({fullScreen:!1,animate:!1});return(0,k.useEffect)(()=>{let e=tu();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var ru=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],iu=[{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],au=new Map(iu.map(e=>[e.id,e])),ou=typeof window<`u`&&tu()!==void 0;function su(e,t=ou){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function cu(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var lu={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},uu={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function du(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):uu[e]??e}function fu(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>lu[e]??e).join(``)+du(n)}var pu=new Map;function mu(e,t){return pu.set(e,t),()=>{pu.get(e)===t&&pu.delete(e)}}var hu=e=>pu.get(e),gu=e=>au.get(e);function _u(e,t){return e.id===`editor.save`||t&&e.editor!==!0}var vu={},yu=new Set,bu=xu();function xu(){let e={};for(let t of iu)e[t.id]=vu[t.id]||su(t);return e}function Su(e){vu=e??{},bu=xu(),yu.forEach(e=>e())}var Cu=e=>bu[e]??``;function wu(e){for(let[t,n]of Object.entries(bu))if(n===e)return t}function Tu(e){return fu(Eu()[e]??``)}function Eu(){return(0,k.useSyncExternalStore)(e=>(yu.add(e),()=>yu.delete(e)),()=>bu)}function Du(e,t,n){return!e||e.major>t||e.major===t&&e.minor>=n}function Ou(e){return Du(e,17,1)}function ku(e){return Du(e,17,3)}var Au=e=>Du(e,10,3),ju=e=>Du(e,12,3),Mu=e=>Du(e,12,4),Nu=e=>Du(e,15,3),Pu=e=>e!==void 0&&Du(e,16,3),Fu=e=>Du(e,16,4),Iu=e=>Du(e,14,1),Lu=500,Ru=1e4;function zu(e,t){return`${e} ${t}`}var Bu=new class{ws=null;open=!1;backoff=Lu;reconnectTimer=null;theme=null;terminals=new Map;statusListeners=new Set;renameListeners=new Set;accountListeners=new Set;switchListeners=new Set;sessionsChangedListeners=new Set;connectionListeners=new Set;shellWaiters=new Map;attach(e,t,n,r,i){let a={session:e,term:t,cols:n,rows:r,handlers:i};return this.terminals.set(zu(e,t),a),this.ensureConnected(),this.open&&this.send({t:`attach`,session:e,term:t,cols:n,rows:r}),()=>this.detach(e,t)}detach(e,t){this.terminals.delete(zu(e,t))&&this.open&&this.send({t:`detach`,session:e,term:t})}write(e,t,n){this.open&&this.send({t:`stdin`,session:e,term:t,data:n})}resize(e,t,n,r){let i=this.terminals.get(zu(e,t));i&&(i.cols=n,i.rows=r),this.open&&this.send({t:`resize`,session:e,term:t,cols:n,rows:r})}spawnShell(e){return this.ensureConnected(),new Promise(t=>{let n=this.shellWaiters.get(e)??[];n.push(t),this.shellWaiters.set(e,n),this.open&&this.send({t:`spawn-shell`,session:e})})}killShell(e,t){this.open&&this.send({t:`kill-shell`,session:e,term:t})}onStatus(e){return this.statusListeners.add(e),this.ensureConnected(),()=>this.statusListeners.delete(e)}onRenamed(e){return this.renameListeners.add(e),this.ensureConnected(),()=>this.renameListeners.delete(e)}onAccount(e){return this.accountListeners.add(e),this.ensureConnected(),()=>this.accountListeners.delete(e)}onSessionSwitched(e){return this.switchListeners.add(e),this.ensureConnected(),()=>this.switchListeners.delete(e)}onSessionsChanged(e){return this.sessionsChangedListeners.add(e),this.ensureConnected(),()=>this.sessionsChangedListeners.delete(e)}onConnectionChange(e){return this.connectionListeners.add(e),()=>this.connectionListeners.delete(e)}isConnected(){return this.open}reportTheme(e,t){this.theme&&this.theme.fg===e&&this.theme.bg===t||(this.theme={fg:e,bg:t},this.open&&this.send({t:`theme`,fg:e,bg:t}))}reset(){this.ws?.close()}ensureConnected(){this.ws||this.reconnectTimer||this.connect()}connect(){let e=c.get();if(!e)return;let t=window.location.protocol===`https:`?`wss`:`ws`,n=new WebSocket(`${t}://${window.location.host}/ws`);this.ws=n,n.addEventListener(`open`,()=>{this.open=!0,this.backoff=Lu,this.send({t:`auth`,token:e}),this.send({t:`subscribe-status`}),this.theme&&this.send({t:`theme`,fg:this.theme.fg,bg:this.theme.bg});for(let{session:e,term:t,cols:n,rows:r}of this.terminals.values())this.send({t:`attach`,session:e,term:t,cols:n,rows:r});for(let e of this.connectionListeners)e(!0)}),n.addEventListener(`message`,e=>{this.handle(JSON.parse(String(e.data)))}),n.addEventListener(`close`,()=>{let e=this.open;if(this.open=!1,this.ws=null,e)for(let e of this.connectionListeners)e(!1);this.scheduleReconnect()})}scheduleReconnect(){this.reconnectTimer||this.terminals.size===0&&this.statusListeners.size===0&&this.renameListeners.size===0&&this.accountListeners.size===0&&this.switchListeners.size===0&&this.sessionsChangedListeners.size===0||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},this.backoff),this.backoff=Math.min(this.backoff*2,Ru))}send(e){this.ws?.send(JSON.stringify(e))}handle(e){switch(e.t){case`replay`:case`output`:this.terminals.get(zu(e.session,e.term))?.handlers.onData(e.data,e.t);break;case`exit`:this.terminals.get(zu(e.session,e.term))?.handlers.onExit?.(e.code);break;case`status`:for(let t of this.statusListeners)t({session:e.session,status:e.status,last_activity_at:e.last_activity_at});break;case`renamed`:for(let t of this.renameListeners)t({session:e.session,title:e.title,agent_title:e.agent_title,osc_title:e.osc_title});break;case`account`:for(let t of this.accountListeners)t({account_id:e.account_id,profile_id:e.profile_id,logged_in:e.logged_in});break;case`session-switched`:for(let t of this.switchListeners)t(e);break;case`sessions-changed`:for(let t of this.sessionsChangedListeners)t(e);break;case`shell-spawned`:{let t=this.shellWaiters.get(e.session)?.shift();t&&t(e.term);break}case`notice`:(e.level===`warning`?l.warning:l.error)(e.title,{...e.detail===void 0?{}:{description:e.detail},duration:12e3});break;case`error`:l.error(`Connection error`,{description:e.message});break}}};function Vu(e){return e.trim().slice(0,5).toUpperCase()}function Hu(e){return e.abbrev??Vu(e.name)}function Uu(e){return e.trim().toUpperCase().slice(0,5)}function Wu(e,t){let[n,r]=(0,k.useState)(e);return(0,k.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Gu(e){let t=e.trim().replace(/\/+$/,``);return t===``?`/`:t}function Ku(e){return e.startsWith(`/`)||e.startsWith(`~`)}function Y(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function qu({dir:e,onNavigate:t,onChoose:n}){let r=ks(e.endsWith(`/`)?e:`${e}/`);return(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>t(Y(e)),disabled:e===`/`,title:`Parent directory`,className:`shrink-0 rounded-sm p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg disabled:pointer-events-none disabled:opacity-40`,children:[(0,A.jsx)(Mc,{className:`size-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Parent directory`})]}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`ml-auto shrink-0 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose this folder`})]}),(0,A.jsxs)(`div`,{className:`max-h-48 overflow-y-auto`,children:[(r.data?.entries??[]).map(e=>(0,A.jsxs)(`div`,{className:`flex items-center rounded-md transition-colors hover:bg-elevated`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>t(e.path),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1 text-left`,children:[e.is_git?(0,A.jsx)(ke,{className:`size-3.5 shrink-0 text-success`}):(0,A.jsx)(Vc,{className:`size-3.5 shrink-0 text-fg-gold`}),(0,A.jsx)(`span`,{className:`truncate text-xs text-fg`,children:e.name})]}),e.is_git&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>n(e.path),className:`shrink-0 px-2 py-1 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose`})]},e.path)),r.data!==void 0&&r.data.entries.length===0&&(0,A.jsx)(`p`,{className:`px-2 py-1 text-xs text-fg-muted`,children:`No subdirectories.`})]})]})}function Ju({profileId:e,open:t,onOpenChange:n}){let r=gs(),i=Hs(),a=Gs(),o=Fr(),s=js(),[c,l]=(0,k.useState)(``),[u,d]=(0,k.useState)(``),[f,p]=(0,k.useState)(!1),[m,h]=(0,k.useState)(``),[g,_]=(0,k.useState)(!1),[v,y]=(0,k.useState)(null),[b,x]=(0,k.useState)(null),S=s.data?.home,ee=()=>{let e=c.trim(),t=Ku(e)&&S!==void 0?Gu(e.replace(/^~(?=\/|$)/,S)):Ku(e)&&e.startsWith(`/`)?Gu(e):S??`/`;ne(t)},C=e=>{d(e),g||h(Vu(e))},ne=e=>{x(e),l(e)},re=e=>{l(e),x(null),C(e.split(`/`).filter(Boolean).pop()??``),p(!0)},ie=ks(Wu(c,150)),ae=(0,k.useMemo)(()=>{if(!Ku(c))return(r.data??[]).map(e=>({value:e.path,badge:`registered`,is_git:!0}));let e=new Set((r.data??[]).map(e=>e.path));return(ie.data?.entries??[]).map(t=>({value:t.path,label:t.name,badge:e.has(t.path)?`registered`:t.is_git?`git`:void 0,is_git:t.is_git}))},[c,r.data,ie.data]),ce=async()=>{y(null);try{let t=Gu(c),s=r.data?.find(e=>e.path===t)?.id??(await i.mutateAsync({path:t})).id,l=await a.mutateAsync({profile_id:e,repo_id:s,name:u.trim(),...Uu(m)?{abbrev:Uu(m)}:{}});n(!1),o(`/project/${l.id}`)}catch(e){y(e instanceof Error?e.message:String(e))}},le=u.trim()!==``&&Ku(c.trim());return(0,A.jsx)(me,{open:t,onOpenChange:n,children:(0,A.jsxs)(w,{children:[(0,A.jsxs)(te,{children:[(0,A.jsx)(T,{children:`New project`}),(0,A.jsx)(fe,{children:`Point at a git repository on the daemon host — known repositories are reused.`})]}),(0,A.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),le&&ce()},children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(xe,{htmlFor:`repo-path`,children:`Repository path`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>b===null?ee():x(null),className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:b===null?`browse…`:`hide browser`})]}),(0,A.jsx)(Oe,{id:`repo-path`,placeholder:`~/src/my-repo`,value:c,onValueChange:l,onChoose:e=>{!f&&e.is_git&&C(e.value.split(`/`).filter(Boolean).pop()??``)},hints:ae}),b!==null&&(0,A.jsx)(qu,{dir:b,onNavigate:ne,onChoose:re})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(xe,{htmlFor:`project-name`,children:`Project name`}),(0,A.jsx)(Te,{id:`project-name`,placeholder:`e.g. checkout-rework`,value:u,onChange:e=>{C(e.target.value),p(!0)}})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(xe,{htmlFor:`project-abbrev`,children:`Abbreviation`}),(0,A.jsx)(Te,{id:`project-abbrev`,placeholder:u.trim()?Vu(u):`ABBRV`,maxLength:5,value:m,onChange:e=>{h(Uu(e.target.value)),_(!0)},className:`w-24 uppercase`}),(0,A.jsxs)(`p`,{className:`text-2xs text-fg-muted`,children:[`Up to `,5,` characters — the project's label on the collapsed sidebar rail.`]})]}),v&&(0,A.jsx)(`p`,{className:`text-xs text-danger`,children:v}),(0,A.jsxs)(se,{children:[(0,A.jsx)(oe,{type:`button`,variant:`ghost`,onClick:()=>n(!1),children:`Cancel`}),(0,A.jsx)(oe,{type:`submit`,disabled:!le||i.isPending||a.isPending,children:`Create project`})]})]})]})})}var Yu=1,Xu=.9,Zu=.8,Qu=.17,$u=.1,ed=.999,td=.9999,nd=.99,rd=/[\\\/_+.#"@\[\(\{&]/,id=/[\\\/_+.#"@\[\(\{&]/g,ad=/[\s-]/,od=/[\s-]/g;function sd(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Yu:nd;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=sd(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Yu:rd.test(e.charAt(l-1))?(d*=Zu,p=e.slice(i,l-1).match(id),p&&i>0&&(d*=ed**+p.length)):ad.test(e.charAt(l-1))?(d*=Xu,m=e.slice(i,l-1).match(od),m&&i>0&&(d*=ed**+m.length)):(d*=Qu,i>0&&(d*=ed**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=td)),(d<$u&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=sd(e,t,n,r,l+1,a+2,o),f*$u>d&&(d=f*$u)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function cd(e){return e.toLowerCase().replace(od,` `)}function ld(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,sd(e,t,cd(e),cd(t),0,0,{})}var ud=`[cmdk-group=""]`,dd=`[cmdk-group-items=""]`,fd=`[cmdk-group-heading=""]`,pd=`[cmdk-item=""]`,md=`${pd}:not([aria-disabled="true"])`,hd=`cmdk-item-select`,gd=`data-value`,_d=(e,t,n)=>ld(e,t,n),vd=k.createContext(void 0),yd=()=>k.useContext(vd),bd=k.createContext(void 0),xd=()=>k.useContext(bd),X=k.createContext(void 0),Sd=k.forwardRef((e,t)=>{let n=Fd(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Fd(()=>new Set),i=Fd(()=>new Map),a=Fd(()=>new Map),o=Fd(()=>new Set),s=Pd(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=_e(),b=_e(),x=_e(),S=k.useRef(null),ee=Ld();Z(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Z(()=>{ee(6,oe)},[]);let C=k.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)ae(),re(),ee(1,ie);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(ee(7,()=>{n.current.selectedItemId=se()?.id,C.emit()}),r||ee(5,oe),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),te=k.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,ne(t,r)),ee(2,()=>{re(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),ee(3,()=>{ae(),re(),n.current.value||ie(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=se();ee(4,()=>{ae(),t?.getAttribute(`id`)===e&&ie(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:x,labelId:b,listInnerRef:S}),[]);function ne(e,t){let r=s.current?.filter??_d;return e?r(e,n.current.search,t):0}function re(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;ce().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(dd);t?t.appendChild(e.parentElement===t?e:e.closest(`${dd} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${dd} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${ud}[${gd}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function ie(){let e=ce().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(gd);C.setState(`value`,e||void 0)}function ae(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=ne(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function oe(){var e;let t=se();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ud)?.querySelector(fd))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function se(){return S.current?.querySelector(`${pd}[aria-selected="true"]`)}function ce(){return Array.from(S.current?.querySelectorAll(md)||[])}function le(e){let t=ce()[e];t&&C.setState(`value`,t.getAttribute(gd))}function ue(e){var t;let n=se(),r=ce(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(gd))}function w(e){let t=se()?.closest(ud),n;for(;t&&!n;)t=e>0?Md(t,ud):Nd(t,ud),n=t?.querySelector(md);n?C.setState(`value`,n.getAttribute(gd)):ue(e)}let T=()=>le(ce().length-1),de=e=>{e.preventDefault(),e.metaKey?T():e.altKey?w(1):ue(1)},fe=e=>{e.preventDefault(),e.metaKey?le(0):e.altKey?w(-1):ue(-1)};return k.createElement(y.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&de(e);break;case`ArrowDown`:de(e);break;case`p`:case`k`:g&&e.ctrlKey&&fe(e);break;case`ArrowUp`:fe(e);break;case`Home`:e.preventDefault(),le(0);break;case`End`:e.preventDefault(),T();break;case`Enter`:{e.preventDefault();let t=se();if(t){let e=new Event(hd);t.dispatchEvent(e)}}}}},k.createElement(`label`,{"cmdk-label":``,htmlFor:te.inputId,id:te.labelId,style:Bd},c),zd(e,e=>k.createElement(bd.Provider,{value:C},k.createElement(vd.Provider,{value:te},e))))}),Cd=k.forwardRef((e,t)=>{let n=_e(),r=k.useRef(null),i=k.useContext(X),a=yd(),o=Pd(e),s=o.current?.forceMount??i?.forceMount;Z(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Id(n,r,[e.value,e.children,r],e.keywords),l=xd(),u=Q(e=>e.value&&e.value===c.current),d=Q(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);k.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(hd,f),()=>t.removeEventListener(hd,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...b}=e;return k.createElement(y.div,{ref:S(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),wd=k.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=_e(),s=k.useRef(null),c=k.useRef(null),l=_e(),u=yd(),d=Q(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Z(()=>u.group(o),[]),Id(o,s,[e.value,e.heading,c]);let f=k.useMemo(()=>({id:o,forceMount:i}),[i]);return k.createElement(y.div,{ref:S(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&k.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),zd(e,e=>k.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},k.createElement(X.Provider,{value:f},e))))}),Td=k.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=k.useRef(null),a=Q(e=>!e.search);return!n&&!a?null:k.createElement(y.div,{ref:S(i,t),...r,"cmdk-separator":``,role:`separator`})}),Ed=k.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=xd(),o=Q(e=>e.search),s=Q(e=>e.selectedItemId),c=yd();return k.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),k.createElement(y.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Dd=k.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=k.useRef(null),o=k.useRef(null),s=Q(e=>e.selectedItemId),c=yd();return k.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),k.createElement(y.div,{ref:S(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},zd(e,e=>k.createElement(`div`,{ref:S(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Od=k.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return k.createElement(pe,{open:n,onOpenChange:r},k.createElement(he,{container:o},k.createElement(le,{"cmdk-overlay":``,className:i}),k.createElement(ne,{"aria-label":e.label,"cmdk-dialog":``,className:a},k.createElement(Sd,{ref:t,...s}))))}),kd=k.forwardRef((e,t)=>Q(e=>e.filtered.count===0)?k.createElement(y.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Ad=k.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return k.createElement(y.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},zd(e,e=>k.createElement(`div`,{"aria-hidden":!0},e)))}),jd=Object.assign(Sd,{List:Dd,Item:Cd,Input:Ed,Group:wd,Separator:Td,Dialog:Od,Empty:kd,Loading:Ad});function Md(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nd(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pd(e){let t=k.useRef(e);return Z(()=>{t.current=e}),t}var Z=typeof window>`u`?k.useEffect:k.useLayoutEffect;function Fd(e){let t=k.useRef();return t.current===void 0&&(t.current=e()),t}function Q(e){let t=xd(),n=()=>e(t.snapshot());return k.useSyncExternalStore(t.subscribe,n,n)}function Id(e,t,n,r=[]){let i=k.useRef(),a=yd();return Z(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(gd,s),i.current=s}),i}var Ld=()=>{let[e,t]=k.useState(),n=Fd(()=>new Map);return Z(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Rd(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function zd({asChild:e,children:t},n){return e&&k.isValidElement(t)?k.cloneElement(Rd(t),{ref:t.ref},n(t.props.children)):n(t)}var Bd={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Vd({className:e,...t}){return(0,A.jsx)(jd,{className:D(`flex size-full flex-col overflow-hidden rounded-lg bg-elevated`,e),...t})}function Hd({open:e,onOpenChange:t,children:n}){return(0,A.jsx)(me,{open:e,onOpenChange:t,children:(0,A.jsx)(w,{className:`max-w-lg overflow-hidden p-0 [&>button]:hidden`,children:(0,A.jsx)(Vd,{loop:!0,children:n})})})}function Ud({className:e,...t}){return(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pt-1`,children:[(0,A.jsx)(vl,{className:`size-4 shrink-0 text-fg-muted`}),(0,A.jsx)(jd.Input,{className:D(`flex h-10 w-full bg-transparent text-sm text-fg outline-none placeholder:text-fg-muted`,e),...t})]})}function Wd({className:e,...t}){return(0,A.jsx)(jd.List,{className:D(`max-h-72 overflow-y-auto p-1`,e),...t})}function Gd(e){return(0,A.jsx)(jd.Empty,{className:`py-6 text-center text-sm text-fg-muted`,...e})}function Kd({className:e,...t}){return(0,A.jsx)(jd.Group,{className:D(`overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-fg-muted`,e),...t})}function qd({className:e,...t}){return(0,A.jsx)(jd.Item,{className:D(Ee,Se,`[&_svg]:size-3.5 [&_svg]:text-fg-muted data-[selected=true]:[&_svg]:text-action-ink`,e),...t})}function Jd({className:e,...t}){return(0,A.jsx)(`span`,{className:D(`ml-auto font-mono text-2xs tracking-widest text-fg-muted`,e),...t})}async function Yd(){try{let e=await fetch(`/cockpit/refresh`,{method:`POST`,headers:{authorization:`Bearer ${c.get()??``}`}});return e.status===202?(m.parse(await e.json()),!0):!1}catch{return!1}}async function Xd(e=12e4){let t=Date.now()+e;for(;Date.now()<t;){await new Promise(e=>setTimeout(e,1e3));try{return await fetch(`/api/version`,{cache:`no-store`}),!0}catch{}}return!1}var Zd=null;function Qd(e){return Zd=e,()=>{Zd===e&&(Zd=null)}}function $d(){Zd?.()}var ef=null;function tf(e){return ef=e,()=>{ef===e&&(ef=null)}}async function nf(e){if(!ef)throw Error(`Open a project before opening a path.`);await ef(e)}var rf=new Set;function af(){return[...rf].flatMap(e=>e())}function of(e){return e.title??e.agent_title??e.osc_title??e.id.slice(0,8)}var sf=` — `;function cf(e){return e.replace(/\/+$/,``).split(`/`).pop()??``}function lf(e){return{name:of(e),title:e.title??``,agentName:e.agent_title??``,sequence:e.osc_title??``,branch:e.branch,cwd:cf(e.worktree_path),id:e.id.slice(0,8),status:e.status,agent:e.agent_type??``}}function uf(e,t){let n=t&&t.length>0?t:h,r=lf(e),i=[];for(let e of n.split(/(\$\{[a-zA-Z]+\})/)){if(e===``)continue;let t=/^\$\{([a-zA-Z]+)\}$/.exec(e)?.[1];t===void 0?i.push({text:e,sep:!1}):t===`separator`?i.push({text:sf,sep:!0}):i.push({text:r[t]??e,sep:!1})}let a=[];i.forEach((e,t)=>{if(!e.sep){a.push(e.text);return}let n=a.join(``).trim().length>0,r=i.slice(t+1).some(e=>!e.sep&&e.text.trim().length>0);n&&r&&a.push(e.text)});let o=a.join(``).trim();return o.length>0?o:e.id.slice(0,8)}function df(){let e=ps(K()??void 0).data?.tabTitleTemplate;return(0,k.useCallback)(t=>uf(t,e),[e])}function ff({onNewSession:e,onNewProject:t}){let[n,r]=(0,k.useState)(!1),[i,a]=(0,k.useState)(`commands`),[o,s]=(0,k.useState)(``),[c,l]=(0,k.useState)(null),[u,d]=(0,k.useState)(!1),f=Fr(),p=zr(),m=K(),h=p.id,g=_s(m??void 0),_=bs(h),v=df();(0,k.useEffect)(()=>mu(`palette.toggle`,()=>r(e=>!e)),[]),(0,k.useEffect)(()=>Kl(()=>r(!0)),[]),(0,k.useEffect)(()=>{n||(a(`commands`),s(``),l(null),d(!1))},[n]);let y=(0,k.useMemo)(()=>{let n=[];for(let e of g.data??[])n.push({id:`project-${e.id}`,group:`Projects`,label:e.name,icon:V,keywords:`switch project open`,run:()=>void f(`/project/${e.id}`)});for(let e of _.data??[])e.status!==`archived`&&n.push({id:`session-${e.id}`,group:`Sessions`,label:v(e),icon:El,keywords:`switch session ${e.branch}`,run:()=>void f(`/project/${e.project_id}/session/${e.id}`)});return h!==void 0&&e&&n.push({id:`new-agent`,group:`Actions`,label:`New agent`,icon:bc,keywords:`new agent create start session`,run:()=>e()},{id:`new-terminal`,group:`Actions`,label:`New terminal`,icon:El,keywords:`new terminal create start shell session`,run:()=>e({kind:`terminal`})}),h!==void 0&&n.push({id:`open-path`,group:`Actions`,label:`Open path`,icon:V,keywords:`open path file directory folder editor tree browse absolute relative home`,closeOnRun:!1,run:()=>{s(``),l(null),a(`path`)}}),t&&n.push({id:`new-project`,group:`Actions`,label:`New project`,icon:H,keywords:`new project open create repository repo workspace`,run:t}),n.push({id:`theme-dark`,group:`Theme`,label:`Switch theme: dark`,icon:nl,keywords:`switch theme dark appearance`,run:()=>void Da(`dark`)},{id:`theme-light`,group:`Theme`,label:`Switch theme: light`,icon:Ol,keywords:`switch theme light appearance`,run:()=>void Da(`light`)},{id:`theme-system`,group:`Theme`,label:`Switch theme: system`,icon:tl,keywords:`switch theme system appearance`,run:()=>void Da(`system`)},{id:`open-settings`,group:`Actions`,label:`Settings`,icon:bl,keywords:`open settings preferences options configure`,run:()=>$l()},{id:`switch-profile`,group:`Actions`,label:`Switch profile`,icon:Il,keywords:`switch profile identity user change`,run:()=>G.set(null)},{id:`refresh-connection`,group:`Actions`,label:`Refresh connection`,icon:ml,keywords:`refresh connection reconnect restart cockpit tunnel ssh daemon`,run:()=>$d()}),[...n,...af()]},[g.data,_.data,h,f,e,t,v]),b=(0,k.useMemo)(()=>{let e=new Map;for(let t of y){let n=e.get(t.group)??[];n.push(t),e.set(t.group,n)}return[...e.entries()]},[y]),x=async()=>{let e=o.trim();if(!(e===``||u)){d(!0),l(null);try{await nf(e),r(!1)}catch(e){l(e instanceof Error?e.message:`Could not open that path.`)}finally{d(!1)}}};return(0,A.jsxs)(Hd,{open:n,onOpenChange:r,children:[(0,A.jsx)(Ud,{value:o,onValueChange:e=>{s(e),l(null)},placeholder:i===`path`?`Enter a path…`:`Type a command or search…`,onKeyDown:e=>{i===`path`&&(e.key===`Enter`?(e.preventDefault(),e.stopPropagation(),x()):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),a(`commands`),s(``),l(null)))}}),i===`path`?(0,A.jsx)(Wd,{children:(0,A.jsxs)(`div`,{className:`px-3 py-3 text-xs text-fg-muted`,children:[(0,A.jsx)(`p`,{children:`Relative paths start from the bound worktree or project. Absolute and ~ paths work too.`}),(0,A.jsx)(`p`,{className:c?`mt-2 text-danger`:`mt-2`,"aria-live":`polite`,children:c??(u?`Opening…`:`Press Enter to open.`)})]})}):(0,A.jsxs)(Wd,{children:[(0,A.jsx)(Gd,{children:`Nothing matches.`}),b.map(([e,t])=>(0,A.jsx)(Kd,{heading:e,children:t.map(e=>{let t=e.icon;return(0,A.jsxs)(qd,{value:`${e.label} ${e.keywords??``}`,onSelect:()=>{e.closeOnRun!==!1&&r(!1),e.run()},children:[t&&(0,A.jsx)(t,{}),e.label,e.shortcut&&(0,A.jsx)(Jd,{children:e.shortcut})]},e.id)})},e))]})]})}function pf(){let e=document.activeElement;return e instanceof Element&&e.closest(`.xterm`)!==null}function mf(){let e=document.activeElement;return e instanceof Element&&e.closest(`.monaco-editor`)!==null}function hf(){let e=ps(K()??void 0).data?.hotkeys;return(0,k.useEffect)(()=>{Su(e&&typeof e==`object`?e:void 0)},[e]),(0,k.useEffect)(()=>mu(`window.close`,()=>{let e=tu();e?.closeWindow?e.closeWindow():window.close()}),[]),(0,k.useEffect)(()=>{let e=e=>{let t=cu(e);if(!t)return;let n=wu(t);if(!n)return;let r=gu(n);if(!r||!_u(r,mf()))return;let i=hu(n);i&&(e.preventDefault(),e.stopPropagation(),i())},t=e=>{let t=cu(e);if(!t)return;let n=wu(t);if(!n)return;let r=gu(n);if(!r||r.editor&&mf()||r.deferInTerminal&&pf())return;let i=hu(n);i&&(e.preventDefault(),i())};return window.addEventListener(`keydown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,e,!0),window.removeEventListener(`keydown`,t)}},[]),null}var gf=4e3;function _f(){let[e,t]=(0,k.useState)(`hidden`),n=(0,k.useRef)(e);n.current=e,(0,k.useEffect)(()=>{let e=null,r=Bu.onConnectionChange(r=>{if(r){e!==null&&clearTimeout(e),e=null,n.current===`lost`&&t(`hidden`);return}e!==null||n.current!==`hidden`||(e=setTimeout(()=>{e=null,n.current===`hidden`&&t(`lost`)},gf))});return()=>{r(),e!==null&&clearTimeout(e)}},[]);let r=(0,k.useCallback)(async()=>{if(n.current===`refreshing`)return;t(`refreshing`);let e=()=>t(Bu.isConnected()?`hidden`:`lost`);if(!await Yd()){l.error("The cockpit did not accept the refresh — run `puddle refresh` in a terminal."),e();return}if(await Xd()){window.location.reload();return}l.error(`The cockpit has not come back — it may need a terminal (ssh re-auth): puddle refresh`),e()},[]);return(0,k.useEffect)(()=>Qd(()=>void r()),[r]),e===`hidden`?null:(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 bg-elevated px-3 py-2`,children:[(0,A.jsx)(`span`,{className:`text-xs text-fg-secondary`,children:e===`refreshing`?`Restarting the cockpit.`:`Connection to the daemon lost.`}),e===`lost`&&(0,A.jsxs)(oe,{size:`sm`,className:`ml-auto`,onClick:()=>void r(),children:[(0,A.jsx)(ml,{}),`Refresh connection`]})]})}var vf=`Popover`,[yf,bf]=b(vf,[Ne]),xf=Ne(),[Sf,Cf]=yf(vf),wf=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=xf(t),c=k.useRef(null),[l,u]=k.useState(!1),[d,f]=ae({prop:r,defaultProp:i??!1,onChange:a,caller:vf});return(0,A.jsx)(Me,{...s,children:(0,A.jsx)(Sf,{scope:t,contentId:_e(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:k.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:k.useCallback(()=>u(!0),[]),onCustomAnchorRemove:k.useCallback(()=>u(!1),[]),modal:o,children:n})})};wf.displayName=vf;var Tf=`PopoverAnchor`,Ef=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Cf(Tf,n),a=xf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return k.useEffect(()=>(o(),()=>s()),[o,s]),(0,A.jsx)(we,{...a,...r,ref:t})});Ef.displayName=Tf;var Df=`PopoverTrigger`,Of=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Cf(Df,n),a=xf(n),o=ce(t,i.triggerRef),s=(0,A.jsx)(y.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Uf(i.open),...r,ref:o,onClick:v(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,A.jsx)(we,{asChild:!0,...a,children:s})});Of.displayName=Df;var kf=`PopoverPortal`,[Af,jf]=yf(kf,{forceMount:void 0}),Mf=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Cf(kf,t);return(0,A.jsx)(Af,{scope:t,forceMount:n,children:(0,A.jsx)(C,{present:n||a.open,children:(0,A.jsx)(E,{asChild:!0,container:i,children:r})})})};Mf.displayName=kf;var Nf=`PopoverContent`,Pf=k.forwardRef((e,t)=>{let n=jf(Nf,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Cf(Nf,e.__scopePopover);return(0,A.jsx)(C,{present:r||a.open,children:a.modal?(0,A.jsx)(If,{...i,ref:t}):(0,A.jsx)(Lf,{...i,ref:t})})});Pf.displayName=Nf;var Ff=ee(`PopoverContent.RemoveScroll`),If=k.forwardRef((e,t)=>{let n=Cf(Nf,e.__scopePopover),r=k.useRef(null),i=ce(t,r),a=k.useRef(!1);return k.useEffect(()=>{let e=r.current;if(e)return re(e)},[]),(0,A.jsx)(ie,{as:Ff,allowPinchZoom:!0,children:(0,A.jsx)(Rf,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:v(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:v(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:v(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Lf=k.forwardRef((e,t)=>{let n=Cf(Nf,e.__scopePopover),r=k.useRef(!1),i=k.useRef(!1);return(0,A.jsx)(Rf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Rf=k.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Cf(Nf,n),p=xf(n);return de(),(0,A.jsx)(ue,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,A.jsx)(ge,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,A.jsx)(ve,{"data-state":Uf(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),zf=`PopoverClose`,Bf=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Cf(zf,n);return(0,A.jsx)(y.button,{type:`button`,...r,ref:t,onClick:v(e.onClick,()=>i.onOpenChange(!1))})});Bf.displayName=zf;var Vf=`PopoverArrow`,Hf=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=xf(n);return(0,A.jsx)(Ce,{...i,...r,ref:t})});Hf.displayName=Vf;function Uf(e){return e?`open`:`closed`}var Wf=wf,Gf=Of,Kf=Mf,qf=Pf,Jf=Wf,Yf=Gf;function Xf({className:e,align:t=`end`,sideOffset:n=8,...r}){return(0,A.jsx)(Kf,{children:(0,A.jsx)(qf,{align:t,sideOffset:n,className:D(`z-50 rounded-lg bg-elevated p-5 shadow-2xl outline-none`,e),...r})})}function Zf({stream:e,label:t,hint:n,onClose:r}){let[i,a]=(0,k.useState)(null);return(0,A.jsx)(me,{open:!0,onOpenChange:e=>!e&&r(),children:(0,A.jsxs)(w,{className:`h-[85vh] max-w-[calc(100vw-4rem)]`,children:[(0,A.jsxs)(te,{children:[(0,A.jsxs)(T,{children:[t,` — login`]}),(0,A.jsx)(fe,{children:i===null?`Complete the agent’s login flow below.${n===void 0?` The account shows as logged in once it finishes cleanly.`:` ${n}`}`:`The login exited with code ${i} without completing. The output above may say why; close this and try again.`})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-md bg-ground p-1`,children:(0,A.jsx)(Ae,{stream:e,onExit:e=>e===0?r():a(e)})})]})})}var Qf=(0,k.createContext)({open:()=>void 0,handler:null,setHandler:()=>void 0});function $f({children:e}){let[t,n]=(0,k.useState)(null),r=(0,k.useCallback)(e=>n(()=>e),[]),i=(0,k.useCallback)(e=>t?.(e),[t]),a=(0,k.useMemo)(()=>({open:i,handler:t,setHandler:r}),[i,t,r]);return(0,A.jsx)(Qf.Provider,{value:a,children:e})}function ep(){return(0,k.useContext)(Qf)}function tp({label:e,percentage:t,hint:n}){let r=Math.max(0,Math.min(100,t));return(0,A.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`w-24 shrink-0 truncate text-2xs text-fg-muted`,title:e,children:e}),(0,A.jsx)(`span`,{className:`relative h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-border`,children:(0,A.jsx)(`span`,{className:`absolute inset-y-0 left-0 rounded-full ${r>=90?`bg-danger`:r>=75?`bg-warning`:`bg-action`}`,style:{width:`${r}%`}})}),(0,A.jsxs)(`span`,{className:`shrink-0 text-2xs tabular-nums text-fg-muted`,children:[Math.round(r),`%`,n?` · ${n}`:``]})]})}function np(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function rp(e){if(e===null)return`never`;let t=new Date(e).getTime(),n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function ip({account:e,onLogin:t,onStartSession:n,installed:r=!0}){let i=hs(e.id),a=e.logged_in?n:r?t:null,o=i.data?.subscription;return(0,A.jsxs)(`div`,{className:`rounded-md px-2 py-2 transition-colors hover:bg-elevated`,children:[(0,A.jsxs)(`button`,{type:`button`,disabled:a===null,onClick:()=>a?.(),className:`flex w-full items-center gap-3 text-left disabled:cursor-default`,children:[(0,A.jsx)(`span`,{className:`size-2 shrink-0 rounded-full ${e.logged_in?`bg-success`:`bg-idle`}`,"aria-hidden":!0}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm text-fg`,children:e.label}),(0,A.jsxs)(`span`,{className:`block text-2xs text-fg-muted`,children:[e.logged_in?`logged in`:`logged out`,i.data&&(0,A.jsxs)(A.Fragment,{children:[` · `,i.data.session_count,` session`,i.data.session_count===1?``:`s`,i.data.active_session_count>0&&` (${i.data.active_session_count} active)`,` · `,`last `,rp(i.data.last_activity_at)]})]}),i.data?.agent_usage&&(0,A.jsxs)(`span`,{className:`block text-2xs text-fg-muted`,children:[np(i.data.agent_usage.input_tokens),` in ·`,` `,np(i.data.agent_usage.output_tokens),` out ·`,` `,np(i.data.agent_usage.cache_read_input_tokens),` cached ·`,` `,i.data.agent_usage.message_count,` msgs`]}),i.data?.live_usage?.context_used_percentage!=null&&(0,A.jsx)(`span`,{className:`mt-1 block`,children:(0,A.jsx)(tp,{label:`context`,percentage:i.data.live_usage.context_used_percentage})})]}),(0,A.jsx)(`span`,{className:`shrink-0 text-2xs text-fg-muted`,children:r?e.logged_in?n?`new agent`:``:(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-warning`,children:[(0,A.jsx)(Zc,{className:`size-3`}),`sign in`]}):`unavailable`})]}),o!=null&&o.windows.length>0&&(0,A.jsx)(`div`,{className:`mt-2 flex flex-col gap-1 pl-5`,children:o.windows.map(e=>(0,A.jsx)(tp,{label:e.label,percentage:e.used_percentage,hint:e.resets==null?void 0:`resets ${e.resets}`},e.key))})]})}function ap(){let[e,t]=(0,k.useState)(!1),[n,r]=(0,k.useState)(!1),i=K(),a=fs(),o=Is(),s=a.data?.find(e=>e.id===i),c=ms(i??void 0),l=Ns(),u=Vs(),{open:d,handler:f}=ep(),[p,m]=(0,k.useState)(null),h=e=>u.mutate(e.id,{onSuccess:t=>m({stream:t.stream,label:`${e.agent_type}/${e.label}`}),onError:e=>ye(e)}),g=e=>{t(!1),d({accountId:e.id})};return n&&s?(0,A.jsxs)(`div`,{className:`flex h-8 items-center gap-2 px-3`,children:[(0,A.jsx)(W,{icon:s.icon,colour:s.icon_colour}),(0,A.jsx)(Ul,{initial:s.name,maxLength:100,className:D(`w-32 text-sm`,U(s.icon_colour)),onCommit:e=>{r(!1);let t=e.trim();!i||!t||t===s?.name||o.mutate({id:i,name:t},{onError:e=>ye(e)})},onCancel:()=>r(!1)})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(Jf,{open:e,onOpenChange:t,children:[(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsx)(Yf,{asChild:!0,children:(0,A.jsxs)(oe,{variant:`ghost`,size:`sm`,className:`font-sans compact:h-7 compact:px-1.5`,children:[(0,A.jsx)(W,{icon:s?.icon,colour:s?.icon_colour}),(0,A.jsx)(`span`,{className:U(s?.icon_colour),...Wl(()=>{t(!1),r(!0)}),children:s?.name??`…`})]})})}),(0,A.jsx)(jo,{children:`Profile`})]}),(0,A.jsxs)(Xf,{className:`w-[28rem] max-w-[calc(100vw-1rem)]`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(l.data??[]).map(e=>{let t=c.data?.filter(t=>t.agent_type===e.id)??[];if(t.length===0)return null;let n=e.available!==!1;return(0,A.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,A.jsxs)(`span`,{className:`px-2 text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:[e.display_name,!n&&(0,A.jsxs)(`span`,{className:`ml-2 normal-case tracking-normal text-fg-muted`,children:[`not installed — no `,e.binary??e.id,` on PATH`]})]}),t.map(e=>(0,A.jsx)(ip,{account:e,onLogin:()=>h(e),onStartSession:f&&n?()=>g(e):null,installed:n},e.id))]},e.id)}),c.data?.length===0&&(0,A.jsx)(`p`,{className:`px-2 text-sm text-fg-muted`,children:`No accounts yet — add one in settings.`})]}),(0,A.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,A.jsxs)(oe,{variant:`ghost`,size:`sm`,onClick:()=>{t(!1),$l(`accounts`)},children:[(0,A.jsx)(H,{}),`Add account`]}),(0,A.jsxs)(oe,{variant:`ghost`,size:`sm`,className:`ml-auto`,onClick:()=>{t(!1),G.set(null)},children:[(0,A.jsx)(yl,{}),`Switch profile`]})]})]})]}),p&&(0,A.jsx)(Zf,{stream:p.stream,label:p.label,onClose:()=>m(null)})]})}var op=`desktop-update`;function sp(){let e=(0,k.useRef)(null);return(0,k.useEffect)(()=>{let t=tu();if(t?.updateReady===void 0||t.onUpdateReady===void 0)return;let n=t=>{e.current!==t&&(e.current=t,l(`Puddle ${t} is downloaded and ready.`,{id:op,duration:1/0,closeButton:!0,action:{label:`Restart to update`,onClick:()=>{tu()?.installUpdate?.(),l.loading(`Restarting into Puddle ${t}…`,{id:`${op}-restarting`,duration:1/0})}}}))};return t.updateReady().then(e=>{e!==null&&n(e)}),t.onUpdateReady(n)},[]),null}var cp=e=>e&&typeof e==`object`?e:{},lp=[{id:`appearance`,label:`Appearance`,fields:[{key:`theme`,store:`theme`},{key:`cursorPackage`,store:`client`},{key:`uiFontSize`,store:`client`},{key:`terminalFontSize`,store:`client`},{key:`editorFontSize`,store:`client`},{key:`density`,store:`client`},{key:`terminalScrollback`,store:`client`},{key:`projectBasedLayout`,store:`client`},{key:`showAllProjectSessions`,store:`client`}]},{id:`profile`,label:`Profile`,fields:[{key:`branch_prefix`,store:`profileColumn`},{key:`icon`,store:`profileColumn`},{key:`icon_colour`,store:`profileColumn`}]},{id:`sessions`,label:`Sessions`,fields:[{key:`onboardingTemplate`,store:`profileSettings`},{key:`concurrentTemplate`,store:`profileSettings`},{key:`restartTemplate`,store:`profileSettings`},{key:`tabTitleTemplate`,store:`profileSettings`},{key:`sessionDefaults`,store:`profileSettings`},{key:`allowSkipPermissions`,store:`profileSettings`},{key:`captureSessionEnv`,store:`profileSettings`}]},{id:`editor`,label:`Editor`,fields:[{key:`editorTabSize`,store:`client`},{key:`editorWordWrap`,store:`client`},{key:`editorLinkSshHost`,store:`client`}]},{id:`hotkeys`,label:`Hotkeys`,fields:[{key:`hotkeys`,store:`profileSettings`}]},{id:`notifications`,label:`Notifications`,fields:[{key:`notifications`,store:`profileSettings`,pick:e=>{let{desktop:t,sound:n}=cp(e);return{desktop:t,sound:n}},mergeInto:(e,t)=>({...cp(t),...cp(e)})}]},{id:`scratchpad`,label:`Scratchpad (profile-wide entries)`,fields:[{key:`entries`,store:`scratchpad`}]}];function up(e){return e.filter(e=>e.scope===`profile`).map(e=>({title:e.title,body:e.body,tags:e.tags,agent_type:e.agent_type}))}function dp(e){return JSON.stringify([e.title??``,e.body,e.tags,e.agent_type??``])}function fp(e,t){if(!Array.isArray(e))return[];let n=new Set(up(t).map(dp)),r=new Set,i=[];for(let t of e){let e=cp(t);if(typeof e.body!=`string`||e.body.length===0)continue;let a={title:typeof e.title==`string`&&e.title!==``?e.title:null,body:e.body,tags:Array.isArray(e.tags)?e.tags.filter(e=>typeof e==`string`):[],agent_type:typeof e.agent_type==`string`?e.agent_type:null},o=dp(a);n.has(o)||r.has(o)||(r.add(o),i.push(a))}return i}function pp(e,t){switch(e.store){case`client`:return t.client[e.key];case`theme`:return t.theme;case`profileSettings`:return t.profileSettings[e.key];case`profileColumn`:return t.profile[e.key];case`scratchpad`:return up(t.scratchpad)}}function mp(e,t){let n={};for(let r of lp){if(!e.includes(r.id))continue;let i={};for(let e of r.fields){let n=pp(e,t);n!==void 0&&(i[e.key]=e.pick?e.pick(n):n)}Object.keys(i).length>0&&(n[r.id]=i)}return n}function hp(e,t,n,r){if(!e||typeof e!=`object`)return[];let i=e,a={},o={},s={},c=[];for(let e of lp){if(r&&!r.includes(e.id))continue;let l=i[e.id];if(!l||typeof l!=`object`)continue;let u=l,d=!1;for(let r of e.fields){if(!(r.key in u))continue;let e=u[r.key];if(r.store===`scratchpad`){let r=fp(e,n.scratchpad);r.length>0&&(t.createScratchpad(r),d=!0);continue}d=!0;let i=r.mergeInto?r.mergeInto(e,r.store===`profileSettings`?n.profileSettings[r.key]:void 0):e;r.store===`client`?a[r.key]=i:r.store===`theme`?t.setTheme(i):r.store===`profileSettings`?o[r.key]=i:s[r.key]=i}d&&c.push(e.label)}return Object.keys(a).length>0&&t.setClient(a),Object.keys(o).length>0&&t.patchProfileSettings(o),Object.keys(s).length>0&&t.patchProfileColumns(s),c}var gp={version:1,profiles:{}};function _p(e,t){return e.profiles[t]??{enabled:!0,groups:lp.map(e=>e.id),doc:{},updatedAt:new Date(0).toISOString()}}async function vp(){try{let e=await fetch(`/cockpit/local-sync`,{headers:d(),cache:`no-store`});return e.ok?{available:!0,file:await e.json()}:{available:!1,file:gp}}catch{return{available:!1,file:gp}}}function yp(){return M({queryKey:[`local-sync`],queryFn:vp,staleTime:5e3,refetchOnWindowFocus:!0,retry:!1})}function bp(){let e=j();return N({mutationFn:async e=>{let t=await fetch(`/cockpit/local-sync`,{method:`PUT`,headers:{...d(),"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`The local sync store did not accept the write.`);return await t.json()},onSuccess:t=>e.setQueryData([`local-sync`],{available:!0,file:t})})}function xp(){let e=K(),t=fs().data?.find(t=>t.id===e),n=ps(e??void 0),r=qs(e??void 0,void 0),i=qo(),a=yp(),o=bp(),s=Fs(e??``),c=Is(),l=Js(),[u,d]=(0,k.useReducer)(e=>e+1,0);(0,k.useEffect)(()=>ka(()=>d()),[]);let f=(0,k.useRef)(null);(0,k.useEffect)(()=>{f.current=null},[t?.name]);let p=a.data?.available===!0?a.data.file:void 0,m=t!==void 0&&e!==null&&n.data!==void 0&&r.data!==void 0&&p!==void 0,h=t&&p?_p(p,t.name):void 0,g=s.isPending||c.isPending||l.isPending||o.isPending||n.isFetching||r.isFetching;(0,k.useEffect)(()=>{if(!m||!h?.enabled||g)return;let a={client:i,theme:Ta(),profileSettings:n.data,profile:t,scratchpad:r.data},u={setClient:e=>Go(e),setTheme:e=>{typeof e==`string`&&Da(e)},patchProfileSettings:e=>s.mutate(e),patchProfileColumns:t=>c.mutate({id:e,...t}),createScratchpad:t=>{for(let n of t)l.mutate({profile_id:e,scope:`profile`,title:n.title??void 0,body:n.body,tags:n.tags,agent_type:n.agent_type??void 0})}},d=JSON.stringify(h.doc);if(f.current!==d){f.current=d,hp(h.doc,u,a,h.groups);return}let p=mp(h.groups,a),_=JSON.stringify(p);_!==d&&(f.current=_,o.mutate({profile:t.name,entry:{...h,doc:p,updatedAt:new Date().toISOString()}}))})}function Sp(){return typeof Notification>`u`?`unsupported`:tu()?`granted`:Notification.permission}var Cp={desktop:!0,sound:!1,muted_projects:[]};function wp(e){return e.prefs.muted_projects.includes(e.projectId)?{desktop:!1,sound:!1}:{desktop:e.prefs.desktop&&e.permission===`granted`&&!e.windowFocused,sound:e.prefs.sound}}function Tp(e,t){for(let[,n]of e.getQueriesData({queryKey:[`sessions`]})){let e=n?.find(e=>e.id===t);if(e)return e}for(let[,n]of e.getQueriesData({queryKey:[`project`]})){let e=n?.sessions.find(e=>e.id===t);if(e)return e}}function Ep(e){return e.title??e.agent_title??e.osc_title??e.id.slice(0,8)}function Dp(){try{let e=new AudioContext,t=e.createGain();t.gain.value=.04,t.connect(e.destination);for(let[n,r]of[[880,0],[1318.5,.09]]){let i=e.createOscillator();i.type=`sine`,i.frequency.value=n,i.connect(t),i.start(e.currentTime+r),i.stop(e.currentTime+r+.12)}setTimeout(()=>void e.close(),400)}catch{}}function Op(){let e=j(),t=Fr(),n=ps(K()??void 0),r=(0,k.useRef)(Cp);r.current={...Cp,...n.data?.notifications??{}};let i=Ms(js().data)??`Puddle`,a=(0,k.useRef)(i);(0,k.useEffect)(()=>{document.title===a.current&&(document.title=i),a.current=i},[i]),(0,k.useEffect)(()=>{let n=new Set,i=()=>{document.title=n.size>0?`(${n.size}) ${a.current}`:a.current},o=Bu.onStatus(a=>{let o=n.has(a.session);a.status===`waiting_input`?n.add(a.session):n.delete(a.session),i(),!(a.status!==`waiting_input`||o)&&(async()=>{let n=Tp(e,a.session);if(!n)try{n=(await Cs(e)).find(e=>e.id===a.session)}catch{return}if(!n||n.kind===`terminal`)return;let i=n,o=wp({prefs:r.current,projectId:i.project_id,windowFocused:document.hasFocus(),permission:Sp()});if(o.sound&&Dp(),o.desktop){let e=new Notification(Ep(i),{body:`Waiting for your input`,tag:`puddle-waiting-${i.id}`});e.onclick=()=>{tu()?.raiseWindow(),window.focus(),t(`/project/${i.project_id}/session/${i.id}`),e.close()}}})()});return()=>{o(),document.title=a.current}},[e,t])}function kp({className:e,strokeScale:t=1}){return(0,A.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,"aria-hidden":!0,children:[(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`22`,y2:`12`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`20.66`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`20.66`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`2`,y2:`12`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`3.34`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`3.34`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`15.25`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`18.5`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`15.25`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`8.75`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`5.5`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`8.75`})]})}function Ap({className:e,strokeScale:t=1}){return(0,A.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.6*t,"aria-hidden":!0,children:[(0,A.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,A.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(60 12 12)`}),(0,A.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(120 12 12)`})]})}function jp({className:e,strokeScale:t=1}){return(0,A.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,A.jsx)(`path`,{d:`M8 4H4v16h4`}),(0,A.jsx)(`path`,{d:`M16 4h4v16h-4`}),(0,A.jsx)(`rect`,{x:`10.5`,y:`10.5`,width:`3`,height:`3`,fill:`currentColor`,stroke:`none`})]})}function Mp({className:e}){return(0,A.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,"aria-hidden":!0,children:(0,A.jsx)(`path`,{d:`M12 1.5c0 5.8 4.7 10.5 10.5 10.5C16.7 12 12 16.7 12 22.5 12 16.7 7.3 12 1.5 12 7.3 12 12 7.3 12 1.5Z`})})}function Np({type:e,className:t,strokeScale:n=1}){switch(e){case`claude-code`:return(0,A.jsx)(kp,{className:t,strokeScale:n});case`codex`:return(0,A.jsx)(Ap,{className:t,strokeScale:n});case`opencode`:return(0,A.jsx)(jp,{className:t,strokeScale:n});case`gemini-cli`:return(0,A.jsx)(Mp,{className:t});default:return(0,A.jsx)(Il,{className:t,strokeWidth:2*n})}}function Pp(e){let t=k.useRef({value:e,previous:e});return k.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Fp=`Switch`,[Ip,Lp]=b(Fp),[Rp,zp]=Ip(Fp);function Bp(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=ae({prop:n,defaultProp:i??!1,onChange:c,caller:Fp}),[m,h]=k.useState(null),[g,_]=k.useState(null),v={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:k.useRef(!1),required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,A.jsx)(Rp,{scope:t,...v,children:Jp(d)?d(v):r})}var Vp=`SwitchTrigger`,Hp=k.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=zp(Vp,e),h=ce(r,u),g=k.useRef(c);return k.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,A.jsx)(y.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":Yp(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:h,onClick:v(t,e=>{d(e=>!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Hp.displayName=Vp;var Up=k.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,A.jsx)(Bp,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Hp,{...d,ref:t,__scopeSwitch:n}),e&&(0,A.jsx)(qp,{__scopeSwitch:n})]})})});Up.displayName=Fp;var Wp=`SwitchThumb`,Gp=k.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=zp(Wp,n);return(0,A.jsx)(y.span,{"data-state":Yp(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});Gp.displayName=Wp;var Kp=`SwitchBubbleInput`,qp=k.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=zp(Kp,e),m=ce(n,p),h=Pp(a),g=be(r);k.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});n.call(e,a),e.dispatchEvent(t)}},[f,h,a,i]);let _=k.useRef(a);return(0,A.jsx)(y.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});qp.displayName=Kp;function Jp(e){return typeof e==`function`}function Yp(e){return e?`checked`:`unchecked`}function Xp({className:e,...t}){return(0,A.jsx)(Up,{className:D(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full transition-colors data-[state=checked]:bg-action data-[state=unchecked]:bg-border data-[state=unchecked]:hover:bg-border/70 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,A.jsx)(Gp,{className:`pointer-events-none block size-4 rounded-full bg-ground shadow-sm transition-transform data-[state=checked]:translate-x-[1.125rem] data-[state=unchecked]:translate-x-0.5`})})}function Zp({initial:e,defaultScope:t,allowProject:n=!0,agents:r,onSave:i,onCancel:a}){let[o,s]=(0,k.useState)(e?.title??``),[c,l]=(0,k.useState)(e?.body??``),[u,d]=(0,k.useState)(n?e?.scope??t:`profile`),[f,p]=(0,k.useState)((e?.tags??[]).join(`, `)),[m,h]=(0,k.useState)(e?.agent_type??null),g=()=>{let e=c.trim();e&&i({title:o.trim()||null,body:e,scope:u,tags:f.split(`,`).map(e=>e.trim()).filter(Boolean),agent_type:m})};return(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,A.jsx)(Te,{value:o,placeholder:`Title (optional)`,spellCheck:!1,onChange:e=>s(e.target.value),onKeyDown:e=>e.stopPropagation(),className:`h-9 text-sm font-medium`}),(0,A.jsx)(je,{autoFocus:!0,value:c,placeholder:`Prompt or note…`,spellCheck:!1,rows:10,onChange:e=>l(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`?a():e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&g()},className:`resize-y text-sm leading-relaxed`}),(0,A.jsx)(Te,{value:f,placeholder:`tags, comma, separated`,spellCheck:!1,onChange:e=>p(e.target.value),onKeyDown:e=>e.stopPropagation(),className:`h-8 text-xs`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n&&(0,A.jsxs)(`label`,{className:`flex items-center gap-1.5 text-2xs text-fg-secondary`,children:[(0,A.jsx)(Xp,{checked:u===`profile`,onCheckedChange:e=>d(e?`profile`:`project`)}),`Profile-wide`]}),(0,A.jsx)(`div`,{className:`ml-auto flex items-center gap-1`,children:r.map(e=>(0,A.jsxs)(`button`,{type:`button`,title:e.display_name,"aria-pressed":m===e.id,onClick:()=>h(t=>t===e.id?null:e.id),className:D(`rounded-md p-1 transition-colors`,m===e.id?`bg-surface text-fg`:`text-fg-gold hover:bg-surface hover:text-fg`),children:[(0,A.jsx)(Np,{type:e.id,className:`size-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:e.display_name})]},e.id))})]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[(0,A.jsx)(oe,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),(0,A.jsx)(oe,{size:`sm`,disabled:!c.trim(),onClick:g,children:`Save`})]})]})}var Qp=new Set,$p=!1,em=null;function tm(){for(let e of Qp)e()}function nm(e){return Qp.add(e),()=>Qp.delete(e)}function rm(e){$p!==e&&($p=e,tm())}function im(){rm(!$p)}function am(){return(0,k.useSyncExternalStore)(nm,()=>$p)}function om(e){em=e,tm()}function sm(){return(0,k.useSyncExternalStore)(nm,()=>em)}function cm(){let e=am(),t=K(),n=zr().id,r=qs(t??void 0,n).data??[],i=Ns().data??[],a=Js(),o=Ys(),s=Xs(),c=sm(),[u,d]=(0,k.useState)(null),[f,p]=(0,k.useState)(null),[m,h]=(0,k.useState)(null),[g,_]=(0,k.useState)(null),[v,y]=(0,k.useState)(null);(0,k.useEffect)(()=>mu(`scratchpad.toggle`,im),[]),(0,k.useEffect)(()=>{e||(d(null),p(null),h(null))},[e]);let b=(0,k.useMemo)(()=>[...new Set(r.flatMap(e=>e.tags))].sort((e,t)=>e.localeCompare(t)),[r]),x=(0,k.useMemo)(()=>[...new Set(r.map(e=>e.agent_type).filter(e=>e!==null))],[r]),S=f!==null||m!==null,ee=r.filter(e=>(f===null||e.tags.includes(f))&&(m===null||e.agent_type===m)),C=S?ee:v??r,te=e=>{t&&(a.mutate({profile_id:t,scope:e.scope,project_id:e.scope===`project`?n:void 0,title:e.title??void 0,body:e.body,tags:e.tags,agent_type:e.agent_type??void 0}),d(null))},ne=(e,t)=>{o.mutate({id:e,scope:t.scope,project_id:t.scope===`project`?n??null:null,title:t.title,body:t.body,tags:t.tags,agent_type:t.agent_type}),d(null)},re=(e,t)=>{let n=v??r,i=n.findIndex(t=>t.id===e),a=n.findIndex(e=>e.id===t);if(i===-1||a===-1||i===a)return;let o=n.slice(),[s]=o.splice(i,1);o.splice(a,0,s),y(o)},ie=()=>{let e=g,t=v;if(_(null),y(null),e===null||!t)return;let n=t.findIndex(t=>t.id===e);if(n===-1)return;let r=t[n-1],i=t[n+1],a=r?i?(r.position+i.position)/2:r.position+1:(i?i.position:0)-1;o.mutate({id:e,position:a})},ae=e=>{navigator.clipboard?.writeText(e.body),l.success(`Copied to clipboard`)};return(0,A.jsxs)(Jf,{open:e,onOpenChange:rm,children:[(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsx)(Yf,{asChild:!0,children:(0,A.jsxs)(oe,{variant:`ghost`,size:`icon`,className:`compact:h-7 compact:w-7`,children:[(0,A.jsx)(ol,{}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Scratchpad`})]})})}),(0,A.jsx)(jo,{children:`Scratchpad`})]}),(0,A.jsxs)(Xf,{className:`w-[34rem] max-w-[calc(100vw-1rem)] p-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-5 pb-2 pt-4`,children:[(0,A.jsx)(`span`,{className:`text-2xs font-medium uppercase tracking-wide text-fg-gold`,children:`Scratchpad`}),(0,A.jsxs)(`button`,{type:`button`,onClick:()=>d(u===`new`?null:`new`),className:`ml-auto flex items-center rounded-md p-1 text-fg-gold transition-colors hover:bg-surface hover:text-fg`,children:[(0,A.jsx)(H,{className:`size-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`New entry`})]})]}),(b.length>0||x.length>0)&&(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 px-5 pb-2`,children:[b.map(e=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>p(t=>t===e?null:e),className:D(`rounded-full px-2 py-0.5 text-2xs transition-colors`,f===e?`bg-action text-action-ink`:`bg-surface text-fg-secondary hover:text-fg`),children:e},e)),x.map(e=>(0,A.jsx)(`button`,{type:`button`,"aria-pressed":m===e,onClick:()=>h(t=>t===e?null:e),className:D(`rounded-md p-1 transition-colors`,m===e?`bg-action text-action-ink`:`text-fg-gold hover:bg-surface`),children:(0,A.jsx)(Np,{type:e,className:`size-3.5`})},e))]}),(0,A.jsxs)(`div`,{className:`no-scrollbar max-h-[65vh] overflow-y-auto px-2 pb-3`,children:[u===`new`&&(0,A.jsx)(`div`,{className:`px-3 py-2`,children:(0,A.jsx)(Zp,{defaultScope:n?`project`:`profile`,allowProject:n!==void 0,agents:i,onSave:te,onCancel:()=>d(null)})}),C.length===0&&u!==`new`&&(0,A.jsx)(`p`,{className:`px-3 py-3 text-sm text-fg-muted`,children:S?`Nothing matches this filter.`:`No entries yet — press + to add a reusable prompt or note.`}),(0,A.jsx)(`ul`,{className:`flex flex-col`,children:C.map(e=>u===e.id?(0,A.jsx)(`li`,{className:`px-3 py-2`,children:(0,A.jsx)(Zp,{initial:e,defaultScope:e.scope,allowProject:n!==void 0||e.scope===`project`,agents:i,onSave:t=>ne(e.id,t),onCancel:()=>d(null)})},e.id):(0,A.jsx)(`li`,{draggable:!S&&u===null,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,_(e.id)},onDragOver:t=>{g!==null&&(t.preventDefault(),g!==e.id&&re(g,e.id))},onDragEnd:ie,className:D(`transition-opacity`,g===e.id&&`opacity-50`),children:(0,A.jsx)(lm,{entry:e,onInsert:c?()=>{c(e.body),rm(!1)}:null,onCopy:()=>ae(e),onEdit:()=>d(e.id),onDelete:()=>s.mutate(e.id)})},e.id))})]})]})]})}function lm({entry:e,onInsert:t,onCopy:n,onEdit:r,onDelete:i}){let[a,o]=(0,k.useState)(!1);return(0,A.jsxs)(`div`,{onClick:e=>{e.target.closest(`button`)||r()},className:`cursor-pointer rounded-md px-3 py-2.5 transition-colors hover:bg-surface`,children:[e.title&&(0,A.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.title}),(0,A.jsx)(`p`,{className:D(`line-clamp-3 whitespace-pre-wrap text-sm text-fg-secondary`,e.title&&`mt-0.5`),children:e.body}),a?(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-2xs text-fg-muted`,children:`Delete this entry? This can’t be undone.`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{o(!1),i()},className:`text-2xs font-medium text-interrupted transition-colors hover:underline`,children:`Delete`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(!1),className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:`Cancel`})]}):(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:`text-2xs uppercase tracking-wide text-fg-muted`,children:e.scope===`profile`?`Profile-wide`:`Project`}),e.agent_type&&(0,A.jsx)(Np,{type:e.agent_type,className:`size-3 text-fg-gold`}),e.tags.map(e=>(0,A.jsx)(`span`,{className:`rounded-full bg-surface px-1.5 text-2xs text-fg-secondary`,children:e},e)),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[t&&(0,A.jsx)(um,{icon:jc,label:`Insert into focused terminal`,onClick:t}),(0,A.jsx)(um,{icon:Ac,label:`Copy`,onClick:n}),(0,A.jsx)(um,{icon:De,label:`Edit`,onClick:r}),(0,A.jsx)(um,{icon:jl,label:`Delete`,onClick:()=>o(!0)})]})]})]})}function um({icon:e,label:t,onClick:n}){return(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsxs)(`button`,{type:`button`,onClick:n,className:`rounded-md p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg`,children:[(0,A.jsx)(e,{className:`size-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:t})]})}),(0,A.jsx)(jo,{children:t})]})}function dm(e){return e.kind??`file`}function fm(e){if(e.view===`linked`||e.view===`locked`)return e.view;let t=`${dm(e)}:${e.session}:${e.sha??``}:${e.root??``}:${e.path}`;return e.git_area===void 0?t:`${t}:git-${e.git_area}`}var pm={md:`markdown`,markdown:`markdown`,mdown:`markdown`,html:`html`,htm:`html`};function mm(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0?null:pm[t.slice(n+1).toLowerCase()]??null}function hm(e,t){if(t===``||t.startsWith(`#`)||t.startsWith(`//`)||/^[a-z][a-z0-9+.-]*:/i.test(t))return null;let n=t.split(`#`)[0].split(`?`)[0];if(n===``||n===`/`)return null;let r=[...n.startsWith(`/`)?[]:e.split(`/`).slice(0,-1)];for(let e of decodeURI(n).split(`/`))if(!(e===``||e===`.`))if(e===`..`){if(r.length===0)return null;r.pop()}else r.push(e);return r.length>0?r.join(`/`):null}function gm(e){let t=[],n=0,r=e=>/[\t\n\f\r ]/.test(e);for(;n<e.length;){for(;n<e.length&&(r(e[n])||e[n]===`,`);)n+=1;if(n>=e.length)break;let i=n;for(;n<e.length&&!r(e[n]);)n+=1;let a=e.slice(i,n);if(a.endsWith(`,`)){a=a.replace(/,+$/,``),a!==``&&t.push({ref:a,descriptor:``});continue}for(;n<e.length&&r(e[n]);)n+=1;let o=n;for(;n<e.length&&e[n]!==`,`;)n+=1;let s=e.slice(o,n).trim();n<e.length&&(n+=1),a!==``&&t.push({ref:a,descriptor:s})}return t}function _m(e){return e.map(({ref:e,descriptor:t})=>`${e}${t===``?``:` ${t}`}`).join(`, `)}function vm(){return crypto.randomUUID()}function $(e){return e.type===`terminal`?`term:${e.session}`:`editor:${fm(e.tab)}`}function ym(e,t){return $(e)===$(t)}function bm(e){return e.type===`terminal`}function xm(e){return e.type===`editor`&&(e.tab.view===`linked`||e.tab.view===`locked`)}function Sm(e=[],t){let n=e.map($),r=t&&n.includes(t)?t:n.length>0?n[0]:null;return{kind:`leaf`,id:vm(),tabs:e,activeKey:r,previewKey:null}}function Cm(e,t,n){return{kind:`split`,id:vm(),direction:e,children:t,sizes:n??t.map(()=>100/Math.max(1,t.length))}}function wm(e,t){if(e.kind===`leaf`)return e.id===t?e:null;for(let n of e.children){let e=wm(n,t);if(e)return e}return null}function Tm(e,t){if(e.kind===`leaf`)return e.tabs.some(e=>$(e)===t)?e:null;for(let n of e.children){let e=Tm(n,t);if(e)return e}return null}function Em(e){return e.kind===`leaf`?[e]:e.children.flatMap(Em)}function Dm(e){return Em(e).flatMap(e=>e.tabs)}function Om(e){return e.kind===`leaf`?[e.id]:[e.id,...e.children.flatMap(Om)]}function km(e){let t=Om(e);return new Set(t).size!==t.length}function Am(e){return e.kind===`leaf`?{...e,id:vm()}:{...e,id:vm(),children:e.children.map(Am)}}function jm(e){if(!km(e))return e;let t=new Set,n=e=>{let r=t.has(e.id)?vm():e.id;return t.add(r),e.kind===`leaf`?{...e,id:r}:{...e,id:r,children:e.children.map(n)}};return n(e)}function Mm(e){let t=e.tabs.map($),n=e.activeKey&&t.includes(e.activeKey)?e.activeKey:t[0]??null,r=e.previewKey&&t.includes(e.previewKey)?e.previewKey:null;return n===e.activeKey&&r===(e.previewKey??null)?e:{...e,activeKey:n,previewKey:r}}function Nm(e){if(e.kind===`leaf`)return Mm(e);let t=e.children.map(Nm),n=[],r=[];t.forEach((t,i)=>{let a=e.sizes[i]??1;if(t.kind===`split`&&t.direction===e.direction){let e=t.sizes.reduce((e,t)=>e+t,0)||t.children.length;t.children.forEach((i,o)=>{n.push(i),r.push(a*(t.sizes[o]??1)/e)})}else n.push(t),r.push(a)});let i=[],a=[];return n.forEach((e,t)=>{e.kind===`leaf`&&e.tabs.length===0||(i.push(e),a.push(r[t]??1))}),i.length===0?Sm([]):i.length===1?i[0]:{...e,children:i,sizes:a}}function Pm(e,t,n){return e.kind===`leaf`?e.id===t?n(e):e:{...e,children:e.children.map(e=>Pm(e,t,n))}}function Fm(e,t,n){return Pm(e,t,e=>{if(!e.tabs.some(e=>$(e)===n))return e;let t=e.tabs.filter(e=>$(e)!==n),r=e.activeKey===n?Im(e,n):e.activeKey;return{...e,tabs:t,activeKey:r}})}function Im(e,t){let n=e.tabs.findIndex(e=>$(e)===t);if(n===-1)return e.activeKey;let r=e.tabs.filter(e=>$(e)!==t);return r.length===0?null:$(r[Math.min(n,r.length-1)])}function Lm(e,t,n){let r=e.tabs.filter(e=>!ym(e,t)),i=n===void 0?r.length:Math.max(0,Math.min(n,r.length)),a=[...r.slice(0,i),t,...r.slice(i)];return{...e,tabs:a,activeKey:$(t)}}function Rm(e,t,n,r){let i=n===`left`||n===`right`?`row`:`col`,a=n===`left`||n===`top`;return Nm(Pm(e,t,e=>{let t=Sm([r]);return Cm(i,a?[t,e]:[e,t],[50,50])}))}function zm(e,t){let{ref:n,toLeafId:r,edge:i}=t,a=$(n),o=t.copy===!0&&!bm(n),s=t.index;if(i===`center`&&s!==void 0){let t=wm(e,r)?.tabs.findIndex(e=>$(e)===a)??-1;t!==-1&&t<s&&--s}let c=o?e:Fm(e,t.fromLeafId,a);if(i===`center`){let e=Pm(c,r,e=>Lm(e,n,s));return!wm(e,r)&&!Tm(e,a)?Jm(Nm(Bm(e,n)),a):Jm(Nm(e),a)}return wm(c,r)?Jm(Rm(c,r,i,n),a):Nm(Sm([n]))}function Bm(e,t){let n=Em(e)[0];return n?Pm(e,n.id,e=>Lm(e,t)):Sm([t])}function Vm(e,t,n){return Nm(Pm(e,t,e=>e.tabs.some(e=>$(e)===n)?{...e,tabs:e.tabs.filter(e=>$(e)!==n),activeKey:e.activeKey===n?Im(e,n):e.activeKey}:e))}function Hm(e,t,n){let r=$(n);return Nm(Pm(e,t,e=>{let t=e.previewKey===r?null:e.previewKey;return e.tabs.some(e=>ym(e,n))?{...e,activeKey:r,previewKey:t}:{...e,tabs:[...e.tabs,n],activeKey:r,previewKey:t}}))}function Um(e,t,n){let r=$(n);return Nm(Pm(e,t,e=>e.tabs.some(e=>$(e)===r)?{...e,tabs:e.tabs.map(e=>$(e)===r?n:e),previewKey:e.previewKey===r?null:e.previewKey}:{...e,tabs:[...e.tabs,n]}))}function Wm(e,t,n){let r=$(n);return Pm(e,t,e=>({...e,tabs:e.tabs.map(e=>$(e)===r?n:e)}))}function Gm(e,t,n){let r=fm(t),i=e=>e.kind===`split`?{...e,children:e.children.map(i)}:{...e,tabs:e.tabs.map(e=>e.type===`editor`&&fm(e.tab)===r?{...e,tab:{...e.tab,compile_mode:n}}:e)};return i(e)}function Km(e,t){return e.type!==`editor`||t.type!==`editor`||e.tab.view!==`preview`||t.tab.view!==void 0||mm(t.tab.path)===null?t:{...t,tab:{...t.tab,view:`preview`}}}function qm(e,t,n){let r=$(n);return Nm(Pm(e,t,e=>{if(e.tabs.some(e=>ym(e,n)))return{...e,activeKey:r};let t=e.previewKey?e.tabs.findIndex(t=>$(t)===e.previewKey):-1,i=t>=0?e.tabs[t]:void 0,a=i!==void 0&&!bm(i)&&!xm(i),o=a?Km(i,n):n,s=a?e.tabs.map((e,n)=>n===t?o:e):[...e.tabs,o];return{...e,tabs:s,activeKey:r,previewKey:r}}))}function Jm(e,t){let n=e=>e.kind===`leaf`?e.previewKey===t?{...e,previewKey:null}:e:{...e,children:e.children.map(n)};return n(e)}function Ym(e,t,n,r){return Pm(e,t,e=>{let t=e.tabs.findIndex(e=>e.type===`editor`&&$(e)===n),i=t>=0?e.tabs[t]:void 0;if(i===void 0||i.type!==`editor`)return e;let a={...i,tab:{...i.tab,view:r}},o=$(a);if(o===n)return{...e,tabs:e.tabs.map((e,n)=>n===t?a:e)};let s=e.tabs.some((e,n)=>n!==t&&$(e)===o),c=s?e.tabs.filter((e,n)=>n!==t):e.tabs.map((e,n)=>n===t?a:e);return{...e,tabs:c,activeKey:e.activeKey===n?o:e.activeKey,previewKey:e.previewKey===n?s?null:o:e.previewKey??null}})}function Xm(e,t){let n=dm(e);return n!==`commit`&&n!==`untitled`&&e.session===t.session&&e.path===t.path&&e.root===t.root}function Zm(e,t,n){if(n===t.path)return e;let r=!1,i=e=>{if(e.kind===`split`){let t=e.children.map(i);return t.some((t,n)=>t!==e.children[n])?{...e,children:t}:e}let a=new Map,o=!1,s=e.tabs.map(e=>{if(e.type!==`editor`||!Xm(e.tab,t))return e;let r={...e,tab:{...e.tab,path:n}};return a.set($(e),$(r)),o=!0,r});if(!o)return e;r=!0;let c=e.activeKey,l=e.previewKey??null;return{...e,tabs:s,activeKey:c===null?null:a.get(c)??c,previewKey:l===null?null:a.get(l)??l}},a=i(e);return r?a:e}function Qm(e){if(e.type!==`editor`)return null;let t=e.tab,n=dm(t);return n!==`file`&&n!==`external`||t.view===`linked`||t.view===`locked`||mm(t.path)===null?null:t}function $m(e,t){let n=Qm(t);if(!n)return e;let r=!1,i=e=>{if(e.kind===`split`)return{...e,children:e.children.map(i)};let t=!1,a=e.tabs.map(e=>{if(e.type!==`editor`||!xm(e))return e;let r=e.tab;return r.session===n.session&&r.path===n.path&&(r.root??``)===(n.root??``)&&dm(r)===dm(n)?e:(t=!0,{type:`editor`,tab:{session:n.session,path:n.path,...n.kind===void 0?{}:{kind:n.kind},...n.root===void 0?{}:{root:n.root},view:r.view}})});return t?(r=!0,{...e,tabs:a}):e},a=i(e);return r?a:e}function eh(e,t){return e.session===t.session&&e.path===t.path&&(e.root??``)===(t.root??``)&&dm(e)===dm(t)}function th(e,t,n){let r=Em(e).flatMap(e=>e.tabs.flatMap(n=>n.type!==`editor`||n.tab.view===`linked`||n.tab.view===`locked`||!eh(n.tab,t)?[]:[{leafId:e.id,ref:n}]));return r.find(({leafId:e})=>e===n)??r.find(({ref:e})=>(e.tab.view??`source`)===`source`)??r[0]??null}function nh(e,t,n){return Pm(e,t,e=>e.tabs.some(e=>$(e)===n)?{...e,activeKey:n}:e)}function rh(e,t,n){function r(e){return e.kind===`leaf`?e:e.id===t&&n.length===e.children.length?{...e,children:e.children.map(r),sizes:[...n]}:{...e,children:e.children.map(r)}}return r(e)}function ih(e){let t=e.type===`terminal`?e.session:e.tab.session;return t===`00000000-0000-0000-0000-000000000000`?null:t}function ah(e){return t=>{let n=ih(t);return n===null||e.has(n)}}function oh(e,t){let n=e=>e.kind===`leaf`?{...e,tabs:e.tabs.filter(t)}:{...e,children:e.children.map(n)};return Nm(n(e))}function sh(e){let t=new Set,n=[];for(let r of e){let e=Nm(oh(r,e=>!t.has($(e)))),i=Dm(e);if(i.length!==0){for(let e of i)t.add($(e));n.push(e)}}return n.length===0?Sm([]):jm(n.length===1?n[0]:Nm(Cm(`row`,n)))}function ch(e){let t=e.editor_tabs.map(e=>({type:`editor`,tab:e})),n=e.session_tabs.map(e=>({type:`terminal`,session:e})),r=e.active_editor_tab?$({type:`editor`,tab:e.active_editor_tab}):null,i=e.active_session?`term:${e.active_session}`:null;if(t.length===0&&n.length===0)return Sm([]);if(t.length===0)return Sm(n,i);if(n.length===0)return Sm(t,r);let a=e.layout,o=typeof a.editor==`number`?a.editor:40,s=typeof a.session==`number`?a.session:60;return Nm(Cm(`col`,[Sm(t,r),Sm(n,i)],[o,s]))}function lh(e){return JSON.stringify(uh(e))}function uh(e){return e===null?null:e.kind===`leaf`?e.tabs.length===0?null:{t:e.tabs.map($)}:{d:e.direction,s:e.sizes.map(e=>Math.round(e*10)/10),c:e.children.map(uh)}}var dh=new Set,fh=!1,ph=null;function mh(){for(let e of dh)e()}function hh(e){return dh.add(e),()=>dh.delete(e)}function gh(e){fh!==e&&(fh=e,mh())}function _h(){gh(!fh)}function vh(){return(0,k.useSyncExternalStore)(hh,()=>fh)}function yh(e){ph=e,mh()}function bh(){return(0,k.useSyncExternalStore)(hh,()=>ph)}var xh={layout_tree:null,active_session:null,layout_ref:null};function Sh(e){return e.type===`terminal`?e.session:e.tab.session}function Ch(e,t){let n=new Set;for(let[r,i]of Object.entries(e))if(!(r===t||!i.layout_tree))for(let e of Dm(i.layout_tree))e.type===`terminal`&&n.add(e.session);return[...n]}function wh(e,t){let n=e.project_layouts[t];return{...e,layout_tree:n?.layout_tree??null,active_session:n?.active_session??null,layout_ref:n?.layout_ref??null,session_tabs:[],editor_tabs:[],active_editor_tab:null}}function Th(e,t,n){return n?{loaded:e.loaded,snapshot:wh(e.snapshot,t),current:()=>wh(e.current(),t),update(n){let r={},i={...n};if(`layout_tree`in n&&(r.layout_tree=n.layout_tree??null,delete i.layout_tree),`active_session`in n&&(r.active_session=n.active_session??null,delete i.active_session),`layout_ref`in n&&(r.layout_ref=n.layout_ref??null,delete i.layout_ref),Object.keys(r).length>0){let n=e.current().project_layouts;i.project_layouts={...n,[t]:{...n[t]??xh,...r}}}Object.keys(i).length>0&&e.update(i)}}:e}function Eh(e,t,n,r){let i=e.layout_tree??ch(e),a={};for(let o of t)a[o]={layout_tree:Am(oh(i,e=>{let i=Sh(e);return i===`00000000-0000-0000-0000-000000000000`?o===(r??t[0]):n.get(i)===o})),active_session:e.active_session!==null&&n.get(e.active_session)===o?e.active_session:null,layout_ref:null};return{layout_mode:`project`,project_layouts:a}}function Dh(e,t,n={}){return{...e,...t,...n}}function Oh(e,t,n){let r=t.layout_tree?oh(t.layout_tree,e=>{let t=Sh(e);return t===`00000000-0000-0000-0000-000000000000`||n.alive.has(t)}):null,i=t.active_session!==null&&n.alive.has(t.active_session)?t.active_session:null;if(t.scope===`profile`)return{projectBased:!1,patch:{layout_mode:`profile`,layout_tree:r,active_session:i,layout_ref:t.id}};let a=t.project_id??n.currentProject??n.projectIds[0]??``,o={layout_tree:r,active_session:i,layout_ref:t.id};if((e.layout_mode??`profile`)===`project`)return{projectBased:!0,patch:{project_layouts:{...e.project_layouts,[a]:o}}};let s=Eh(e,n.projectIds,n.sessionProject,a);return{projectBased:!0,patch:{...s,project_layouts:Dh(s.project_layouts??{},e.project_layouts,{[a]:o})}}}function kh(e,t){let n=e.project_layouts,r=[...t.filter(e=>e in n),...Object.keys(n).filter(e=>!t.includes(e))].map(e=>n[e]);return{layout_mode:`profile`,project_layouts:{},layout_tree:sh(r.map(e=>e.layout_tree).filter(e=>e!==null)),active_session:r.map(e=>e.active_session).find(e=>e!==null)??null,layout_ref:null}}function Ah(e,t){let n=null,r=null,i=(...i)=>{r=i,n&&clearTimeout(n),n=setTimeout(()=>{n=null;let t=r;r=null,e(...t)},t)};return i.flush=()=>{if(!n)return;clearTimeout(n),n=null;let t=r;r=null,e(...t)},i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i.pending=()=>n!==null,i}var jh=2e3,Mh=u.parse({});function Nh(e){return`puddle.ws.${e}`}function Ph(e){if(e===null)return{kind:`absent`};try{return{kind:`present`,snapshot:u.parse(JSON.parse(e))}}catch{return{kind:`corrupt`}}}function Fh(){let e=K(),[t,n]=(0,k.useState)(!1),[r,i]=(0,k.useState)(Mh),a=(0,k.useRef)(r);a.current=r;let o=(0,k.useRef)(null),s=(0,k.useMemo)(()=>Ah((e,t)=>{dc(e,t).catch(e=>console.warn(`ui-state save failed: ${e.message}`))},jh),[]);return(0,k.useEffect)(()=>{if(e===null){o.current=null;return}let t=Nh(e);o.current=t;let r=!1;n(!1),i(Mh);let a;try{a=Ph(sessionStorage.getItem(t)),a.kind===`corrupt`&&sessionStorage.removeItem(t)}catch(e){console.warn(`ui-state read failed: ${e.message}`),a={kind:`absent`}}return a.kind===`present`?(i(a.snapshot),n(!0)):uc(e).then(e=>{r||(e&&i(e.ui_state),n(!0))}).catch(e=>{console.warn(`ui-state load failed: ${e.message}`),r||n(!0)}),()=>{r=!0,s.flush()}},[e,s]),{loaded:t,snapshot:r,current:()=>a.current,update(t){if(e===null)return;let n={...a.current,...t};a.current=n,i(n);let r=o.current??Nh(e);s(e,n);try{sessionStorage.setItem(r,JSON.stringify(n))}catch(e){console.warn(`ui-state write failed: ${e.message}`)}}}}var Ih=u.parse({});function Lh(e,t){let[n,r]=(0,k.useState)(null),i=Ss(t).data,a=_s(e??void 0,t&&e!==null).data;return(0,k.useEffect)(()=>{if(!t||e===null){r(null);return}let n=!1,i;try{i=Ph(sessionStorage.getItem(Nh(e)))}catch{i={kind:`absent`}}if(i.kind===`present`){r(i.snapshot);return}return uc(e).then(e=>{n||r(e?e.ui_state:Ih)}).catch(()=>{n||r(Ih)}),()=>{n=!0}},[t,e]),(0,k.useMemo)(()=>{if(!t||e===null||n===null)return null;let o=t=>{if(!i||!a)return!1;let{patch:o,projectBased:s}=Oh(n,t,{alive:new Set(i.filter(e=>e.status!==`archived`).map(e=>e.id)),sessionProject:new Map(i.map(e=>[e.id,e.project_id])),projectIds:a.map(e=>e.id),currentProject:null}),c={...n,...o};r(c),dc(e,c).catch(e=>console.warn(`ui-state save failed: ${e.message}`));try{sessionStorage.setItem(Nh(e),JSON.stringify(c))}catch(e){console.warn(`ui-state write failed: ${e.message}`)}return Wo().projectBasedLayout!==s&&Go({projectBasedLayout:s}),!0},s=Object.fromEntries(Object.entries(n.project_layouts).map(([e,t])=>[e,{layoutRef:t.layout_ref,signature:lh(t.layout_tree)}]));return(n.layout_mode??`profile`)===`project`?{headless:!0,scope:`project`,projectId:``,layoutRef:null,signature:lh(null),slices:s,capture:()=>({layout_tree:null,active_session:null}),apply:o}:{scope:`profile`,projectId:``,layoutRef:n.layout_ref,signature:lh(n.layout_tree),slices:s,capture:()=>({layout_tree:n.layout_tree,active_session:n.active_session}),apply:o}},[t,e,n,i,a])}var Rh=lh(null);function zh(){let e=vh(),t=Fr(),n=K(),r=bh(),i=Lh(n,e&&r===null),a=r??i,o=Zs(n??void 0,void 0).data??[],s=_s(n??void 0,e&&n!==null).data??[],c=Qs(),u=$s(),d=ec(),[f,p]=(0,k.useState)(``),[m,h]=(0,k.useState)(!1),[g,_]=(0,k.useState)(null);(0,k.useEffect)(()=>mu(`layouts.toggle`,_h),[]),(0,k.useEffect)(()=>{e||(p(``),h(!1),_(null))},[e]);let v=a?.headless===!0,y=a===null||v?null:o.find(e=>e.id===a.layoutRef)??null,b=a!==null&&!v&&(y===null?a.signature!==Rh:lh(y.layout_tree)!==a.signature),x=e=>{let t=a?.slices?.[e];if(!t)return!1;let n=t.layoutRef===null?null:o.find(e=>e.id===t.layoutRef)??null;return n?lh(n.layout_tree)!==t.signature:t.signature!==Rh},S=e=>a===null?!1:e.scope===`profile`?a.scope===`profile`&&b:e.project_id===null?!1:a.scope===`project`?!v&&e.project_id===a.projectId?b:x(e.project_id):b||x(e.project_id),ee=e=>y!==null&&e.id===y.id,C=e=>(e===null?void 0:s.find(t=>t.id===e)?.name)??`Project`,te=a!==null&&!v&&a.scope===`project`?o.filter(e=>e.scope===`profile`||e.project_id===a.projectId):o,ne=[...te.some(e=>e.scope===`profile`)?[{key:`profile`,name:`Profile-wide`}]:[],...[...new Set(te.flatMap(e=>e.project_id===null?[]:[e.project_id]))].map(e=>({key:e,name:C(e)})).sort((e,t)=>e.name.localeCompare(t.name))],re=g===null?te:g===`profile`?te.filter(e=>e.scope===`profile`):te.filter(e=>e.project_id===g),ie=e=>a!==null&&e.scope===a.scope&&(a.scope===`profile`||e.project_id===a.projectId),ae=(e,t,r)=>{!a||!n||c.mutate({profile_id:n,scope:a.scope,project_id:a.scope===`project`?a.projectId:void 0,name:e,...t},{onSuccess:e=>{r&&a.apply(e)},onError:e=>ye(e)})},se=e=>{if(!a)return;let t=ie(e)?e:o.find(t=>t.name===e.name&&ie(t));if(!t){ae(e.name,a.capture(),!0);return}u.mutate({id:t.id,...a.capture()},{onSuccess:e=>a.apply(e),onError:e=>ye(e)})},ce=(e,t)=>ae(t,{layout_tree:e.layout_tree,active_session:e.active_session},!1),le=e=>{if(a){if(!a.apply(e)){l.error(`Workspace is still loading — try again in a moment`);return}e.project_id!==null&&e.project_id!==a.projectId&&t(`/project/${e.project_id}`),gh(!1)}};return(0,A.jsxs)(Jf,{open:e,onOpenChange:gh,children:[(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsx)(Yf,{asChild:!0,children:(0,A.jsxs)(oe,{variant:`ghost`,size:`icon`,className:`compact:h-7 compact:w-7`,children:[(0,A.jsx)(Qc,{}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Layouts`})]})})}),(0,A.jsx)(jo,{children:`Layouts`})]}),(0,A.jsxs)(Xf,{className:`w-[26rem] max-w-[calc(100vw-1rem)] p-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-5 pb-2 pt-4`,children:[(0,A.jsx)(`span`,{className:`text-2xs font-medium uppercase tracking-wide text-fg-gold`,children:`Layouts`}),a!==null&&!v&&(0,A.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:`ml-auto flex items-center rounded-md p-1 text-fg-gold transition-colors hover:bg-surface hover:text-fg`,children:[(0,A.jsx)(H,{className:`size-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Save the current layout as a new layout`})]})]}),a===null?(0,A.jsx)(`p`,{className:`px-5 pb-3 text-sm text-fg-muted`,children:`Loading the profile’s layout state…`}):v?(0,A.jsx)(`p`,{className:`px-5 pb-3 text-sm text-fg-muted`,children:`Project-based layout is on — every project keeps its own layout. Open a project to name or save it; loading works from here.`}):(y===null||m)&&(0,A.jsxs)(`div`,{className:`flex flex-col gap-2 px-5 pb-3`,children:[y===null&&(0,A.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,A.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:`Unnamed layout`}),(0,A.jsx)(`span`,{className:`text-2xs uppercase tracking-wide text-fg-muted`,children:a.scope===`profile`?`Profile-wide`:`Project`}),(0,A.jsx)(`span`,{className:`ml-auto text-2xs text-interrupted`,children:`Unsaved`})]}),(0,A.jsxs)(`form`,{className:`flex items-center gap-1.5`,onSubmit:e=>{e.preventDefault();let t=f.trim();t&&(ae(t,a.capture(),!0),p(``),h(!1))},children:[(0,A.jsx)(Te,{autoFocus:m,value:f,placeholder:y===null?`Name this layout…`:`Save as a new layout…`,spellCheck:!1,onChange:e=>p(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&h(!1)},className:`h-8 flex-1 text-sm`}),(0,A.jsx)(oe,{size:`sm`,type:`submit`,disabled:!f.trim(),children:`Save`}),y!==null&&(0,A.jsx)(oe,{variant:`ghost`,size:`sm`,onClick:()=>h(!1),children:`Cancel`})]})]}),ne.length>1&&(0,A.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 px-5 pb-2`,children:ne.map(e=>(0,A.jsx)(Hh,{active:g===e.key,onClick:()=>_(t=>t===e.key?null:e.key),children:e.name},e.key))}),(0,A.jsxs)(`div`,{className:`no-scrollbar max-h-[60vh] overflow-y-auto px-2 pb-3`,children:[re.length===0&&(0,A.jsx)(`p`,{className:`px-3 py-3 text-sm text-fg-muted`,children:g===null?`No layouts yet — name and save the current layout to keep it.`:`Nothing matches this filter.`}),(0,A.jsx)(`ul`,{className:`flex flex-col`,children:re.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(Bh,{layout:e,projectLabel:e.scope===`profile`?null:C(e.project_id),isCurrent:ee(e),dirty:b,loadable:a!==null,savable:a!==null&&!v,confirmBeforeLoad:S(e),overwrites:ie(e),onLoad:()=>le(e),onRename:t=>u.mutate({id:e.id,name:t}),onDelete:()=>d.mutate(e.id),onSaveAs:()=>se(e),onDuplicate:t=>ce(e,t)})},e.id))})]})]})]})}function Bh({layout:e,projectLabel:t,isCurrent:n,dirty:r,loadable:i,savable:a,confirmBeforeLoad:o,overwrites:s,onLoad:c,onRename:l,onDelete:u,onSaveAs:d,onDuplicate:f}){let[p,m]=(0,k.useState)(null),[h,g]=(0,k.useState)(null),[_,v]=(0,k.useState)(e.name),y=()=>{if(!(!i||h!==null)){if(o&&p!==`load`){m(`load`);return}m(null),c()}},b=t=>{m(null),v(t===`rename`?e.name:`${e.name} copy`),g(t)},x=()=>{if(n){d();return}m(`save`)},S=n?r?`unsaved`:`active`:null;return(0,A.jsxs)(`div`,{onClick:e=>{e.target.closest(`button, input`)||y()},className:D(`rounded-md px-3 py-2.5 transition-colors`,i&&`cursor-pointer hover:bg-surface`),children:[h===null?(0,A.jsxs)(`p`,{className:D(`flex items-baseline gap-2 text-sm font-medium`,S===`active`?`text-success`:S===`unsaved`?`text-interrupted`:`text-fg`),children:[e.name,S!==null&&(0,A.jsx)(`span`,{className:`text-2xs font-normal`,children:S===`active`?`Active`:`Unsaved`})]}):(0,A.jsxs)(`form`,{className:`flex items-center gap-1.5`,onSubmit:t=>{t.preventDefault();let n=_.trim();n&&(h===`rename`?n!==e.name&&l(n):f(n)),g(null)},children:[(0,A.jsx)(Te,{autoFocus:!0,value:_,spellCheck:!1,onChange:e=>v(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&g(null)},className:`h-7 flex-1 text-sm`}),(0,A.jsx)(oe,{size:`sm`,type:`submit`,disabled:!_.trim(),children:h===`rename`?`Rename`:`Save`})]}),p===`save`?(0,A.jsx)(Vh,{question:s?`Overwrite “${e.name}” with the current layout?`:`Save the current layout as “${e.name}” here?`,verb:s?`Overwrite`:`Save`,onConfirm:()=>{m(null),d()},onCancel:()=>m(null)}):p===`delete`?(0,A.jsx)(Vh,{question:`Delete this layout? This can’t be undone.`,verb:`Delete`,onConfirm:()=>{m(null),u()},onCancel:()=>m(null)}):p===`load`?(0,A.jsx)(Vh,{question:`Loading discards unsaved layout changes.`,verb:`Load`,onConfirm:y,onCancel:()=>m(null)}):(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-1.5`,children:[t!==null&&(0,A.jsx)(`span`,{className:`text-2xs uppercase tracking-wide text-fg-muted`,children:t}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[a&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Uh,{icon:_l,label:n?`Save`:`Save the current layout as “${e.name}”`,onClick:x}),(0,A.jsx)(Uh,{icon:Ac,label:`Duplicate`,onClick:()=>b(`duplicate`)})]}),(0,A.jsx)(Uh,{icon:De,label:`Rename`,onClick:()=>b(`rename`)}),(0,A.jsx)(Uh,{icon:jl,label:`Delete`,onClick:()=>m(`delete`)})]})]})]})}function Vh({question:e,verb:t,onConfirm:n,onCancel:r}){return(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-2xs text-fg-muted`,children:e}),(0,A.jsx)(`button`,{type:`button`,onClick:n,className:`text-2xs font-medium text-interrupted transition-colors hover:underline`,children:t}),(0,A.jsx)(`button`,{type:`button`,onClick:r,className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:`Cancel`})]})}function Hh({active:e,onClick:t,children:n}){return(0,A.jsx)(`button`,{type:`button`,"aria-pressed":e,onClick:t,className:D(`rounded-full px-2 py-0.5 text-2xs transition-colors`,e?`bg-action text-action-ink`:`bg-surface text-fg-secondary hover:text-fg`),children:n})}function Uh({icon:e,label:t,onClick:n}){return(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsxs)(`button`,{type:`button`,onClick:n,className:`rounded-md p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg`,children:[(0,A.jsx)(e,{className:`size-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:t})]})}),(0,A.jsx)(jo,{children:t})]})}var Wh=tu()!==void 0&&/Mac/.test(navigator.platform),Gh=(0,k.lazy)(()=>o(()=>import(`./SettingsDialog-CNrX86pI.js`).then(e=>({default:e.SettingsDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])));function Kh(){let e=j();(0,k.useEffect)(()=>{let t=t=>{for(let[n,r]of e.getQueriesData({queryKey:[`sessions`]}))r&&e.setQueryData(n,r.map(t));for(let[n,r]of e.getQueriesData({queryKey:[`project`]}))r&&e.setQueryData(n,{...r,sessions:r.sessions.map(t)})},n=Bu.onStatus(e=>t(t=>t.id===e.session?{...t,status:e.status,last_activity_at:e.last_activity_at}:t)),r=Bu.onRenamed(e=>t(t=>t.id===e.session?{...t,title:e.title,agent_title:`agent_title`in e?e.agent_title:t.agent_title,osc_title:`osc_title`in e?e.osc_title:t.osc_title}:t)),i=Bu.onAccount(t=>{for(let[n,r]of e.getQueriesData({queryKey:[`accounts`]}))r&&e.setQueryData(n,r.map(e=>e.id===t.account_id?{...e,logged_in:t.logged_in}:e))}),a=t=>{e.invalidateQueries({queryKey:[`sessions`]});for(let n of t)e.invalidateQueries({queryKey:[`project`,n]})},o=Bu.onSessionsChanged(e=>a(e.project_ids)),s=Bu.onSessionSwitched(e=>a([e.target_project]));return()=>{n(),r(),i(),o(),s()}},[e])}function qh(){let e=js(),t=lc(),[n,r]=(0,k.useState)(!1),i=Ms(e.data),a=n=>{r(!1);let a=n.trim();a!==i&&t.mutate({displayName:a===e.data?.hostname?``:a},{onError:e=>ye(e)})},o=!Wh&&(0,A.jsx)(`img`,{src:`/puddle.svg`,alt:`Puddle`,className:`size-4`}),s=D(`flex shrink-0 items-center gap-2`,Wh&&`[-webkit-app-region:no-drag]`),c=`truncate text-sm font-semibold text-fg-secondary`;return n&&i!==void 0?(0,A.jsxs)(`div`,{className:s,children:[o,(0,A.jsx)(Ul,{initial:e.data?.displayName??i,maxLength:64,className:D(c,`w-40`),onCommit:a,onCancel:()=>r(!1)})]}):(0,A.jsxs)(Qi,{to:`/`,className:D(s,`transition-opacity hover:opacity-70`),title:`All projects`,children:[o,i!==void 0&&(0,A.jsx)(`span`,{className:c,...Wl(()=>r(!0)),children:i})]})}function Jh(){let e=zr(),t=Tu(`palette.toggle`),n=vs(e.id).data?.project,r=n!==void 0&&n.id===e.id?n.name:void 0;return(0,A.jsxs)(`button`,{type:`button`,onClick:J,className:D(`absolute left-1/2 flex h-6 w-[min(30rem,42%)] -translate-x-1/2 items-center justify-center gap-2 rounded-md bg-ground text-fg-muted transition-colors hover:bg-elevated hover:text-fg-secondary`,Wh&&`[-webkit-app-region:no-drag]`),children:[(0,A.jsx)(`span`,{className:`truncate text-xs`,children:r??`Puddle`}),(0,A.jsx)(`span`,{className:`text-2xs`,children:t})]})}function Yh(){let{fullScreen:e,animate:t}=nu();return(0,A.jsxs)(`header`,{className:D(`relative flex h-9 shrink-0 items-center gap-3 bg-surface pl-3 pr-3`,Wh&&!e&&`pl-[88px] [-webkit-app-region:drag]`,t&&`transition-[padding] duration-200 ease-out`),children:[(0,A.jsx)(qh,{}),(0,A.jsx)(Jh,{}),(0,A.jsxs)(`div`,{className:D(`ml-auto flex items-center`,Wh&&`[-webkit-app-region:no-drag]`),children:[(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsxs)(oe,{variant:`ghost`,size:`icon`,className:`compact:h-7 compact:w-7`,onClick:()=>$l(),children:[(0,A.jsx)(bl,{}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Settings`})]})}),(0,A.jsx)(jo,{children:`Settings`})]}),(0,A.jsx)(zh,{}),(0,A.jsx)(cm,{}),(0,A.jsx)(ap,{})]})]})}function Xh(){Kh(),xp(),Op();let{handler:e}=ep(),t=K(),{pathname:n}=Nr(),[r,i]=(0,k.useState)(!1),a=As(),o=a.data!==void 0&&Iu(a.data.protocol);return(0,k.useEffect)(()=>{if(!o)return;let e=()=>{let e=ja();Bu.reportTheme(e(`--text-primary`),e(`--bg-base`))};return e(),ka(e)},[o]),(0,A.jsxs)(`div`,{className:`flex h-screen flex-col bg-ground`,children:[(0,A.jsx)(Yh,{}),(0,A.jsx)(`main`,{className:`min-h-0 flex-1`,children:(0,A.jsx)(_a,{resetOn:n,scope:n.startsWith(`/project/`)?`workspace`:`view`,children:(0,A.jsx)(li,{})})}),(0,A.jsx)(_f,{}),(0,A.jsx)(sp,{}),(0,A.jsx)(ff,{onNewSession:e??void 0,onNewProject:()=>i(!0)}),t!==null&&(0,A.jsx)(Ju,{profileId:t,open:r,onOpenChange:i}),(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(Gh,{})}),(0,A.jsx)(hf,{})]})}function Zh(){return(0,A.jsx)($f,{children:(0,A.jsx)(Xh,{})})}var Qh=(0,k.lazy)(()=>o(()=>import(`./Dashboard-BM1e1IRo.js`).then(e=>({default:e.Dashboard})),__vite__mapDeps([12,1,2,3,4,5,6,7,8,13,11]))),$h=(0,k.lazy)(()=>o(()=>import(`./Workspace-CG6XSaGb.js`).then(e=>({default:e.Workspace})),__vite__mapDeps([14,1,2,3,15,4,8,5,6,7,13,11,16,9,10,17,18]))),eg=new qt({defaultOptions:{queries:{retry:1,staleTime:5e3}},mutationCache:new Ut({onError:e=>ye(e)})});function tg(){let e=K(),t=fs(),n=e!==null&&t.data!==void 0&&!t.data.some(t=>t.id===e);return e===null||n?(0,A.jsx)(Hl,{}):(0,A.jsx)(Xi,{useTransitions:!1,children:(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(fi,{children:(0,A.jsxs)(ui,{element:(0,A.jsx)(Zh,{}),children:[(0,A.jsx)(ui,{path:`/`,element:(0,A.jsx)(Qh,{})}),(0,A.jsx)(ui,{path:`/project/:id`,element:(0,A.jsx)($h,{})}),(0,A.jsx)(ui,{path:`/project/:id/session/:sid`,element:(0,A.jsx)($h,{})})]})})})})}function ng(){let e=(0,k.useSyncExternalStore)(c.subscribe,c.get);return(0,A.jsx)(Yt,{client:eg,children:(0,A.jsxs)(Oo,{delayDuration:300,children:[(0,A.jsx)(cs,{}),(0,A.jsx)(_a,{scope:`app`,children:e?(0,A.jsx)(tg,{}):(0,A.jsx)(Mo,{})}),(0,A.jsx)(Ba,{})]})})}function rg(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}function ig(e){return e.replace(/[%#? ]/g,e=>encodeURIComponent(e))}function ag(e,t,n){let r=rg(t);return n?`${e}://vscode-remote/ssh-remote+${ig(n)}${r}`:`${e}://file${r}`}function og(e,t){return e.trim()||t||null}var sg=s(`puddle.host`);function cg(){return og(Wo().editorLinkSshHost,sg.get())}function lg(e){return new URLSearchParams(e).get(`host`)?.trim()||null}function ug(e,t,n){return lg(e)||(/[#&]token=/.test(t)?null:n)}function dg(){let e=ug(window.location.search,window.location.hash,sg.get());if(sg.set(e),lg(window.location.search)!==null){let e=new URL(window.location.href);e.searchParams.delete(`host`),history.replaceState(null,``,e)}}Oa(),Ko(),dg(),_(),(0,ga.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(ng,{}));export{lp as $,Va as $n,Zc as $t,oh as A,ps as An,hu as At,mm as B,rc as Bn,G as Bt,Dm as C,ic as Cn,Au as Ct,Sm as D,Fs as Dn,cu as Dt,Qm as E,Is as En,wu as Et,Ym as F,cc as Fn,eu as Ft,om as G,ds as Gn,Rl as Gt,_m as H,fc as Hn,W as Ht,th as I,Ts as In,$l as It,Np as J,qo as Jn,El as Jt,Xp as K,Wo as Kn,Il as Kt,$ as L,Es as Ln,Ql as Lt,rh as M,vs as Mn,mu as Mt,$m as N,_s as Nn,su as Nt,qm as O,Ks as On,fu as Ot,Gm as P,Ds as Pn,Tu as Pt,bp as Q,Ao as Qn,sl as Qt,Wm as R,gs as Rn,J as Rt,wm as S,Vs as Sn,Nu as St,Tm as T,lc as Tn,ru as Tt,fm as U,bs as Un,U as Ut,hm as V,pc as Vn,K as Vt,dm as W,sc as Wn,zl as Wt,_p as X,ko as Xn,ml as Xt,Sp as Y,B as Yn,vl as Yt,yp as Z,jo as Zn,H as Zt,ah as _,Rs as _n,Ou as _t,Ah as a,ms as an,Pa as ar,Xf as at,jm as b,ac as bn,Mu as bt,Ch as c,oc as cn,Fr as cr,uf as ct,kh as d,Bs as dn,M as dr,Wu as dt,V as en,Da as er,hp as et,yh as f,Js as fn,ln as fr,Uu as ft,Em as g,Os as gn,kt as gr,ku as gt,Hm as h,zs as hn,Ot as hr,ju as ht,Fh as i,ys as in,Ta as ir,Jf as it,Zm as j,fs as jn,Cu as jt,Jm as k,Us as kn,gu as kt,Th as l,mc as ln,zr as lr,tf as lt,Um as m,As as mn,Pt as mr,Bu as mt,cg as n,bc as nn,za as nr,ep as nt,Oh as o,Ns as on,Ia as or,Yf as ot,lh as p,nc as pn,j as pr,Hu as pt,Pp as q,Go as qn,jl as qt,sg as r,Ms as rn,ka as rr,Zf as rt,Dh as s,Ss as sn,Qi as sr,df as st,ag as t,Mc as tn,ja as tr,mp as tt,Eh as u,ws as un,N as ur,Ju as ut,ch as v,ks as vn,Pu as vt,nh as w,Ls as wn,iu as wt,zm as x,js as xn,Fu as xt,Vm as y,Ws as yn,Iu as yt,gm as z,qs as zn,Ul as zt};
|
|
10
|
+
`).replace(Md,``)}function Pd(e,t){return t=Nd(t),Nd(e)===t}function Z(e,t,n,r,i,a){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Qt(e,``+r);break;case`className`:zt(e,`class`,r);break;case`tabIndex`:zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:zt(e,n,r);break;case`style`:tn(e,r,a);break;case`data`:if(t!==`object`){zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof a==`function`&&(n===`formAction`?(t!==`input`&&Z(e,t,`name`,i.name,i,null),Z(e,t,`formEncType`,i.formEncType,i,null),Z(e,t,`formMethod`,i.formMethod,i,null),Z(e,t,`formTarget`,i.formTarget,i,null)):(Z(e,t,`encType`,i.encType,i,null),Z(e,t,`method`,i.method,i,null),Z(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=on(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:X(`beforetoggle`,e),X(`toggle`,e),Rt(e,`popover`,r);break;case`xlinkActuate`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Bt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Bt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Rt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=rn.get(n)||n,Rt(e,n,r))}}function Fd(e,t,n,r,i,a){switch(n){case`style`:tn(e,r,a);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Qt(e,``+r);break;case`onScroll`:r!=null&&X(`scroll`,e);break;case`onScrollEnd`:r!=null&&X(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!jt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),a=e[vt]||null,a=a==null?null:a[n],typeof a==`function`&&e.removeEventListener(t,a,i),typeof r==`function`)){typeof a!=`function`&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Rt(e,n,r)}}}function Q(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:X(`error`,e),X(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:Z(e,t,a,s,n,null)}}i&&Z(e,t,`srcSet`,n.srcSet,n,null),r&&Z(e,t,`src`,n.src,n,null);return;case`input`:X(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:Z(e,t,r,d,n,null)}}Jt(e,a,c,l,u,s,i,!1);return;case`select`:for(i in X(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Z(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&Yt(e,!!r,n,!0):Yt(e,!!r,t,!1);return;case`textarea`:for(s in X(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:Z(e,t,s,c,n,null)}Zt(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Z(e,t,l,r,n,null)}return;case`dialog`:X(`beforetoggle`,e),X(`toggle`,e),X(`cancel`,e),X(`close`,e);break;case`iframe`:case`object`:X(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)X(yd[r],e);break;case`image`:X(`error`,e),X(`load`,e);break;case`details`:X(`toggle`,e);break;case`embed`:case`source`:case`link`:X(`error`,e),X(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:Z(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Z(e,t,c,r,n,null))}function Id(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Z(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:a=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&Z(e,t,p,m,r,f)}}A(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||Z(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:p=a;break;case`defaultValue`:c=a;break;case`multiple`:s=a;default:a!==l&&Z(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Yt(e,!!n,n?[]:``,!1):Yt(e,!!n,t,!0)):Yt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Z(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&Z(e,t,s,i,r,a)}Xt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Z(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Z(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Z(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:Z(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Z(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Z(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ld(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Ud(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Wd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e===Gd?!1:(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&mf(e.ownerDocument.body);n=i}while(n);Pp(t)}function ef(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:tf(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pf(e,t,n){switch(t=Vd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vf=T.d;T.d={f:yf,r:bf,D:Cf,C:wf,L:Tf,m:Ef,X:Of,S:Df,M:kf};function yf(){var e=vf.f(),t=Su();return e||t}function bf(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):vf.r(e)}var xf=typeof document>`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=k(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Q(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+k(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+k(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+k(n.imageSizes)+`"]`)):i+=`[href="`+k(e)+`"]`;var a=i;switch(t){case`style`:a=jf(e);break;case`script`:a=Ff(e)}hf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Mf(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Q(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+k(r)+`"][href="`+k(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!hf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Q(r,`link`,e),kt(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=Ot(r).hoistableStyles,a=jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Mf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);kt(c),Q(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=Ot(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),kt(a),Q(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=Ot(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),kt(a),Q(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t,n,r){var i=(i=ve.current)?_f(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=jf(n.href),n=Ot(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var a=Ot(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Mf(e)))&&!a._p&&(s.instance=a,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),a||Pf(i,e,n,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=Ot(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function jf(e){return`href="`+k(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Q(t,`link`,n),kt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+k(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+k(n.href)+`"]`);if(r)return t.instance=r,kt(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),kt(r),Q(r,`style`,i),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=jf(n.href);var a=e.querySelector(Mf(i));if(a)return t.state.loading|=4,t.instance=a,kt(a),a;r=Nf(n),(i=hf.get(i))&&zf(r,i),a=(e.ownerDocument||e).createElement(`link`),kt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Q(a,`link`,r),t.state.loading|=4,Rf(a,n.precedence,e),t.instance=a;case`script`:return a=Ff(n.src),(i=e.querySelector(If(a)))?(t.instance=i,kt(i),i):(r=n,(i=hf.get(a))&&(r=m({},n),Bf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),kt(i),Q(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Vf=null;function Hf(e,t,n){if(Vf===null){var r=new Map,i=Vf=new Map;i.set(n,r)}else i=Vf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Uf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Wf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=jf(r.href),a=t.querySelector(Mf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,kt(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),kt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Q(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Yf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var $f={$$typeof:S,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function ep(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function tp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ep(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=fi(3,null,null,t),e.current=a,a.stateNode=e,t=da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Wa(a),e}function np(e){return e?(e=ui,e):ui}function rp(e,t,n,r,i,a){i=np(i),r.context===null?r.context=i:r.pendingContext=i,r=Ka(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=qa(e,r,t),n!==null&&(_u(n,e,t),Ja(n,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ap(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=si(e,67108864);t!==null&&_u(t,e,67108864),ap(e,67108864)}}function sp(e){if(e.tag===13||e.tag===31){var t=hu();t=ft(t);var n=si(e,t);n!==null&&_u(n,e,t),ap(e,t)}}var cp=!0;function lp(e,t,n,r){var i=w.T;w.T=null;var a=T.p;try{T.p=2,dp(e,t,n,r)}finally{T.p=a,w.T=i}}function up(e,t,n,r){var i=w.T;w.T=null;var a=T.p;try{T.p=8,dp(e,t,n,r)}finally{T.p=a,w.T=i}}function dp(e,t,n,r){if(cp){var i=fp(r);if(i===null)Ed(e,t,r,pp,n),wp(e,r);else if(Ep(i,e,t,n,r))r.stopPropagation();else if(wp(e,r),t&4&&-1<Cp.indexOf(e)){for(;i!==null;){var a=Et(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}ad(a),!(U&6)&&(ru=Ie()+500,od(0,!1))}}break;case 31:case 13:s=si(a,2),s!==null&&_u(s,a,2),Su(),ap(a,2)}if(a=fp(r),a===null&&Ed(e,t,r,pp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ed(e,t,r,null,n)}}function fp(e){return e=ln(e),mp(e)}var pp=null;function mp(e){if(pp=null,e=Tt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pp=e,null}function hp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var gp=!1,_p=null,vp=null,yp=null,bp=new Map,xp=new Map,Sp=[],Cp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function wp(e,t){switch(e){case`focusin`:case`focusout`:_p=null;break;case`dragenter`:case`dragleave`:vp=null;break;case`mouseover`:case`mouseout`:yp=null;break;case`pointerover`:case`pointerout`:bp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:xp.delete(t.pointerId)}}function Tp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Et(t),t!==null&&op(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ep(e,t,n,r,i){switch(t){case`focusin`:return _p=Tp(_p,e,t,n,r,i),!0;case`dragenter`:return vp=Tp(vp,e,t,n,r,i),!0;case`mouseover`:return yp=Tp(yp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return bp.set(a,Tp(bp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,xp.set(a,Tp(xp.get(a)||null,e,t,n,r,i)),!0}return!1}function Dp(e){var t=Tt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,ht(e.priority,function(){sp(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,ht(e.priority,function(){sp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Op(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=Et(n),t!==null&&op(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Op(e)&&n.delete(t)}function Ap(){gp=!1,_p!==null&&Op(_p)&&(_p=null),vp!==null&&Op(vp)&&(vp=null),yp!==null&&Op(yp)&&(yp=null),bp.forEach(kp),xp.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,gp||(gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(mp(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Pp(e){function t(t){return jp(t,e)}_p!==null&&jp(_p,e),vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp.forEach(t),xp.forEach(t);for(var n=0;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sp.length&&(n=Sp[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(mp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;rp(n,hu(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rp(e.current,2,null,e,null,null),Su(),t[O]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sp.length&&t!==0&&t<Sp[n].priority;n++);Sp.splice(n,0,e),n===0&&Dp(e)}};var Rp=r.version;if(Rp!==`19.2.7`)throw Error(o(527,Rp,`19.2.7`));T.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:w,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{Ge=Bp.inject(zp),Ke=Bp}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(o(299));var n=!1,r=``,i=Xs,a=Zs,c=Qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=tp(e,1,!1,null,null,n,r,null,i,a,c,Fp),e[O]=t.current,wd(e),new Ip(t)}})),Le=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ie()})),Re=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ze=new class extends Re{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Be={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ve=new class{#e=Be;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function He(e){setTimeout(e,0)}var Ue=typeof window>`u`||`Deno`in globalThis;function We(){}function Ge(e,t){return typeof e==`function`?e(t):e}function Ke(e){return typeof e==`number`&&e>=0&&e!==1/0}function qe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Je(e,t){return typeof e==`function`?e(t):e}function Ye(e,t){return typeof e==`function`?e(t):e}function Xe(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Qe(o,t.options))return!1}else if(!et(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ze(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if($e(t.options.mutationKey)!==$e(a))return!1}else if(!et(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Qe(e,t){return(t?.queryKeyHashFn||$e)(e)}function $e(e){return JSON.stringify(e,(e,t)=>at(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function et(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>et(e[n],t[n])):!1}var tt=Object.prototype.hasOwnProperty;function nt(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=it(e)&&it(t);if(!r&&!(at(e)&&at(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:tt.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=nt(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function rt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function it(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function at(e){if(!ot(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ot(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ot(e){return Object.prototype.toString.call(e)===`[object Object]`}function st(e){return new Promise(t=>{Ve.setTimeout(t,e)})}function ct(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:nt(e,t)}function lt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ut(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var dt=Symbol();function ft(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===dt?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function pt(e,t){return typeof e==`function`?e(...t):!!e}function mt(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ht=(()=>{let e=()=>Ue;return{isServer(){return e()},setIsServer(t){e=t}}})();function gt(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var _t=He;function vt(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=_t,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var O=vt(),yt=new class extends Re{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function bt(e){return Math.min(1e3*2**e,3e4)}function xt(e){return(e??`online`)!==`online`||yt.isOnline()}var St=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ct(e){let t=!1,n=0,r,i=gt(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new St(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ze.isFocused()&&(e.networkMode===`always`||yt.isOnline())&&e.canRun(),u=()=>xt(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ht.isServer()?0:3),o=e.retryDelay??bt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),st(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var wt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ke(this.gcTime)&&(this.#e=Ve.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ht.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Ve.clearTimeout(this.#e),this.#e=void 0)}};function Tt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{mt(e,()=>t.signal,()=>n=!0)},u=ft(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ut:lt;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Dt:Et,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Et(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Et(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Dt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ot(e,t){return t?Et(e,t)!=null:!1}function kt(e,t){return!t||!e.getPreviousPageParam?!1:Dt(e,t)!=null}var At=class extends wt{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Nt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Nt(this.options);e.data!==void 0&&(this.setState(Mt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ct(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(We).catch(We):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ye(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dt||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Je(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!qe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ft(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Tt(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ct({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof St&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof St){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...jt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Mt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),O.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function jt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Mt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Nt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Pt=class extends Re{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=gt(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),It(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Lt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Lt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Ye(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!rt(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Rt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Ye(this.options.enabled,this.#t)!==Ye(t.enabled,this.#t)||Je(this.options.staleTime,this.#t)!==Je(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Ye(this.options.enabled,this.#t)!==Ye(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Bt(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(We)),t}#g(){this.#b();let e=Je(this.options.staleTime,this.#t);if(ht.isServer()||this.#r.isStale||!Ke(e))return;let t=qe(this.#r.dataUpdatedAt,e)+1;this.#d=Ve.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(ht.isServer()||Ye(this.options.enabled,this.#t)===!1||!Ke(this.#p)||this.#p===0)&&(this.#f=Ve.setInterval(()=>{(this.options.refetchIntervalInBackground||ze.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Ve.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Ve.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&It(e,t),o=i&&Rt(e,n,t,r);(a||o)&&(l={...l,...jt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=ct(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=ct(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:zt(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Ye(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=gt();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!rt(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){O.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ft(e,t){return Ye(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&Ye(t.retryOnMount,e)===!1)}function It(e,t){return Ft(e,t)||e.state.data!==void 0&&Lt(e,t,t.refetchOnMount)}function Lt(e,t,n){if(Ye(t.enabled,e)!==!1&&Je(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&zt(e,t)}return!1}function Rt(e,t,n,r){return(e!==t||Ye(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&zt(e,n)}function zt(e,t){return Ye(t.enabled,e)!==!1&&e.isStaleByTime(Je(t.staleTime,e))}function Bt(e,t){return!rt(e.getCurrentResult(),t)}var Vt=class extends wt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ht(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ct({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),O.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ht(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ut=class extends Re{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Vt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Wt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Wt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){O.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ze(t,e))}findAll(e={}){return this.getAll().filter(t=>Ze(e,t))}notify(e){O.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return O.batch(()=>Promise.all(e.map(e=>e.continue().catch(We))))}};function Wt(e){return e.options.scope?.id}var Gt=class extends Re{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),rt(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&$e(t.mutationKey)!==$e(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ht();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){O.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Kt=class extends Re{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Qe(r,t),a=this.get(i);return a||(a=new At({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){O.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Xe(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Xe(e,t)):t}notify(e){O.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){O.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){O.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Kt,this.#t=e.mutationCache||new Ut,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ze.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=yt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Je(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ge(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return O.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;O.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return O.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=O.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(We).catch(We)}invalidateQueries(e,t={}){return O.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=O.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(We)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(We)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Je(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(We).catch(We)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(We).catch(We)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return yt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set($e(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{et(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set($e(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{et(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Qe(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===dt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},k=e(n(),1),A=r(),Jt=k.createContext(void 0),j=e=>{let t=k.useContext(Jt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Yt=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,A.jsx)(Jt.Provider,{value:e,children:t})),Xt=k.createContext(!1),Zt=()=>k.useContext(Xt);Xt.Provider;function Qt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $t=k.createContext(Qt()),en=()=>k.useContext($t),tn=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?pt(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},nn=e=>{k.useEffect(()=>{e.clearReset()},[e])},rn=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||pt(n,[e.error,r])),an=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},on=(e,t)=>e.isLoading&&e.isFetching&&!t,sn=(e,t)=>e?.suspense&&t.isPending,cn=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ln(e,t,n){let r=Zt(),i=en(),a=j(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,an(o),tn(o,i,s),nn(i);let l=!a.getQueryCache().get(o.queryHash),[u]=k.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(k.useSyncExternalStore(k.useCallback(e=>{let t=f?u.subscribe(O.batchCalls(e)):We;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),k.useEffect(()=>{u.setOptions(o)},[o,u]),sn(o,d))throw cn(o,u,i);if(rn({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!ht.isServer()&&on(d,r)&&(l?cn(o,u,i):s?.promise)?.catch(We).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function M(e,t){return ln(e,Pt,t)}function N(e,t){let n=j(t),[r]=k.useState(()=>new Gt(n,e));k.useEffect(()=>{r.setOptions(e)},[r,e]);let i=k.useSyncExternalStore(k.useCallback(e=>r.subscribe(O.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=k.useCallback((e,t)=>{r.mutate(e,t).catch(We)},[r]);if(i.error&&pt(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var un=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,dn=/^[\\/]{2}/;function fn(e,t){return t+e.replace(/\\/g,`/`)}var pn=`popstate`;function mn(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function hn(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return yn(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:bn(t)}return Sn(t,n,null,e)}function P(e,t){if(e===!1||e==null)throw Error(t)}function gn(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function _n(){return Math.random().toString(36).substring(2,10)}function vn(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function yn(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?xn(t):t,state:n,key:t&&t.key||r||_n(),mask:i}}function bn({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function xn(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Sn(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=mn(e)?e:yn(h.location,e,t);n&&n(r,e),l=u()+1;let d=vn(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=mn(e)?e:yn(h.location,e,t);n&&n(r,e),l=u();let i=vn(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Cn(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(pn,d),c=e,()=>{i.removeEventListener(pn,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Cn(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),P(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:bn(t);return i=i.replace(/ $/,`%20`),!n&&dn.test(i)&&(i=r+i),new URL(i,r)}function wn(e,t,n=`/`){return Tn(e,t,n,!1)}function Tn(e,t,n,r,i){let a=qn((typeof t==`string`?xn(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Dn(e),s=null,c=Kn(a);for(let e=0;s==null&&e<o.length;++e)s=Hn(o[e],c,r);return s}function En(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function Dn(e){let t=On(e);return An(t),t}function On(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;P(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=tr([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(P(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),On(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Bn(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Gn(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of kn(e.path))a(e,t,!0,n)}),t}function kn(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=kn(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function An(e){e.sort((e,t)=>e.score===t.score?Vn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var jn=/^:[\w-]+$/,Mn=/^:[\w-]+/,Nn=3.5,Pn=3,Fn=2,In=1,Ln=10,Rn=-2,zn=e=>e===`*`;function Bn(e,t){let n=e.split(`/`),r=n.length;return n.some(zn)&&(r+=Rn),t&&(r+=Fn),n.filter(e=>!zn(e)).reduce((e,t)=>e+(jn.test(t)?Pn:Mn.test(t)?Nn:t===``?In:Ln),r)}function Vn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Hn(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Wn(u,l,s.matcher,s.compiledParams):Un(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Un({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:tr([a,d.pathname]),pathnameBase:rr(tr([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=tr([a,d.pathnameBase]))}return o}function Un(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Gn(e.path,e.caseSensitive,e.end);return Wn(e,t,n,r)}function Wn(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Gn(e,t=!1,n=!0){gn(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Kn(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return gn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function qn(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Jn(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?xn(e):e,a;return n?(n=er(n),a=n.startsWith(`/`)?Yn(n.substring(1),`/`):Yn(n,t)):a=t,{pathname:a,search:ir(r),hash:ar(i)}}function Yn(e,t){let n=nr(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Xn(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Qn(e){let t=Zn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function $n(e,t,n,r=!1){let i;typeof e==`string`?i=xn(e):(i={...e},P(!i.pathname||!i.pathname.includes(`?`),Xn(`?`,`pathname`,`search`,i)),P(!i.pathname||!i.pathname.includes(`#`),Xn(`#`,`pathname`,`hash`,i)),P(!i.search||!i.search.includes(`#`),Xn(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Jn(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var er=e=>e.replace(/[\\/]{2,}/g,`/`),tr=e=>er(e.join(`/`)),nr=e=>e.replace(/\/+$/,``),rr=e=>nr(e).replace(/^\/*/,`/`),ir=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ar=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,or=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function sr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function cr(e){return tr(e.map(e=>e.route.path).filter(Boolean))||`/`}var lr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ur(e,t){let n=e;if(typeof n!=`string`||!un.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(lr)try{let e=new URL(window.location.href),r=dn.test(n)?new URL(fn(n,e.protocol)):new URL(n),a=qn(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{gn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var dr=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(dr);var fr=[`GET`,...dr];new Set(fr);var pr=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function mr(e){try{return pr.includes(new URL(e).protocol)}catch{return!1}}var hr=k.createContext(null);hr.displayName=`DataRouter`;var gr=k.createContext(null);gr.displayName=`DataRouterState`;var _r=k.createContext(!1);function vr(){return k.useContext(_r)}var yr=k.createContext({isTransitioning:!1});yr.displayName=`ViewTransition`;var br=k.createContext(new Map);br.displayName=`Fetchers`;var xr=k.createContext(null);xr.displayName=`Await`;var Sr=k.createContext(null);Sr.displayName=`Navigation`;var Cr=k.createContext(null);Cr.displayName=`Location`;var wr=k.createContext({outlet:null,matches:[],isDataRoute:!1});wr.displayName=`Route`;var Tr=k.createContext(null);Tr.displayName=`RouteError`;var Er=`REACT_ROUTER_ERROR`,Dr=`REDIRECT`,Or=`ROUTE_ERROR_RESPONSE`;function kr(e){if(e.startsWith(`${Er}:${Dr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ar(e){if(e.startsWith(`${Er}:${Or}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new or(t.status,t.statusText,t.data)}catch{}}function jr(e,{relative:t}={}){P(Mr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=k.useContext(Sr),{hash:i,pathname:a,search:o}=Br(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:tr([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Mr(){return k.useContext(Cr)!=null}function Nr(){return P(Mr(),`useLocation() may be used only in the context of a <Router> component.`),k.useContext(Cr).location}var Pr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Fr(){let{isDataRoute:e}=k.useContext(wr);return e?ai():Ir()}function Ir(){P(Mr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=k.useContext(hr),{basename:t,navigator:n}=k.useContext(Sr),{matches:r}=k.useContext(wr),{pathname:i}=Nr(),a=JSON.stringify(Qn(r)),o=k.useRef(!1);return k.useLayoutEffect(()=>{o.current=!0}),k.useCallback((r,s={})=>{if(gn(o.current,Pr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=$n(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:tr([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Lr=k.createContext(null);function Rr(e){let t=k.useContext(wr).outlet;return k.useMemo(()=>t&&k.createElement(Lr.Provider,{value:e},t),[t,e])}function zr(){let{matches:e}=k.useContext(wr);return e[e.length-1]?.params??{}}function Br(e,{relative:t}={}){let{matches:n}=k.useContext(wr),{pathname:r}=Nr(),i=JSON.stringify(Qn(n));return k.useMemo(()=>$n(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Vr(e,t){return Hr(e,t)}function Hr(e,t,n){P(Mr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=k.useContext(Sr),{matches:i}=k.useContext(wr),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=Nr(),l;if(t){let e=typeof t==`string`?xn(t):t;P(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):wn(e,{pathname:d}),p=Yr(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:tr([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:tr([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?k.createElement(Cr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Ur(){let e=ii(),t=sr(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return k.createElement(k.Fragment,null,k.createElement(`h2`,null,`Unexpected Application Error!`),k.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?k.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Wr=k.createElement(Ur,null),Gr=class extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=_r;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ar(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:k.createElement(wr.Provider,{value:this.props.routeContext},k.createElement(Tr.Provider,{value:e,children:this.props.component}));return this.context?k.createElement(qr,{error:e},t):t}},Kr=new WeakMap;function qr({children:e,error:t}){let{basename:n}=k.useContext(Sr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=kr(t.digest);if(e){let r=Kr.get(t);if(r)throw r;let i=ur(e.location,n),a=i.absoluteURL||i.to;if(mr(a))throw Error(`Invalid redirect location`);if(lr&&!Kr.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Kr.set(t,n),n}return k.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Jr({routeContext:e,match:t,children:n}){let r=k.useContext(hr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement(wr.Provider,{value:e},n)}function Yr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);P(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:cr(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Wr,o&&(s<0&&c===0?(si(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?k.createElement(n.route.Component,null):n.route.element?n.route.element:e,k.createElement(Jr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?k.createElement(Gr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Xr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zr(e){let t=k.useContext(hr);return P(t,Xr(e)),t}function Qr(e){let t=k.useContext(gr);return P(t,Xr(e)),t}function $r(e){let t=k.useContext(wr);return P(t,Xr(e)),t}function ei(e){let t=$r(e),n=t.matches[t.matches.length-1];return P(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ti(){return ei(`useRouteId`)}function ni(){let e=Qr(`useNavigation`);return k.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function ri(){let{matches:e,loaderData:t}=Qr(`useMatches`);return k.useMemo(()=>e.map(e=>En(e,t)),[e,t])}function ii(){let e=k.useContext(Tr),t=Qr(`useRouteError`),n=ei(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ai(){let{router:e}=Zr(`useNavigate`),t=ei(`useNavigate`),n=k.useRef(!1);return k.useLayoutEffect(()=>{n.current=!0}),k.useCallback(async(r,i={})=>{gn(n.current,Pr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var oi={};function si(e,t,n){!t&&!oi[e]&&(oi[e]=!0,gn(!1,n))}k.memo(ci);function ci({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Hr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function li(e){return Rr(e.context)}function ui(e){P(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function di({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){P(!Mr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=k.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=xn(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=k.useMemo(()=>{let e=qn(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return gn(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:k.createElement(Sr.Provider,{value:c},k.createElement(Cr.Provider,{children:t,value:h}))}function fi({children:e,location:t}){return Vr(pi(e),t)}k.Component;function pi(e,t=[]){let n=[];return k.Children.forEach(e,(e,r)=>{if(!k.isValidElement(e))return;let i=[...t,r];if(e.type===k.Fragment){n.push.apply(n,pi(e.props.children,i));return}P(e.type===ui,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;P(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=pi(a.children,i)),n.push(o)}),n}var mi=`application/x-www-form-urlencoded`;function hi(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function gi(e){return hi(e)&&e.tagName.toLowerCase()===`button`}function _i(e){return hi(e)&&e.tagName.toLowerCase()===`form`}function vi(e){return hi(e)&&e.tagName.toLowerCase()===`input`}function yi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bi(e,t){return e.button===0&&(!t||t===`_self`)&&!yi(e)}var xi=null;function Si(){if(xi===null)try{new FormData(document.createElement(`form`),0),xi=!1}catch{xi=!0}return xi}var Ci=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function wi(e){return e!=null&&!Ci.has(e)?(gn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mi}"`),null):e}function Ti(e,t){let n,r,i,a,o;if(_i(e)){let o=e.getAttribute(`action`);r=o?qn(o,t):null,n=e.getAttribute(`method`)||`get`,i=wi(e.getAttribute(`enctype`))||mi,a=new FormData(e)}else if(gi(e)||vi(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?qn(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=wi(e.getAttribute(`formenctype`))||wi(o.getAttribute(`enctype`))||mi,a=new FormData(o,e),!Si()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(hi(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=mi,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function Ei(e,t){if(e===!1||e==null)throw Error(t)}var Di={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Oi=/[&><\u2028\u2029]/g;function ki(e){return e.replace(Oi,e=>Di[e])}function Ai(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname.endsWith(`/`)?n.pathname=`${n.pathname}_.${t}`:n.pathname=`${n.pathname}.${t}`,n}async function ji(e,t){if(e.id in t)return t[e.id];try{let n=await o(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Mi(e){return e!=null&&typeof e.page==`string`}function Ni(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Pi(e,t,n){return I((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ji(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ni).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Fi(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ii(e,t,{includeHydrateFallback:n}={}){return Li(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Li(e){return[...new Set(e)]}function F(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function I(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Mi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(F(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ri(){let e=k.useContext(hr);return Ei(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function zi(){let e=k.useContext(gr);return Ei(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Bi=k.createContext(void 0);Bi.displayName=`FrameworkContext`;function Vi(){let e=k.useContext(Bi);return Ei(e,`You must render this element inside a <HydratedRouter> element`),e}function Hi(e,t){let n=k.useContext(Bi),[r,i]=k.useState(!1),[a,o]=k.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=k.useRef(null);k.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),k.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ui(s,p),onBlur:Ui(c,m),onMouseEnter:Ui(l,p),onMouseLeave:Ui(u,m),onTouchStart:Ui(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ui(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Wi({page:e,...t}){let n=vr(),{nonce:r}=Vi(),{router:i}=Ri(),a=k.useMemo(()=>wn(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?k.createElement(Ki,{page:e,matches:a,...t}):k.createElement(qi,{page:e,matches:a,...t})):null}function Gi(e){let{manifest:t,routeModules:n}=Vi(),[r,i]=k.useState([]);return k.useEffect(()=>{let r=!1;return Pi(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ki({page:e,matches:t,...n}){let r=Nr(),i=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Ai(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return k.createElement(k.Fragment,null,i.map(e=>k.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function qi({page:e,matches:t,...n}){let r=Nr(),{manifest:i,routeModules:a}=Vi(),{loaderData:o,matches:s}=zi(),c=k.useMemo(()=>Fi(e,t,s,i,r,`data`),[e,t,s,i,r]),l=k.useMemo(()=>Fi(e,t,s,i,r,`assets`),[e,t,s,i,r]),u=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];!t||!t.hasLoader||(!c.some(t=>t.route.id===e.route.id)&&e.route.id in o&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let l=Ai(e,`data`);return s&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[o,r,i,c,t,e,a]),d=k.useMemo(()=>Ii(l,i),[l,i]),f=Gi(l);return k.createElement(k.Fragment,null,u.map(e=>k.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>k.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>k.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ji(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Yi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Yi&&(window.__reactRouterVersion=`8.2.0`)}catch{}function Xi({basename:e,children:t,useTransitions:n,window:r}){let i=k.useRef(null);i.current??=hn({window:r,v5Compat:!0});let a=i.current,[o,s]=k.useState({action:a.action,location:a.location}),c=k.useCallback(e=>{n===!1?s(e):k.startTransition(()=>s(e))},[n]);return k.useLayoutEffect(()=>a.listen(c),[a,c]),k.createElement(di,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Zi({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=k.useState({action:n.action,location:n.location}),o=k.useCallback(e=>{r===!1?a(e):k.startTransition(()=>a(e))},[r]);return k.useLayoutEffect(()=>n.listen(o),[n,o]),k.createElement(di,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Zi.displayName=`unstable_HistoryRouter`;var Qi=k.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=k.useContext(Sr),v=typeof l==`string`&&un.test(l),y=ur(l,h);l=y.to;let b=jr(l,{relative:r}),x=Nr(),S=null;if(o){let e=$n(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:tr([h,e.pathname])),S=g.createHref(e)}let[ee,C,te]=Hi(n,p),ne=aa(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function re(t){e&&e(t),t.defaultPrevented||ne(t)}let ie=!(y.isExternal||i),ae=k.createElement(`a`,{...p,...te,href:(ie?S:void 0)||y.absoluteURL||b,onClick:ie?re:e,ref:Ji(m,C),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return ee&&!v?k.createElement(k.Fragment,null,ae,k.createElement(Wi,{page:b})):ae});Qi.displayName=`Link`;var $i=k.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Br(a,{relative:c.relative}),d=Nr(),f=k.useContext(gr),{navigator:p,basename:m}=k.useContext(Sr),h=f!=null&&ha(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=qn(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},ee=b?e:void 0,C;C=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let te=typeof i==`function`?i(S):i;return k.createElement(Qi,{...c,"aria-current":ee,className:C,ref:l,style:te,to:a,viewTransition:o},typeof s==`function`?s(S):s)});$i.displayName=`NavLink`;var ea=k.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=k.useContext(Sr),g=ca(),_=la(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&un.test(s);return k.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?k.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});ea.displayName=`Form`;function ta({getKey:e,storageKey:t,...n}){let r=k.useContext(Bi),{basename:i}=k.useContext(Sr),a=Nr(),o=ri();pa({getKey:e,storageKey:t});let s=k.useMemo(()=>{if(!r||!e)return null;let t=fa(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),k.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${ki(JSON.stringify(t||ua))}, ${ki(JSON.stringify(s))})`}})}ta.displayName=`ScrollRestoration`;function na(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ra(e){let t=k.useContext(hr);return P(t,na(e)),t}function ia(e){let t=k.useContext(gr);return P(t,na(e)),t}function aa(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Fr(),d=Nr(),f=Br(e,{relative:o});return k.useCallback(p=>{if(bi(p,t)){p.preventDefault();let t=n===void 0?bn(d)===bn(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?k.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var oa=0,sa=()=>`__${String(++oa)}__`;function ca(){let{router:e}=ra(`useSubmit`),{basename:t}=k.useContext(Sr),n=ti(),r=e.fetch,i=e.navigate;return k.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ti(e,t);a.navigate===!1?await r(a.fetcherKey||sa(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function la(e,{relative:t}={}){let{basename:n}=k.useContext(Sr),r=k.useContext(wr);P(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Br(e||`.`,{relative:t})},o=Nr();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:tr([n,a.pathname])),bn(a)}var ua=`react-router-scroll-positions`,da={};function fa(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:qn(e.pathname,n)||e.pathname},t)),i??=e.key,i}function pa({getKey:e,storageKey:t}={}){let{router:n}=ra(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=ia(`useScrollRestoration`),{basename:a}=k.useContext(Sr),o=Nr(),s=ri(),c=ni();k.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),ma(k.useCallback(()=>{if(c.state===`idle`){let t=fa(o,s,a,e);da[t]=window.scrollY}try{sessionStorage.setItem(t||ua,JSON.stringify(da))}catch(e){gn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(k.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||ua);e&&(da=JSON.parse(e))}catch{}},[t]),k.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(da,()=>window.scrollY,e?(t,n)=>fa(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),k.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{gn(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function ma(e,t){let{capture:n}=t||{};k.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ha(e,{relative:t}={}){let n=k.useContext(yr);P(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ra(`useViewTransitionState`),i=Br(e,{relative:t});if(!n.isTransitioning)return!1;let a=qn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=qn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Un(i.pathname,o)!=null||Un(i.pathname,a)!=null}var ga=Le(),_a=class extends k.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidUpdate(e){this.state.error!==null&&e.resetOn!==this.props.resetOn&&this.setState({error:null})}componentDidCatch(e,t){console.error(`Puddle: the ${this.props.scope} crashed`,e,t.componentStack)}render(){let{error:e}=this.state;return e===null?this.props.children:(0,A.jsxs)(`div`,{className:`flex h-full min-h-40 flex-col items-center justify-center gap-4 px-8 py-10 text-center`,children:[(0,A.jsxs)(`p`,{className:`text-sm text-fg`,children:[`The `,this.props.scope,` stopped rendering.`]}),(0,A.jsx)(`p`,{className:`max-w-lg font-mono text-2xs leading-relaxed text-interrupted`,children:e.message||String(e)}),(0,A.jsx)(`p`,{className:`max-w-sm text-2xs leading-relaxed text-fg-muted`,children:`Your sessions and their worktrees are on the daemon and untouched; the layout is saved. The console has the full stack.`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>this.setState({error:null}),className:`text-2xs font-medium text-fg-gold transition-colors hover:underline`,children:`Try again`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:`Reload`})]})]})}},va=[`dark`,`light`],ya=`puddle.theme`,ba=`system`,xa=`dark`,Sa=new Set;function Ca(){return window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function wa(e){return e===`system`?Ca():e}function Ta(){let e=localStorage.getItem(ya);return e===`system`||va.includes(e??``)?e:ba}function Ea(){let e=document.documentElement.dataset.theme;return va.includes(e??``)?e:xa}function Da(e){localStorage.setItem(ya,e);let t=wa(e);document.documentElement.dataset.theme=t;for(let e of Sa)e(t);return t}function Oa(){Da(Ta()),window.matchMedia(`(prefers-color-scheme: light)`).addEventListener(`change`,()=>{Ta()===`system`&&Da(`system`)})}function ka(e){return Sa.add(e),()=>Sa.delete(e)}function Aa(e){let t=/^#([0-9a-fA-F]{3,4})$/.exec(e);return t?.[1]?`#${[...t[1]].map(e=>e+e).join(``)}`:e}function ja(){let e=getComputedStyle(document.documentElement);return t=>Aa(e.getPropertyValue(t).trim())}var Ma=4.5;function Na(e){return{background:e(`--bg-base`),foreground:e(`--text-primary`),cursor:e(`--accent`),cursorAccent:e(`--bg-base`),selectionBackground:e(`--selection`),black:e(`--ansi-black`),red:e(`--ansi-red`),green:e(`--ansi-green`),yellow:e(`--ansi-yellow`),blue:e(`--ansi-blue`),magenta:e(`--ansi-magenta`),cyan:e(`--ansi-cyan`),white:e(`--ansi-white`),brightBlack:e(`--ansi-bright-black`),brightRed:e(`--ansi-bright-red`),brightGreen:e(`--ansi-bright-green`),brightYellow:e(`--ansi-bright-yellow`),brightBlue:e(`--ansi-bright-blue`),brightMagenta:e(`--ansi-bright-magenta`),brightCyan:e(`--ansi-bright-cyan`),brightWhite:e(`--ansi-bright-white`)}}function Pa(){return Na(ja())}function Fa(e){return{theme:Na(e),minimumContrastRatio:Ma}}function Ia(){return Fa(ja())}function La(e){return e.replace(`#`,``)}function Ra(e,t){return{base:t===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:La(e(`--text-muted`)),fontStyle:`italic`},{token:`string`,foreground:La(e(`--ansi-green`))},{token:`number`,foreground:La(e(`--ansi-yellow`))},{token:`keyword`,foreground:La(e(`--ansi-blue`))},{token:`type`,foreground:La(e(`--ansi-cyan`))},{token:`function`,foreground:La(e(`--ansi-magenta`))}],colors:{"editor.background":e(`--bg-base`),"editor.foreground":e(`--text-primary`),"editor.selectionBackground":e(`--selection`),"editor.lineHighlightBackground":e(`--bg-surface`),"editorCursor.foreground":e(`--accent`),"editorLineNumber.foreground":e(`--text-muted`),"editorLineNumber.activeForeground":e(`--text-secondary`),"editorWidget.background":e(`--bg-elevated`),"editorWidget.border":e(`--border`),focusBorder:e(`--focus-ring`),"diffEditor.insertedTextBackground":e(`--diff-added`),"diffEditor.removedTextBackground":e(`--diff-removed`)}}}function za(){return Ra(ja(),Ea())}function Ba(){return(0,A.jsx)(g,{theme:(0,k.useSyncExternalStore)(ka,Ea),position:`bottom-right`,toastOptions:{style:{background:`var(--bg-elevated)`,border:`none`,boxShadow:`0 8px 30px rgb(0 0 0 / 0.25)`,color:`var(--text-primary)`},classNames:{description:`whitespace-pre-wrap break-words font-mono text-2xs leading-snug max-h-40 overflow-y-auto`}}})}var Va=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ha=`VisuallyHidden`,Ua=k.forwardRef((e,t)=>(0,A.jsx)(y.span,{...e,ref:t,style:{...Va,...e.style}}));Ua.displayName=Ha;var Wa=Ua,[Ga,Ka]=b(`Tooltip`,[Ne]),qa=Ne(),Ja=`TooltipProvider`,Ya=700,Xa=`tooltip.open`,[Za,Qa]=Ga(Ja),$a=e=>{let{__scopeTooltip:t,delayDuration:n=Ya,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=k.useRef(!0),s=k.useRef(!1),c=k.useRef(0);return k.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,A.jsx)(Za,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:k.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:k.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:k.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};$a.displayName=Ja;var eo=`Tooltip`,[to,no]=Ga(eo),ro=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Qa(eo,e.__scopeTooltip),l=qa(t),[u,d]=k.useState(null),f=_e(),p=k.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=k.useRef(!1),[_,v]=ae({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Xa))):c.onClose(),a?.(e)},caller:eo}),y=k.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=k.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=k.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=k.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return k.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,A.jsx)(Me,{...l,children:(0,A.jsx)(to,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:k.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};ro.displayName=eo;var io=`TooltipTrigger`,ao=k.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=no(io,n),a=Qa(io,n),o=qa(n),s=ce(t,k.useRef(null),i.onTriggerChange),c=k.useRef(!1),l=k.useRef(!1),u=k.useCallback(()=>c.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,A.jsx)(we,{asChild:!0,...o,children:(0,A.jsx)(y.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:v(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:v(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:v(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:v(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:v(e.onBlur,i.onClose),onClick:v(e.onClick,i.onClose)})})});ao.displayName=io;var oo=`TooltipPortal`,[so,co]=Ga(oo,{forceMount:void 0}),lo=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=no(oo,t);return(0,A.jsx)(so,{scope:t,forceMount:n,children:(0,A.jsx)(C,{present:n||a.open,children:(0,A.jsx)(E,{asChild:!0,container:i,children:r})})})};lo.displayName=oo;var uo=`TooltipContent`,fo=k.forwardRef((e,t)=>{let n=co(uo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=no(uo,e.__scopeTooltip);return(0,A.jsx)(C,{present:r||o.open,children:o.disableHoverableContent?(0,A.jsx)(L,{side:i,...a,ref:t}):(0,A.jsx)(po,{side:i,...a,ref:t})})}),po=k.forwardRef((e,t)=>{let n=no(uo,e.__scopeTooltip),r=Qa(uo,e.__scopeTooltip),i=k.useRef(null),a=ce(t,i),[o,s]=k.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=k.useCallback(()=>{s(null),d(!1)},[d]),p=k.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=yo(r,vo(r,n.getBoundingClientRect())),a=bo(t.getBoundingClientRect()),o=So([...i,...a]);s(o),d(!0)},[d]);return k.useEffect(()=>()=>f(),[f]),k.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),k.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!xo(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,A.jsx)(L,{...e,ref:a})}),[mo,ho]=Ga(eo,{isInside:!1}),go=x(`TooltipContent`),L=k.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=no(uo,n),l=qa(n),{onClose:u}=c;return k.useEffect(()=>(document.addEventListener(Xa,u),()=>document.removeEventListener(Xa,u)),[u]),k.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,A.jsx)(ge,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,A.jsxs)(ve,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,A.jsx)(go,{children:r}),(0,A.jsx)(mo,{scope:n,isInside:!0,children:(0,A.jsx)(Wa,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});fo.displayName=uo;var R=`TooltipArrow`,_o=k.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=qa(n);return ho(R,n).isInside?null:(0,A.jsx)(Ce,{...i,...r,ref:t})});_o.displayName=R;function vo(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function yo(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bo(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function xo(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function So(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Co(t)}function Co(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var wo=$a,z=ro,To=ao,Eo=lo,Do=fo,Oo=wo,ko=z,Ao=To;function jo({className:e,sideOffset:t=4,...n}){return(0,A.jsx)(Eo,{children:(0,A.jsx)(Do,{sideOffset:t,className:D(`z-50 overflow-hidden rounded-md bg-elevated px-2 py-1 text-xs text-fg shadow-lg`,e),...n})})}function Mo(){let[e,t]=(0,k.useState)(``);return(0,A.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-ground`,children:(0,A.jsxs)(`div`,{className:`flex w-full max-w-md flex-col gap-10 px-8 pb-24`,children:[(0,A.jsx)(`h1`,{className:`font-mono text-2xl font-semibold text-fg`,children:`Puddle`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3 text-sm leading-relaxed text-fg-secondary`,children:[(0,A.jsx)(`p`,{children:`This page needs the daemon's access token.`}),(0,A.jsxs)(`p`,{children:[`Launch the UI with `,(0,A.jsx)(`span`,{className:`font-mono text-accent`,children:`puddle launch`}),` and it arrives automatically — or paste it from`,` `,(0,A.jsx)(`span`,{className:`font-mono text-accent`,children:`~/.puddle/token`}),` on the machine running puddled.`]})]}),(0,A.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:t=>{t.preventDefault(),e.trim()&&c.set(e.trim())},children:[(0,A.jsx)(Te,{placeholder:`paste token`,value:e,onChange:e=>t(e.target.value),className:`h-10 font-mono`,autoFocus:!0}),(0,A.jsx)(oe,{type:`submit`,size:`lg`,className:`self-start px-6`,disabled:!e.trim(),children:`Connect`})]})]})})}var No=e(i(),1),B=[{id:`system`,label:`System`},{id:`rangefinder`,label:`Rangefinder`},{id:`drafting`,label:`Drafting`},{id:`invert`,label:`Invert`}],Po=`system`;function Fo(e){return B.some(t=>t.id===e)?e:Po}var Io={uiFontSize:16,cursorPackage:Po,terminalFontSize:13,editorFontSize:14,density:`compact`,terminalScrollback:2e4,editorTabSize:2,editorWordWrap:!1,editorLinkSshHost:``,projectBasedLayout:!0,showAllProjectSessions:!0},Lo=`puddle.client-settings`,Ro=new Set,zo=null;function Bo(e){let t={...e};return t.projectBasedLayout===void 0&&t.showAllProjectSessions!==void 0&&(t.projectBasedLayout=!t.showAllProjectSessions),t.showAllProjectSessions===void 0&&t.projectBasedLayout!==void 0&&(t.showAllProjectSessions=!t.projectBasedLayout),t}function Vo(e){return e.terminalScrollback===5e3?{...e,terminalScrollback:Io.terminalScrollback}:e}function Ho(){if(zo)return zo;let e={};try{e=JSON.parse(localStorage.getItem(Lo)??`{}`)}catch{}let t={...Io,...Vo(Bo(e))};return zo={...t,cursorPackage:Fo(t.cursorPackage)},zo}function Uo(e){document.documentElement.style.setProperty(`--ui-font-size`,`${e.uiFontSize}px`),document.documentElement.dataset.density=e.density,document.documentElement.dataset.cursorPackage=e.cursorPackage}function Wo(){return Ho()}function Go(e){let t={...Ho(),...e};zo={...t,cursorPackage:Fo(t.cursorPackage)},localStorage.setItem(Lo,JSON.stringify(zo)),Uo(zo);for(let e of Ro)e()}function Ko(){Uo(Ho())}function qo(){return(0,k.useSyncExternalStore)(e=>(Ro.add(e),()=>Ro.delete(e)),()=>Ho())}var Jo=`a, button, [role="button"], [role="slider"], input, select, textarea, summary, label, [onclick], .cursor-pointer`,Yo=`.monaco-editor`;function Xo(e,t){return e?.closest(Yo)&&!e.closest(t)?`text`:e?.closest(Jo)?`interactive`:`default`}function Zo(e,t=`.no-custom-caret`){(0,k.useEffect)(()=>{let n=e.current;if(!n)return;let r=window.matchMedia(`(pointer: fine)`),i=()=>{n.style.opacity=`0`},a=e=>{if(e.pointerType===`touch`||!r.matches){i();return}n.style.transform=`translate3d(${e.clientX}px, ${e.clientY}px, 0) translate(-50%, -50%)`;let a=e.target instanceof Element?e.target:null;if(a instanceof HTMLIFrameElement){i();return}n.style.opacity=`1`;let o=a?.closest(Yo),s=Xo(a,t),c=s===`text`,l=s===`interactive`,u=c;if(c&&o){let e=getComputedStyle(o);n.style.setProperty(`--custom-cursor-caret-height`,`${Math.round(Number.parseFloat(e.fontSize)*1.3)}px`)}else if(!l&&a&&!a.closest(t)&&Array.from(a.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())){let e=getComputedStyle(a);e.userSelect!==`none`&&(u=!0,n.style.setProperty(`--custom-cursor-caret-height`,`${Math.round(Number.parseFloat(e.fontSize)*1.3)}px`))}n.classList.toggle(`is-interactive`,l),n.classList.toggle(`is-text`,u)};return window.addEventListener(`pointermove`,a,{passive:!0}),document.documentElement.addEventListener(`pointerleave`,i),window.addEventListener(`blur`,i),()=>{window.removeEventListener(`pointermove`,a),document.documentElement.removeEventListener(`pointerleave`,i),window.removeEventListener(`blur`,i)}},[t,e])}var Qo=[`top`,`right`,`bottom`,`left`];function $o(){let e=(0,k.useRef)(null);return Zo(e),(0,A.jsx)(`div`,{ref:e,className:`custom-cursor drafting-cursor`,"aria-hidden":`true`,children:Qo.map(e=>(0,A.jsx)(`span`,{className:`drafting-cursor-tick`,"data-side":e},e))})}function es(){let e=(0,k.useRef)(null);return Zo(e),(0,A.jsx)(`div`,{ref:e,className:`custom-cursor invert-cursor`,"aria-hidden":`true`})}var ts=`h1, h2, h3, h4, h5, h6, .no-rangefinder-caret`,ns=40.5,rs=4.05,is=rs*Math.sqrt(3)/2;function as(){let e=[],t=[],n=ns/2,r=Math.ceil(n/is)+1,i=e=>Math.round(e*100)/100,a=e=>`M${e.map(([e,t])=>`${i(e)} ${i(t)}`).join(`L`)}Z`;for(let i=-r;i<r;i+=1){let o=n+i*is,s=o+is,c=(i%2+2)%2*(rs/2);for(let i=-r;i<r;i+=1){let r=n+i*rs+c,l=[[r+rs/2,o],[r,s],[r+rs,s]],u=[[r+rs/2,o],[r+3*rs/2,o],[r+rs,s]],d=e=>{let t=e.map(([e])=>e),n=e.map(([,e])=>e);return Math.max(...t)>0&&Math.min(...t)<ns&&Math.max(...n)>0&&Math.min(...n)<ns};d(l)&&e.push(a(l)),d(u)&&t.push(a(u))}}return{light:e.join(``),dark:t.join(``)}}var os=as();function ss(){let e=(0,k.useRef)(null);return Zo(e,ts),(0,A.jsx)(`div`,{ref:e,className:`custom-cursor rangefinder-cursor`,"aria-hidden":`true`,children:(0,A.jsxs)(`svg`,{className:`rangefinder-cursor-facets`,viewBox:`0 0 ${ns} ${ns}`,focusable:`false`,children:[(0,A.jsx)(`path`,{className:`rangefinder-cursor-facet-light`,d:os.light}),(0,A.jsx)(`path`,{className:`rangefinder-cursor-facet-dark`,d:os.dark})]})})}function cs(){let{cursorPackage:e}=qo(),t=null;switch(e){case`rangefinder`:t=(0,A.jsx)(ss,{});break;case`drafting`:t=(0,A.jsx)($o,{});break;case`invert`:t=(0,A.jsx)(es,{});break;case`system`:return null}return(0,No.createPortal)(t,document.body)}var ls=12,us=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{us=!0}),window.addEventListener(`blur`,()=>{us=!1}),ze.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function ds(e){return()=>us?e:e*ls}function fs(){return M({queryKey:[`profiles`],queryFn:()=>p(`GET`,`/api/profiles`)})}function ps(e){return M({queryKey:[`profile-settings`,e],queryFn:()=>p(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function ms(e){return M({queryKey:[`accounts`,e],queryFn:()=>p(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function hs(e){return M({queryKey:[`account-usage`,e],queryFn:()=>p(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function gs(){return M({queryKey:[`repos`],queryFn:()=>p(`GET`,`/api/repos`)})}function _s(e,t=!0){return M({queryKey:[`projects`,e??`all`],queryFn:()=>p(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function vs(e){return M({queryKey:[`project`,e],queryFn:()=>p(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function ys(e){return p(`POST`,`/api/projects/${e}/conversations/refresh`)}function bs(e){return M({queryKey:[`sessions`,e],queryFn:()=>p(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var xs={queryKey:[`sessions`,`all`],queryFn:()=>p(`GET`,`/api/sessions`)};function Ss(e=!0){return M({...xs,enabled:e})}function Cs(e){return e.fetchQuery(xs)}function ws(){return M({queryKey:[`config`],queryFn:()=>p(`GET`,`/api/config`)})}function Ts(e){return M({queryKey:[`repo-branches`,e],queryFn:()=>p(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function Es(e){return M({queryKey:[`repo-worktrees`,e],queryFn:()=>p(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:1e4})}function Ds(e,t){let n=j();return N({mutationFn:t=>p(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function Os(e,t){let n=j();return N({mutationFn:({name:t,confirm:n})=>{let r=new URLSearchParams({name:t});return n&&r.set(`confirm`,`1`),p(`DELETE`,`/api/repos/${e}/branches?${r.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function ks(e){return M({queryKey:[`fs-dirs`,e],queryFn:()=>p(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function As(){return M({queryKey:[`version`],queryFn:()=>p(`GET`,`/api/version`),staleTime:1/0})}function js(){return M({queryKey:[`host`],queryFn:()=>p(`GET`,`/api/host`),staleTime:1/0})}function Ms(e){return e?e.displayName||e.hostname:void 0}function Ns(){return M({queryKey:[`agents`],queryFn:()=>p(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function Ps(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function Fs(e){let t=j();return N({mutationFn:t=>p(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function Is(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function Ls(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function Rs(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function zs(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function Bs(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function Vs(){return N({mutationFn:e=>p(`POST`,`/api/accounts/${e}/login`)})}function Hs(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Us(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Ws(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Gs(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function Ks(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/projects/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function qs(e,t){return M({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>p(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Js(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Ys(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Xs(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Zs(e,t){return M({queryKey:[`layouts`,e,t??`none`],queryFn:()=>p(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Qs(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function $s(){let e=j();return N({mutationFn:({id:e,...t})=>p(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function ec(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function tc(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function nc(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/sessions`,e),onSuccess:t=>tc(e,t)})}function rc(e){let t=j();return N({mutationFn:t=>p(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>tc(t,e)})}function ic(){let e=j();return N({mutationFn:({sessionId:e,accountId:t})=>p(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>tc(e,t)})}function ac(){let e=j();return N({mutationFn:({sessionId:e,accountId:t})=>p(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{tc(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function oc(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>tc(e,t)})}function sc(){let e=j();return N({mutationFn:e=>p(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>tc(e,t)})}function cc(){let e=j();return N({mutationFn:({sessionId:e,title:t})=>p(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>tc(e,t)})}function lc(){let e=j();return N({mutationFn:e=>p(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function uc(e){try{return await p(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function dc(e,t){return p(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function fc(e,t){return M({queryKey:[`ports`,e],queryFn:()=>p(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:ds(5e3),refetchIntervalInBackground:!1})}function pc(e,t){return M({queryKey:[`session-env`,e],queryFn:()=>p(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:ds(5e3),refetchIntervalInBackground:!1})}function mc(){let e=j();return N({mutationFn:e=>p(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var hc=a(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),gc=a(`bike`,[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]),_c=a(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),vc=a(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),yc=a(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),bc=a(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),xc=a(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),Sc=a(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Cc=a(`cake`,[[`path`,{d:`M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8`,key:`1w3rig`}],[`path`,{d:`M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1`,key:`n2jgmb`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}],[`path`,{d:`M7 8v3`,key:`1qtyvj`}],[`path`,{d:`M12 8v3`,key:`hwp4zt`}],[`path`,{d:`M17 8v3`,key:`1i6e5u`}],[`path`,{d:`M7 4h.01`,key:`1bh4kh`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M17 4h.01`,key:`1upcoc`}]]),wc=a(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Tc=a(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),Ec=a(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),Dc=a(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Oc=a(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),kc=a(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Ac=a(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),jc=a(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Mc=a(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),Nc=a(`crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Pc=a(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),Fc=a(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),Ic=a(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),Lc=a(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),Rc=a(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),zc=a(`flower-2`,[[`path`,{d:`M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1`,key:`3pnvol`}],[`circle`,{cx:`12`,cy:`8`,r:`2`,key:`1822b1`}],[`path`,{d:`M12 10v12`,key:`6ubwww`}],[`path`,{d:`M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z`,key:`9hd38g`}],[`path`,{d:`M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z`,key:`ufn41s`}]]),Bc=a(`flower`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5`,key:`14wa3c`}],[`path`,{d:`M12 7.5V9`,key:`1oy5b0`}],[`path`,{d:`M7.5 12H9`,key:`eltsq1`}],[`path`,{d:`M16.5 12H15`,key:`vk5kw4`}],[`path`,{d:`M12 16.5V15`,key:`k7eayi`}],[`path`,{d:`m8 8 1.88 1.88`,key:`nxy4qf`}],[`path`,{d:`M14.12 9.88 16 8`,key:`1lst6k`}],[`path`,{d:`m8 16 1.88-1.88`,key:`h2eex1`}],[`path`,{d:`M14.12 14.12 16 16`,key:`uqkrx3`}]]),V=a(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Vc=a(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Hc=a(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),Uc=a(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),Wc=a(`ghost`,[[`path`,{d:`M9 10h.01`,key:`qbtxuw`}],[`path`,{d:`M15 10h.01`,key:`1qmjsl`}],[`path`,{d:`M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z`,key:`uwwb07`}]]),Gc=a(`gift`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]),Kc=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),qc=a(`guitar`,[[`path`,{d:`m11.9 12.1 4.514-4.514`,key:`109xqo`}],[`path`,{d:`M20.1 2.3a1 1 0 0 0-1.4 0l-1.114 1.114A2 2 0 0 0 17 4.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 17.828 7h1.344a2 2 0 0 0 1.414-.586L21.7 5.3a1 1 0 0 0 0-1.4z`,key:`txyc8t`}],[`path`,{d:`m6 16 2 2`,key:`16qmzd`}],[`path`,{d:`M8.23 9.85A3 3 0 0 1 11 8a5 5 0 0 1 5 5 3 3 0 0 1-1.85 2.77l-.92.38A2 2 0 0 0 12 18a4 4 0 0 1-4 4 6 6 0 0 1-6-6 4 4 0 0 1 4-4 2 2 0 0 0 1.85-1.23z`,key:`1de1vg`}]]),Jc=a(`headphones`,[[`path`,{d:`M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3`,key:`1xhozi`}]]),Yc=a(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),Xc=a(`ice-cream-cone`,[[`path`,{d:`m7 11 4.08 10.35a1 1 0 0 0 1.84 0L17 11`,key:`1v6356`}],[`path`,{d:`M17 7A5 5 0 0 0 7 7`,key:`151p3v`}],[`path`,{d:`M17 7a2 2 0 0 1 0 4H7a2 2 0 0 1 0-4`,key:`1sdaij`}]]),Zc=a(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Qc=a(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),$c=a(`leaf`,[[`path`,{d:`M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z`,key:`nnexq3`}],[`path`,{d:`M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12`,key:`mt58a7`}]]),el=a(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),tl=a(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),nl=a(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),rl=a(`mountain-snow`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}],[`path`,{d:`M4.14 15.08c2.62-1.57 5.24-1.43 7.86.42 2.74 1.94 5.49 2 8.23.19`,key:`1pvmmp`}]]),il=a(`mountain`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]),al=a(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),ol=a(`notebook-pen`,[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]),sl=a(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),cl=a(`paw-print`,[[`circle`,{cx:`11`,cy:`4`,r:`2`,key:`vol9p0`}],[`circle`,{cx:`18`,cy:`8`,r:`2`,key:`17gozi`}],[`circle`,{cx:`20`,cy:`16`,r:`2`,key:`1v9bxh`}],[`path`,{d:`M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z`,key:`1ydw1z`}]]),ll=a(`pizza`,[[`path`,{d:`m12 14-1 1`,key:`11onhr`}],[`path`,{d:`m13.75 18.25-1.25 1.42`,key:`1yisr3`}],[`path`,{d:`M17.775 5.654a15.68 15.68 0 0 0-12.121 12.12`,key:`1qtqk6`}],[`path`,{d:`M18.8 9.3a1 1 0 0 0 2.1 7.7`,key:`fbbbr2`}],[`path`,{d:`M21.964 20.732a1 1 0 0 1-1.232 1.232l-18-5a1 1 0 0 1-.695-1.232A19.68 19.68 0 0 1 15.732 2.037a1 1 0 0 1 1.232.695z`,key:`1hyfdd`}]]),ul=a(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),H=a(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),dl=a(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),fl=a(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),pl=a(`rainbow`,[[`path`,{d:`M22 17a10 10 0 0 0-20 0`,key:`ozegv`}],[`path`,{d:`M6 17a6 6 0 0 1 12 0`,key:`5giftw`}],[`path`,{d:`M10 17a2 2 0 0 1 4 0`,key:`gnsikk`}]]),ml=a(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),hl=a(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),gl=a(`sailboat`,[[`path`,{d:`M10 2v15`,key:`1qf71f`}],[`path`,{d:`M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z`,key:`1pxcvx`}],[`path`,{d:`M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z`,key:`5oog16`}]]),_l=a(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),vl=a(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),yl=a(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),bl=a(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),xl=a(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]),Sl=a(`snail`,[[`path`,{d:`M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0`,key:`hneq2s`}],[`circle`,{cx:`10`,cy:`13`,r:`8`,key:`194lz3`}],[`path`,{d:`M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6`,key:`ixqyt7`}],[`path`,{d:`M18 3 19.1 5.2`,key:`9tjm43`}],[`path`,{d:`M22 3 20.9 5.2`,key:`j3odrs`}]]),Cl=a(`snowflake`,[[`path`,{d:`m10 20-1.25-2.5L6 18`,key:`18frcb`}],[`path`,{d:`M10 4 8.75 6.5 6 6`,key:`7mghy3`}],[`path`,{d:`m14 20 1.25-2.5L18 18`,key:`1chtki`}],[`path`,{d:`m14 4 1.25 2.5L18 6`,key:`1b4wsy`}],[`path`,{d:`m17 21-3-6h-4`,key:`15hhxa`}],[`path`,{d:`m17 3-3 6 1.5 3`,key:`11697g`}],[`path`,{d:`M2 12h6.5L10 9`,key:`kv9z4n`}],[`path`,{d:`m20 10-1.5 2 1.5 2`,key:`1swlpi`}],[`path`,{d:`M22 12h-6.5L14 15`,key:`1mxi28`}],[`path`,{d:`m4 10 1.5 2L4 14`,key:`k9enpj`}],[`path`,{d:`m7 21 3-6-1.5-3`,key:`j8hb9u`}],[`path`,{d:`m7 3 3 6h4`,key:`1otusx`}]]),wl=a(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Tl=a(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),El=a(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Dl=a(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Ol=a(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),kl=a(`tent`,[[`path`,{d:`M3.5 21 14 3`,key:`1szst5`}],[`path`,{d:`M20.5 21 10 3`,key:`1310c3`}],[`path`,{d:`M15.5 21 12 15l-3.5 6`,key:`1ddtfw`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}]]),Al=a(`train-front`,[[`path`,{d:`M8 3.1V7a4 4 0 0 0 8 0V3.1`,key:`1v71zp`}],[`path`,{d:`m9 15-1-1`,key:`1yrq24`}],[`path`,{d:`m15 15 1-1`,key:`1t0d6s`}],[`path`,{d:`M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z`,key:`1p0hjs`}],[`path`,{d:`m8 19-2 3`,key:`13i0xs`}],[`path`,{d:`m16 19 2 3`,key:`xo31yx`}]]),jl=a(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ml=a(`tree-pine`,[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]),Nl=a(`trees`,[[`path`,{d:`M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z`,key:`1l6gj6`}],[`path`,{d:`M7 16v6`,key:`1a82de`}],[`path`,{d:`M13 19v3`,key:`13sx9i`}],[`path`,{d:`M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5`,key:`1sj9kv`}]]),Pl=a(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),Fl=a(`turtle`,[[`path`,{d:`m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z`,key:`1lbbv7`}],[`path`,{d:`M4.82 7.9 8 10`,key:`m9wose`}],[`path`,{d:`M15.18 7.9 12 10`,key:`p8dp2u`}],[`path`,{d:`M16.93 10H20a2 2 0 0 1 0 4H2`,key:`12nsm7`}]]),Il=a(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Ll=a(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]),Rl=a(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),zl=[{name:`mountain`,Icon:il},{name:`mountain-snow`,Icon:rl},{name:`tree-pine`,Icon:Ml},{name:`trees`,Icon:Nl},{name:`leaf`,Icon:$c},{name:`flower`,Icon:Bc},{name:`flower-2`,Icon:zc},{name:`sprout`,Icon:Tl},{name:`sun`,Icon:Ol},{name:`moon`,Icon:nl},{name:`star`,Icon:Dl},{name:`cloud`,Icon:Dc},{name:`snowflake`,Icon:Cl},{name:`zap`,Icon:Rl},{name:`flame`,Icon:Rc},{name:`droplet`,Icon:Fc},{name:`rainbow`,Icon:pl},{name:`wind`,Icon:Ll},{name:`bird`,Icon:_c},{name:`fish`,Icon:Lc},{name:`cat`,Icon:Ec},{name:`dog`,Icon:Pc},{name:`rabbit`,Icon:fl},{name:`turtle`,Icon:Fl},{name:`bug`,Icon:Sc},{name:`snail`,Icon:Sl},{name:`paw-print`,Icon:cl},{name:`feather`,Icon:Ic},{name:`rocket`,Icon:hl},{name:`anchor`,Icon:hc},{name:`compass`,Icon:kc},{name:`map`,Icon:el},{name:`tent`,Icon:kl},{name:`camera`,Icon:wc},{name:`music`,Icon:al},{name:`headphones`,Icon:Jc},{name:`palette`,Icon:sl},{name:`brush`,Icon:xc},{name:`pencil`,Icon:De},{name:`book`,Icon:yc},{name:`book-open`,Icon:vc},{name:`coffee`,Icon:Oc},{name:`pizza`,Icon:ll},{name:`ice-cream-cone`,Icon:Xc},{name:`cake`,Icon:Cc},{name:`gift`,Icon:Gc},{name:`gamepad-2`,Icon:Hc},{name:`puzzle`,Icon:dl},{name:`bike`,Icon:gc},{name:`car`,Icon:Tc},{name:`plane`,Icon:ul},{name:`ship`,Icon:xl},{name:`sailboat`,Icon:gl},{name:`train-front`,Icon:Al},{name:`heart`,Icon:Yc},{name:`sparkles`,Icon:wl},{name:`crown`,Icon:Nc},{name:`gem`,Icon:Uc},{name:`trophy`,Icon:Pl},{name:`ghost`,Icon:Wc},{name:`bot`,Icon:bc},{name:`globe`,Icon:Kc},{name:`guitar`,Icon:qc}],Bl=Object.fromEntries(zl.map(e=>[e.name,e.Icon])),Vl={navy:`text-fg`,gold:`text-fg-gold`,blue:`text-icon-blue`,green:`text-icon-green`,amber:`text-icon-amber`,red:`text-icon-red`,violet:`text-icon-violet`,cyan:`text-icon-cyan`,accent:`text-accent`};function U(e){return e&&Vl[e]||``}function W({icon:e,colour:t,className:n}){let r=D(`size-4 shrink-0`,t?U(t):`text-fg-muted`,n);return(0,A.jsx)(e&&Bl[e]||Il,{className:r})}var G=s(`puddle.profile-id`);function K(){let e=(0,k.useSyncExternalStore)(G.subscribe,G.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function q(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),G.set(e)}function Hl(){let e=fs(),t=Ps(),[n,r]=(0,k.useState)(``),[i,a]=(0,k.useState)(f),o=()=>{n.trim()&&t.mutate({name:n.trim(),branch_prefix:i.trim()},{onSuccess:e=>q(e.id)})},s=(e.data?.length??0)>0;return(0,A.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-ground`,children:(0,A.jsxs)(`div`,{className:`flex w-full max-w-md flex-col gap-10 px-8 pb-16`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,A.jsx)(`h1`,{className:`font-mono text-2xl font-semibold text-fg`,children:`Puddle`}),(0,A.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:`Who is working?`})]}),s&&(0,A.jsx)(`div`,{className:`flex flex-col`,children:e.data.map(e=>(0,A.jsxs)(`button`,{onClick:()=>q(e.id),className:`flex items-center gap-3 rounded-md px-3 py-2.5 text-left transition-colors hover:bg-elevated active:bg-border/70`,children:[(0,A.jsx)(W,{icon:e.icon,colour:e.icon_colour,className:`size-5`}),(0,A.jsx)(`span`,{className:D(`text-base`,U(e.icon_colour)||`text-fg`),children:e.name}),e.branch_prefix&&(0,A.jsxs)(`span`,{className:`ml-auto text-2xs text-fg-muted`,children:[e.branch_prefix,`…`]})]},e.id))}),(0,A.jsxs)(`form`,{className:`flex flex-col gap-5`,onSubmit:e=>{e.preventDefault(),o()},children:[s&&(0,A.jsx)(`p`,{className:`text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:`or create a profile`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(xe,{htmlFor:`profile-name`,children:`Name`}),(0,A.jsx)(Te,{id:`profile-name`,placeholder:`e.g. alice`,value:n,onChange:e=>r(e.target.value),className:`h-10`,autoFocus:!s})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(xe,{htmlFor:`branch-prefix`,children:`Branch prefix`}),(0,A.jsx)(Te,{id:`branch-prefix`,placeholder:`no prefix`,value:i,onChange:e=>a(e.target.value),className:`h-10`})]}),t.error&&(0,A.jsx)(`p`,{className:`text-xs text-danger`,children:t.error.message}),(0,A.jsx)(oe,{type:`submit`,size:`lg`,className:`self-start px-6`,disabled:!n.trim()||t.isPending,children:`Create profile`})]})]})})}function Ul({initial:e,maxLength:t,className:n,onCommit:r,onCancel:i}){let[a,o]=(0,k.useState)(e);return(0,A.jsx)(`input`,{autoFocus:!0,value:a,maxLength:t,onFocus:e=>e.currentTarget.select(),onChange:e=>o(e.target.value),onBlur:()=>r(a),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?r(a):e.key===`Escape`&&i()},className:D(`bg-transparent outline-none`,n)})}function Wl(e){return{onClick:e=>{e.detail===2&&e.preventDefault()},onDoubleClick:t=>{t.preventDefault(),e()}}}var Gl=null;function Kl(e){return Gl=e,()=>{Gl===e&&(Gl=null)}}function J(){Gl?.()}var ql=new Set;function Jl(e){let t=/^#settings\/([\w-]+)$/.exec(e);return t?t[1]:null}var Yl=Jl(window.location.hash);function Xl(){let e=Yl?`#settings/${Yl}`:``;window.location.hash!==e&&history.replaceState(null,``,window.location.pathname+window.location.search+e)}function Zl(e){if(e!==Yl){Yl=e;for(let e of ql)e()}queueMicrotask(Xl)}window.addEventListener(`hashchange`,()=>Zl(Jl(window.location.hash))),window.addEventListener(`popstate`,()=>Zl(Jl(window.location.hash)));function Ql(){return(0,k.useSyncExternalStore)(e=>(ql.add(e),()=>{ql.delete(e)}),()=>Yl)}function $l(e=`appearance`){Zl(e)}function eu(){Zl(null)}function tu(){return window.puddleDesktop}function nu(){let[e,t]=(0,k.useState)({fullScreen:!1,animate:!1});return(0,k.useEffect)(()=>{let e=tu();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var ru=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],iu=[{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],au=new Map(iu.map(e=>[e.id,e])),ou=typeof window<`u`&&tu()!==void 0;function su(e,t=ou){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function cu(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var lu={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},uu={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function du(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):uu[e]??e}function fu(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>lu[e]??e).join(``)+du(n)}var pu=new Map;function mu(e,t){return pu.set(e,t),()=>{pu.get(e)===t&&pu.delete(e)}}var hu=e=>pu.get(e),gu=e=>au.get(e);function _u(e,t){return e.id===`editor.save`||t&&e.editor!==!0}var vu={},yu=new Set,bu=xu();function xu(){let e={};for(let t of iu)e[t.id]=vu[t.id]||su(t);return e}function Su(e){vu=e??{},bu=xu(),yu.forEach(e=>e())}var Cu=e=>bu[e]??``;function wu(e){for(let[t,n]of Object.entries(bu))if(n===e)return t}function Tu(e){return fu(Eu()[e]??``)}function Eu(){return(0,k.useSyncExternalStore)(e=>(yu.add(e),()=>yu.delete(e)),()=>bu)}function Du(e,t,n){return!e||e.major>t||e.major===t&&e.minor>=n}function Ou(e){return Du(e,17,1)}function ku(e){return Du(e,17,3)}var Au=e=>Du(e,10,3),ju=e=>Du(e,12,3),Mu=e=>Du(e,12,4),Nu=e=>Du(e,15,3),Pu=e=>e!==void 0&&Du(e,16,3),Fu=e=>Du(e,16,4),Iu=e=>Du(e,14,1),Lu=500,Ru=1e4;function zu(e,t){return`${e} ${t}`}var Bu=new class{ws=null;open=!1;backoff=Lu;reconnectTimer=null;theme=null;terminals=new Map;statusListeners=new Set;renameListeners=new Set;accountListeners=new Set;switchListeners=new Set;sessionsChangedListeners=new Set;connectionListeners=new Set;shellWaiters=new Map;attach(e,t,n,r,i){let a={session:e,term:t,cols:n,rows:r,handlers:i};return this.terminals.set(zu(e,t),a),this.ensureConnected(),this.open&&this.send({t:`attach`,session:e,term:t,cols:n,rows:r}),()=>this.detach(e,t)}detach(e,t){this.terminals.delete(zu(e,t))&&this.open&&this.send({t:`detach`,session:e,term:t})}write(e,t,n){this.open&&this.send({t:`stdin`,session:e,term:t,data:n})}resize(e,t,n,r){let i=this.terminals.get(zu(e,t));i&&(i.cols=n,i.rows=r),this.open&&this.send({t:`resize`,session:e,term:t,cols:n,rows:r})}spawnShell(e){return this.ensureConnected(),new Promise(t=>{let n=this.shellWaiters.get(e)??[];n.push(t),this.shellWaiters.set(e,n),this.open&&this.send({t:`spawn-shell`,session:e})})}killShell(e,t){this.open&&this.send({t:`kill-shell`,session:e,term:t})}onStatus(e){return this.statusListeners.add(e),this.ensureConnected(),()=>this.statusListeners.delete(e)}onRenamed(e){return this.renameListeners.add(e),this.ensureConnected(),()=>this.renameListeners.delete(e)}onAccount(e){return this.accountListeners.add(e),this.ensureConnected(),()=>this.accountListeners.delete(e)}onSessionSwitched(e){return this.switchListeners.add(e),this.ensureConnected(),()=>this.switchListeners.delete(e)}onSessionsChanged(e){return this.sessionsChangedListeners.add(e),this.ensureConnected(),()=>this.sessionsChangedListeners.delete(e)}onConnectionChange(e){return this.connectionListeners.add(e),()=>this.connectionListeners.delete(e)}isConnected(){return this.open}reportTheme(e,t){this.theme&&this.theme.fg===e&&this.theme.bg===t||(this.theme={fg:e,bg:t},this.open&&this.send({t:`theme`,fg:e,bg:t}))}reset(){this.ws?.close()}ensureConnected(){this.ws||this.reconnectTimer||this.connect()}connect(){let e=c.get();if(!e)return;let t=window.location.protocol===`https:`?`wss`:`ws`,n=new WebSocket(`${t}://${window.location.host}/ws`);this.ws=n,n.addEventListener(`open`,()=>{this.open=!0,this.backoff=Lu,this.send({t:`auth`,token:e}),this.send({t:`subscribe-status`}),this.theme&&this.send({t:`theme`,fg:this.theme.fg,bg:this.theme.bg});for(let{session:e,term:t,cols:n,rows:r}of this.terminals.values())this.send({t:`attach`,session:e,term:t,cols:n,rows:r});for(let e of this.connectionListeners)e(!0)}),n.addEventListener(`message`,e=>{this.handle(JSON.parse(String(e.data)))}),n.addEventListener(`close`,()=>{let e=this.open;if(this.open=!1,this.ws=null,e)for(let e of this.connectionListeners)e(!1);this.scheduleReconnect()})}scheduleReconnect(){this.reconnectTimer||this.terminals.size===0&&this.statusListeners.size===0&&this.renameListeners.size===0&&this.accountListeners.size===0&&this.switchListeners.size===0&&this.sessionsChangedListeners.size===0||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},this.backoff),this.backoff=Math.min(this.backoff*2,Ru))}send(e){this.ws?.send(JSON.stringify(e))}handle(e){switch(e.t){case`replay`:case`output`:this.terminals.get(zu(e.session,e.term))?.handlers.onData(e.data,e.t);break;case`exit`:this.terminals.get(zu(e.session,e.term))?.handlers.onExit?.(e.code);break;case`status`:for(let t of this.statusListeners)t({session:e.session,status:e.status,last_activity_at:e.last_activity_at});break;case`renamed`:for(let t of this.renameListeners)t({session:e.session,title:e.title,agent_title:e.agent_title,osc_title:e.osc_title});break;case`account`:for(let t of this.accountListeners)t({account_id:e.account_id,profile_id:e.profile_id,logged_in:e.logged_in});break;case`session-switched`:for(let t of this.switchListeners)t(e);break;case`sessions-changed`:for(let t of this.sessionsChangedListeners)t(e);break;case`shell-spawned`:{let t=this.shellWaiters.get(e.session)?.shift();t&&t(e.term);break}case`notice`:(e.level===`warning`?l.warning:l.error)(e.title,{...e.detail===void 0?{}:{description:e.detail},duration:12e3});break;case`error`:l.error(`Connection error`,{description:e.message});break}}};function Vu(e){return e.trim().slice(0,5).toUpperCase()}function Hu(e){return e.abbrev??Vu(e.name)}function Uu(e){return e.trim().toUpperCase().slice(0,5)}function Wu(e,t){let[n,r]=(0,k.useState)(e);return(0,k.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Gu(e){let t=e.trim().replace(/\/+$/,``);return t===``?`/`:t}function Ku(e){return e.startsWith(`/`)||e.startsWith(`~`)}function Y(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function qu({dir:e,onNavigate:t,onChoose:n}){let r=ks(e.endsWith(`/`)?e:`${e}/`);return(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>t(Y(e)),disabled:e===`/`,title:`Parent directory`,className:`shrink-0 rounded-sm p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg disabled:pointer-events-none disabled:opacity-40`,children:[(0,A.jsx)(Mc,{className:`size-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Parent directory`})]}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`ml-auto shrink-0 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose this folder`})]}),(0,A.jsxs)(`div`,{className:`max-h-48 overflow-y-auto`,children:[(r.data?.entries??[]).map(e=>(0,A.jsxs)(`div`,{className:`flex items-center rounded-md transition-colors hover:bg-elevated`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>t(e.path),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1 text-left`,children:[e.is_git?(0,A.jsx)(ke,{className:`size-3.5 shrink-0 text-success`}):(0,A.jsx)(Vc,{className:`size-3.5 shrink-0 text-fg-gold`}),(0,A.jsx)(`span`,{className:`truncate text-xs text-fg`,children:e.name})]}),e.is_git&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>n(e.path),className:`shrink-0 px-2 py-1 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose`})]},e.path)),r.data!==void 0&&r.data.entries.length===0&&(0,A.jsx)(`p`,{className:`px-2 py-1 text-xs text-fg-muted`,children:`No subdirectories.`})]})]})}function Ju({profileId:e,open:t,onOpenChange:n}){let r=gs(),i=Hs(),a=Gs(),o=Fr(),s=js(),[c,l]=(0,k.useState)(``),[u,d]=(0,k.useState)(``),[f,p]=(0,k.useState)(!1),[m,h]=(0,k.useState)(``),[g,_]=(0,k.useState)(!1),[v,y]=(0,k.useState)(null),[b,x]=(0,k.useState)(null),S=s.data?.home,ee=()=>{let e=c.trim(),t=Ku(e)&&S!==void 0?Gu(e.replace(/^~(?=\/|$)/,S)):Ku(e)&&e.startsWith(`/`)?Gu(e):S??`/`;ne(t)},C=e=>{d(e),g||h(Vu(e))},ne=e=>{x(e),l(e)},re=e=>{l(e),x(null),C(e.split(`/`).filter(Boolean).pop()??``),p(!0)},ie=ks(Wu(c,150)),ae=(0,k.useMemo)(()=>{if(!Ku(c))return(r.data??[]).map(e=>({value:e.path,badge:`registered`,is_git:!0}));let e=new Set((r.data??[]).map(e=>e.path));return(ie.data?.entries??[]).map(t=>({value:t.path,label:t.name,badge:e.has(t.path)?`registered`:t.is_git?`git`:void 0,is_git:t.is_git}))},[c,r.data,ie.data]),ce=async()=>{y(null);try{let t=Gu(c),s=r.data?.find(e=>e.path===t)?.id??(await i.mutateAsync({path:t})).id,l=await a.mutateAsync({profile_id:e,repo_id:s,name:u.trim(),...Uu(m)?{abbrev:Uu(m)}:{}});n(!1),o(`/project/${l.id}`)}catch(e){y(e instanceof Error?e.message:String(e))}},le=u.trim()!==``&&Ku(c.trim());return(0,A.jsx)(me,{open:t,onOpenChange:n,children:(0,A.jsxs)(w,{children:[(0,A.jsxs)(te,{children:[(0,A.jsx)(T,{children:`New project`}),(0,A.jsx)(fe,{children:`Point at a git repository on the daemon host — known repositories are reused.`})]}),(0,A.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),le&&ce()},children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(xe,{htmlFor:`repo-path`,children:`Repository path`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>b===null?ee():x(null),className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:b===null?`browse…`:`hide browser`})]}),(0,A.jsx)(Oe,{id:`repo-path`,placeholder:`~/src/my-repo`,value:c,onValueChange:l,onChoose:e=>{!f&&e.is_git&&C(e.value.split(`/`).filter(Boolean).pop()??``)},hints:ae}),b!==null&&(0,A.jsx)(qu,{dir:b,onNavigate:ne,onChoose:re})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(xe,{htmlFor:`project-name`,children:`Project name`}),(0,A.jsx)(Te,{id:`project-name`,placeholder:`e.g. checkout-rework`,value:u,onChange:e=>{C(e.target.value),p(!0)}})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(xe,{htmlFor:`project-abbrev`,children:`Abbreviation`}),(0,A.jsx)(Te,{id:`project-abbrev`,placeholder:u.trim()?Vu(u):`ABBRV`,maxLength:5,value:m,onChange:e=>{h(Uu(e.target.value)),_(!0)},className:`w-24 uppercase`}),(0,A.jsxs)(`p`,{className:`text-2xs text-fg-muted`,children:[`Up to `,5,` characters — the project's label on the collapsed sidebar rail.`]})]}),v&&(0,A.jsx)(`p`,{className:`text-xs text-danger`,children:v}),(0,A.jsxs)(se,{children:[(0,A.jsx)(oe,{type:`button`,variant:`ghost`,onClick:()=>n(!1),children:`Cancel`}),(0,A.jsx)(oe,{type:`submit`,disabled:!le||i.isPending||a.isPending,children:`Create project`})]})]})]})})}var Yu=1,Xu=.9,Zu=.8,Qu=.17,$u=.1,ed=.999,td=.9999,nd=.99,rd=/[\\\/_+.#"@\[\(\{&]/,id=/[\\\/_+.#"@\[\(\{&]/g,ad=/[\s-]/,od=/[\s-]/g;function sd(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Yu:nd;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=sd(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Yu:rd.test(e.charAt(l-1))?(d*=Zu,p=e.slice(i,l-1).match(id),p&&i>0&&(d*=ed**+p.length)):ad.test(e.charAt(l-1))?(d*=Xu,m=e.slice(i,l-1).match(od),m&&i>0&&(d*=ed**+m.length)):(d*=Qu,i>0&&(d*=ed**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=td)),(d<$u&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=sd(e,t,n,r,l+1,a+2,o),f*$u>d&&(d=f*$u)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function cd(e){return e.toLowerCase().replace(od,` `)}function ld(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,sd(e,t,cd(e),cd(t),0,0,{})}var ud=`[cmdk-group=""]`,dd=`[cmdk-group-items=""]`,fd=`[cmdk-group-heading=""]`,pd=`[cmdk-item=""]`,md=`${pd}:not([aria-disabled="true"])`,hd=`cmdk-item-select`,gd=`data-value`,_d=(e,t,n)=>ld(e,t,n),vd=k.createContext(void 0),yd=()=>k.useContext(vd),bd=k.createContext(void 0),xd=()=>k.useContext(bd),X=k.createContext(void 0),Sd=k.forwardRef((e,t)=>{let n=Fd(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Fd(()=>new Set),i=Fd(()=>new Map),a=Fd(()=>new Map),o=Fd(()=>new Set),s=Pd(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=_e(),b=_e(),x=_e(),S=k.useRef(null),ee=Ld();Z(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Z(()=>{ee(6,oe)},[]);let C=k.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)ae(),re(),ee(1,ie);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(ee(7,()=>{n.current.selectedItemId=se()?.id,C.emit()}),r||ee(5,oe),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),te=k.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,ne(t,r)),ee(2,()=>{re(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),ee(3,()=>{ae(),re(),n.current.value||ie(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=se();ee(4,()=>{ae(),t?.getAttribute(`id`)===e&&ie(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:x,labelId:b,listInnerRef:S}),[]);function ne(e,t){let r=s.current?.filter??_d;return e?r(e,n.current.search,t):0}function re(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;ce().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(dd);t?t.appendChild(e.parentElement===t?e:e.closest(`${dd} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${dd} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${ud}[${gd}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function ie(){let e=ce().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(gd);C.setState(`value`,e||void 0)}function ae(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=ne(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function oe(){var e;let t=se();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ud)?.querySelector(fd))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function se(){return S.current?.querySelector(`${pd}[aria-selected="true"]`)}function ce(){return Array.from(S.current?.querySelectorAll(md)||[])}function le(e){let t=ce()[e];t&&C.setState(`value`,t.getAttribute(gd))}function ue(e){var t;let n=se(),r=ce(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(gd))}function w(e){let t=se()?.closest(ud),n;for(;t&&!n;)t=e>0?Md(t,ud):Nd(t,ud),n=t?.querySelector(md);n?C.setState(`value`,n.getAttribute(gd)):ue(e)}let T=()=>le(ce().length-1),de=e=>{e.preventDefault(),e.metaKey?T():e.altKey?w(1):ue(1)},fe=e=>{e.preventDefault(),e.metaKey?le(0):e.altKey?w(-1):ue(-1)};return k.createElement(y.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&de(e);break;case`ArrowDown`:de(e);break;case`p`:case`k`:g&&e.ctrlKey&&fe(e);break;case`ArrowUp`:fe(e);break;case`Home`:e.preventDefault(),le(0);break;case`End`:e.preventDefault(),T();break;case`Enter`:{e.preventDefault();let t=se();if(t){let e=new Event(hd);t.dispatchEvent(e)}}}}},k.createElement(`label`,{"cmdk-label":``,htmlFor:te.inputId,id:te.labelId,style:Bd},c),zd(e,e=>k.createElement(bd.Provider,{value:C},k.createElement(vd.Provider,{value:te},e))))}),Cd=k.forwardRef((e,t)=>{let n=_e(),r=k.useRef(null),i=k.useContext(X),a=yd(),o=Pd(e),s=o.current?.forceMount??i?.forceMount;Z(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Id(n,r,[e.value,e.children,r],e.keywords),l=xd(),u=Q(e=>e.value&&e.value===c.current),d=Q(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);k.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(hd,f),()=>t.removeEventListener(hd,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...b}=e;return k.createElement(y.div,{ref:S(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),wd=k.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=_e(),s=k.useRef(null),c=k.useRef(null),l=_e(),u=yd(),d=Q(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Z(()=>u.group(o),[]),Id(o,s,[e.value,e.heading,c]);let f=k.useMemo(()=>({id:o,forceMount:i}),[i]);return k.createElement(y.div,{ref:S(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&k.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),zd(e,e=>k.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},k.createElement(X.Provider,{value:f},e))))}),Td=k.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=k.useRef(null),a=Q(e=>!e.search);return!n&&!a?null:k.createElement(y.div,{ref:S(i,t),...r,"cmdk-separator":``,role:`separator`})}),Ed=k.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=xd(),o=Q(e=>e.search),s=Q(e=>e.selectedItemId),c=yd();return k.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),k.createElement(y.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Dd=k.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=k.useRef(null),o=k.useRef(null),s=Q(e=>e.selectedItemId),c=yd();return k.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),k.createElement(y.div,{ref:S(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},zd(e,e=>k.createElement(`div`,{ref:S(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Od=k.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return k.createElement(pe,{open:n,onOpenChange:r},k.createElement(he,{container:o},k.createElement(le,{"cmdk-overlay":``,className:i}),k.createElement(ne,{"aria-label":e.label,"cmdk-dialog":``,className:a},k.createElement(Sd,{ref:t,...s}))))}),kd=k.forwardRef((e,t)=>Q(e=>e.filtered.count===0)?k.createElement(y.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Ad=k.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return k.createElement(y.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},zd(e,e=>k.createElement(`div`,{"aria-hidden":!0},e)))}),jd=Object.assign(Sd,{List:Dd,Item:Cd,Input:Ed,Group:wd,Separator:Td,Dialog:Od,Empty:kd,Loading:Ad});function Md(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nd(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pd(e){let t=k.useRef(e);return Z(()=>{t.current=e}),t}var Z=typeof window>`u`?k.useEffect:k.useLayoutEffect;function Fd(e){let t=k.useRef();return t.current===void 0&&(t.current=e()),t}function Q(e){let t=xd(),n=()=>e(t.snapshot());return k.useSyncExternalStore(t.subscribe,n,n)}function Id(e,t,n,r=[]){let i=k.useRef(),a=yd();return Z(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(gd,s),i.current=s}),i}var Ld=()=>{let[e,t]=k.useState(),n=Fd(()=>new Map);return Z(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Rd(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function zd({asChild:e,children:t},n){return e&&k.isValidElement(t)?k.cloneElement(Rd(t),{ref:t.ref},n(t.props.children)):n(t)}var Bd={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Vd({className:e,...t}){return(0,A.jsx)(jd,{className:D(`flex size-full flex-col overflow-hidden rounded-lg bg-elevated`,e),...t})}function Hd({open:e,onOpenChange:t,children:n}){return(0,A.jsx)(me,{open:e,onOpenChange:t,children:(0,A.jsx)(w,{className:`max-w-lg overflow-hidden p-0 [&>button]:hidden`,children:(0,A.jsx)(Vd,{loop:!0,children:n})})})}function Ud({className:e,...t}){return(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pt-1`,children:[(0,A.jsx)(vl,{className:`size-4 shrink-0 text-fg-muted`}),(0,A.jsx)(jd.Input,{className:D(`flex h-10 w-full bg-transparent text-sm text-fg outline-none placeholder:text-fg-muted`,e),...t})]})}function Wd({className:e,...t}){return(0,A.jsx)(jd.List,{className:D(`max-h-72 overflow-y-auto p-1`,e),...t})}function Gd(e){return(0,A.jsx)(jd.Empty,{className:`py-6 text-center text-sm text-fg-muted`,...e})}function Kd({className:e,...t}){return(0,A.jsx)(jd.Group,{className:D(`overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-2xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-fg-muted`,e),...t})}function qd({className:e,...t}){return(0,A.jsx)(jd.Item,{className:D(Ee,Se,`[&_svg]:size-3.5 [&_svg]:text-fg-muted data-[selected=true]:[&_svg]:text-action-ink`,e),...t})}function Jd({className:e,...t}){return(0,A.jsx)(`span`,{className:D(`ml-auto font-mono text-2xs tracking-widest text-fg-muted`,e),...t})}async function Yd(){try{let e=await fetch(`/cockpit/refresh`,{method:`POST`,headers:{authorization:`Bearer ${c.get()??``}`}});return e.status===202?(m.parse(await e.json()),!0):!1}catch{return!1}}async function Xd(e=12e4){let t=Date.now()+e;for(;Date.now()<t;){await new Promise(e=>setTimeout(e,1e3));try{return await fetch(`/api/version`,{cache:`no-store`}),!0}catch{}}return!1}var Zd=null;function Qd(e){return Zd=e,()=>{Zd===e&&(Zd=null)}}function $d(){Zd?.()}var ef=null;function tf(e){return ef=e,()=>{ef===e&&(ef=null)}}async function nf(e){if(!ef)throw Error(`Open a project before opening a path.`);await ef(e)}var rf=new Set;function af(){return[...rf].flatMap(e=>e())}function of(e){return e.title??e.agent_title??e.osc_title??e.id.slice(0,8)}var sf=` — `;function cf(e){return e.replace(/\/+$/,``).split(`/`).pop()??``}function lf(e){return{name:of(e),title:e.title??``,agentName:e.agent_title??``,sequence:e.osc_title??``,branch:e.branch,cwd:cf(e.worktree_path),id:e.id.slice(0,8),status:e.status,agent:e.agent_type??``}}function uf(e,t){let n=t&&t.length>0?t:h,r=lf(e),i=[];for(let e of n.split(/(\$\{[a-zA-Z]+\})/)){if(e===``)continue;let t=/^\$\{([a-zA-Z]+)\}$/.exec(e)?.[1];t===void 0?i.push({text:e,sep:!1}):t===`separator`?i.push({text:sf,sep:!0}):i.push({text:r[t]??e,sep:!1})}let a=[];i.forEach((e,t)=>{if(!e.sep){a.push(e.text);return}let n=a.join(``).trim().length>0,r=i.slice(t+1).some(e=>!e.sep&&e.text.trim().length>0);n&&r&&a.push(e.text)});let o=a.join(``).trim();return o.length>0?o:e.id.slice(0,8)}function df(){let e=ps(K()??void 0).data?.tabTitleTemplate;return(0,k.useCallback)(t=>uf(t,e),[e])}function ff({onNewSession:e,onNewProject:t}){let[n,r]=(0,k.useState)(!1),[i,a]=(0,k.useState)(`commands`),[o,s]=(0,k.useState)(``),[c,l]=(0,k.useState)(null),[u,d]=(0,k.useState)(!1),f=Fr(),p=zr(),m=K(),h=p.id,g=_s(m??void 0),_=bs(h),v=df();(0,k.useEffect)(()=>mu(`palette.toggle`,()=>r(e=>!e)),[]),(0,k.useEffect)(()=>Kl(()=>r(!0)),[]),(0,k.useEffect)(()=>{n||(a(`commands`),s(``),l(null),d(!1))},[n]);let y=(0,k.useMemo)(()=>{let n=[];for(let e of g.data??[])n.push({id:`project-${e.id}`,group:`Projects`,label:e.name,icon:V,keywords:`switch project open`,run:()=>void f(`/project/${e.id}`)});for(let e of _.data??[])e.status!==`archived`&&n.push({id:`session-${e.id}`,group:`Sessions`,label:v(e),icon:El,keywords:`switch session ${e.branch}`,run:()=>void f(`/project/${e.project_id}/session/${e.id}`)});return h!==void 0&&e&&n.push({id:`new-agent`,group:`Actions`,label:`New agent`,icon:bc,keywords:`new agent create start session`,run:()=>e()},{id:`new-terminal`,group:`Actions`,label:`New terminal`,icon:El,keywords:`new terminal create start shell session`,run:()=>e({kind:`terminal`})}),h!==void 0&&n.push({id:`open-path`,group:`Actions`,label:`Open path`,icon:V,keywords:`open path file directory folder editor tree browse absolute relative home`,closeOnRun:!1,run:()=>{s(``),l(null),a(`path`)}}),t&&n.push({id:`new-project`,group:`Actions`,label:`New project`,icon:H,keywords:`new project open create repository repo workspace`,run:t}),n.push({id:`theme-dark`,group:`Theme`,label:`Switch theme: dark`,icon:nl,keywords:`switch theme dark appearance`,run:()=>void Da(`dark`)},{id:`theme-light`,group:`Theme`,label:`Switch theme: light`,icon:Ol,keywords:`switch theme light appearance`,run:()=>void Da(`light`)},{id:`theme-system`,group:`Theme`,label:`Switch theme: system`,icon:tl,keywords:`switch theme system appearance`,run:()=>void Da(`system`)},{id:`open-settings`,group:`Actions`,label:`Settings`,icon:bl,keywords:`open settings preferences options configure`,run:()=>$l()},{id:`switch-profile`,group:`Actions`,label:`Switch profile`,icon:Il,keywords:`switch profile identity user change`,run:()=>G.set(null)},{id:`refresh-connection`,group:`Actions`,label:`Refresh connection`,icon:ml,keywords:`refresh connection reconnect restart cockpit tunnel ssh daemon`,run:()=>$d()}),[...n,...af()]},[g.data,_.data,h,f,e,t,v]),b=(0,k.useMemo)(()=>{let e=new Map;for(let t of y){let n=e.get(t.group)??[];n.push(t),e.set(t.group,n)}return[...e.entries()]},[y]),x=async()=>{let e=o.trim();if(!(e===``||u)){d(!0),l(null);try{await nf(e),r(!1)}catch(e){l(e instanceof Error?e.message:`Could not open that path.`)}finally{d(!1)}}};return(0,A.jsxs)(Hd,{open:n,onOpenChange:r,children:[(0,A.jsx)(Ud,{value:o,onValueChange:e=>{s(e),l(null)},placeholder:i===`path`?`Enter a path…`:`Type a command or search…`,onKeyDown:e=>{i===`path`&&(e.key===`Enter`?(e.preventDefault(),e.stopPropagation(),x()):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),a(`commands`),s(``),l(null)))}}),i===`path`?(0,A.jsx)(Wd,{children:(0,A.jsxs)(`div`,{className:`px-3 py-3 text-xs text-fg-muted`,children:[(0,A.jsx)(`p`,{children:`Relative paths start from the bound worktree or project. Absolute and ~ paths work too.`}),(0,A.jsx)(`p`,{className:c?`mt-2 text-danger`:`mt-2`,"aria-live":`polite`,children:c??(u?`Opening…`:`Press Enter to open.`)})]})}):(0,A.jsxs)(Wd,{children:[(0,A.jsx)(Gd,{children:`Nothing matches.`}),b.map(([e,t])=>(0,A.jsx)(Kd,{heading:e,children:t.map(e=>{let t=e.icon;return(0,A.jsxs)(qd,{value:`${e.label} ${e.keywords??``}`,onSelect:()=>{e.closeOnRun!==!1&&r(!1),e.run()},children:[t&&(0,A.jsx)(t,{}),e.label,e.shortcut&&(0,A.jsx)(Jd,{children:e.shortcut})]},e.id)})},e))]})]})}function pf(){let e=document.activeElement;return e instanceof Element&&e.closest(`.xterm`)!==null}function mf(){let e=document.activeElement;return e instanceof Element&&e.closest(`.monaco-editor`)!==null}function hf(){let e=ps(K()??void 0).data?.hotkeys;return(0,k.useEffect)(()=>{Su(e&&typeof e==`object`?e:void 0)},[e]),(0,k.useEffect)(()=>mu(`window.close`,()=>{let e=tu();e?.closeWindow?e.closeWindow():window.close()}),[]),(0,k.useEffect)(()=>{let e=e=>{let t=cu(e);if(!t)return;let n=wu(t);if(!n)return;let r=gu(n);if(!r||!_u(r,mf()))return;let i=hu(n);i&&(e.preventDefault(),e.stopPropagation(),i())},t=e=>{let t=cu(e);if(!t)return;let n=wu(t);if(!n)return;let r=gu(n);if(!r||r.editor&&mf()||r.deferInTerminal&&pf())return;let i=hu(n);i&&(e.preventDefault(),i())};return window.addEventListener(`keydown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,e,!0),window.removeEventListener(`keydown`,t)}},[]),null}var gf=4e3;function _f(){let[e,t]=(0,k.useState)(`hidden`),n=(0,k.useRef)(e);n.current=e,(0,k.useEffect)(()=>{let e=null,r=Bu.onConnectionChange(r=>{if(r){e!==null&&clearTimeout(e),e=null,n.current===`lost`&&t(`hidden`);return}e!==null||n.current!==`hidden`||(e=setTimeout(()=>{e=null,n.current===`hidden`&&t(`lost`)},gf))});return()=>{r(),e!==null&&clearTimeout(e)}},[]);let r=(0,k.useCallback)(async()=>{if(n.current===`refreshing`)return;t(`refreshing`);let e=()=>t(Bu.isConnected()?`hidden`:`lost`);if(!await Yd()){l.error("The cockpit did not accept the refresh — run `puddle refresh` in a terminal."),e();return}if(await Xd()){window.location.reload();return}l.error(`The cockpit has not come back — it may need a terminal (ssh re-auth): puddle refresh`),e()},[]);return(0,k.useEffect)(()=>Qd(()=>void r()),[r]),e===`hidden`?null:(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 bg-elevated px-3 py-2`,children:[(0,A.jsx)(`span`,{className:`text-xs text-fg-secondary`,children:e===`refreshing`?`Restarting the cockpit.`:`Connection to the daemon lost.`}),e===`lost`&&(0,A.jsxs)(oe,{size:`sm`,className:`ml-auto`,onClick:()=>void r(),children:[(0,A.jsx)(ml,{}),`Refresh connection`]})]})}var vf=`Popover`,[yf,bf]=b(vf,[Ne]),xf=Ne(),[Sf,Cf]=yf(vf),wf=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=xf(t),c=k.useRef(null),[l,u]=k.useState(!1),[d,f]=ae({prop:r,defaultProp:i??!1,onChange:a,caller:vf});return(0,A.jsx)(Me,{...s,children:(0,A.jsx)(Sf,{scope:t,contentId:_e(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:k.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:k.useCallback(()=>u(!0),[]),onCustomAnchorRemove:k.useCallback(()=>u(!1),[]),modal:o,children:n})})};wf.displayName=vf;var Tf=`PopoverAnchor`,Ef=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Cf(Tf,n),a=xf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return k.useEffect(()=>(o(),()=>s()),[o,s]),(0,A.jsx)(we,{...a,...r,ref:t})});Ef.displayName=Tf;var Df=`PopoverTrigger`,Of=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Cf(Df,n),a=xf(n),o=ce(t,i.triggerRef),s=(0,A.jsx)(y.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Uf(i.open),...r,ref:o,onClick:v(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,A.jsx)(we,{asChild:!0,...a,children:s})});Of.displayName=Df;var kf=`PopoverPortal`,[Af,jf]=yf(kf,{forceMount:void 0}),Mf=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Cf(kf,t);return(0,A.jsx)(Af,{scope:t,forceMount:n,children:(0,A.jsx)(C,{present:n||a.open,children:(0,A.jsx)(E,{asChild:!0,container:i,children:r})})})};Mf.displayName=kf;var Nf=`PopoverContent`,Pf=k.forwardRef((e,t)=>{let n=jf(Nf,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Cf(Nf,e.__scopePopover);return(0,A.jsx)(C,{present:r||a.open,children:a.modal?(0,A.jsx)(If,{...i,ref:t}):(0,A.jsx)(Lf,{...i,ref:t})})});Pf.displayName=Nf;var Ff=ee(`PopoverContent.RemoveScroll`),If=k.forwardRef((e,t)=>{let n=Cf(Nf,e.__scopePopover),r=k.useRef(null),i=ce(t,r),a=k.useRef(!1);return k.useEffect(()=>{let e=r.current;if(e)return re(e)},[]),(0,A.jsx)(ie,{as:Ff,allowPinchZoom:!0,children:(0,A.jsx)(Rf,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:v(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:v(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:v(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Lf=k.forwardRef((e,t)=>{let n=Cf(Nf,e.__scopePopover),r=k.useRef(!1),i=k.useRef(!1);return(0,A.jsx)(Rf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Rf=k.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Cf(Nf,n),p=xf(n);return de(),(0,A.jsx)(ue,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,A.jsx)(ge,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,A.jsx)(ve,{"data-state":Uf(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),zf=`PopoverClose`,Bf=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Cf(zf,n);return(0,A.jsx)(y.button,{type:`button`,...r,ref:t,onClick:v(e.onClick,()=>i.onOpenChange(!1))})});Bf.displayName=zf;var Vf=`PopoverArrow`,Hf=k.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=xf(n);return(0,A.jsx)(Ce,{...i,...r,ref:t})});Hf.displayName=Vf;function Uf(e){return e?`open`:`closed`}var Wf=wf,Gf=Of,Kf=Mf,qf=Pf,Jf=Wf,Yf=Gf;function Xf({className:e,align:t=`end`,sideOffset:n=8,...r}){return(0,A.jsx)(Kf,{children:(0,A.jsx)(qf,{align:t,sideOffset:n,className:D(`z-50 rounded-lg bg-elevated p-5 shadow-2xl outline-none`,e),...r})})}function Zf({stream:e,label:t,hint:n,onClose:r}){let[i,a]=(0,k.useState)(null);return(0,A.jsx)(me,{open:!0,onOpenChange:e=>!e&&r(),children:(0,A.jsxs)(w,{className:`h-[85vh] max-w-[calc(100vw-4rem)]`,children:[(0,A.jsxs)(te,{children:[(0,A.jsxs)(T,{children:[t,` — login`]}),(0,A.jsx)(fe,{children:i===null?`Complete the agent’s login flow below.${n===void 0?` The account shows as logged in once it finishes cleanly.`:` ${n}`}`:`The login exited with code ${i} without completing. The output above may say why; close this and try again.`})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-md bg-ground p-1`,children:(0,A.jsx)(Ae,{stream:e,onExit:e=>e===0?r():a(e)})})]})})}var Qf=(0,k.createContext)({open:()=>void 0,handler:null,setHandler:()=>void 0});function $f({children:e}){let[t,n]=(0,k.useState)(null),r=(0,k.useCallback)(e=>n(()=>e),[]),i=(0,k.useCallback)(e=>t?.(e),[t]),a=(0,k.useMemo)(()=>({open:i,handler:t,setHandler:r}),[i,t,r]);return(0,A.jsx)(Qf.Provider,{value:a,children:e})}function ep(){return(0,k.useContext)(Qf)}function tp({label:e,percentage:t,hint:n}){let r=Math.max(0,Math.min(100,t));return(0,A.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`w-24 shrink-0 truncate text-2xs text-fg-muted`,title:e,children:e}),(0,A.jsx)(`span`,{className:`relative h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-border`,children:(0,A.jsx)(`span`,{className:`absolute inset-y-0 left-0 rounded-full ${r>=90?`bg-danger`:r>=75?`bg-warning`:`bg-action`}`,style:{width:`${r}%`}})}),(0,A.jsxs)(`span`,{className:`shrink-0 text-2xs tabular-nums text-fg-muted`,children:[Math.round(r),`%`,n?` · ${n}`:``]})]})}function np(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function rp(e){if(e===null)return`never`;let t=new Date(e).getTime(),n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function ip({account:e,onLogin:t,onStartSession:n,installed:r=!0}){let i=hs(e.id),a=e.logged_in?n:r?t:null,o=i.data?.subscription;return(0,A.jsxs)(`div`,{className:`rounded-md px-2 py-2 transition-colors hover:bg-elevated`,children:[(0,A.jsxs)(`button`,{type:`button`,disabled:a===null,onClick:()=>a?.(),className:`flex w-full items-center gap-3 text-left disabled:cursor-default`,children:[(0,A.jsx)(`span`,{className:`size-2 shrink-0 rounded-full ${e.logged_in?`bg-success`:`bg-idle`}`,"aria-hidden":!0}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm text-fg`,children:e.label}),(0,A.jsxs)(`span`,{className:`block text-2xs text-fg-muted`,children:[e.logged_in?`logged in`:`logged out`,i.data&&(0,A.jsxs)(A.Fragment,{children:[` · `,i.data.session_count,` session`,i.data.session_count===1?``:`s`,i.data.active_session_count>0&&` (${i.data.active_session_count} active)`,` · `,`last `,rp(i.data.last_activity_at)]})]}),i.data?.agent_usage&&(0,A.jsxs)(`span`,{className:`block text-2xs text-fg-muted`,children:[np(i.data.agent_usage.input_tokens),` in ·`,` `,np(i.data.agent_usage.output_tokens),` out ·`,` `,np(i.data.agent_usage.cache_read_input_tokens),` cached ·`,` `,i.data.agent_usage.message_count,` msgs`]}),i.data?.live_usage?.context_used_percentage!=null&&(0,A.jsx)(`span`,{className:`mt-1 block`,children:(0,A.jsx)(tp,{label:`context`,percentage:i.data.live_usage.context_used_percentage})})]}),(0,A.jsx)(`span`,{className:`shrink-0 text-2xs text-fg-muted`,children:r?e.logged_in?n?`new agent`:``:(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-warning`,children:[(0,A.jsx)(Zc,{className:`size-3`}),`sign in`]}):`unavailable`})]}),o!=null&&o.windows.length>0&&(0,A.jsx)(`div`,{className:`mt-2 flex flex-col gap-1 pl-5`,children:o.windows.map(e=>(0,A.jsx)(tp,{label:e.label,percentage:e.used_percentage,hint:e.resets==null?void 0:`resets ${e.resets}`},e.key))})]})}function ap(){let[e,t]=(0,k.useState)(!1),[n,r]=(0,k.useState)(!1),i=K(),a=fs(),o=Is(),s=a.data?.find(e=>e.id===i),c=ms(i??void 0),l=Ns(),u=Vs(),{open:d,handler:f}=ep(),[p,m]=(0,k.useState)(null),h=e=>u.mutate(e.id,{onSuccess:t=>m({stream:t.stream,label:`${e.agent_type}/${e.label}`}),onError:e=>ye(e)}),g=e=>{t(!1),d({accountId:e.id})};return n&&s?(0,A.jsxs)(`div`,{className:`flex h-8 items-center gap-2 px-3`,children:[(0,A.jsx)(W,{icon:s.icon,colour:s.icon_colour}),(0,A.jsx)(Ul,{initial:s.name,maxLength:100,className:D(`w-32 text-sm`,U(s.icon_colour)),onCommit:e=>{r(!1);let t=e.trim();!i||!t||t===s?.name||o.mutate({id:i,name:t},{onError:e=>ye(e)})},onCancel:()=>r(!1)})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(Jf,{open:e,onOpenChange:t,children:[(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsx)(Yf,{asChild:!0,children:(0,A.jsxs)(oe,{variant:`ghost`,size:`sm`,className:`font-sans compact:h-7 compact:px-1.5`,children:[(0,A.jsx)(W,{icon:s?.icon,colour:s?.icon_colour}),(0,A.jsx)(`span`,{className:U(s?.icon_colour),...Wl(()=>{t(!1),r(!0)}),children:s?.name??`…`})]})})}),(0,A.jsx)(jo,{children:`Profile`})]}),(0,A.jsxs)(Xf,{className:`w-[28rem] max-w-[calc(100vw-1rem)]`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(l.data??[]).map(e=>{let t=c.data?.filter(t=>t.agent_type===e.id)??[];if(t.length===0)return null;let n=e.available!==!1;return(0,A.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,A.jsxs)(`span`,{className:`px-2 text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:[e.display_name,!n&&(0,A.jsxs)(`span`,{className:`ml-2 normal-case tracking-normal text-fg-muted`,children:[`not installed — no `,e.binary??e.id,` on PATH`]})]}),t.map(e=>(0,A.jsx)(ip,{account:e,onLogin:()=>h(e),onStartSession:f&&n?()=>g(e):null,installed:n},e.id))]},e.id)}),c.data?.length===0&&(0,A.jsx)(`p`,{className:`px-2 text-sm text-fg-muted`,children:`No accounts yet — add one in settings.`})]}),(0,A.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,A.jsxs)(oe,{variant:`ghost`,size:`sm`,onClick:()=>{t(!1),$l(`accounts`)},children:[(0,A.jsx)(H,{}),`Add account`]}),(0,A.jsxs)(oe,{variant:`ghost`,size:`sm`,className:`ml-auto`,onClick:()=>{t(!1),G.set(null)},children:[(0,A.jsx)(yl,{}),`Switch profile`]})]})]})]}),p&&(0,A.jsx)(Zf,{stream:p.stream,label:p.label,onClose:()=>m(null)})]})}var op=`desktop-update`;function sp(){let e=(0,k.useRef)(null);return(0,k.useEffect)(()=>{let t=tu();if(t?.updateReady===void 0||t.onUpdateReady===void 0)return;let n=t=>{e.current!==t&&(e.current=t,l(`Puddle ${t} is downloaded and ready.`,{id:op,duration:1/0,closeButton:!0,action:{label:`Restart to update`,onClick:()=>{tu()?.installUpdate?.(),l.loading(`Restarting into Puddle ${t}…`,{id:`${op}-restarting`,duration:1/0})}}}))};return t.updateReady().then(e=>{e!==null&&n(e)}),t.onUpdateReady(n)},[]),null}var cp=e=>e&&typeof e==`object`?e:{},lp=[{id:`appearance`,label:`Appearance`,fields:[{key:`theme`,store:`theme`},{key:`cursorPackage`,store:`client`},{key:`uiFontSize`,store:`client`},{key:`terminalFontSize`,store:`client`},{key:`editorFontSize`,store:`client`},{key:`density`,store:`client`},{key:`terminalScrollback`,store:`client`},{key:`projectBasedLayout`,store:`client`},{key:`showAllProjectSessions`,store:`client`}]},{id:`profile`,label:`Profile`,fields:[{key:`branch_prefix`,store:`profileColumn`},{key:`icon`,store:`profileColumn`},{key:`icon_colour`,store:`profileColumn`}]},{id:`sessions`,label:`Sessions`,fields:[{key:`onboardingTemplate`,store:`profileSettings`},{key:`concurrentTemplate`,store:`profileSettings`},{key:`restartTemplate`,store:`profileSettings`},{key:`tabTitleTemplate`,store:`profileSettings`},{key:`sessionDefaults`,store:`profileSettings`},{key:`allowSkipPermissions`,store:`profileSettings`},{key:`captureSessionEnv`,store:`profileSettings`}]},{id:`editor`,label:`Editor`,fields:[{key:`editorTabSize`,store:`client`},{key:`editorWordWrap`,store:`client`},{key:`editorLinkSshHost`,store:`client`}]},{id:`hotkeys`,label:`Hotkeys`,fields:[{key:`hotkeys`,store:`profileSettings`}]},{id:`notifications`,label:`Notifications`,fields:[{key:`notifications`,store:`profileSettings`,pick:e=>{let{desktop:t,sound:n}=cp(e);return{desktop:t,sound:n}},mergeInto:(e,t)=>({...cp(t),...cp(e)})}]},{id:`scratchpad`,label:`Scratchpad (profile-wide entries)`,fields:[{key:`entries`,store:`scratchpad`}]}];function up(e){return e.filter(e=>e.scope===`profile`).map(e=>({title:e.title,body:e.body,tags:e.tags,agent_type:e.agent_type}))}function dp(e){return JSON.stringify([e.title??``,e.body,e.tags,e.agent_type??``])}function fp(e,t){if(!Array.isArray(e))return[];let n=new Set(up(t).map(dp)),r=new Set,i=[];for(let t of e){let e=cp(t);if(typeof e.body!=`string`||e.body.length===0)continue;let a={title:typeof e.title==`string`&&e.title!==``?e.title:null,body:e.body,tags:Array.isArray(e.tags)?e.tags.filter(e=>typeof e==`string`):[],agent_type:typeof e.agent_type==`string`?e.agent_type:null},o=dp(a);n.has(o)||r.has(o)||(r.add(o),i.push(a))}return i}function pp(e,t){switch(e.store){case`client`:return t.client[e.key];case`theme`:return t.theme;case`profileSettings`:return t.profileSettings[e.key];case`profileColumn`:return t.profile[e.key];case`scratchpad`:return up(t.scratchpad)}}function mp(e,t){let n={};for(let r of lp){if(!e.includes(r.id))continue;let i={};for(let e of r.fields){let n=pp(e,t);n!==void 0&&(i[e.key]=e.pick?e.pick(n):n)}Object.keys(i).length>0&&(n[r.id]=i)}return n}function hp(e,t,n,r){if(!e||typeof e!=`object`)return[];let i=e,a={},o={},s={},c=[];for(let e of lp){if(r&&!r.includes(e.id))continue;let l=i[e.id];if(!l||typeof l!=`object`)continue;let u=l,d=!1;for(let r of e.fields){if(!(r.key in u))continue;let e=u[r.key];if(r.store===`scratchpad`){let r=fp(e,n.scratchpad);r.length>0&&(t.createScratchpad(r),d=!0);continue}d=!0;let i=r.mergeInto?r.mergeInto(e,r.store===`profileSettings`?n.profileSettings[r.key]:void 0):e;r.store===`client`?a[r.key]=i:r.store===`theme`?t.setTheme(i):r.store===`profileSettings`?o[r.key]=i:s[r.key]=i}d&&c.push(e.label)}return Object.keys(a).length>0&&t.setClient(a),Object.keys(o).length>0&&t.patchProfileSettings(o),Object.keys(s).length>0&&t.patchProfileColumns(s),c}var gp={version:1,profiles:{}};function _p(e,t){return e.profiles[t]??{enabled:!0,groups:lp.map(e=>e.id),doc:{},updatedAt:new Date(0).toISOString()}}async function vp(){try{let e=await fetch(`/cockpit/local-sync`,{headers:d(),cache:`no-store`});return e.ok?{available:!0,file:await e.json()}:{available:!1,file:gp}}catch{return{available:!1,file:gp}}}function yp(){return M({queryKey:[`local-sync`],queryFn:vp,staleTime:5e3,refetchOnWindowFocus:!0,retry:!1})}function bp(){let e=j();return N({mutationFn:async e=>{let t=await fetch(`/cockpit/local-sync`,{method:`PUT`,headers:{...d(),"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`The local sync store did not accept the write.`);return await t.json()},onSuccess:t=>e.setQueryData([`local-sync`],{available:!0,file:t})})}function xp(){let e=K(),t=fs().data?.find(t=>t.id===e),n=ps(e??void 0),r=qs(e??void 0,void 0),i=qo(),a=yp(),o=bp(),s=Fs(e??``),c=Is(),l=Js(),[u,d]=(0,k.useReducer)(e=>e+1,0);(0,k.useEffect)(()=>ka(()=>d()),[]);let f=(0,k.useRef)(null);(0,k.useEffect)(()=>{f.current=null},[t?.name]);let p=a.data?.available===!0?a.data.file:void 0,m=t!==void 0&&e!==null&&n.data!==void 0&&r.data!==void 0&&p!==void 0,h=t&&p?_p(p,t.name):void 0,g=s.isPending||c.isPending||l.isPending||o.isPending||n.isFetching||r.isFetching;(0,k.useEffect)(()=>{if(!m||!h?.enabled||g)return;let a={client:i,theme:Ta(),profileSettings:n.data,profile:t,scratchpad:r.data},u={setClient:e=>Go(e),setTheme:e=>{typeof e==`string`&&Da(e)},patchProfileSettings:e=>s.mutate(e),patchProfileColumns:t=>c.mutate({id:e,...t}),createScratchpad:t=>{for(let n of t)l.mutate({profile_id:e,scope:`profile`,title:n.title??void 0,body:n.body,tags:n.tags,agent_type:n.agent_type??void 0})}},d=JSON.stringify(h.doc);if(f.current!==d){f.current=d,hp(h.doc,u,a,h.groups);return}let p=mp(h.groups,a),_=JSON.stringify(p);_!==d&&(f.current=_,o.mutate({profile:t.name,entry:{...h,doc:p,updatedAt:new Date().toISOString()}}))})}function Sp(){return typeof Notification>`u`?`unsupported`:tu()?`granted`:Notification.permission}var Cp={desktop:!0,sound:!1,muted_projects:[]};function wp(e){return e.prefs.muted_projects.includes(e.projectId)?{desktop:!1,sound:!1}:{desktop:e.prefs.desktop&&e.permission===`granted`&&!e.windowFocused,sound:e.prefs.sound}}function Tp(e,t){for(let[,n]of e.getQueriesData({queryKey:[`sessions`]})){let e=n?.find(e=>e.id===t);if(e)return e}for(let[,n]of e.getQueriesData({queryKey:[`project`]})){let e=n?.sessions.find(e=>e.id===t);if(e)return e}}function Ep(e){return e.title??e.agent_title??e.osc_title??e.id.slice(0,8)}function Dp(){try{let e=new AudioContext,t=e.createGain();t.gain.value=.04,t.connect(e.destination);for(let[n,r]of[[880,0],[1318.5,.09]]){let i=e.createOscillator();i.type=`sine`,i.frequency.value=n,i.connect(t),i.start(e.currentTime+r),i.stop(e.currentTime+r+.12)}setTimeout(()=>void e.close(),400)}catch{}}function Op(){let e=j(),t=Fr(),n=ps(K()??void 0),r=(0,k.useRef)(Cp);r.current={...Cp,...n.data?.notifications??{}};let i=Ms(js().data)??`Puddle`,a=(0,k.useRef)(i);(0,k.useEffect)(()=>{document.title===a.current&&(document.title=i),a.current=i},[i]),(0,k.useEffect)(()=>{let n=new Set,i=()=>{document.title=n.size>0?`(${n.size}) ${a.current}`:a.current},o=Bu.onStatus(a=>{let o=n.has(a.session);a.status===`waiting_input`?n.add(a.session):n.delete(a.session),i(),!(a.status!==`waiting_input`||o)&&(async()=>{let n=Tp(e,a.session);if(!n)try{n=(await Cs(e)).find(e=>e.id===a.session)}catch{return}if(!n||n.kind===`terminal`)return;let i=n,o=wp({prefs:r.current,projectId:i.project_id,windowFocused:document.hasFocus(),permission:Sp()});if(o.sound&&Dp(),o.desktop){let e=new Notification(Ep(i),{body:`Waiting for your input`,tag:`puddle-waiting-${i.id}`});e.onclick=()=>{tu()?.raiseWindow(),window.focus(),t(`/project/${i.project_id}/session/${i.id}`),e.close()}}})()});return()=>{o(),document.title=a.current}},[e,t])}function kp({className:e,strokeScale:t=1}){return(0,A.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,"aria-hidden":!0,children:[(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`22`,y2:`12`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`20.66`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`20.66`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`2`,y2:`12`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`3.34`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`3.34`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`15.25`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`18.5`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`15.25`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`8.75`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`5.5`}),(0,A.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`8.75`})]})}function Ap({className:e,strokeScale:t=1}){return(0,A.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.6*t,"aria-hidden":!0,children:[(0,A.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,A.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(60 12 12)`}),(0,A.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(120 12 12)`})]})}function jp({className:e,strokeScale:t=1}){return(0,A.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,A.jsx)(`path`,{d:`M8 4H4v16h4`}),(0,A.jsx)(`path`,{d:`M16 4h4v16h-4`}),(0,A.jsx)(`rect`,{x:`10.5`,y:`10.5`,width:`3`,height:`3`,fill:`currentColor`,stroke:`none`})]})}function Mp({className:e}){return(0,A.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,"aria-hidden":!0,children:(0,A.jsx)(`path`,{d:`M12 1.5c0 5.8 4.7 10.5 10.5 10.5C16.7 12 12 16.7 12 22.5 12 16.7 7.3 12 1.5 12 7.3 12 12 7.3 12 1.5Z`})})}function Np({type:e,className:t,strokeScale:n=1}){switch(e){case`claude-code`:return(0,A.jsx)(kp,{className:t,strokeScale:n});case`codex`:return(0,A.jsx)(Ap,{className:t,strokeScale:n});case`opencode`:return(0,A.jsx)(jp,{className:t,strokeScale:n});case`gemini-cli`:return(0,A.jsx)(Mp,{className:t});default:return(0,A.jsx)(Il,{className:t,strokeWidth:2*n})}}function Pp(e){let t=k.useRef({value:e,previous:e});return k.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Fp=`Switch`,[Ip,Lp]=b(Fp),[Rp,zp]=Ip(Fp);function Bp(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=ae({prop:n,defaultProp:i??!1,onChange:c,caller:Fp}),[m,h]=k.useState(null),[g,_]=k.useState(null),v={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:k.useRef(!1),required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,A.jsx)(Rp,{scope:t,...v,children:Jp(d)?d(v):r})}var Vp=`SwitchTrigger`,Hp=k.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=zp(Vp,e),h=ce(r,u),g=k.useRef(c);return k.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,A.jsx)(y.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":Yp(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:h,onClick:v(t,e=>{d(e=>!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Hp.displayName=Vp;var Up=k.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,A.jsx)(Bp,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Hp,{...d,ref:t,__scopeSwitch:n}),e&&(0,A.jsx)(qp,{__scopeSwitch:n})]})})});Up.displayName=Fp;var Wp=`SwitchThumb`,Gp=k.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=zp(Wp,n);return(0,A.jsx)(y.span,{"data-state":Yp(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});Gp.displayName=Wp;var Kp=`SwitchBubbleInput`,qp=k.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=zp(Kp,e),m=ce(n,p),h=Pp(a),g=be(r);k.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});n.call(e,a),e.dispatchEvent(t)}},[f,h,a,i]);let _=k.useRef(a);return(0,A.jsx)(y.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});qp.displayName=Kp;function Jp(e){return typeof e==`function`}function Yp(e){return e?`checked`:`unchecked`}function Xp({className:e,...t}){return(0,A.jsx)(Up,{className:D(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full transition-colors data-[state=checked]:bg-action data-[state=unchecked]:bg-border data-[state=unchecked]:hover:bg-border/70 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,A.jsx)(Gp,{className:`pointer-events-none block size-4 rounded-full bg-ground shadow-sm transition-transform data-[state=checked]:translate-x-[1.125rem] data-[state=unchecked]:translate-x-0.5`})})}function Zp({initial:e,defaultScope:t,allowProject:n=!0,agents:r,onSave:i,onCancel:a}){let[o,s]=(0,k.useState)(e?.title??``),[c,l]=(0,k.useState)(e?.body??``),[u,d]=(0,k.useState)(n?e?.scope??t:`profile`),[f,p]=(0,k.useState)((e?.tags??[]).join(`, `)),[m,h]=(0,k.useState)(e?.agent_type??null),g=()=>{let e=c.trim();e&&i({title:o.trim()||null,body:e,scope:u,tags:f.split(`,`).map(e=>e.trim()).filter(Boolean),agent_type:m})};return(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,A.jsx)(Te,{value:o,placeholder:`Title (optional)`,spellCheck:!1,onChange:e=>s(e.target.value),onKeyDown:e=>e.stopPropagation(),className:`h-9 text-sm font-medium`}),(0,A.jsx)(je,{autoFocus:!0,value:c,placeholder:`Prompt or note…`,spellCheck:!1,rows:10,onChange:e=>l(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`?a():e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&g()},className:`resize-y text-sm leading-relaxed`}),(0,A.jsx)(Te,{value:f,placeholder:`tags, comma, separated`,spellCheck:!1,onChange:e=>p(e.target.value),onKeyDown:e=>e.stopPropagation(),className:`h-8 text-xs`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n&&(0,A.jsxs)(`label`,{className:`flex items-center gap-1.5 text-2xs text-fg-secondary`,children:[(0,A.jsx)(Xp,{checked:u===`profile`,onCheckedChange:e=>d(e?`profile`:`project`)}),`Profile-wide`]}),(0,A.jsx)(`div`,{className:`ml-auto flex items-center gap-1`,children:r.map(e=>(0,A.jsxs)(`button`,{type:`button`,title:e.display_name,"aria-pressed":m===e.id,onClick:()=>h(t=>t===e.id?null:e.id),className:D(`rounded-md p-1 transition-colors`,m===e.id?`bg-surface text-fg`:`text-fg-gold hover:bg-surface hover:text-fg`),children:[(0,A.jsx)(Np,{type:e.id,className:`size-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:e.display_name})]},e.id))})]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[(0,A.jsx)(oe,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),(0,A.jsx)(oe,{size:`sm`,disabled:!c.trim(),onClick:g,children:`Save`})]})]})}var Qp=new Set,$p=!1,em=null;function tm(){for(let e of Qp)e()}function nm(e){return Qp.add(e),()=>Qp.delete(e)}function rm(e){$p!==e&&($p=e,tm())}function im(){rm(!$p)}function am(){return(0,k.useSyncExternalStore)(nm,()=>$p)}function om(e){em=e,tm()}function sm(){return(0,k.useSyncExternalStore)(nm,()=>em)}function cm(){let e=am(),t=K(),n=zr().id,r=qs(t??void 0,n).data??[],i=Ns().data??[],a=Js(),o=Ys(),s=Xs(),c=sm(),[u,d]=(0,k.useState)(null),[f,p]=(0,k.useState)(null),[m,h]=(0,k.useState)(null),[g,_]=(0,k.useState)(null),[v,y]=(0,k.useState)(null);(0,k.useEffect)(()=>mu(`scratchpad.toggle`,im),[]),(0,k.useEffect)(()=>{e||(d(null),p(null),h(null))},[e]);let b=(0,k.useMemo)(()=>[...new Set(r.flatMap(e=>e.tags))].sort((e,t)=>e.localeCompare(t)),[r]),x=(0,k.useMemo)(()=>[...new Set(r.map(e=>e.agent_type).filter(e=>e!==null))],[r]),S=f!==null||m!==null,ee=r.filter(e=>(f===null||e.tags.includes(f))&&(m===null||e.agent_type===m)),C=S?ee:v??r,te=e=>{t&&(a.mutate({profile_id:t,scope:e.scope,project_id:e.scope===`project`?n:void 0,title:e.title??void 0,body:e.body,tags:e.tags,agent_type:e.agent_type??void 0}),d(null))},ne=(e,t)=>{o.mutate({id:e,scope:t.scope,project_id:t.scope===`project`?n??null:null,title:t.title,body:t.body,tags:t.tags,agent_type:t.agent_type}),d(null)},re=(e,t)=>{let n=v??r,i=n.findIndex(t=>t.id===e),a=n.findIndex(e=>e.id===t);if(i===-1||a===-1||i===a)return;let o=n.slice(),[s]=o.splice(i,1);o.splice(a,0,s),y(o)},ie=()=>{let e=g,t=v;if(_(null),y(null),e===null||!t)return;let n=t.findIndex(t=>t.id===e);if(n===-1)return;let r=t[n-1],i=t[n+1],a=r?i?(r.position+i.position)/2:r.position+1:(i?i.position:0)-1;o.mutate({id:e,position:a})},ae=e=>{navigator.clipboard?.writeText(e.body),l.success(`Copied to clipboard`)};return(0,A.jsxs)(Jf,{open:e,onOpenChange:rm,children:[(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsx)(Yf,{asChild:!0,children:(0,A.jsxs)(oe,{variant:`ghost`,size:`icon`,className:`compact:h-7 compact:w-7`,children:[(0,A.jsx)(ol,{}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Scratchpad`})]})})}),(0,A.jsx)(jo,{children:`Scratchpad`})]}),(0,A.jsxs)(Xf,{className:`w-[34rem] max-w-[calc(100vw-1rem)] p-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-5 pb-2 pt-4`,children:[(0,A.jsx)(`span`,{className:`text-2xs font-medium uppercase tracking-wide text-fg-gold`,children:`Scratchpad`}),(0,A.jsxs)(`button`,{type:`button`,onClick:()=>d(u===`new`?null:`new`),className:`ml-auto flex items-center rounded-md p-1 text-fg-gold transition-colors hover:bg-surface hover:text-fg`,children:[(0,A.jsx)(H,{className:`size-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`New entry`})]})]}),(b.length>0||x.length>0)&&(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 px-5 pb-2`,children:[b.map(e=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>p(t=>t===e?null:e),className:D(`rounded-full px-2 py-0.5 text-2xs transition-colors`,f===e?`bg-action text-action-ink`:`bg-surface text-fg-secondary hover:text-fg`),children:e},e)),x.map(e=>(0,A.jsx)(`button`,{type:`button`,"aria-pressed":m===e,onClick:()=>h(t=>t===e?null:e),className:D(`rounded-md p-1 transition-colors`,m===e?`bg-action text-action-ink`:`text-fg-gold hover:bg-surface`),children:(0,A.jsx)(Np,{type:e,className:`size-3.5`})},e))]}),(0,A.jsxs)(`div`,{className:`no-scrollbar max-h-[65vh] overflow-y-auto px-2 pb-3`,children:[u===`new`&&(0,A.jsx)(`div`,{className:`px-3 py-2`,children:(0,A.jsx)(Zp,{defaultScope:n?`project`:`profile`,allowProject:n!==void 0,agents:i,onSave:te,onCancel:()=>d(null)})}),C.length===0&&u!==`new`&&(0,A.jsx)(`p`,{className:`px-3 py-3 text-sm text-fg-muted`,children:S?`Nothing matches this filter.`:`No entries yet — press + to add a reusable prompt or note.`}),(0,A.jsx)(`ul`,{className:`flex flex-col`,children:C.map(e=>u===e.id?(0,A.jsx)(`li`,{className:`px-3 py-2`,children:(0,A.jsx)(Zp,{initial:e,defaultScope:e.scope,allowProject:n!==void 0||e.scope===`project`,agents:i,onSave:t=>ne(e.id,t),onCancel:()=>d(null)})},e.id):(0,A.jsx)(`li`,{draggable:!S&&u===null,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,_(e.id)},onDragOver:t=>{g!==null&&(t.preventDefault(),g!==e.id&&re(g,e.id))},onDragEnd:ie,className:D(`transition-opacity`,g===e.id&&`opacity-50`),children:(0,A.jsx)(lm,{entry:e,onInsert:c?()=>{c(e.body),rm(!1)}:null,onCopy:()=>ae(e),onEdit:()=>d(e.id),onDelete:()=>s.mutate(e.id)})},e.id))})]})]})]})}function lm({entry:e,onInsert:t,onCopy:n,onEdit:r,onDelete:i}){let[a,o]=(0,k.useState)(!1);return(0,A.jsxs)(`div`,{onClick:e=>{e.target.closest(`button`)||r()},className:`cursor-pointer rounded-md px-3 py-2.5 transition-colors hover:bg-surface`,children:[e.title&&(0,A.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.title}),(0,A.jsx)(`p`,{className:D(`line-clamp-3 whitespace-pre-wrap text-sm text-fg-secondary`,e.title&&`mt-0.5`),children:e.body}),a?(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-2xs text-fg-muted`,children:`Delete this entry? This can’t be undone.`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{o(!1),i()},className:`text-2xs font-medium text-interrupted transition-colors hover:underline`,children:`Delete`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(!1),className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:`Cancel`})]}):(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:`text-2xs uppercase tracking-wide text-fg-muted`,children:e.scope===`profile`?`Profile-wide`:`Project`}),e.agent_type&&(0,A.jsx)(Np,{type:e.agent_type,className:`size-3 text-fg-gold`}),e.tags.map(e=>(0,A.jsx)(`span`,{className:`rounded-full bg-surface px-1.5 text-2xs text-fg-secondary`,children:e},e)),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[t&&(0,A.jsx)(um,{icon:jc,label:`Insert into focused terminal`,onClick:t}),(0,A.jsx)(um,{icon:Ac,label:`Copy`,onClick:n}),(0,A.jsx)(um,{icon:De,label:`Edit`,onClick:r}),(0,A.jsx)(um,{icon:jl,label:`Delete`,onClick:()=>o(!0)})]})]})]})}function um({icon:e,label:t,onClick:n}){return(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsxs)(`button`,{type:`button`,onClick:n,className:`rounded-md p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg`,children:[(0,A.jsx)(e,{className:`size-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:t})]})}),(0,A.jsx)(jo,{children:t})]})}function dm(e){return e.kind??`file`}function fm(e){if(e.view===`linked`||e.view===`locked`)return e.view;let t=`${dm(e)}:${e.session}:${e.sha??``}:${e.root??``}:${e.path}`;return e.git_area===void 0?t:`${t}:git-${e.git_area}`}var pm={md:`markdown`,markdown:`markdown`,mdown:`markdown`,html:`html`,htm:`html`};function mm(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0?null:pm[t.slice(n+1).toLowerCase()]??null}function hm(e,t){if(t===``||t.startsWith(`#`)||t.startsWith(`//`)||/^[a-z][a-z0-9+.-]*:/i.test(t))return null;let n=t.split(`#`)[0].split(`?`)[0];if(n===``||n===`/`)return null;let r=[...n.startsWith(`/`)?[]:e.split(`/`).slice(0,-1)];for(let e of decodeURI(n).split(`/`))if(!(e===``||e===`.`))if(e===`..`){if(r.length===0)return null;r.pop()}else r.push(e);return r.length>0?r.join(`/`):null}function gm(e){let t=[],n=0,r=e=>/[\t\n\f\r ]/.test(e);for(;n<e.length;){for(;n<e.length&&(r(e[n])||e[n]===`,`);)n+=1;if(n>=e.length)break;let i=n;for(;n<e.length&&!r(e[n]);)n+=1;let a=e.slice(i,n);if(a.endsWith(`,`)){a=a.replace(/,+$/,``),a!==``&&t.push({ref:a,descriptor:``});continue}for(;n<e.length&&r(e[n]);)n+=1;let o=n;for(;n<e.length&&e[n]!==`,`;)n+=1;let s=e.slice(o,n).trim();n<e.length&&(n+=1),a!==``&&t.push({ref:a,descriptor:s})}return t}function _m(e){return e.map(({ref:e,descriptor:t})=>`${e}${t===``?``:` ${t}`}`).join(`, `)}function vm(){return crypto.randomUUID()}function $(e){return e.type===`terminal`?`term:${e.session}`:`editor:${fm(e.tab)}`}function ym(e,t){return $(e)===$(t)}function bm(e){return e.type===`terminal`}function xm(e){return e.type===`editor`&&(e.tab.view===`linked`||e.tab.view===`locked`)}function Sm(e=[],t){let n=e.map($),r=t&&n.includes(t)?t:n.length>0?n[0]:null;return{kind:`leaf`,id:vm(),tabs:e,activeKey:r,previewKey:null}}function Cm(e,t,n){return{kind:`split`,id:vm(),direction:e,children:t,sizes:n??t.map(()=>100/Math.max(1,t.length))}}function wm(e,t){if(e.kind===`leaf`)return e.id===t?e:null;for(let n of e.children){let e=wm(n,t);if(e)return e}return null}function Tm(e,t){if(e.kind===`leaf`)return e.tabs.some(e=>$(e)===t)?e:null;for(let n of e.children){let e=Tm(n,t);if(e)return e}return null}function Em(e){return e.kind===`leaf`?[e]:e.children.flatMap(Em)}function Dm(e){return Em(e).flatMap(e=>e.tabs)}function Om(e){return e.kind===`leaf`?[e.id]:[e.id,...e.children.flatMap(Om)]}function km(e){let t=Om(e);return new Set(t).size!==t.length}function Am(e){return e.kind===`leaf`?{...e,id:vm()}:{...e,id:vm(),children:e.children.map(Am)}}function jm(e){if(!km(e))return e;let t=new Set,n=e=>{let r=t.has(e.id)?vm():e.id;return t.add(r),e.kind===`leaf`?{...e,id:r}:{...e,id:r,children:e.children.map(n)}};return n(e)}function Mm(e){let t=e.tabs.map($),n=e.activeKey&&t.includes(e.activeKey)?e.activeKey:t[0]??null,r=e.previewKey&&t.includes(e.previewKey)?e.previewKey:null;return n===e.activeKey&&r===(e.previewKey??null)?e:{...e,activeKey:n,previewKey:r}}function Nm(e){if(e.kind===`leaf`)return Mm(e);let t=e.children.map(Nm),n=[],r=[];t.forEach((t,i)=>{let a=e.sizes[i]??1;if(t.kind===`split`&&t.direction===e.direction){let e=t.sizes.reduce((e,t)=>e+t,0)||t.children.length;t.children.forEach((i,o)=>{n.push(i),r.push(a*(t.sizes[o]??1)/e)})}else n.push(t),r.push(a)});let i=[],a=[];return n.forEach((e,t)=>{e.kind===`leaf`&&e.tabs.length===0||(i.push(e),a.push(r[t]??1))}),i.length===0?Sm([]):i.length===1?i[0]:{...e,children:i,sizes:a}}function Pm(e,t,n){return e.kind===`leaf`?e.id===t?n(e):e:{...e,children:e.children.map(e=>Pm(e,t,n))}}function Fm(e,t,n){return Pm(e,t,e=>{if(!e.tabs.some(e=>$(e)===n))return e;let t=e.tabs.filter(e=>$(e)!==n),r=e.activeKey===n?Im(e,n):e.activeKey;return{...e,tabs:t,activeKey:r}})}function Im(e,t){let n=e.tabs.findIndex(e=>$(e)===t);if(n===-1)return e.activeKey;let r=e.tabs.filter(e=>$(e)!==t);return r.length===0?null:$(r[Math.min(n,r.length-1)])}function Lm(e,t,n){let r=e.tabs.filter(e=>!ym(e,t)),i=n===void 0?r.length:Math.max(0,Math.min(n,r.length)),a=[...r.slice(0,i),t,...r.slice(i)];return{...e,tabs:a,activeKey:$(t)}}function Rm(e,t,n,r){let i=n===`left`||n===`right`?`row`:`col`,a=n===`left`||n===`top`;return Nm(Pm(e,t,e=>{let t=Sm([r]);return Cm(i,a?[t,e]:[e,t],[50,50])}))}function zm(e,t){let{ref:n,toLeafId:r,edge:i}=t,a=$(n),o=t.copy===!0&&!bm(n),s=t.index;if(i===`center`&&s!==void 0){let t=wm(e,r)?.tabs.findIndex(e=>$(e)===a)??-1;t!==-1&&t<s&&--s}let c=o?e:Fm(e,t.fromLeafId,a);if(i===`center`){let e=Pm(c,r,e=>Lm(e,n,s));return!wm(e,r)&&!Tm(e,a)?Jm(Nm(Bm(e,n)),a):Jm(Nm(e),a)}return wm(c,r)?Jm(Rm(c,r,i,n),a):Nm(Sm([n]))}function Bm(e,t){let n=Em(e)[0];return n?Pm(e,n.id,e=>Lm(e,t)):Sm([t])}function Vm(e,t,n){return Nm(Pm(e,t,e=>e.tabs.some(e=>$(e)===n)?{...e,tabs:e.tabs.filter(e=>$(e)!==n),activeKey:e.activeKey===n?Im(e,n):e.activeKey}:e))}function Hm(e,t,n){let r=$(n);return Nm(Pm(e,t,e=>{let t=e.previewKey===r?null:e.previewKey;return e.tabs.some(e=>ym(e,n))?{...e,activeKey:r,previewKey:t}:{...e,tabs:[...e.tabs,n],activeKey:r,previewKey:t}}))}function Um(e,t,n){let r=$(n);return Nm(Pm(e,t,e=>e.tabs.some(e=>$(e)===r)?{...e,tabs:e.tabs.map(e=>$(e)===r?n:e),previewKey:e.previewKey===r?null:e.previewKey}:{...e,tabs:[...e.tabs,n]}))}function Wm(e,t,n){let r=$(n);return Pm(e,t,e=>({...e,tabs:e.tabs.map(e=>$(e)===r?n:e)}))}function Gm(e,t,n){let r=fm(t),i=e=>e.kind===`split`?{...e,children:e.children.map(i)}:{...e,tabs:e.tabs.map(e=>e.type===`editor`&&fm(e.tab)===r?{...e,tab:{...e.tab,compile_mode:n}}:e)};return i(e)}function Km(e,t){return e.type!==`editor`||t.type!==`editor`||e.tab.view!==`preview`||t.tab.view!==void 0||mm(t.tab.path)===null?t:{...t,tab:{...t.tab,view:`preview`}}}function qm(e,t,n){let r=$(n);return Nm(Pm(e,t,e=>{if(e.tabs.some(e=>ym(e,n)))return{...e,activeKey:r};let t=e.previewKey?e.tabs.findIndex(t=>$(t)===e.previewKey):-1,i=t>=0?e.tabs[t]:void 0,a=i!==void 0&&!bm(i)&&!xm(i),o=a?Km(i,n):n,s=a?e.tabs.map((e,n)=>n===t?o:e):[...e.tabs,o];return{...e,tabs:s,activeKey:r,previewKey:r}}))}function Jm(e,t){let n=e=>e.kind===`leaf`?e.previewKey===t?{...e,previewKey:null}:e:{...e,children:e.children.map(n)};return n(e)}function Ym(e,t,n,r){return Pm(e,t,e=>{let t=e.tabs.findIndex(e=>e.type===`editor`&&$(e)===n),i=t>=0?e.tabs[t]:void 0;if(i===void 0||i.type!==`editor`)return e;let a={...i,tab:{...i.tab,view:r}},o=$(a);if(o===n)return{...e,tabs:e.tabs.map((e,n)=>n===t?a:e)};let s=e.tabs.some((e,n)=>n!==t&&$(e)===o),c=s?e.tabs.filter((e,n)=>n!==t):e.tabs.map((e,n)=>n===t?a:e);return{...e,tabs:c,activeKey:e.activeKey===n?o:e.activeKey,previewKey:e.previewKey===n?s?null:o:e.previewKey??null}})}function Xm(e,t){let n=dm(e);return n!==`commit`&&n!==`untitled`&&e.session===t.session&&e.path===t.path&&e.root===t.root}function Zm(e,t,n){if(n===t.path)return e;let r=!1,i=e=>{if(e.kind===`split`){let t=e.children.map(i);return t.some((t,n)=>t!==e.children[n])?{...e,children:t}:e}let a=new Map,o=!1,s=e.tabs.map(e=>{if(e.type!==`editor`||!Xm(e.tab,t))return e;let r={...e,tab:{...e.tab,path:n}};return a.set($(e),$(r)),o=!0,r});if(!o)return e;r=!0;let c=e.activeKey,l=e.previewKey??null;return{...e,tabs:s,activeKey:c===null?null:a.get(c)??c,previewKey:l===null?null:a.get(l)??l}},a=i(e);return r?a:e}function Qm(e){if(e.type!==`editor`)return null;let t=e.tab,n=dm(t);return n!==`file`&&n!==`external`||t.view===`linked`||t.view===`locked`||mm(t.path)===null?null:t}function $m(e,t){let n=Qm(t);if(!n)return e;let r=!1,i=e=>{if(e.kind===`split`)return{...e,children:e.children.map(i)};let t=!1,a=e.tabs.map(e=>{if(e.type!==`editor`||!xm(e))return e;let r=e.tab;return r.session===n.session&&r.path===n.path&&(r.root??``)===(n.root??``)&&dm(r)===dm(n)?e:(t=!0,{type:`editor`,tab:{session:n.session,path:n.path,...n.kind===void 0?{}:{kind:n.kind},...n.root===void 0?{}:{root:n.root},view:r.view}})});return t?(r=!0,{...e,tabs:a}):e},a=i(e);return r?a:e}function eh(e,t){return e.session===t.session&&e.path===t.path&&(e.root??``)===(t.root??``)&&dm(e)===dm(t)}function th(e,t,n){let r=Em(e).flatMap(e=>e.tabs.flatMap(n=>n.type!==`editor`||n.tab.view===`linked`||n.tab.view===`locked`||!eh(n.tab,t)?[]:[{leafId:e.id,ref:n}]));return r.find(({leafId:e})=>e===n)??r.find(({ref:e})=>(e.tab.view??`source`)===`source`)??r[0]??null}function nh(e,t,n){return Pm(e,t,e=>e.tabs.some(e=>$(e)===n)?{...e,activeKey:n}:e)}function rh(e,t,n){function r(e){return e.kind===`leaf`?e:e.id===t&&n.length===e.children.length?{...e,children:e.children.map(r),sizes:[...n]}:{...e,children:e.children.map(r)}}return r(e)}function ih(e){let t=e.type===`terminal`?e.session:e.tab.session;return t===`00000000-0000-0000-0000-000000000000`?null:t}function ah(e){return t=>{let n=ih(t);return n===null||e.has(n)}}function oh(e,t){let n=e=>e.kind===`leaf`?{...e,tabs:e.tabs.filter(t)}:{...e,children:e.children.map(n)};return Nm(n(e))}function sh(e){let t=new Set,n=[];for(let r of e){let e=Nm(oh(r,e=>!t.has($(e)))),i=Dm(e);if(i.length!==0){for(let e of i)t.add($(e));n.push(e)}}return n.length===0?Sm([]):jm(n.length===1?n[0]:Nm(Cm(`row`,n)))}function ch(e){let t=e.editor_tabs.map(e=>({type:`editor`,tab:e})),n=e.session_tabs.map(e=>({type:`terminal`,session:e})),r=e.active_editor_tab?$({type:`editor`,tab:e.active_editor_tab}):null,i=e.active_session?`term:${e.active_session}`:null;if(t.length===0&&n.length===0)return Sm([]);if(t.length===0)return Sm(n,i);if(n.length===0)return Sm(t,r);let a=e.layout,o=typeof a.editor==`number`?a.editor:40,s=typeof a.session==`number`?a.session:60;return Nm(Cm(`col`,[Sm(t,r),Sm(n,i)],[o,s]))}function lh(e){return JSON.stringify(uh(e))}function uh(e){return e===null?null:e.kind===`leaf`?e.tabs.length===0?null:{t:e.tabs.map($)}:{d:e.direction,s:e.sizes.map(e=>Math.round(e*10)/10),c:e.children.map(uh)}}var dh=new Set,fh=!1,ph=null;function mh(){for(let e of dh)e()}function hh(e){return dh.add(e),()=>dh.delete(e)}function gh(e){fh!==e&&(fh=e,mh())}function _h(){gh(!fh)}function vh(){return(0,k.useSyncExternalStore)(hh,()=>fh)}function yh(e){ph=e,mh()}function bh(){return(0,k.useSyncExternalStore)(hh,()=>ph)}var xh={layout_tree:null,active_session:null,layout_ref:null};function Sh(e){return e.type===`terminal`?e.session:e.tab.session}function Ch(e,t){let n=new Set;for(let[r,i]of Object.entries(e))if(!(r===t||!i.layout_tree))for(let e of Dm(i.layout_tree))e.type===`terminal`&&n.add(e.session);return[...n]}function wh(e,t){let n=e.project_layouts[t];return{...e,layout_tree:n?.layout_tree??null,active_session:n?.active_session??null,layout_ref:n?.layout_ref??null,session_tabs:[],editor_tabs:[],active_editor_tab:null}}function Th(e,t,n){return n?{loaded:e.loaded,snapshot:wh(e.snapshot,t),current:()=>wh(e.current(),t),update(n){let r={},i={...n};if(`layout_tree`in n&&(r.layout_tree=n.layout_tree??null,delete i.layout_tree),`active_session`in n&&(r.active_session=n.active_session??null,delete i.active_session),`layout_ref`in n&&(r.layout_ref=n.layout_ref??null,delete i.layout_ref),Object.keys(r).length>0){let n=e.current().project_layouts;i.project_layouts={...n,[t]:{...n[t]??xh,...r}}}Object.keys(i).length>0&&e.update(i)}}:e}function Eh(e,t,n,r){let i=e.layout_tree??ch(e),a={};for(let o of t)a[o]={layout_tree:Am(oh(i,e=>{let i=Sh(e);return i===`00000000-0000-0000-0000-000000000000`?o===(r??t[0]):n.get(i)===o})),active_session:e.active_session!==null&&n.get(e.active_session)===o?e.active_session:null,layout_ref:null};return{layout_mode:`project`,project_layouts:a}}function Dh(e,t,n={}){return{...e,...t,...n}}function Oh(e,t,n){let r=t.layout_tree?oh(t.layout_tree,e=>{let t=Sh(e);return t===`00000000-0000-0000-0000-000000000000`||n.alive.has(t)}):null,i=t.active_session!==null&&n.alive.has(t.active_session)?t.active_session:null;if(t.scope===`profile`)return{projectBased:!1,patch:{layout_mode:`profile`,layout_tree:r,active_session:i,layout_ref:t.id}};let a=t.project_id??n.currentProject??n.projectIds[0]??``,o={layout_tree:r,active_session:i,layout_ref:t.id};if((e.layout_mode??`profile`)===`project`)return{projectBased:!0,patch:{project_layouts:{...e.project_layouts,[a]:o}}};let s=Eh(e,n.projectIds,n.sessionProject,a);return{projectBased:!0,patch:{...s,project_layouts:Dh(s.project_layouts??{},e.project_layouts,{[a]:o})}}}function kh(e,t){let n=e.project_layouts,r=[...t.filter(e=>e in n),...Object.keys(n).filter(e=>!t.includes(e))].map(e=>n[e]);return{layout_mode:`profile`,project_layouts:{},layout_tree:sh(r.map(e=>e.layout_tree).filter(e=>e!==null)),active_session:r.map(e=>e.active_session).find(e=>e!==null)??null,layout_ref:null}}function Ah(e,t){let n=null,r=null,i=(...i)=>{r=i,n&&clearTimeout(n),n=setTimeout(()=>{n=null;let t=r;r=null,e(...t)},t)};return i.flush=()=>{if(!n)return;clearTimeout(n),n=null;let t=r;r=null,e(...t)},i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i.pending=()=>n!==null,i}var jh=2e3,Mh=u.parse({});function Nh(e){return`puddle.ws.${e}`}function Ph(e){if(e===null)return{kind:`absent`};try{return{kind:`present`,snapshot:u.parse(JSON.parse(e))}}catch{return{kind:`corrupt`}}}function Fh(){let e=K(),[t,n]=(0,k.useState)(!1),[r,i]=(0,k.useState)(Mh),a=(0,k.useRef)(r);a.current=r;let o=(0,k.useRef)(null),s=(0,k.useMemo)(()=>Ah((e,t)=>{dc(e,t).catch(e=>console.warn(`ui-state save failed: ${e.message}`))},jh),[]);return(0,k.useEffect)(()=>{if(e===null){o.current=null;return}let t=Nh(e);o.current=t;let r=!1;n(!1),i(Mh);let a;try{a=Ph(sessionStorage.getItem(t)),a.kind===`corrupt`&&sessionStorage.removeItem(t)}catch(e){console.warn(`ui-state read failed: ${e.message}`),a={kind:`absent`}}return a.kind===`present`?(i(a.snapshot),n(!0)):uc(e).then(e=>{r||(e&&i(e.ui_state),n(!0))}).catch(e=>{console.warn(`ui-state load failed: ${e.message}`),r||n(!0)}),()=>{r=!0,s.flush()}},[e,s]),{loaded:t,snapshot:r,current:()=>a.current,update(t){if(e===null)return;let n={...a.current,...t};a.current=n,i(n);let r=o.current??Nh(e);s(e,n);try{sessionStorage.setItem(r,JSON.stringify(n))}catch(e){console.warn(`ui-state write failed: ${e.message}`)}}}}var Ih=u.parse({});function Lh(e,t){let[n,r]=(0,k.useState)(null),i=Ss(t).data,a=_s(e??void 0,t&&e!==null).data;return(0,k.useEffect)(()=>{if(!t||e===null){r(null);return}let n=!1,i;try{i=Ph(sessionStorage.getItem(Nh(e)))}catch{i={kind:`absent`}}if(i.kind===`present`){r(i.snapshot);return}return uc(e).then(e=>{n||r(e?e.ui_state:Ih)}).catch(()=>{n||r(Ih)}),()=>{n=!0}},[t,e]),(0,k.useMemo)(()=>{if(!t||e===null||n===null)return null;let o=t=>{if(!i||!a)return!1;let{patch:o,projectBased:s}=Oh(n,t,{alive:new Set(i.filter(e=>e.status!==`archived`).map(e=>e.id)),sessionProject:new Map(i.map(e=>[e.id,e.project_id])),projectIds:a.map(e=>e.id),currentProject:null}),c={...n,...o};r(c),dc(e,c).catch(e=>console.warn(`ui-state save failed: ${e.message}`));try{sessionStorage.setItem(Nh(e),JSON.stringify(c))}catch(e){console.warn(`ui-state write failed: ${e.message}`)}return Wo().projectBasedLayout!==s&&Go({projectBasedLayout:s}),!0},s=Object.fromEntries(Object.entries(n.project_layouts).map(([e,t])=>[e,{layoutRef:t.layout_ref,signature:lh(t.layout_tree)}]));return(n.layout_mode??`profile`)===`project`?{headless:!0,scope:`project`,projectId:``,layoutRef:null,signature:lh(null),slices:s,capture:()=>({layout_tree:null,active_session:null}),apply:o}:{scope:`profile`,projectId:``,layoutRef:n.layout_ref,signature:lh(n.layout_tree),slices:s,capture:()=>({layout_tree:n.layout_tree,active_session:n.active_session}),apply:o}},[t,e,n,i,a])}var Rh=lh(null);function zh(){let e=vh(),t=Fr(),n=K(),r=bh(),i=Lh(n,e&&r===null),a=r??i,o=Zs(n??void 0,void 0).data??[],s=_s(n??void 0,e&&n!==null).data??[],c=Qs(),u=$s(),d=ec(),[f,p]=(0,k.useState)(``),[m,h]=(0,k.useState)(!1),[g,_]=(0,k.useState)(null);(0,k.useEffect)(()=>mu(`layouts.toggle`,_h),[]),(0,k.useEffect)(()=>{e||(p(``),h(!1),_(null))},[e]);let v=a?.headless===!0,y=a===null||v?null:o.find(e=>e.id===a.layoutRef)??null,b=a!==null&&!v&&(y===null?a.signature!==Rh:lh(y.layout_tree)!==a.signature),x=e=>{let t=a?.slices?.[e];if(!t)return!1;let n=t.layoutRef===null?null:o.find(e=>e.id===t.layoutRef)??null;return n?lh(n.layout_tree)!==t.signature:t.signature!==Rh},S=e=>a===null?!1:e.scope===`profile`?a.scope===`profile`&&b:e.project_id===null?!1:a.scope===`project`?!v&&e.project_id===a.projectId?b:x(e.project_id):b||x(e.project_id),ee=e=>y!==null&&e.id===y.id,C=e=>(e===null?void 0:s.find(t=>t.id===e)?.name)??`Project`,te=a!==null&&!v&&a.scope===`project`?o.filter(e=>e.scope===`profile`||e.project_id===a.projectId):o,ne=[...te.some(e=>e.scope===`profile`)?[{key:`profile`,name:`Profile-wide`}]:[],...[...new Set(te.flatMap(e=>e.project_id===null?[]:[e.project_id]))].map(e=>({key:e,name:C(e)})).sort((e,t)=>e.name.localeCompare(t.name))],re=g===null?te:g===`profile`?te.filter(e=>e.scope===`profile`):te.filter(e=>e.project_id===g),ie=e=>a!==null&&e.scope===a.scope&&(a.scope===`profile`||e.project_id===a.projectId),ae=(e,t,r)=>{!a||!n||c.mutate({profile_id:n,scope:a.scope,project_id:a.scope===`project`?a.projectId:void 0,name:e,...t},{onSuccess:e=>{r&&a.apply(e)},onError:e=>ye(e)})},se=e=>{if(!a)return;let t=ie(e)?e:o.find(t=>t.name===e.name&&ie(t));if(!t){ae(e.name,a.capture(),!0);return}u.mutate({id:t.id,...a.capture()},{onSuccess:e=>a.apply(e),onError:e=>ye(e)})},ce=(e,t)=>ae(t,{layout_tree:e.layout_tree,active_session:e.active_session},!1),le=e=>{if(a){if(!a.apply(e)){l.error(`Workspace is still loading — try again in a moment`);return}e.project_id!==null&&e.project_id!==a.projectId&&t(`/project/${e.project_id}`),gh(!1)}};return(0,A.jsxs)(Jf,{open:e,onOpenChange:gh,children:[(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsx)(Yf,{asChild:!0,children:(0,A.jsxs)(oe,{variant:`ghost`,size:`icon`,className:`compact:h-7 compact:w-7`,children:[(0,A.jsx)(Qc,{}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Layouts`})]})})}),(0,A.jsx)(jo,{children:`Layouts`})]}),(0,A.jsxs)(Xf,{className:`w-[26rem] max-w-[calc(100vw-1rem)] p-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-5 pb-2 pt-4`,children:[(0,A.jsx)(`span`,{className:`text-2xs font-medium uppercase tracking-wide text-fg-gold`,children:`Layouts`}),a!==null&&!v&&(0,A.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:`ml-auto flex items-center rounded-md p-1 text-fg-gold transition-colors hover:bg-surface hover:text-fg`,children:[(0,A.jsx)(H,{className:`size-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Save the current layout as a new layout`})]})]}),a===null?(0,A.jsx)(`p`,{className:`px-5 pb-3 text-sm text-fg-muted`,children:`Loading the profile’s layout state…`}):v?(0,A.jsx)(`p`,{className:`px-5 pb-3 text-sm text-fg-muted`,children:`Project-based layout is on — every project keeps its own layout. Open a project to name or save it; loading works from here.`}):(y===null||m)&&(0,A.jsxs)(`div`,{className:`flex flex-col gap-2 px-5 pb-3`,children:[y===null&&(0,A.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,A.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:`Unnamed layout`}),(0,A.jsx)(`span`,{className:`text-2xs uppercase tracking-wide text-fg-muted`,children:a.scope===`profile`?`Profile-wide`:`Project`}),(0,A.jsx)(`span`,{className:`ml-auto text-2xs text-interrupted`,children:`Unsaved`})]}),(0,A.jsxs)(`form`,{className:`flex items-center gap-1.5`,onSubmit:e=>{e.preventDefault();let t=f.trim();t&&(ae(t,a.capture(),!0),p(``),h(!1))},children:[(0,A.jsx)(Te,{autoFocus:m,value:f,placeholder:y===null?`Name this layout…`:`Save as a new layout…`,spellCheck:!1,onChange:e=>p(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&h(!1)},className:`h-8 flex-1 text-sm`}),(0,A.jsx)(oe,{size:`sm`,type:`submit`,disabled:!f.trim(),children:`Save`}),y!==null&&(0,A.jsx)(oe,{variant:`ghost`,size:`sm`,onClick:()=>h(!1),children:`Cancel`})]})]}),ne.length>1&&(0,A.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 px-5 pb-2`,children:ne.map(e=>(0,A.jsx)(Hh,{active:g===e.key,onClick:()=>_(t=>t===e.key?null:e.key),children:e.name},e.key))}),(0,A.jsxs)(`div`,{className:`no-scrollbar max-h-[60vh] overflow-y-auto px-2 pb-3`,children:[re.length===0&&(0,A.jsx)(`p`,{className:`px-3 py-3 text-sm text-fg-muted`,children:g===null?`No layouts yet — name and save the current layout to keep it.`:`Nothing matches this filter.`}),(0,A.jsx)(`ul`,{className:`flex flex-col`,children:re.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(Bh,{layout:e,projectLabel:e.scope===`profile`?null:C(e.project_id),isCurrent:ee(e),dirty:b,loadable:a!==null,savable:a!==null&&!v,confirmBeforeLoad:S(e),overwrites:ie(e),onLoad:()=>le(e),onRename:t=>u.mutate({id:e.id,name:t}),onDelete:()=>d.mutate(e.id),onSaveAs:()=>se(e),onDuplicate:t=>ce(e,t)})},e.id))})]})]})]})}function Bh({layout:e,projectLabel:t,isCurrent:n,dirty:r,loadable:i,savable:a,confirmBeforeLoad:o,overwrites:s,onLoad:c,onRename:l,onDelete:u,onSaveAs:d,onDuplicate:f}){let[p,m]=(0,k.useState)(null),[h,g]=(0,k.useState)(null),[_,v]=(0,k.useState)(e.name),y=()=>{if(!(!i||h!==null)){if(o&&p!==`load`){m(`load`);return}m(null),c()}},b=t=>{m(null),v(t===`rename`?e.name:`${e.name} copy`),g(t)},x=()=>{if(n){d();return}m(`save`)},S=n?r?`unsaved`:`active`:null;return(0,A.jsxs)(`div`,{onClick:e=>{e.target.closest(`button, input`)||y()},className:D(`rounded-md px-3 py-2.5 transition-colors`,i&&`cursor-pointer hover:bg-surface`),children:[h===null?(0,A.jsxs)(`p`,{className:D(`flex items-baseline gap-2 text-sm font-medium`,S===`active`?`text-success`:S===`unsaved`?`text-interrupted`:`text-fg`),children:[e.name,S!==null&&(0,A.jsx)(`span`,{className:`text-2xs font-normal`,children:S===`active`?`Active`:`Unsaved`})]}):(0,A.jsxs)(`form`,{className:`flex items-center gap-1.5`,onSubmit:t=>{t.preventDefault();let n=_.trim();n&&(h===`rename`?n!==e.name&&l(n):f(n)),g(null)},children:[(0,A.jsx)(Te,{autoFocus:!0,value:_,spellCheck:!1,onChange:e=>v(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&g(null)},className:`h-7 flex-1 text-sm`}),(0,A.jsx)(oe,{size:`sm`,type:`submit`,disabled:!_.trim(),children:h===`rename`?`Rename`:`Save`})]}),p===`save`?(0,A.jsx)(Vh,{question:s?`Overwrite “${e.name}” with the current layout?`:`Save the current layout as “${e.name}” here?`,verb:s?`Overwrite`:`Save`,onConfirm:()=>{m(null),d()},onCancel:()=>m(null)}):p===`delete`?(0,A.jsx)(Vh,{question:`Delete this layout? This can’t be undone.`,verb:`Delete`,onConfirm:()=>{m(null),u()},onCancel:()=>m(null)}):p===`load`?(0,A.jsx)(Vh,{question:`Loading discards unsaved layout changes.`,verb:`Load`,onConfirm:y,onCancel:()=>m(null)}):(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-1.5`,children:[t!==null&&(0,A.jsx)(`span`,{className:`text-2xs uppercase tracking-wide text-fg-muted`,children:t}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[a&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Uh,{icon:_l,label:n?`Save`:`Save the current layout as “${e.name}”`,onClick:x}),(0,A.jsx)(Uh,{icon:Ac,label:`Duplicate`,onClick:()=>b(`duplicate`)})]}),(0,A.jsx)(Uh,{icon:De,label:`Rename`,onClick:()=>b(`rename`)}),(0,A.jsx)(Uh,{icon:jl,label:`Delete`,onClick:()=>m(`delete`)})]})]})]})}function Vh({question:e,verb:t,onConfirm:n,onCancel:r}){return(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-2xs text-fg-muted`,children:e}),(0,A.jsx)(`button`,{type:`button`,onClick:n,className:`text-2xs font-medium text-interrupted transition-colors hover:underline`,children:t}),(0,A.jsx)(`button`,{type:`button`,onClick:r,className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:`Cancel`})]})}function Hh({active:e,onClick:t,children:n}){return(0,A.jsx)(`button`,{type:`button`,"aria-pressed":e,onClick:t,className:D(`rounded-full px-2 py-0.5 text-2xs transition-colors`,e?`bg-action text-action-ink`:`bg-surface text-fg-secondary hover:text-fg`),children:n})}function Uh({icon:e,label:t,onClick:n}){return(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsxs)(`button`,{type:`button`,onClick:n,className:`rounded-md p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg`,children:[(0,A.jsx)(e,{className:`size-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:t})]})}),(0,A.jsx)(jo,{children:t})]})}var Wh=tu()!==void 0&&/Mac/.test(navigator.platform),Gh=(0,k.lazy)(()=>o(()=>import(`./SettingsDialog-Wz8QQE8s.js`).then(e=>({default:e.SettingsDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])));function Kh(){let e=j();(0,k.useEffect)(()=>{let t=t=>{for(let[n,r]of e.getQueriesData({queryKey:[`sessions`]}))r&&e.setQueryData(n,r.map(t));for(let[n,r]of e.getQueriesData({queryKey:[`project`]}))r&&e.setQueryData(n,{...r,sessions:r.sessions.map(t)})},n=Bu.onStatus(e=>t(t=>t.id===e.session?{...t,status:e.status,last_activity_at:e.last_activity_at}:t)),r=Bu.onRenamed(e=>t(t=>t.id===e.session?{...t,title:e.title,agent_title:`agent_title`in e?e.agent_title:t.agent_title,osc_title:`osc_title`in e?e.osc_title:t.osc_title}:t)),i=Bu.onAccount(t=>{for(let[n,r]of e.getQueriesData({queryKey:[`accounts`]}))r&&e.setQueryData(n,r.map(e=>e.id===t.account_id?{...e,logged_in:t.logged_in}:e))}),a=t=>{e.invalidateQueries({queryKey:[`sessions`]});for(let n of t)e.invalidateQueries({queryKey:[`project`,n]})},o=Bu.onSessionsChanged(e=>a(e.project_ids)),s=Bu.onSessionSwitched(e=>a([e.target_project]));return()=>{n(),r(),i(),o(),s()}},[e])}function qh(){let e=js(),t=lc(),[n,r]=(0,k.useState)(!1),i=Ms(e.data),a=n=>{r(!1);let a=n.trim();a!==i&&t.mutate({displayName:a===e.data?.hostname?``:a},{onError:e=>ye(e)})},o=!Wh&&(0,A.jsx)(`img`,{src:`/puddle.svg`,alt:`Puddle`,className:`size-4`}),s=D(`flex shrink-0 items-center gap-2`,Wh&&`[-webkit-app-region:no-drag]`),c=`truncate text-sm font-semibold text-fg-secondary`;return n&&i!==void 0?(0,A.jsxs)(`div`,{className:s,children:[o,(0,A.jsx)(Ul,{initial:e.data?.displayName??i,maxLength:64,className:D(c,`w-40`),onCommit:a,onCancel:()=>r(!1)})]}):(0,A.jsxs)(Qi,{to:`/`,className:D(s,`transition-opacity hover:opacity-70`),title:`All projects`,children:[o,i!==void 0&&(0,A.jsx)(`span`,{className:c,...Wl(()=>r(!0)),children:i})]})}function Jh(){let e=zr(),t=Tu(`palette.toggle`),n=vs(e.id).data?.project,r=n!==void 0&&n.id===e.id?n.name:void 0;return(0,A.jsxs)(`button`,{type:`button`,onClick:J,className:D(`absolute left-1/2 flex h-6 w-[min(30rem,42%)] -translate-x-1/2 items-center justify-center gap-2 rounded-md bg-ground text-fg-muted transition-colors hover:bg-elevated hover:text-fg-secondary`,Wh&&`[-webkit-app-region:no-drag]`),children:[(0,A.jsx)(`span`,{className:`truncate text-xs`,children:r??`Puddle`}),(0,A.jsx)(`span`,{className:`text-2xs`,children:t})]})}function Yh(){let{fullScreen:e,animate:t}=nu();return(0,A.jsxs)(`header`,{className:D(`relative flex h-9 shrink-0 items-center gap-3 bg-surface pl-3 pr-3`,Wh&&!e&&`pl-[88px] [-webkit-app-region:drag]`,t&&`transition-[padding] duration-200 ease-out`),children:[(0,A.jsx)(qh,{}),(0,A.jsx)(Jh,{}),(0,A.jsxs)(`div`,{className:D(`ml-auto flex items-center`,Wh&&`[-webkit-app-region:no-drag]`),children:[(0,A.jsxs)(ko,{children:[(0,A.jsx)(Ao,{asChild:!0,children:(0,A.jsxs)(oe,{variant:`ghost`,size:`icon`,className:`compact:h-7 compact:w-7`,onClick:()=>$l(),children:[(0,A.jsx)(bl,{}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Settings`})]})}),(0,A.jsx)(jo,{children:`Settings`})]}),(0,A.jsx)(zh,{}),(0,A.jsx)(cm,{}),(0,A.jsx)(ap,{})]})]})}function Xh(){Kh(),xp(),Op();let{handler:e}=ep(),t=K(),{pathname:n}=Nr(),[r,i]=(0,k.useState)(!1),a=As(),o=a.data!==void 0&&Iu(a.data.protocol);return(0,k.useEffect)(()=>{if(!o)return;let e=()=>{let e=ja();Bu.reportTheme(e(`--text-primary`),e(`--bg-base`))};return e(),ka(e)},[o]),(0,A.jsxs)(`div`,{className:`flex h-screen flex-col bg-ground`,children:[(0,A.jsx)(Yh,{}),(0,A.jsx)(`main`,{className:`min-h-0 flex-1`,children:(0,A.jsx)(_a,{resetOn:n,scope:n.startsWith(`/project/`)?`workspace`:`view`,children:(0,A.jsx)(li,{})})}),(0,A.jsx)(_f,{}),(0,A.jsx)(sp,{}),(0,A.jsx)(ff,{onNewSession:e??void 0,onNewProject:()=>i(!0)}),t!==null&&(0,A.jsx)(Ju,{profileId:t,open:r,onOpenChange:i}),(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(Gh,{})}),(0,A.jsx)(hf,{})]})}function Zh(){return(0,A.jsx)($f,{children:(0,A.jsx)(Xh,{})})}var Qh=(0,k.lazy)(()=>o(()=>import(`./Dashboard-DvfD1Uxd.js`).then(e=>({default:e.Dashboard})),__vite__mapDeps([12,1,2,3,4,5,6,7,8,13,11]))),$h=(0,k.lazy)(()=>o(()=>import(`./Workspace-BV1fbSwH.js`).then(e=>({default:e.Workspace})),__vite__mapDeps([14,1,2,3,15,4,8,5,6,7,13,11,16,9,10,17,18]))),eg=new qt({defaultOptions:{queries:{retry:1,staleTime:5e3}},mutationCache:new Ut({onError:e=>ye(e)})});function tg(){let e=K(),t=fs(),n=e!==null&&t.data!==void 0&&!t.data.some(t=>t.id===e);return e===null||n?(0,A.jsx)(Hl,{}):(0,A.jsx)(Xi,{useTransitions:!1,children:(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(fi,{children:(0,A.jsxs)(ui,{element:(0,A.jsx)(Zh,{}),children:[(0,A.jsx)(ui,{path:`/`,element:(0,A.jsx)(Qh,{})}),(0,A.jsx)(ui,{path:`/project/:id`,element:(0,A.jsx)($h,{})}),(0,A.jsx)(ui,{path:`/project/:id/session/:sid`,element:(0,A.jsx)($h,{})})]})})})})}function ng(){let e=(0,k.useSyncExternalStore)(c.subscribe,c.get);return(0,A.jsx)(Yt,{client:eg,children:(0,A.jsxs)(Oo,{delayDuration:300,children:[(0,A.jsx)(cs,{}),(0,A.jsx)(_a,{scope:`app`,children:e?(0,A.jsx)(tg,{}):(0,A.jsx)(Mo,{})}),(0,A.jsx)(Ba,{})]})})}function rg(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}function ig(e){return e.replace(/[%#? ]/g,e=>encodeURIComponent(e))}function ag(e,t,n){let r=rg(t);return n?`${e}://vscode-remote/ssh-remote+${ig(n)}${r}`:`${e}://file${r}`}function og(e,t){return e.trim()||t||null}var sg=s(`puddle.host`);function cg(){return og(Wo().editorLinkSshHost,sg.get())}function lg(e){return new URLSearchParams(e).get(`host`)?.trim()||null}function ug(e,t,n){return lg(e)||(/[#&]token=/.test(t)?null:n)}function dg(){let e=ug(window.location.search,window.location.hash,sg.get());if(sg.set(e),lg(window.location.search)!==null){let e=new URL(window.location.href);e.searchParams.delete(`host`),history.replaceState(null,``,e)}}Oa(),Ko(),dg(),_(),(0,ga.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(ng,{}));export{lp as $,Va as $n,Zc as $t,oh as A,ps as An,hu as At,mm as B,rc as Bn,G as Bt,Dm as C,ic as Cn,Au as Ct,Sm as D,Fs as Dn,cu as Dt,Qm as E,Is as En,wu as Et,Ym as F,cc as Fn,eu as Ft,om as G,ds as Gn,Rl as Gt,_m as H,fc as Hn,W as Ht,th as I,Ts as In,$l as It,Np as J,qo as Jn,El as Jt,Xp as K,Wo as Kn,Il as Kt,$ as L,Es as Ln,Ql as Lt,rh as M,vs as Mn,mu as Mt,$m as N,_s as Nn,su as Nt,qm as O,Ks as On,fu as Ot,Gm as P,Ds as Pn,Tu as Pt,bp as Q,Ao as Qn,sl as Qt,Wm as R,gs as Rn,J as Rt,wm as S,Vs as Sn,Nu as St,Tm as T,lc as Tn,ru as Tt,fm as U,bs as Un,U as Ut,hm as V,pc as Vn,K as Vt,dm as W,sc as Wn,zl as Wt,_p as X,ko as Xn,ml as Xt,Sp as Y,B as Yn,vl as Yt,yp as Z,jo as Zn,H as Zt,ah as _,Rs as _n,kt as _r,Ou as _t,Ah as a,ms as an,Ta as ar,Xf as at,jm as b,ac as bn,Mu as bt,Ch as c,oc as cn,Qi as cr,uf as ct,kh as d,Bs as dn,N as dr,Wu as dt,V as en,Da as er,hp as et,yh as f,Js as fn,M as fr,Uu as ft,Em as g,Os as gn,Ot as gr,ku as gt,Hm as h,zs as hn,Pt as hr,ju as ht,Fh as i,ys as in,ka as ir,Jf as it,Zm as j,fs as jn,Cu as jt,Jm as k,Us as kn,gu as kt,Th as l,mc as ln,Fr as lr,tf as lt,Um as m,As as mn,j as mr,Bu as mt,cg as n,bc as nn,Ea as nr,ep as nt,Oh as o,Ns as on,Pa as or,Yf as ot,lh as p,nc as pn,ln as pr,Hu as pt,Pp as q,Go as qn,jl as qt,sg as r,Ms as rn,za as rr,Zf as rt,Dh as s,Ss as sn,Ia as sr,df as st,ag as t,Mc as tn,ja as tr,mp as tt,Eh as u,ws as un,zr as ur,Ju as ut,ch as v,ks as vn,Pu as vt,nh as w,Ls as wn,iu as wt,zm as x,js as xn,Fu as xt,Vm as y,Ws as yn,Iu as yt,gm as z,qs as zn,Ul as zt};
|