pisper 0.5.50 → 0.5.51
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/package.json +7 -7
- package/web/.vite/manifest.json +162 -159
- package/web/assets/{AppOverlays-DrS2NA9w.js → AppOverlays-DlB6SVT6.js} +1 -1
- package/web/assets/{AppSelect-CRjRgr38.js → AppSelect-kDqZkETY.js} +1 -1
- package/web/assets/{AssetsPage-C2GY8596.js → AssetsPage-mZkZgR9g.js} +1 -1
- package/web/assets/{ChannelsPage-FPSrQa1G.js → ChannelsPage-Dau7vaaV.js} +1 -1
- package/web/assets/{ChatDockView-BJGa8Bm8.js → ChatDockView-Cq7J6Xmn.js} +1 -1
- package/web/assets/{ChatHistoryPage-BBmrFY5U.js → ChatHistoryPage-BpoHAiYo.js} +1 -1
- package/web/assets/{ChatPage-DfQGtuLo.js → ChatPage-CCMsSvJV.js} +3 -3
- package/web/assets/{ConfigPage-D27UB6Ni.js → ConfigPage-BGZoCXnB.js} +1 -1
- package/web/assets/{MarkdownMessage-BQ_6o9-O.js → MarkdownMessage-Dbgb5XkJ.js} +1 -1
- package/web/assets/{MemoryPage-D46RKJLE.js → MemoryPage-BiAbcHbL.js} +1 -1
- package/web/assets/{PageHeader-DH1jtT2l.js → PageHeader-9ctH9v28.js} +1 -1
- package/web/assets/PluginsPage-D-D22LWb.js +1 -0
- package/web/assets/{PreviewPages-BBwzd5LJ.js → PreviewPages-DUZgwvOb.js} +1 -1
- package/web/assets/{SchedulesPage-AyePMsz_.js → SchedulesPage-C3sS9Ej3.js} +1 -1
- package/web/assets/{SkillsPage-Cb3i7xyX.js → SkillsPage-BeeTZyfc.js} +1 -1
- package/web/assets/{TerminalPanel-B06cwdRZ.js → TerminalPanel-a4jiIuSs.js} +1 -1
- package/web/assets/{WelcomeEffects-CsxWSguh.js → WelcomeEffects-Xo1Z1Nf4.js} +1 -1
- package/web/assets/{WorkflowsPage-Byq1cQot.js → WorkflowsPage-BCdz4ise.js} +1 -1
- package/web/assets/{WorkspacePicker-BNVaK0c9.js → WorkspacePicker-Ctf1A8lp.js} +1 -1
- package/web/assets/client-store-ohgbeJNh.js +1 -0
- package/web/assets/{collapsible-C4owDMcF.js → collapsible-U8Wh2f7S.js} +1 -1
- package/web/assets/{config-search-CsGhOXIG.js → config-search-CdRsMMUS.js} +1 -1
- package/web/assets/{dist-VQXpFPjV.js → dist-Dq4VqZgU.js} +1 -1
- package/web/assets/{dist-CyztUDRL.js → dist-cR3ayBwn.js} +1 -1
- package/web/assets/{es2015-BpePoPbM.js → es2015-DycjrqX-.js} +1 -1
- package/web/assets/{field-BAyGDYW_.js → field-t72VAR-1.js} +1 -1
- package/web/assets/index-Bd5A8V1V.js +40 -0
- package/web/assets/index-DUhopGVK.css +2 -0
- package/web/assets/{progress-BqaId9J2.js → progress-DQDjWjzV.js} +1 -1
- package/web/assets/{scroll-area-DkxdCF8r.js → scroll-area-C1DpxpHg.js} +1 -1
- package/web/assets/{separator-0_agp17Z.js → separator-Br2F2Mir.js} +1 -1
- package/web/assets/tool-labels-v0OysnpI.js +1 -0
- package/web/assets/{tooltip-D9uQM6ab.js → tooltip-DfGEs0yi.js} +1 -1
- package/web/assets/use-i18n-jYw5s_Yn.js +1 -0
- package/web/assets/{use-mobile-A2egKMjY.js → use-mobile-C1OVAMOm.js} +1 -1
- package/web/assets/web-preview-panel-uBOnhY4Z.js +556 -0
- package/web/assets/{welcome-brand-CYtVVlIL.js → welcome-brand-R7Xflzvb.js} +1 -1
- package/web/index.html +10 -10
- package/web/assets/PluginsPage-B4cG171E.js +0 -1
- package/web/assets/client-store-BSV7t02b.js +0 -1
- package/web/assets/index-CAWCOpxG.js +0 -40
- package/web/assets/index-DT-gaDrM.css +0 -2
- package/web/assets/tool-labels-BJhLig5u.js +0 -1
- package/web/assets/use-i18n-yjKc6F2w.js +0 -1
- package/web/assets/web-preview-panel-BOmJGqhe.js +0 -556
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n,t as r}from"./vendor-react-CHuvPdJE.js";import{o as i}from"./button-XhIEgIsg.js";import{f as a,g as o,h as s,p as c}from"./use-i18n-yjKc6F2w.js";import{t as l}from"./dist-CyztUDRL.js";var u=e(t(),1),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}f(p,`useStateMachine`);var m=f(e=>{let{present:t,children:n}=e,r=h(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=_(r.ref,y(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null},`Presence`);function h(e){let[t,n]=u.useState(),r=u.useRef(null),i=u.useRef(e),o=u.useRef(`none`),s=u.useRef(void 0),[c,l]=p(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{c===`mounted`?(o.current=s.current??v(r.current),s.current=void 0):o.current=`none`},[c]),a(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=v(t);e?(s.current=a,l(`MOUNT`)):a===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==a?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),a(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=f(a=>{let o=v(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=f(e=>{e.target===t&&(o.current=v(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,a),t.addEventListener(`animationend`,a),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,a),t.removeEventListener(`animationend`,a)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:u.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=v(t)}else r.current=null;n(e)},[])}}f(h,`usePresence`);function g(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}f(g,`setRef`);function _(...e){let t=u.useRef(e);return t.current=e,u.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=g(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():g(n[e],null)}}},[])}f(_,`useStableComposedRefs`);function v(e){return e?.animationName||`none`}f(v,`getAnimationName`);function y(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}f(y,`getElementRef`);var b=r(),ee=Object.defineProperty,x=(e,t)=>ee(e,`name`,{value:t,configurable:!0}),S=`dismissableLayer.update`,C=`dismissableLayer.pointerDownOutside`,w=`dismissableLayer.focusOutside`,te,T=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ne=u.forwardRef(x(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d,onInteractOutside:f,onDismiss:p,...m}=e,h=u.useContext(T),[g,_]=u.useState(null),v=g?.ownerDocument??globalThis?.document,[,y]=u.useState({}),ee=i(t,_),C=Array.from(h.layers),[w]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),ne=w?C.indexOf(w):-1,E=g?C.indexOf(g):-1,D=h.layersWithOutsidePointerEventsDisabled.size>0,O=E>=ne,k=u.useRef(!1),oe=re(e=>{o?.(e),f?.(e),e.defaultPrevented||p?.()},{ownerDocument:v,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...h.branches].some(t=>t.contains(e));return O&&!t},[h.branches,O])}),A=ie(e=>{if(r&&k.current)return;let t=e.target;[...h.branches].some(e=>e.contains(t))||(d?.(e),f?.(e),e.defaultPrevented||p?.())},v),j=g?E===C.length-1:!1,M=l(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&p&&(e.preventDefault(),p()))});return u.useEffect(()=>{if(j)return v.addEventListener(`keydown`,M,{capture:!0}),()=>v.removeEventListener(`keydown`,M,{capture:!0})},[v,j,M]),u.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(te=v.body.style.pointerEvents,v.body.style.pointerEvents=`none`),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),ae(),()=>{n&&(h.layersWithOutsidePointerEventsDisabled.delete(g),h.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=te))}},[g,v,n,h]),u.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),ae())},[g,h]),u.useEffect(()=>{let e=x(()=>y({}),`handleUpdate`);return document.addEventListener(S,e),()=>document.removeEventListener(S,e)},[]),(0,b.jsx)(s.div,{...m,ref:ee,style:{pointerEvents:D?O?`auto`:`none`:void 0,...e.style},onFocusCapture:c(e.onFocusCapture,A.onFocusCapture),onBlurCapture:c(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,oe.onPointerDownCapture)})},`DismissableLayer`)),E=u.forwardRef(x(function(e,t){let n=u.useContext(T),r=u.useRef(null),a=i(t,r);return u.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,b.jsx)(s.div,{...e,ref:a})},`DismissableLayerBranch`));function D(){let e=u.useContext(T),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}x(D,`useDismissableLayerSurface`);var O=x(()=>!0,`IS_TRUE`);function re(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=O}=t,s=l(e),c=u.useRef(!1),d=u.useRef(!1),f=u.useRef(new Map),p=u.useRef(()=>{});return u.useEffect(()=>{function e(){d.current=!1,i.current=!1,f.current.clear()}x(e,`resetOutsideInteraction`);function t(){return Array.from(f.current.values()).some(Boolean)}x(t,`isOutsideInteractionIntercepted`);function l(e){if(!d.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||f.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{d.current&&p.current()},0)}x(l,`handleInteractionCapture`);function u(e){d.current&&f.current.set(e.type,!1)}x(u,`handleInteractionBubble`);let m=x(a=>{if(a.target&&!c.current){let l=function(){n.removeEventListener(`click`,p.current);let r=t();e(),r||k(C,s,u,{discrete:!0})};if(x(l,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,p.current),e(),c.current=!1;return}let u={originalEvent:a};d.current=!0,i.current=r&&a.button===0,f.current.clear(),!r||a.button!==0?l():(n.removeEventListener(`click`,p.current),p.current=l,n.addEventListener(`click`,p.current,{once:!0}))}else n.removeEventListener(`click`,p.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,l,!0),n.addEventListener(e,u);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,p.current);for(let e of h)n.removeEventListener(e,l,!0),n.removeEventListener(e,u)}},[n,s,r,i,a,o]),{onPointerDownCapture:x(()=>c.current=!0,`onPointerDownCapture`)}}x(re,`usePointerDownOutside`);function ie(e,t=globalThis?.document){let n=l(e),r=u.useRef(!1);return u.useEffect(()=>{let e=x(e=>{e.target&&!r.current&&k(w,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:x(()=>r.current=!0,`onFocusCapture`),onBlurCapture:x(()=>r.current=!1,`onBlurCapture`)}}x(ie,`useFocusOutside`);function ae(){let e=new CustomEvent(S);document.dispatchEvent(e)}x(ae,`dispatchUpdate`);function k(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?o(i,a):i.dispatchEvent(a)}x(k,`handleAndDispatchCustomEvent`);var oe=ne,A=E,j=Object.defineProperty,M=(e,t)=>j(e,`name`,{value:t,configurable:!0}),N=`focusScope.autoFocusOnMount`,se=`focusScope.autoFocusOnUnmount`,ce={bubbles:!1,cancelable:!0},le=u.forwardRef(M(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...c}=e,[d,f]=u.useState(null),p=l(a),m=l(o),h=u.useRef(null),g=i(t,f),_=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(_.paused||!d)return;let t=e.target;d.contains(t)?h.current=t:P(h.current,{select:!0})},t=function(e){if(_.paused||!d)return;let t=e.relatedTarget;t!==null&&(d.contains(t)||P(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&P(d)};M(e,`handleFocusIn`),M(t,`handleFocusOut`),M(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return d&&r.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,d,_.paused]),u.useEffect(()=>{if(d){ge.add(_);let e=document.activeElement;if(!d.contains(e)){let t=new CustomEvent(N,ce);d.addEventListener(N,p),d.dispatchEvent(t),t.defaultPrevented||(ue(ye(fe(d)),{select:!0}),document.activeElement===e&&P(d))}return()=>{d.removeEventListener(N,p),setTimeout(()=>{let t=new CustomEvent(se,ce);d.addEventListener(se,m),d.dispatchEvent(t),t.defaultPrevented||P(e??document.body,{select:!0}),d.removeEventListener(se,m),ge.remove(_)},0)}}},[d,p,m,_]);let v=u.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=de(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&P(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&P(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,b.jsx)(s.div,{tabIndex:-1,...c,ref:g,onKeyDown:v})},`FocusScope`));function ue(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(P(r,{select:t}),document.activeElement!==n)return}M(ue,`focusFirst`);function de(e){let t=fe(e);return[pe(t,e),pe(t.reverse(),e)]}M(de,`getTabbableEdges`);function fe(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:M(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}M(fe,`getTabbableCandidates`);function pe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):me(r,{upTo:t})))return r}M(pe,`findVisible`);function me(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}M(me,`isHidden`);function he(e){return e instanceof HTMLInputElement&&`select`in e}M(he,`isSelectableInput`);function P(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&he(e)&&t&&e.select()}}M(P,`focus`);var ge=_e();function _e(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ve(e,t),e.unshift(t)},remove(t){e=ve(e,t),e[0]?.resume()}}}M(_e,`createFocusScopesStack`);function ve(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}M(ve,`arrayRemove`);function ye(e){return e.filter(e=>e.tagName!==`A`)}M(ye,`removeLinks`);var be=e(n(),1),xe=Object.defineProperty,Se=u.forwardRef(((e,t)=>xe(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,o]=u.useState(!1);a(()=>o(!0),[]);let c=n||i&&globalThis?.document?.body;return c?be.createPortal((0,b.jsx)(s.div,{...r,ref:t}),c):null},`Portal`)),Ce=Object.defineProperty,we=(e,t)=>Ce(e,`name`,{value:t,configurable:!0}),F=0,I=null;function Te(e){return L(),e.children}we(Te,`FocusGuards`);function L(){u.useEffect(()=>{I||={start:R(),end:R()};let{start:e,end:t}=I;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),F++,()=>{F===1&&(I?.start.remove(),I?.end.remove(),I=null),F=Math.max(0,F-1)}},[])}we(L,`useFocusGuards`);function R(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}we(R,`createFocusGuard`);var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function Ee(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function De(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var B=`right-scroll-bar-position`,V=`width-before-scroll-bar`,Oe=`with-scroll-bars-hidden`,ke=`--removed-body-scroll-bar-size`;function H(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ae(e,t){var n=(0,u.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var je=typeof window<`u`?u.useLayoutEffect:u.useEffect,Me=new WeakMap;function Ne(e,t){var n=Ae(t||null,function(t){return e.forEach(function(e){return H(e,t)})});return je(function(){var t=Me.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||H(e,null)}),i.forEach(function(e){r.has(e)||H(e,a)})}Me.set(n,e)},[e]),n}function Pe(e){return e}function Fe(e,t){t===void 0&&(t=Pe);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ie(e){e===void 0&&(e={});var t=Fe(null);return t.options=z({async:!0,ssr:!1},e),t}var Le=function(e){var t=e.sideCar,n=Ee(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return u.createElement(r,z({},n))};Le.isSideCarExport=!0;function Re(e,t){return e.useMedium(t),Le}var ze=Ie(),U=function(){},W=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:U,onWheelCapture:U,onTouchMoveCapture:U}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,ee=Ee(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=p,S=Ne([n,t]),C=z(z({},ee),i);return u.createElement(u.Fragment,null,d&&u.createElement(x,{sideCar:ze,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),z(z({},C),{ref:S})):u.createElement(y,z({},C,{className:c,ref:S}),s))});W.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},W.classNames={fullWidth:V,zeroRight:B};var Be,Ve=function(){if(Be)return Be;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function He(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ve();return t&&e.setAttribute(`nonce`,t),e}function Ue(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function We(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ge=function(){var e=0,t=null;return{add:function(n){e==0&&(t=He())&&(Ue(t,n),We(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ke=function(){var e=Ge();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qe=function(){var e=Ke();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Je={left:0,top:0,right:0,gap:0},G=function(e){return parseInt(e||``,10)||0},Ye=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[G(n),G(r),G(i)]},Xe=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Je;var t=Ye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ze=qe(),K=`data-scroll-locked`,Qe=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n,t as r}from"./vendor-react-CHuvPdJE.js";import{o as i}from"./button-XhIEgIsg.js";import{f as a,g as o,h as s,p as c}from"./use-i18n-jYw5s_Yn.js";import{t as l}from"./dist-cR3ayBwn.js";var u=e(t(),1),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}f(p,`useStateMachine`);var m=f(e=>{let{present:t,children:n}=e,r=h(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=_(r.ref,y(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null},`Presence`);function h(e){let[t,n]=u.useState(),r=u.useRef(null),i=u.useRef(e),o=u.useRef(`none`),s=u.useRef(void 0),[c,l]=p(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{c===`mounted`?(o.current=s.current??v(r.current),s.current=void 0):o.current=`none`},[c]),a(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=v(t);e?(s.current=a,l(`MOUNT`)):a===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==a?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),a(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=f(a=>{let o=v(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=f(e=>{e.target===t&&(o.current=v(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,a),t.addEventListener(`animationend`,a),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,a),t.removeEventListener(`animationend`,a)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:u.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=v(t)}else r.current=null;n(e)},[])}}f(h,`usePresence`);function g(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}f(g,`setRef`);function _(...e){let t=u.useRef(e);return t.current=e,u.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=g(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():g(n[e],null)}}},[])}f(_,`useStableComposedRefs`);function v(e){return e?.animationName||`none`}f(v,`getAnimationName`);function y(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}f(y,`getElementRef`);var b=r(),ee=Object.defineProperty,x=(e,t)=>ee(e,`name`,{value:t,configurable:!0}),S=`dismissableLayer.update`,C=`dismissableLayer.pointerDownOutside`,w=`dismissableLayer.focusOutside`,te,T=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ne=u.forwardRef(x(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d,onInteractOutside:f,onDismiss:p,...m}=e,h=u.useContext(T),[g,_]=u.useState(null),v=g?.ownerDocument??globalThis?.document,[,y]=u.useState({}),ee=i(t,_),C=Array.from(h.layers),[w]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),ne=w?C.indexOf(w):-1,E=g?C.indexOf(g):-1,D=h.layersWithOutsidePointerEventsDisabled.size>0,O=E>=ne,k=u.useRef(!1),oe=re(e=>{o?.(e),f?.(e),e.defaultPrevented||p?.()},{ownerDocument:v,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...h.branches].some(t=>t.contains(e));return O&&!t},[h.branches,O])}),A=ie(e=>{if(r&&k.current)return;let t=e.target;[...h.branches].some(e=>e.contains(t))||(d?.(e),f?.(e),e.defaultPrevented||p?.())},v),j=g?E===C.length-1:!1,M=l(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&p&&(e.preventDefault(),p()))});return u.useEffect(()=>{if(j)return v.addEventListener(`keydown`,M,{capture:!0}),()=>v.removeEventListener(`keydown`,M,{capture:!0})},[v,j,M]),u.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(te=v.body.style.pointerEvents,v.body.style.pointerEvents=`none`),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),ae(),()=>{n&&(h.layersWithOutsidePointerEventsDisabled.delete(g),h.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=te))}},[g,v,n,h]),u.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),ae())},[g,h]),u.useEffect(()=>{let e=x(()=>y({}),`handleUpdate`);return document.addEventListener(S,e),()=>document.removeEventListener(S,e)},[]),(0,b.jsx)(s.div,{...m,ref:ee,style:{pointerEvents:D?O?`auto`:`none`:void 0,...e.style},onFocusCapture:c(e.onFocusCapture,A.onFocusCapture),onBlurCapture:c(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,oe.onPointerDownCapture)})},`DismissableLayer`)),E=u.forwardRef(x(function(e,t){let n=u.useContext(T),r=u.useRef(null),a=i(t,r);return u.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,b.jsx)(s.div,{...e,ref:a})},`DismissableLayerBranch`));function D(){let e=u.useContext(T),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}x(D,`useDismissableLayerSurface`);var O=x(()=>!0,`IS_TRUE`);function re(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=O}=t,s=l(e),c=u.useRef(!1),d=u.useRef(!1),f=u.useRef(new Map),p=u.useRef(()=>{});return u.useEffect(()=>{function e(){d.current=!1,i.current=!1,f.current.clear()}x(e,`resetOutsideInteraction`);function t(){return Array.from(f.current.values()).some(Boolean)}x(t,`isOutsideInteractionIntercepted`);function l(e){if(!d.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||f.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{d.current&&p.current()},0)}x(l,`handleInteractionCapture`);function u(e){d.current&&f.current.set(e.type,!1)}x(u,`handleInteractionBubble`);let m=x(a=>{if(a.target&&!c.current){let l=function(){n.removeEventListener(`click`,p.current);let r=t();e(),r||k(C,s,u,{discrete:!0})};if(x(l,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,p.current),e(),c.current=!1;return}let u={originalEvent:a};d.current=!0,i.current=r&&a.button===0,f.current.clear(),!r||a.button!==0?l():(n.removeEventListener(`click`,p.current),p.current=l,n.addEventListener(`click`,p.current,{once:!0}))}else n.removeEventListener(`click`,p.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,l,!0),n.addEventListener(e,u);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,p.current);for(let e of h)n.removeEventListener(e,l,!0),n.removeEventListener(e,u)}},[n,s,r,i,a,o]),{onPointerDownCapture:x(()=>c.current=!0,`onPointerDownCapture`)}}x(re,`usePointerDownOutside`);function ie(e,t=globalThis?.document){let n=l(e),r=u.useRef(!1);return u.useEffect(()=>{let e=x(e=>{e.target&&!r.current&&k(w,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:x(()=>r.current=!0,`onFocusCapture`),onBlurCapture:x(()=>r.current=!1,`onBlurCapture`)}}x(ie,`useFocusOutside`);function ae(){let e=new CustomEvent(S);document.dispatchEvent(e)}x(ae,`dispatchUpdate`);function k(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?o(i,a):i.dispatchEvent(a)}x(k,`handleAndDispatchCustomEvent`);var oe=ne,A=E,j=Object.defineProperty,M=(e,t)=>j(e,`name`,{value:t,configurable:!0}),N=`focusScope.autoFocusOnMount`,se=`focusScope.autoFocusOnUnmount`,ce={bubbles:!1,cancelable:!0},le=u.forwardRef(M(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...c}=e,[d,f]=u.useState(null),p=l(a),m=l(o),h=u.useRef(null),g=i(t,f),_=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(_.paused||!d)return;let t=e.target;d.contains(t)?h.current=t:P(h.current,{select:!0})},t=function(e){if(_.paused||!d)return;let t=e.relatedTarget;t!==null&&(d.contains(t)||P(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&P(d)};M(e,`handleFocusIn`),M(t,`handleFocusOut`),M(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return d&&r.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,d,_.paused]),u.useEffect(()=>{if(d){ge.add(_);let e=document.activeElement;if(!d.contains(e)){let t=new CustomEvent(N,ce);d.addEventListener(N,p),d.dispatchEvent(t),t.defaultPrevented||(ue(ye(fe(d)),{select:!0}),document.activeElement===e&&P(d))}return()=>{d.removeEventListener(N,p),setTimeout(()=>{let t=new CustomEvent(se,ce);d.addEventListener(se,m),d.dispatchEvent(t),t.defaultPrevented||P(e??document.body,{select:!0}),d.removeEventListener(se,m),ge.remove(_)},0)}}},[d,p,m,_]);let v=u.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=de(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&P(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&P(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,b.jsx)(s.div,{tabIndex:-1,...c,ref:g,onKeyDown:v})},`FocusScope`));function ue(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(P(r,{select:t}),document.activeElement!==n)return}M(ue,`focusFirst`);function de(e){let t=fe(e);return[pe(t,e),pe(t.reverse(),e)]}M(de,`getTabbableEdges`);function fe(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:M(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}M(fe,`getTabbableCandidates`);function pe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):me(r,{upTo:t})))return r}M(pe,`findVisible`);function me(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}M(me,`isHidden`);function he(e){return e instanceof HTMLInputElement&&`select`in e}M(he,`isSelectableInput`);function P(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&he(e)&&t&&e.select()}}M(P,`focus`);var ge=_e();function _e(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ve(e,t),e.unshift(t)},remove(t){e=ve(e,t),e[0]?.resume()}}}M(_e,`createFocusScopesStack`);function ve(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}M(ve,`arrayRemove`);function ye(e){return e.filter(e=>e.tagName!==`A`)}M(ye,`removeLinks`);var be=e(n(),1),xe=Object.defineProperty,Se=u.forwardRef(((e,t)=>xe(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,o]=u.useState(!1);a(()=>o(!0),[]);let c=n||i&&globalThis?.document?.body;return c?be.createPortal((0,b.jsx)(s.div,{...r,ref:t}),c):null},`Portal`)),Ce=Object.defineProperty,we=(e,t)=>Ce(e,`name`,{value:t,configurable:!0}),F=0,I=null;function Te(e){return L(),e.children}we(Te,`FocusGuards`);function L(){u.useEffect(()=>{I||={start:R(),end:R()};let{start:e,end:t}=I;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),F++,()=>{F===1&&(I?.start.remove(),I?.end.remove(),I=null),F=Math.max(0,F-1)}},[])}we(L,`useFocusGuards`);function R(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}we(R,`createFocusGuard`);var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function Ee(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function De(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var B=`right-scroll-bar-position`,V=`width-before-scroll-bar`,Oe=`with-scroll-bars-hidden`,ke=`--removed-body-scroll-bar-size`;function H(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ae(e,t){var n=(0,u.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var je=typeof window<`u`?u.useLayoutEffect:u.useEffect,Me=new WeakMap;function Ne(e,t){var n=Ae(t||null,function(t){return e.forEach(function(e){return H(e,t)})});return je(function(){var t=Me.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||H(e,null)}),i.forEach(function(e){r.has(e)||H(e,a)})}Me.set(n,e)},[e]),n}function Pe(e){return e}function Fe(e,t){t===void 0&&(t=Pe);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ie(e){e===void 0&&(e={});var t=Fe(null);return t.options=z({async:!0,ssr:!1},e),t}var Le=function(e){var t=e.sideCar,n=Ee(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return u.createElement(r,z({},n))};Le.isSideCarExport=!0;function Re(e,t){return e.useMedium(t),Le}var ze=Ie(),U=function(){},W=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:U,onWheelCapture:U,onTouchMoveCapture:U}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,ee=Ee(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=p,S=Ne([n,t]),C=z(z({},ee),i);return u.createElement(u.Fragment,null,d&&u.createElement(x,{sideCar:ze,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),z(z({},C),{ref:S})):u.createElement(y,z({},C,{className:c,ref:S}),s))});W.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},W.classNames={fullWidth:V,zeroRight:B};var Be,Ve=function(){if(Be)return Be;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function He(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ve();return t&&e.setAttribute(`nonce`,t),e}function Ue(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function We(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ge=function(){var e=0,t=null;return{add:function(n){e==0&&(t=He())&&(Ue(t,n),We(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ke=function(){var e=Ge();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qe=function(){var e=Ke();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Je={left:0,top:0,right:0,gap:0},G=function(e){return parseInt(e||``,10)||0},Ye=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[G(n),G(r),G(i)]},Xe=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Je;var t=Ye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ze=qe(),K=`data-scroll-locked`,Qe=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
2
|
.${Oe} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-B0Z9INg1.js";import{i as e,t}from"./vendor-react-CHuvPdJE.js";import"./separator-
|
|
1
|
+
import"./rolldown-runtime-B0Z9INg1.js";import{i as e,t}from"./vendor-react-CHuvPdJE.js";import"./separator-Br2F2Mir.js";import{t as n}from"./vendor-ui-DvrYggeS.js";import{t as r}from"./utils-C8uzG5AZ.js";import{O as i}from"./index-Bd5A8V1V.js";e();var a=t();n(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function o({className:e,variant:t=`default`,...n}){return(0,a.jsx)(i,{"data-slot":`field-label`,"data-variant":t,className:r(t==="default"&&`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,t===`control`&&`mt-2.5 flex w-full min-w-0 flex-col items-stretch gap-[5px] text-[12px] font-semibold text-[var(--text-secondary)] [&_input]:h-[31px] [&_input]:w-full [&_input]:rounded-[var(--r-xs)] [&_input]:border [&_input]:border-[var(--stroke)] [&_input]:bg-[var(--surface-subtle)] [&_input]:px-[9px] [&_input]:text-[12px] [&_input]:font-normal [&_input]:text-[var(--text)] [&_textarea]:min-h-[66px] [&_textarea]:w-full [&_textarea]:resize-y [&_textarea]:rounded-[var(--r-xs)] [&_textarea]:border [&_textarea]:border-[var(--stroke)] [&_textarea]:bg-[var(--surface-subtle)] [&_textarea]:px-[9px] [&_textarea]:py-2 [&_textarea]:text-[12px] [&_textarea]:leading-[1.45] [&_textarea]:font-normal [&_textarea]:text-[var(--text)] dark:[&_input]:bg-[var(--solid)] dark:[&_textarea]:bg-[var(--solid)]`,e),...n})}export{o as t};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AppShortcuts-D66c2bOM.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-CHuvPdJE.js","assets/shortcuts-BIzphxhz.js","assets/vendor-state-DE1O_s6m.js","assets/storage-BE5DCCG3.js","assets/AppOverlays-DlB6SVT6.js","assets/chat-api-Cy0t78Jm.js","assets/api-B6CluO7V.js","assets/vendor-router-Bw2aAdMs.js","assets/abort-signal-f4JsiYKX.js","assets/button-XhIEgIsg.js","assets/vendor-ui-DvrYggeS.js","assets/utils-C8uzG5AZ.js","assets/use-i18n-jYw5s_Yn.js","assets/loader-circle-72TYCcVQ.js","assets/tag-Csd134FL.js","assets/x-bw26XDZM.js","assets/input-D1QFzNMx.js","assets/field-t72VAR-1.js","assets/separator-Br2F2Mir.js","assets/PageHeader-9ctH9v28.js","assets/link-2-CaZP6GWi.js","assets/config-search-CdRsMMUS.js","assets/play-N6mg4pFl.js","assets/save-CVL5N6eP.js","assets/square-terminal-DpCa0gzM.js","assets/square-BZ3Bi3O-.js","assets/TerminalPanel-a4jiIuSs.js","assets/chevron-down-DT6AXwTP.js","assets/TerminalPanel-BrP-ENHg.css","assets/MobileViewportStabilizer-CYh5obIv.js","assets/ChatPage-CCMsSvJV.js","assets/use-mobile-C1OVAMOm.js","assets/dist-cR3ayBwn.js","assets/web-preview-panel-uBOnhY4Z.js","assets/es2015-DycjrqX-.js","assets/collapsible-U8Wh2f7S.js","assets/AppSelect-kDqZkETY.js","assets/check-jIXqkGKr.js","assets/progress-DQDjWjzV.js","assets/scroll-area-C1DpxpHg.js","assets/tooltip-DfGEs0yi.js","assets/circle-dot-rl11gaty.js","assets/code-xml-Z4K2ea1N.js","assets/file-C8GNXmhJ.js","assets/client-store-ohgbeJNh.js","assets/panel-top-CA2GX1Rj.js","assets/panel-left-CVuoi3zo.js","assets/paperclip-BMRj9kRG.js","assets/pencil-CxA1IK0x.js","assets/send-DcLH_sg0.js","assets/tool-labels-v0OysnpI.js","assets/shield-check-BQHFfxVy.js","assets/trash-2-mhzzyC6i.js","assets/wrench-BqeVhocX.js","assets/vendor-motion-XxgxfZSY.js","assets/MarkdownMessage-Dbgb5XkJ.js","assets/copy-DS-8Hh_R.js","assets/vendor-markdown-plugins-Wv1dLaAO.js","assets/vendor-shiki-runtime-CxE5QolQ.js","assets/vendor-markdown-plugins-DEcVZfaU.css","assets/vendor-markdown-Bsw0Ng3w.js","assets/alert-B7D8joCd.js","assets/welcome-brand-R7Xflzvb.js","assets/speech-session-DpiCjZiC.js","assets/WorkspacePicker-Ctf1A8lp.js","assets/usePagePrimaryAction-Bw0OFTDZ.js","assets/brand-DIEc3fK8.js","assets/pick-system-directory-BnIFt85A.js","assets/ChatHistoryPage-BpoHAiYo.js","assets/StarOrbit-BlI6MhVr.js","assets/react-bits-8ql09OLP.css","assets/AssetsPage-mZkZgR9g.js","assets/mobile-runtime-recovery-tbTyacip.js","assets/ChannelsPage-Dau7vaaV.js","assets/message-circle-Bc_EzZop.js","assets/SchedulesPage-C3sS9Ej3.js","assets/ConfigPage-BGZoCXnB.js","assets/arrow-right-KWvgbo3p.js","assets/earth-DR_clkZ9.js","assets/zap-CFsp4Y1u.js","assets/PluginsPage-D-D22LWb.js","assets/dist-Dq4VqZgU.js","assets/file-code-corner-BKkXAMHR.js","assets/image-Dh7-wI1d.js","assets/MemoryPage-BiAbcHbL.js","assets/use-animation-visibility-C-GENY2Z.js","assets/PreviewPages-DUZgwvOb.js","assets/SkillsPage-BeeTZyfc.js","assets/WorkflowsPage-BCdz4ise.js","assets/vendor-xyflow-CnjXtcyK.js","assets/vendor-xyflow-DLioOiRN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,n,r,t as i}from"./vendor-react-CHuvPdJE.js";import{a,c as o,f as s,i as c,n as l,o as u,r as d,s as f,t as p,u as m}from"./vendor-router-Bw2aAdMs.js";import{S as h,_ as g,a as _,b as v,c as y,d as b,f as x,g as S,h as C,i as ee,l as w,m as T,n as te,o as E,p as D,r as O,s as k,t as ne,u as re,v as ie,x as ae,y as oe}from"./chat-api-Cy0t78Jm.js";import{a as se,s as ce,t as le}from"./api-B6CluO7V.js";import{i as ue,n as A,o as j,r as de,t as M}from"./button-XhIEgIsg.js";import{a as fe,c as pe,d as N,f as me,g as P,h as F,i as he,l as ge,m as I,n as _e,p as L,t as R,u as ve}from"./use-i18n-jYw5s_Yn.js";import{d as ye,n as be,r as xe}from"./use-mobile-C1OVAMOm.js";import{c as Se,i as Ce,o as we,u as Te}from"./es2015-DycjrqX-.js";import{n as Ee,t as De}from"./dist-cR3ayBwn.js";import{a as Oe,c as ke,i as Ae,n as je,o as Me,r as Ne,s as z,t as Pe}from"./dist-Dq4VqZgU.js";import"./separator-Br2F2Mir.js";import{r as Fe}from"./tooltip-DfGEs0yi.js";import{t as Ie}from"./vendor-ui-DvrYggeS.js";import{t as B}from"./utils-C8uzG5AZ.js";import{a as Le,i as Re}from"./vendor-state-DE1O_s6m.js";import{t as V}from"./storage-BE5DCCG3.js";import{a as ze,i as Be,n as Ve,o as He,r as Ue,s as We,t as Ge}from"./client-store-ohgbeJNh.js";import{t as Ke}from"./panel-left-CVuoi3zo.js";import{t as qe}from"./x-bw26XDZM.js";import{t as H}from"./input-D1QFzNMx.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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var U=e(t(),1),W=n(),Je=class extends h{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=re(),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),Xe(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ze(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ze(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 C(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&&!g(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Qe(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||C(this.options.enabled,this.#t)!==C(t.enabled,this.#t)||S(this.options.staleTime,this.#t)!==S(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||C(this.options.enabled,this.#t)!==C(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 et(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(D)),t}#g(){this.#b();let e=S(this.options.staleTime,this.#t);if(b.isServer()||this.#r.isStale||!x(e))return;let t=oe(this.#r.dataUpdatedAt,e)+1;this.#d=v.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,!(b.isServer()||C(this.options.enabled,this.#t)===!1||!x(this.#p)||this.#p===0)&&(this.#f=v.setInterval(()=>{(this.options.refetchIntervalInBackground||ae.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(v.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(v.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&&Xe(e,t),o=i&&Qe(e,n,t,r);(a||o)&&(l={...l,...y(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=T(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=T(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`,b=_&&g,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:b,isLoading:b,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&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:$e(e,t),refetch:this.refetch,promise:this.#o,isEnabled:C(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=re();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a()}}return S}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),!g(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){w.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ye(e,t){return C(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||C(t.retryOnMount,e)!==!1)}function Xe(e,t){return Ye(e,t)||e.state.data!==void 0&&Ze(e,t,t.refetchOnMount)}function Ze(e,t,n){if(C(t.enabled,e)!==!1&&S(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&$e(e,t)}return!1}function Qe(e,t,n,r){return(e!==t||C(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&$e(e,n)}function $e(e,t){return C(t.enabled,e)!==!1&&e.isStaleByTime(S(t.staleTime,e))}function et(e,t){return!g(e.getCurrentResult(),t)}var G=i(),tt=U.createContext(void 0),nt=e=>{let t=U.useContext(tt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},rt=({client:e,children:t})=>(U.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,G.jsx)(tt.Provider,{value:e,children:t})),it=U.createContext(!1),at=()=>U.useContext(it);it.Provider;function ot(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var st=U.createContext(ot()),ct=()=>U.useContext(st),lt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ie(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ut=e=>{U.useEffect(()=>{e.clearReset()},[e])},dt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ie(n,[e.error,r])),ft=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))}},pt=(e,t)=>e.isLoading&&e.isFetching&&!t,mt=(e,t)=>e?.suspense&&t.isPending,ht=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function gt(e,t,n){let r=at(),i=ct(),a=nt(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,ft(o),lt(o,i,s),ut(i);let l=!a.getQueryCache().get(o.queryHash),[u]=U.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(U.useSyncExternalStore(U.useCallback(e=>{let t=f?u.subscribe(w.batchCalls(e)):D;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),U.useEffect(()=>{u.setOptions(o)},[o,u]),mt(o,d))throw ht(o,u,i);if(dt({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&&!b.isServer()&&pt(d,r)&&(l?ht(o,u,i):s?.promise)?.catch(D).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function _t(e,t){return gt(e,Je,t)}var vt=Object.defineProperty,K=(e,t)=>vt(e,`name`,{value:t,configurable:!0});function yt(e){let t=e+`CollectionProvider`,[n,r]=I(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=K(e=>{let{scope:t,children:n}=e,r=U.useRef(null),a=U.useRef(new Map).current;return(0,G.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=ue(s),l=U.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=j(t,i.collectionRef);return(0,G.jsx)(c,{ref:o,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=ue(u),p=U.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=U.useRef(null),s=j(t,o),c=a(u,n);return U.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,G.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return U.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return K(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}K(yt,`createCollection`);var bt=new WeakMap,xt=class e extends Map{static#e=K(this,`OrderedDict`);#t;constructor(e){super(e),this.#t=[...super.keys()],bt.set(this,!0)}set(e,t){return bt.get(this)&&(this.has(e)?this.#t[this.#t.indexOf(e)]=e:this.#t.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#t.length,a=wt(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#t],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#t.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#t.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#t.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#t.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#t=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#t.splice(this.#t.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=St(this.#t,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=St(this.#t,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#t.indexOf(e)}keyAt(e){return St(this.#t,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function St(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Ct(e,t);return n===-1?void 0:e[n]}K(St,`at`);function Ct(e,t){let n=e.length,r=wt(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}K(Ct,`toSafeIndex`);function wt(e){return e!==e||e===0?0:Math.trunc(e)}K(wt,`toSafeInteger`);function Tt(e){let t=e+`CollectionProvider`,[n,r]=I(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new xt,setItemMap:K(()=>void 0,`setItemMap`)}),o=K(({state:e,...t})=>e?(0,G.jsx)(c,{...t,state:e}):(0,G.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=K(e=>{let t=h();return(0,G.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=K(e=>{let{scope:t,children:n,state:r}=e,a=U.useRef(null),[o,s]=U.useState(null),c=j(a,s),[l,u]=r;return U.useEffect(()=>{if(!o)return;let e=kt(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,G.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=ue(l),d=U.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(l,n),o=j(t,i.collectionRef);return(0,G.jsx)(u,{ref:o,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=ue(f),m=U.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=U.useRef(null),[s,c]=U.useState(null),l=j(t,o,c),{setItemMap:u}=a(f,n),d=U.useRef(i);Et(d.current,i)||(d.current=i);let m=d.current;return U.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Ot):(t.set(s,{...e,element:s}),t.toSorted(Ot)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new xt(e)))}},[s,m,u]),(0,G.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return U.useState(new xt)}K(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return K(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}K(Tt,`createCollection`);function Et(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}K(Et,`shallowEqual`);function Dt(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}K(Dt,`isElementPreceding`);function Ot(e,t){return!e[1].element||!t[1].element?0:Dt(e[1].element,t[1].element)?-1:1}K(Ot,`sortByDocumentPosition`);function kt(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}K(kt,`getChildListObserver`);var At=Object.defineProperty,jt=(e,t)=>At(e,`name`,{value:t,configurable:!0}),Mt=U.createContext(void 0);function Nt(e){let t=U.useContext(Mt);return e||t||`ltr`}jt(Nt,`useDirection`);var Pt=Object.defineProperty,Ft=(e,t)=>Pt(e,`name`,{value:t,configurable:!0}),It=!1;function Lt(){let[e,t]=U.useState(It);return U.useEffect(()=>{It||(It=!0,t(!0))},[]),e}Ft(Lt,`useIsHydrated`);var Rt=U.useSyncExternalStore;function zt(){return()=>{}}Ft(zt,`subscribe`);function Bt(){return Rt(zt,()=>!0,()=>!1)}Ft(Bt,`useIsHydratedModern`);var Vt=typeof Rt==`function`?Bt:Lt,Ht=Object.defineProperty,Ut=(e,t)=>Ht(e,`name`,{value:t,configurable:!0}),Wt=`rovingFocusGroup.onEntryFocus`,Gt={bubbles:!1,cancelable:!0},Kt=`RovingFocusGroup`,[qt,Jt,Yt]=yt(Kt),[Xt,Zt]=I(Kt,[Yt]),[Qt,$t]=Xt(Kt),en=U.forwardRef(Ut(function(e,t){return(0,G.jsx)(qt.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,G.jsx)(qt.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,G.jsx)(tn,{...e,ref:t})})})},`RovingFocusGroup`)),tn=U.forwardRef(Ut(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=U.useRef(null),p=j(t,f),m=Nt(a),[h,g]=N({prop:o,defaultProp:s??null,onChange:c,caller:Kt}),[_,v]=U.useState(!1),y=De(l),b=Jt(n),x=U.useRef(!1),[S,C]=U.useState(0);return U.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Wt,y),()=>e.removeEventListener(Wt,y)},[y]),(0,G.jsx)(Qt,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:U.useCallback(e=>g(e),[g]),onItemShiftTab:U.useCallback(()=>v(!0),[]),onFocusableItemAdd:U.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:U.useCallback(()=>C(e=>e-1),[]),children:(0,G.jsx)(F.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:L(e.onMouseDown,()=>{x.current=!0}),onFocus:L(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Wt,Gt);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);cn([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:L(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),nn=`RovingFocusGroupItem`,rn=U.forwardRef(Ut(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ee(),l=a||c,u=$t(nn,n),d=u.currentTabStopId===l,f=Jt(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Vt();return me(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),U.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,G.jsx)(qt.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,G.jsx)(F.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:L(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:L(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:L(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=sn(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?ln(n,r+1):n.slice(r+1)}setTimeout(()=>cn(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),an={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function on(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Ut(on,`getDirectionAwareKey`);function sn(e,t,n){let r=on(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return an[r]}Ut(sn,`getFocusIntent`);function cn(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Ut(cn,`focusFirst`);function ln(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ut(ln,`wrapArray`);var un=en,dn=rn,fn=Object.defineProperty,pn=U.forwardRef(((e,t)=>fn(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,G.jsx)(F.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),mn=Object.defineProperty,q=(e,t)=>mn(e,`name`,{value:t,configurable:!0}),hn=`Switch`,[gn,_n]=I(hn),[vn,yn]=gn(hn);function bn(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]=N({prop:n,defaultProp:i??!1,onChange:c,caller:hn}),[m,h]=U.useState(null),[g,_]=U.useState(null),v=U.useRef(!1),[y,b]=U.useReducer(e=>e+1,0),x={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,G.jsx)(vn,{scope:t,...x,children:On(d)?d(x):r})}q(bn,`SwitchProvider`);var xn=`SwitchTrigger`,Sn=U.forwardRef(q(function({__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,onUserInteraction:p,isFormControl:m,bubbleInput:h}=yn(xn,e),g=j(r,u),_=U.useRef(c);return U.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=q(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,G.jsx)(F.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":kn(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:g,onClick:L(t,e=>{p(),d(e=>!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),Cn=U.forwardRef(q(function(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,G.jsx)(bn,{__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,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Sn,{...d,ref:t,__scopeSwitch:n}),e&&(0,G.jsx)(Dn,{__scopeSwitch:n})]})})},`Switch`)),wn=`SwitchThumb`,Tn=U.forwardRef(q(function(e,t){let{__scopeSwitch:n,...r}=e,i=yn(wn,n);return(0,G.jsx)(F.span,{"data-state":kn(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),En=`SwitchBubbleInput`,Dn=U.forwardRef(q(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=yn(En,e),g=j(r,h),_=ve(i),v=U.useRef(!1),y=U.useRef(s),b=U.useRef(o);U.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==b.current;b.current=o;let i=y.current!==s;y.current=s;let c=!(r&&a.current);if(i&&n){v.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),v.current=!1}},[m,s,a,o]);let x=U.useRef(s);return(0,G.jsx)(F.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??x.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:L(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function On(e){return typeof e==`function`}q(On,`isFunction`);function kn(e){return e?`checked`:`unchecked`}q(kn,`getState`);var An=Object.defineProperty,jn=(e,t)=>An(e,`name`,{value:t,configurable:!0}),Mn=`Tabs`,[Nn,Pn]=I(Mn,[Zt]),Fn=Zt(),[In,Ln]=Nn(Mn),Rn=U.forwardRef(jn(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Nt(s),[d,f]=N({prop:r,onChange:i,defaultProp:a??``,caller:Mn});return(0,G.jsx)(In,{scope:n,baseId:Ee(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,G.jsx)(F.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),zn=`TabsList`,Bn=U.forwardRef(jn(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Ln(zn,n),o=Fn(n);return(0,G.jsx)(un,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,G.jsx)(F.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Vn=`TabsTrigger`,Hn=U.forwardRef(jn(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Ln(Vn,n),s=Fn(n),c=Un(o.baseId,r),l=Wn(o.baseId,r),u=r===o.value;return(0,G.jsx)(dn,{asChild:!0,...s,focusable:!i,active:u,children:(0,G.jsx)(F.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:L(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:L(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:L(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`));function Un(e,t){return`${e}-trigger-${t}`}jn(Un,`makeTriggerId`);function Wn(e,t){return`${e}-content-${t}`}jn(Wn,`makeContentId`);var Gn=Rn,Kn=Bn,qn=Hn,Jn=e(r(),1),Yn=Object.defineProperty,J=(e,t)=>Yn(e,`name`,{value:t,configurable:!0}),Xn=`ToastProvider`,[Zn,Qn,$n]=yt(`Toast`),[er,tr]=I(`Toast`,[$n]),[nr,rr]=er(Xn),ir=J(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=U.useState(null),[u,d]=U.useState(0),f=U.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Xn}\`. Expected non-empty \`string\`.`),(0,G.jsx)(Zn.Provider,{scope:t,children:(0,G.jsx)(nr,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:U.useCallback(()=>d(e=>e+1),[]),onToastRemove:U.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),ar=`ToastViewport`,or=[`F8`],sr=`toast.viewportPause`,cr=`toast.viewportResume`,lr=U.forwardRef(J(function(e,t){let{__scopeToast:n,hotkey:r=or,label:i=`Notifications ({hotkey})`,...a}=e,o=rr(ar,n),s=Qn(n),c=U.useRef(null),l=U.useRef(null),u=U.useRef(null),d=U.useRef(null),f=j(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;U.useEffect(()=>{let e=J(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),U.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=J(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(sr);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=J(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(cr);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=J(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=J(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=U.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...jr(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return U.useEffect(()=>{let e=d.current;if(e){let t=J(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Mr(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,G.jsxs)(we,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,G.jsx)(dr,{ref:l,onFocusFromOutsideViewport:()=>{Mr(h({tabbingDirection:`forwards`}))}}),(0,G.jsx)(Zn.Slot,{scope:n,children:(0,G.jsx)(F.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,G.jsx)(dr,{ref:u,onFocusFromOutsideViewport:()=>{Mr(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),ur=`ToastFocusProxy`,dr=U.forwardRef(J(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=rr(ur,n);return(0,G.jsx)(ye,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),fr=`Toast`,pr=`toast.swipeStart`,mr=`toast.swipeMove`,hr=`toast.swipeCancel`,gr=`toast.swipeEnd`,_r=U.forwardRef(J(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=N({prop:r,defaultProp:i??!0,onChange:a,caller:fr});return(0,G.jsx)(Te,{present:n||s,children:(0,G.jsx)(br,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:De(e.onPause),onResume:De(e.onResume),onSwipeStart:L(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:L(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:L(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:L(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[vr,yr]=er(fr,{onClose(){}}),br=U.forwardRef(J(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=rr(fr,n),g=Qn(n),[_,v]=U.useState(null),y=j(t,v),b=U.useRef(null),x=U.useRef(null),S=i||h.duration,C=U.useRef(0),ee=U.useRef(S),w=U.useRef(0),{onToastAdd:T,onToastRemove:te}=h,E=De(()=>{_?.contains(document.activeElement)&&h.viewport?.focus(),o()}),D=U.useCallback(e=>{!e||e===1/0||(window.clearTimeout(w.current),C.current=new Date().getTime(),w.current=window.setTimeout(E,e))},[E]);U.useEffect(()=>{let e=h.viewport;if(e){let t=J(()=>{D(ee.current),l?.()},`handleResume`),n=J(()=>{let e=new Date().getTime()-C.current;ee.current-=e,window.clearTimeout(w.current),c?.()},`handlePause`);return e.addEventListener(sr,n),e.addEventListener(cr,t),()=>{e.removeEventListener(sr,n),e.removeEventListener(cr,t)}}},[h.viewport,S,c,l,D]),U.useEffect(()=>{a&&!h.isClosePausedRef.current&&D(S)},[a,S,h.isClosePausedRef,D]),U.useEffect(()=>()=>{window.clearTimeout(w.current)},[]),U.useEffect(()=>(T(),()=>te()),[T,te]);let O=U.useMemo(()=>_?Er(_):null,[_]);return h.viewport?(0,G.jsxs)(G.Fragment,{children:[O&&(0,G.jsx)(xr,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:O}),(0,G.jsx)(vr,{scope:n,onClose:E,children:Jn.createPortal((0,G.jsx)(Zn.ItemSlot,{scope:n,children:(0,G.jsx)(Se,{asChild:!0,onEscapeKeyDown:L(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||E()}),children:(0,G.jsx)(F.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:L(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||E())}),onPointerDown:L(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:L(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,Dr(mr,d,f,{discrete:!1})):Or(l,h.swipeDirection,c)?(x.current=l,Dr(pr,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:L(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Or(t,h.swipeDirection,h.swipeThreshold)?Dr(gr,p,r,{discrete:!0}):Dr(hr,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),xr=J(e=>{let{__scopeToast:t,children:n,...r}=e,i=rr(fr,t),[a,o]=U.useState(!1),[s,c]=U.useState(!1);return kr(()=>o(!0)),U.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,G.jsx)(Ce,{asChild:!0,container:i.announcerContainer||void 0,children:(0,G.jsx)(ye,{...r,children:a&&(0,G.jsxs)(G.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),Sr=U.forwardRef(J(function(e,t){let{__scopeToast:n,...r}=e;return(0,G.jsx)(F.div,{...r,ref:t})},`ToastDescription`)),Cr=`ToastClose`,wr=U.forwardRef(J(function(e,t){let{__scopeToast:n,...r}=e,i=yr(Cr,n);return(0,G.jsx)(Tr,{asChild:!0,children:(0,G.jsx)(F.button,{type:`button`,...r,ref:t,onClick:L(e.onClick,i.onClose)})})},`ToastClose`)),Tr=U.forwardRef(J(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,G.jsx)(F.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Er(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Ar(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Er(e))}}}),t}J(Er,`getAnnounceTextContent`);function Dr(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?P(i,a):i.dispatchEvent(a)}J(Dr,`handleAndDispatchCustomEvent`);var Or=J((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function kr(e=()=>{}){let t=De(e);me(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}J(kr,`useNextFrame`);function Ar(e){return e.nodeType===e.ELEMENT_NODE}J(Ar,`isHTMLElement`);function jr(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:J(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}J(jr,`getTabbableCandidates`);function Mr(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}J(Mr,`focusFirst`);var Nr=ir,Pr=lr,Fr=_r,Ir=Sr,Lr=wr;function Rr({i18n:e,defaultNS:t,children:n}){let r=(0,U.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,U.createElement)(ge.Provider,{value:r},n)}function zr({children:e}){let{i18n:t}=pe(),n=fe(t.resolvedLanguage)?t.resolvedLanguage:_e;return(0,U.useEffect)(()=>{document.documentElement.lang=n;try{localStorage.setItem(V.language,n)}catch{}window.pisperDesktop?.setLanguage?.(n)},[n]),e}function Br({children:e}){return(0,G.jsx)(Rr,{i18n:he,children:(0,G.jsx)(zr,{children:e})})}function Vr({children:e}){return(0,U.useEffect)(()=>O(window),[]),(0,G.jsx)(rt,{client:_,children:(0,G.jsx)(Br,{children:(0,G.jsx)(Fe,{delayDuration:300,children:e})})})}function Hr(){let e=null,t=!1;return{register(n){return e=n,t&&(t=!1,n()),()=>{e===n&&(e=null)}},invoke(){if(e)return e();t=!0},clear(){e=null}}}var Ur=`pisper:local-reveal-notice`,Wr=A(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Gr=A(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Kr=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`}]]),qr=A(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Jr=A(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Yr=A(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Xr=A(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Zr=A(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Qr=A(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),$r=A(`folder-closed`,[[`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`}],[`path`,{d:`M2 10h20`,key:`1ir3d8`}]]),ei=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`}]]),ti=A(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ni=A(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),ri=A(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ii=A(`monitor-smartphone`,[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]),ai=A(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),oi=A(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),si=A(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),ci=A(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),li=A(`radio-tower`,[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]),ui=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`}]]),di=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`}]]),fi=A(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),pi=A(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),mi=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`}]]),hi=A(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),gi={version:0,profile:`desktop`,engine:`node`,degraded:!1,modules:{childProcess:!0,workerThreads:!0,sqlite:!0,wasm:!0},features:{chat:!0,sessions:!0,providers:!0,filesystem:!0,assets:!0,skills:!0,webSearch:!0,visualGeneration:!0,imageProcessing:!0,processes:!0,shell:!0,terminal:!0,vcs:!0,memory:!0,workers:!0,plugins:!0,mcp:!0,goals:!0,plans:!0,multiAgent:!0,channels:!0,workflows:!0,schedules:!0,browserAutomation:!0,remoteAccess:!0,desktopPet:!0},tools:[]};function _i(e,t){return e.features[t]!==!1}var vi={assets:`assets`,channels:`channels`,schedules:`schedules`,memory:`memory`,mcp:`mcp`,skills:`skills`,workflows:`workflows`,workflowCreate:`workflows`},yi={"desktop-pet":`desktopPet`,"remote-access":`remoteAccess`};function bi(e,t){let n=vi[t];return!n||_i(e,n)}function xi(e,t){let n=yi[t];return!n||_i(e,n)}function Si(e=e=>e,t=gi){let n=[[`chat`,e(`navigation:navigation.chat`),ri],[`assets`,e(`navigation:navigation.assets`),ei],[`workflows`,e(`navigation:navigation.workflows`),ze],[`schedules`,e(`navigation:navigation.schedules`),Jr]];return[[e(`navigation:navigation.app`),n.filter(([e])=>bi(t,e))]]}function Ci(e=e=>e){return{chat:[e(`navigation:navigation.chat`),e(`navigation:navigation.chatDescription`)],chatHistory:[e(`navigation:navigation.chatHistory`),e(`navigation:navigation.chatHistoryDescription`)],assets:[e(`navigation:navigation.assets`),e(`navigation:navigation.assetsDescription`)],channels:[e(`navigation:navigation.channels`),e(`navigation:navigation.channelsDescription`)],schedules:[e(`navigation:navigation.schedules`),e(`navigation:navigation.schedulesDescription`)],config:[e(`navigation:navigation.settings`),e(`navigation:navigation.settingsDescription`)],plugins:[e(`navigation:navigation.plugins`),e(`navigation:navigation.pluginsDescription`)],memory:[e(`navigation:navigation.memory`),e(`navigation:navigation.memoryDescription`)],mcp:[e(`navigation:navigation.mcp`),e(`navigation:navigation.mcpDescription`)],skills:[e(`navigation:navigation.skills`),e(`navigation:navigation.skillsDescription`)],workflows:[e(`navigation:navigation.workflows`),e(`navigation:navigation.workflowsDescription`)],workflowCreate:[e(`navigation:navigation.newWorkflow`),e(`navigation:navigation.newWorkflowDescription`)]}}var Y=Object.freeze({chat:`/chat`,chatHistory:`/chat/history`,assets:`/assets`,channels:`/channels`,schedules:`/schedules`,plugins:`/plugins`,memory:`/memory`,mcp:`/mcp`,skills:`/skills`,workflows:`/workflows`,workflowCreate:`/workflows/new`,config:`/config/models`}),wi=new Set(Object.keys(Y)),Ti=new Map(Object.entries(Y).map(([e,t])=>[t,e]));function Ei(e){return Y[e]||Y.chat}function Di(e){let t=e.length>1?e.replace(/\/+$/,``):e;return/^\/workflows\/[^/]+$/.test(t)?`workflowCreate`:/^\/config(?:\/[^/]+)?$/.test(t)?`config`:Ti.get(t)||null}function Oi(e=`new`){return`/workflows/${encodeURIComponent(e||`new`)}`}function ki(e){let t=String(e||``).replace(/^#/,``);return wi.has(t)?Ei(t):null}var Ai=new Set([`models`,`notifications`,`interface`,`shortcuts`,`desktop-pet`,`updates`,`remote-access`,`mobile-server`,`about`]),X=new Set([`config`,`channels`,`plugins`,`memory`,`mcp`,`skills`]);function ji(e,{mobileApp:t=!1,capabilities:n=gi}={}){let r=t?[{key:`config:mobile-server`,label:e(`config:configPage.mobileServer`),icon:ii,destination:{type:`config`,id:`mobile-server`}}]:[{key:`config:remote-access`,label:e(`config:configPage.remoteAccess`),icon:ii,destination:{type:`config`,id:`remote-access`}}];return[{label:e(`config:settingsShell.agent`),items:[{key:`config:models`,label:e(`config:configPage.models`),icon:Kr,destination:{type:`config`,id:`models`}}]},{label:e(`config:settingsShell.agentCapabilities`),items:[{key:`page:plugins`,label:e(`navigation:navigation.plugins`),icon:si,destination:{type:`page`,id:`plugins`}},{key:`page:mcp`,label:e(`navigation:navigation.mcp`),icon:pi,destination:{type:`page`,id:`mcp`}},{key:`page:skills`,label:e(`navigation:navigation.skills`),icon:mi,destination:{type:`page`,id:`skills`}}]},{label:e(`config:settingsShell.contextAndData`),items:[{key:`page:memory`,label:e(`navigation:navigation.memory`),icon:qr,destination:{type:`page`,id:`memory`}}]},{label:e(`config:settingsShell.connections`),items:[{key:`page:channels`,label:e(`navigation:navigation.channels`),icon:li,destination:{type:`page`,id:`channels`}},...r,{key:`config:notifications`,label:e(`config:configPage.notifications`),icon:Gr,destination:{type:`config`,id:`notifications`}}]},{label:e(`config:settingsShell.application`),items:[{key:`config:interface`,label:e(`config:configPage.interface`),icon:We,destination:{type:`config`,id:`interface`}},{key:`config:shortcuts`,label:e(`config:configPage.shortcuts`),icon:ni,destination:{type:`config`,id:`shortcuts`}},{key:`config:desktop-pet`,label:e(`config:configPage.desktopPet`),icon:Kr,destination:{type:`config`,id:`desktop-pet`}},{key:`config:updates`,label:e(`config:configPage.appUpdates`),icon:ui,destination:{type:`config`,id:`updates`}},{key:`config:about`,label:e(`config:configPage.about`),icon:ti,destination:{type:`config`,id:`about`}}]}].map(e=>({...e,items:e.items.filter(e=>e.destination.type===`config`?xi(n,e.destination.id):bi(n,e.destination.id))})).filter(e=>e.items.length>0)}function Mi(e,t){return e===`config`?`config:${t}`:`page:${e}`}function Ni(e){let t=String(e||``).trim().replace(/^#/,``);return/^[0-9a-fA-F]{6}$/.test(t)?`#${t.toLowerCase()}`:null}function Pi(e){return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16)}}function Fi({r:e,g:t,b:n}){let r=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`}function Ii(e,t,n){return Fi({r:e.r+(t.r-e.r)*n,g:e.g+(t.g-e.g)*n,b:e.b+(t.b-e.b)*n})}var Li={r:255,g:255,b:255},Ri={r:24,g:24,b:27};function zi({r:e,g:t,b:n},r){return`rgba(${e}, ${t}, ${n}, ${r})`}function Bi(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function Vi({r:e,g:t,b:n}){return .2126*Bi(e)+.7152*Bi(t)+.0722*Bi(n)}function Hi(e,t){let n=Vi(e),r=Vi(t),i=Math.max(n,r),a=Math.min(n,r);return(i+.05)/(a+.05)}function Ui(e){return Hi(e,Li)>=Hi(e,Ri)?`#fff`:`#18181b`}function Wi(e){for(let t=.22;t<=1;t+=.04){let n=Ii(e,Ri,t);if(Hi(Pi(n),Li)>=4.5)return n}return`#18181b`}function Gi(e){for(let t=.46;t<=1;t+=.04){let n=Ii(e,Li,t);if(Hi(Pi(n),Ri)>=4.5)return n}return`#fff`}function Ki(e){let t=Pi(e),n=Ii(t,Ri,.12),r=Wi(t),i=Ii(t,Li,.93),a=Ii(t,Li,.72),o=Ii(t,Li,.22),s=Ii(t,Li,.33),c=Gi(t),l=Pi(o),u=Ui(t),d=Ui(l);return`:root[data-accent='custom'] {
|
|
3
|
+
--star: ${e};
|
|
4
|
+
--star-hover: ${n};
|
|
5
|
+
--star-strong: ${r};
|
|
6
|
+
--star-soft: ${i};
|
|
7
|
+
--star-border: ${a};
|
|
8
|
+
--on-accent: ${u};
|
|
9
|
+
--brand-blue: ${e};
|
|
10
|
+
--brand-blue-hover: ${n};
|
|
11
|
+
--brand-blue-strong: ${r};
|
|
12
|
+
--brand-blue-soft: ${i};
|
|
13
|
+
--brand-blue-border: ${a};
|
|
14
|
+
--accent-ring: ${zi(t,.16)};
|
|
15
|
+
--focus: ${e};
|
|
16
|
+
--focus-ring: ${zi(t,.18)};
|
|
17
|
+
}
|
|
18
|
+
:root[data-theme='dark'][data-accent='custom'] {
|
|
19
|
+
--star: ${o};
|
|
20
|
+
--star-hover: ${s};
|
|
21
|
+
--star-strong: ${c};
|
|
22
|
+
--star-soft: color-mix(in srgb, ${o} 15%, transparent);
|
|
23
|
+
--star-border: color-mix(in srgb, ${o} 38%, transparent);
|
|
24
|
+
--on-accent: ${d};
|
|
25
|
+
--brand-blue: ${o};
|
|
26
|
+
--brand-blue-hover: ${s};
|
|
27
|
+
--brand-blue-strong: ${c};
|
|
28
|
+
--brand-blue-soft: color-mix(in srgb, ${o} 15%, transparent);
|
|
29
|
+
--brand-blue-border: color-mix(in srgb, ${o} 34%, transparent);
|
|
30
|
+
--accent-ring: ${zi(l,.22)};
|
|
31
|
+
--focus: ${o};
|
|
32
|
+
--focus-ring: ${zi(l,.26)};
|
|
33
|
+
}`}var qi=`pisper-custom-accent-style`;function Ji(e,t,n=new Date().getHours()){return e===`dark`?!0:e===`light`?!1:e===`system`?t:n>=18||n<8}function Yi(e){let t=document.documentElement;t.dataset.accent=e.accent,t.dataset.density=e.density,t.dataset.fontScale=e.fontScale,t.dataset.motion=e.motion,t.dataset.radius=e.radius;let n=e.accent===`custom`?Ni(e.customAccent||``):null,r=document.getElementById(qi);n?(r||(r=document.createElement(`style`),r.id=qi,document.head.append(r)),r.textContent=Ki(n)):r?.remove()}function Xi({size:e=22,className:t=``}){return(0,G.jsxs)(`svg`,{className:`block flex-none text-[var(--text)] ${t}`,width:e,height:e,viewBox:`0 0 48 48`,role:`img`,"aria-label":`Pisper`,children:[(0,G.jsx)(`defs`,{children:(0,G.jsxs)(`linearGradient`,{id:`pisper-brand-gradient`,x1:`9`,y1:`6`,x2:`40`,y2:`44`,gradientUnits:`userSpaceOnUse`,children:[(0,G.jsx)(`stop`,{offset:`0`,stopColor:`#8B5CF6`}),(0,G.jsx)(`stop`,{offset:`0.55`,stopColor:`#A855F7`}),(0,G.jsx)(`stop`,{offset:`1`,stopColor:`#EC4899`})]})}),(0,G.jsxs)(`g`,{fill:`none`,stroke:`url(#pisper-brand-gradient)`,strokeWidth:4.5,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,G.jsx)(`path`,{d:`M13,7 V42`}),(0,G.jsx)(`path`,{d:`M13,7 L37,20.5 L13,34`})]}),(0,G.jsx)(`rect`,{x:23,y:38,width:15,height:4,rx:2,fill:`url(#pisper-brand-gradient)`})]})}var Zi=`pisper:web-preview-open`;function Qi(e){let t=Ue(e,window.location.href);if(!t)return null;let n={url:t};return localStorage.setItem(V.webPreviewRequest,JSON.stringify(n)),window.dispatchEvent(new CustomEvent(Zi,{detail:n})),n}function $i(){let e=localStorage.getItem(V.webPreviewRequest);if(localStorage.removeItem(V.webPreviewRequest),!e)return null;try{let t=JSON.parse(e),n=typeof t?.url==`string`?Ue(t.url,window.location.href):null;return n?{url:n}:null}catch{return null}}function ea(){let e=u(),t=f();return(0,U.useEffect)(()=>{let n=n=>{if(n.defaultPrevented)return;let r=(n.target instanceof Element?n.target:null)?.closest(`a[href]`);if(!r)return;let i=Be({href:r.href,baseUrl:window.location.href,button:n.button,download:r.hasAttribute(`download`),altKey:n.altKey,ctrlKey:n.ctrlKey,metaKey:n.metaKey,shiftKey:n.shiftKey,behavior:r.dataset.webPreview});i&&(n.preventDefault(),n.stopPropagation(),Qi(i),e.pathname!==Ei(`chat`)&&t(Ei(`chat`)))};return document.addEventListener(`click`,n,!0),()=>document.removeEventListener(`click`,n,!0)},[e.pathname,t]),null}var ta=Object.freeze([`open`,`left`,`right`,`above`,`below`]),na=`session:`;function ra(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ia(e){return e?`${na}${e}`:``}function aa(e){let t=typeof e==`object`&&e?e.params?.sessionId:void 0;if(typeof t==`string`&&t)return t;let n=typeof e==`string`?e:e?.id;return typeof n==`string`&&n.startsWith(na)?n.slice(8):``}function oa(e){if(!ra(e)||!ra(e.panels))return[];let t=[],n=new Set;for(let[r,i]of Object.entries(e.panels)){let e=aa(r)||aa(i);e&&!n.has(e)&&(n.add(e),t.push(e))}return t}function sa(e,t,n){let r=e.indexOf(t);if(r<0)return{tabIds:e,activeId:n};let i=e.filter(e=>e!==t);return n===t?{tabIds:i,activeId:i[Math.min(r,i.length-1)]||``}:{tabIds:i,activeId:n}}function ca(e,t=``){return{version:1,engine:`dockview`,activePanelId:typeof t==`string`?t:``,layout:e}}function la(e){if(!e)return null;try{let t=typeof e==`string`?JSON.parse(e):e;return!ra(t)||t.version!==1||t.engine!==`dockview`||!ra(t.layout)||!ra(t.layout.grid)||!ra(t.layout.panels)?null:{version:1,engine:`dockview`,activePanelId:typeof t.activePanelId==`string`?t.activePanelId:``,layout:t.layout}}catch{return null}}function ua(e){return e===`above`?`top`:e===`below`?`bottom`:e}function da(e,t=`open`,n=``){return!e||!ta.includes(t)?null:{sessionId:e,disposition:t,...n?{targetEntryId:n}:{}}}function fa(e){if(!e)return null;try{let t=typeof e==`string`?JSON.parse(e):e;return ra(t)?da(typeof t.sessionId==`string`?t.sessionId:``,typeof t.disposition==`string`?t.disposition:`open`,typeof t.targetEntryId==`string`?t.targetEntryId:``):null}catch{return null}}function pa({activeSessionId:e=``,validSessionIds:t=[]}={}){return e&&t.includes(e)?[e]:t[0]?[t[0]]:[]}var ma=`pisper:session-selected`,ha=`pisper:session-create-requested`,Z=`pisper:active-session-changed`,ga=`pisper:sessions-updated`,_a=`pisper:command-palette-requested`;function va(e){if(!e||typeof e!=`object`)return null;let{cwd:t,prompt:n}=e;if(t!==void 0&&typeof t!=`string`)return null;let r=typeof n==`string`&&n.trim()?n.trim():void 0;return{cwd:typeof t==`string`?t:``,...r?{prompt:r}:{}}}function ya(e){if(!e)return null;try{return va(JSON.parse(e))}catch{return null}}function ba(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.sessionId==`string`&&typeof t.entryId==`string`?{sessionId:t.sessionId,entryId:t.entryId}:null}catch{return null}}function xa(){window.dispatchEvent(new Event(_a))}function Sa(e,t){let n=va({cwd:e,prompt:t});return n?(localStorage.setItem(V.sessionCreateRequest,JSON.stringify(n)),window.dispatchEvent(new CustomEvent(ha,{detail:n})),!0):!1}function Ca(){let e=ya(localStorage.getItem(V.sessionCreateRequest));return localStorage.removeItem(V.sessionCreateRequest),e}function wa(e,t=`open`,n=``){let r=da(e,t,n);r&&(localStorage.setItem(V.activeSession,e),localStorage.setItem(V.sessionOpenRequest,JSON.stringify(r)),n?localStorage.setItem(V.sessionMessageTarget,JSON.stringify({sessionId:e,entryId:n})):localStorage.removeItem(V.sessionMessageTarget),window.dispatchEvent(new CustomEvent(ma,{detail:r})))}function Ta(e){let t=ba(localStorage.getItem(V.sessionMessageTarget));return t?.sessionId===e?t.entryId:``}function Ea(e,t){let n=ba(localStorage.getItem(V.sessionMessageTarget));n?.sessionId===e&&n.entryId===t&&localStorage.removeItem(V.sessionMessageTarget)}function Da(){let e=fa(localStorage.getItem(V.sessionOpenRequest));return localStorage.removeItem(V.sessionOpenRequest),e}function Oa(e,t=``){window.dispatchEvent(new CustomEvent(Z,{detail:{id:e||``,model:t||``}}))}function ka(){window.dispatchEvent(new Event(ga))}function Aa(e,t=`zh-CN`){let n=t===`en-US`;if(!e)return n?`Just now`:`刚刚`;let r=Date.now()-new Date(e).getTime();if(r<6e4)return n?`Just now`:`刚刚`;if(r<36e5){let e=Math.floor(r/6e4);return n?new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(-e,`minute`):`${e} 分钟前`}if(r<864e5){let e=Math.floor(r/36e5);return n?new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(-e,`hour`):`${e} 小时前`}return new Date(e).toLocaleDateString(t,{month:`numeric`,day:`numeric`})}function ja(e){let t=Number(e)||0;return t>=1e6?`${(t/1e6).toFixed(t>=1e7?1:2).replace(/\.0+$/,``)}M`:t>=1e3?`${(t/1e3).toFixed(t>=1e5?0:t>=1e4?1:2).replace(/\.0+$/,``)}K`:String(t)}function Ma(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}function Na(e){let t=e&&typeof e==`object`?e:{},n=Ma(t.input),r=Ma(t.output),i=Ma(t.cacheRead),a=Ma(t.cacheWrite);return{input:n,output:r,cacheRead:i,cacheWrite:a,reasoning:Ma(t.reasoning),totalTokens:Ma(t.totalTokens??t.total)||n+r+i+a}}function Pa(e,t=`zh-CN`){let n=String(e||``).replace(/[\\/]+$/,``);return n.split(/[\\/]/).pop()||n||(t===`en-US`?`No folder set`:`未设置目录`)}function Fa(e){return e?e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`:``}function Ia({...e}){return(0,G.jsx)(Pe,{"data-slot":`sheet`,...e})}function La({...e}){return(0,G.jsx)(Me,{"data-slot":`sheet-portal`,...e})}function Ra({className:e,...t}){return(0,G.jsx)(Oe,{"data-slot":`sheet-overlay`,className:B(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function za({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,G.jsxs)(La,{children:[(0,G.jsx)(Ra,{}),(0,G.jsxs)(Ne,{"data-slot":`sheet-content`,"data-side":n,className:B(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...i,children:[t,r&&(0,G.jsx)(je,{"data-slot":`sheet-close`,asChild:!0,children:(0,G.jsxs)(M,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,G.jsx)(qe,{}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function Ba({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`sheet-header`,className:B(`flex flex-col gap-0.5 p-4`,e),...t})}function Va({className:e,...t}){return(0,G.jsx)(z,{"data-slot":`sheet-title`,className:B(`font-heading text-base font-medium text-foreground`,e),...t})}function Ha({className:e,...t}){return(0,G.jsx)(Ae,{"data-slot":`sheet-description`,className:B(`text-sm text-muted-foreground`,e),...t})}var Ua=`sidebar_state`,Wa=604800,Ga=`236px`,Ka=`236px`,qa=`64px`,Ja=U.createContext(null);function Ya(){let e=U.useContext(Ja);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Xa({defaultOpen:e=!0,open:t,onOpenChange:n,openMobile:r,onOpenMobileChange:i,className:a,style:o,children:s,...c}){let l=be(),[u,d]=U.useState(!1),f=r??u,p=U.useCallback(e=>{let t=typeof e==`function`?e(f):e;i?i(t):d(t)},[f,i]),[m,h]=U.useState(e),g=t??m,_=U.useCallback(e=>{let t=typeof e==`function`?e(g):e;n?n(t):h(t),document.cookie=`${Ua}=${t}; path=/; max-age=${Wa}`},[n,g]),v=U.useCallback(()=>l?p(e=>!e):_(e=>!e),[l,_,p]),y=g?`expanded`:`collapsed`,b=U.useMemo(()=>({state:y,open:g,setOpen:_,isMobile:l,openMobile:f,setOpenMobile:p,toggleSidebar:v}),[y,g,_,l,f,p,v]);return(0,G.jsx)(Ja.Provider,{value:b,children:(0,G.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":Ga,"--sidebar-width-icon":qa,...o},className:B(`group/sidebar-wrapper relative flex min-h-0 w-full has-data-[variant=inset]:bg-sidebar`,a),...c,children:s})})}function Za({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Ya();return n===`none`?(0,G.jsx)(`div`,{"data-slot":`sidebar`,className:B(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,G.jsx)(Ia,{open:l,onOpenChange:u,...o,children:(0,G.jsxs)(za,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":Ka,width:Ka,maxWidth:Ka},side:e,children:[(0,G.jsxs)(Ba,{className:`sr-only`,children:[(0,G.jsx)(Va,{children:`Sidebar`}),(0,G.jsx)(Ha,{children:`Displays the mobile sidebar.`})]}),(0,G.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,G.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground min-[901px]:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,G.jsx)(`div`,{"data-slot":`sidebar-gap`,className:B(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,G.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:B(`absolute inset-y-0 z-10 hidden h-full w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] min-[901px]:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,G.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function Qa({className:e,onClick:t,children:n,...r}){let{toggleSidebar:i}=Ya();return(0,G.jsxs)(M,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:B(e),onClick:e=>{t?.(e),i()},...r,children:[n??(0,G.jsx)(Ke,{}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function $a({className:e,...t}){return(0,G.jsx)(`main`,{"data-slot":`sidebar-inset`,className:B(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}Ie(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function eo(e){let t={...gi.features};for(let n of Object.keys(t)){let r=e.features?.[n];typeof r==`boolean`&&(t[n]=r)}let n=[`desktop`,`mobile-embedded`,`mobile-store`].includes(String(e.profile))?e.profile:`desktop`;return{version:Number(e.version)||0,profile:n,engine:`node`,degraded:e.degraded===!0,modules:{childProcess:e.modules?.childProcess!==!1,workerThreads:e.modules?.workerThreads!==!1,sqlite:e.modules?.sqlite!==!1,wasm:e.modules?.wasm!==!1},features:t,tools:Array.isArray(e.tools)?e.tools.filter(e=>typeof e==`string`):[]}}var to=null,no=Le()((e,t)=>({capabilities:gi,loaded:!1,load:({refresh:n=!0}={})=>to||(!n&&t().loaded?Promise.resolve():(to=(async()=>{try{e({capabilities:eo(await le(`/api/runtime/capabilities`)),loaded:!0})}catch{e({capabilities:gi,loaded:!0})}})().finally(()=>{to=null}),to))})),ro=24;function io(e=``){let t=e.trim().replace(/\\/g,`/`).replace(/\/+$/,``);return/^[A-Za-z]:\//.test(t)?t.toLowerCase():t}function ao({page:e,configSection:t,navigation:n,navigate:r,navigateSettings:i,onExitSettings:a,collapsed:o,onToggleCollapse:s,update:c,onOpenUpdates:l}){let{t:u,language:d}=R(),{isMobile:f,setOpenMobile:p}=Ya(),[m,h]=(0,U.useState)(!0),[g,_]=(0,U.useState)(``),[v,y]=(0,U.useState)(()=>new Set),[b,x]=(0,U.useState)(()=>localStorage.getItem(V.activeSession)||``),S=e===`workflowCreate`?`workflows`:e===`chatHistory`?`chat`:e,C=X.has(e),ee=Ve(),w=no(e=>e.capabilities),T=(0,U.useMemo)(()=>ji(u,{mobileApp:ee,capabilities:w}),[w,ee,u]),D=Mi(e,t),{data:O}=_t({...E(`sessions`),refetchInterval:2e4}),k=(0,U.useMemo)(()=>[...O?.sessions||[]].sort((e,t)=>Date.parse(t.modified)-Date.parse(e.modified)),[O]),ne=(0,U.useMemo)(()=>{let e=g.trim().toLocaleLowerCase(d);return e?k.filter(t=>`${t.name||``} ${t.cwd||``}`.toLocaleLowerCase(d).includes(e)):k},[d,g,k]),re=(0,U.useMemo)(()=>{let e=new Map;for(let t of ne.slice(0,ro)){let n=io(t.cwd)||`__no_workspace__`,r=e.get(n)||{key:n,cwd:t.cwd||``,sessions:[]};r.sessions.push(t),e.set(n,r)}return[...e.values()]},[ne]);(0,U.useEffect)(()=>{let e=()=>{te(`sessions`,!0).catch(()=>{})},t=()=>{document.visibilityState===`visible`&&e()},n=e=>{let t=e.detail;x(t?.id||localStorage.getItem(V.activeSession)||``)};return document.addEventListener(`visibilitychange`,t),window.addEventListener(ma,n),window.addEventListener(Z,n),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(ma,n),window.removeEventListener(Z,n)}},[]);let ie=e=>{x(e),wa(e),r(`chat`),f&&p(!1)},ae=e=>{Sa(e)&&(r(`chat`),f&&p(!1))},oe=e=>{r(e),f&&p(!1)},se=e=>{i(e),f&&p(!1)},ce=()=>{a(),f&&p(!1)},le=e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,G.jsx)(Za,{collapsible:`icon`,className:`pisper-sidebar-container`,children:(0,G.jsxs)(`aside`,{className:`sidebar dark:border-[var(--stroke)] dark:bg-[var(--sidebar-bg)] dark:shadow-[0_14px_40px_-18px_var(--sidebar-shadow)] max-[1150px]:w-[205px] max-[1150px]:min-w-[205px] max-[1150px]:p-[16px_14px] max-[900px]:fixed max-[900px]:inset-[0_auto_0_0] max-[900px]:w-[236px] max-[900px]:[transform:translateX(-102%)] max-[900px]:[transition:transform_var(--d2)_var(--ease-out)] max-[900px]:[&.is-open]:[transform:translateX(0)] relative z-[30] w-[236px] min-w-[236px] h-full flex flex-col gap-[18px] [padding:18px] [border-right:1px_solid_var(--stroke)] bg-[var(--sidebar-bg)] shadow-[0_14px_40px_-18px_var(--sidebar-shadow)] shadcn-sidebar-content max-[900px]:[.sidebar&]:relative max-[900px]:[.sidebar&]:inset-[auto] max-[900px]:[.sidebar&]:w-[236px] max-[900px]:[.sidebar&]:min-w-[236px] max-[900px]:[.sidebar&]:[transform:none] max-[900px]:[.sidebar&]:[transition:none] ${o?`collapsed min-[901px]:[.sidebar&]:w-[64px] min-[901px]:[.sidebar&]:min-w-[64px] min-[901px]:[.sidebar&]:gap-[12px] min-[901px]:[.sidebar&]:p-[14px_10px] min-[901px]:[[data-density='compact']_.sidebar:not(&)]:w-[218px] min-[901px]:[[data-density='compact']_.sidebar:not(&)]:min-w-[218px] min-[901px]:[[data-density='compact']_.sidebar:not(&)]:p-[14px]`:``}`,children:[(0,G.jsx)(`button`,{className:`mobile-close hover:bg-[var(--surface-hover)] hover:text-[var(--text)] max-[900px]:grid max-[900px]:place-items-center hidden w-[32px] h-[32px] flex-none [margin-left:auto] border-0 rounded-[var(--r-sm)] bg-transparent text-[var(--text-muted)] cursor-pointer`,"aria-label":u(`navigation:appSidebar.closeNavigation`),onClick:()=>p(!1),children:(0,G.jsx)(qe,{size:18})}),(0,G.jsxs)(`div`,{className:`nav-list [&_button]:relative [&_button]:flex [&_button]:w-full [&_button]:h-[34px] [&_button]:items-center [&_button]:gap-[10px] [&_button]:border-0 [&_button]:rounded-[var(--r-sm)] [&_button]:bg-transparent [&_button]:p-[0_10px] [&_button]:text-[var(--text-secondary)] [&_button]:text-left [&_button]:text-[12px] [&_button]:font-[500] [&_button]:[transition:var(--d1)_var(--ease-out)] [&_button:hover]:bg-[var(--surface-hover)] [&_button:hover]:text-[var(--text)] [&_button.active]:bg-[var(--star-soft)] [&_button.active]:text-[var(--text)] [&_button.active]:font-[600] [&_button.active::before]:[content:''] [&_button.active::before]:absolute [&_button.active::before]:left-[2px] [&_button.active::before]:top-[8px] [&_button.active::before]:bottom-[8px] [&_button.active::before]:w-[3px] [&_button.active::before]:rounded-[var(--r-pill)] [&_button.active::before]:bg-[var(--brand-blue)] min-[901px]:[.sidebar.collapsed_&_button]:justify-center min-[901px]:[.sidebar.collapsed_&_button]:gap-[0] min-[901px]:[.sidebar.collapsed_&_button]:p-0 min-[901px]:[.sidebar.collapsed_&_button_span]:hidden min-[901px]:[.sidebar.collapsed_&_button.active::before]:left-0 dark:[&_button.active]:bg-[var(--surface-hover)] min-[901px]:[[data-density='compact']_&_button]:h-[30px] flex min-h-0 flex-col gap-[3px] overflow-y-auto ${C?`nav-settings-mode gap-[10px]`:``}`,children:[C?(0,G.jsxs)(`nav`,{className:`nav-primary [.nav-settings-mode_&]:gap-[0] flex flex-col gap-[3px]`,"aria-label":u(`config:settingsShell.settingsNavigation`),children:[(0,G.jsxs)(`button`,{className:`nav-settings-back [.nav-list_&]:mb-[13px] [.nav-list_&]:[border-bottom:1px_solid_var(--stroke-soft)] [.nav-list_&]:rounded-[0] [.nav-list_&]:p-[0_8px_10px] [.nav-list_&]:text-[var(--text)] [.nav-list_&]:font-[650] [.nav-list_&:hover]:bg-transparent [.nav-list_&:hover]:text-[var(--star-strong)]`,title:u(`navigation:appSidebar.backToApp`),onClick:ce,children:[(0,G.jsx)(Wr,{size:16}),(0,G.jsx)(`span`,{children:u(`navigation:appSidebar.backToApp`)})]}),T.map(e=>(0,G.jsxs)(`div`,{className:`nav-group [.nav-group_+_&]:mt-[10px] [.nav-settings-mode_.nav-group_+_&]:mt-[13px] min-[901px]:[.sidebar.collapsed_.nav-group_+_&]:mt-[8px] flex flex-col gap-[3px]`,children:[(0,G.jsx)(`span`,{className:`nav-group-label min-[901px]:[.sidebar.collapsed_&]:hidden [padding:0_10px_4px] text-[var(--text-muted)] text-[11px] font-[700] tracking-[.12em]`,children:e.label}),e.items.map(e=>{let t=e.icon,n=D===e.key;return(0,G.jsxs)(`button`,{className:`nav-main ${n?`active`:``}`,"aria-current":n?`page`:void 0,title:e.label,onClick:()=>se(e.destination),children:[(0,G.jsx)(t,{size:16}),(0,G.jsx)(`span`,{children:e.label})]},e.key)})]},e.label))]}):(0,G.jsx)(`nav`,{className:`nav-primary [.nav-settings-mode_&]:gap-[0] flex flex-col gap-[3px]`,"aria-label":u(`navigation:appSidebar.mainNavigation`),children:n.map(([e,t])=>(0,G.jsxs)(`div`,{className:`nav-group [.nav-group_+_&]:mt-[10px] [.nav-settings-mode_.nav-group_+_&]:mt-[13px] min-[901px]:[.sidebar.collapsed_.nav-group_+_&]:mt-[8px] flex flex-col gap-[3px]`,children:[(0,G.jsx)(`span`,{className:`nav-group-label min-[901px]:[.sidebar.collapsed_&]:hidden [padding:0_10px_4px] text-[var(--text-muted)] text-[11px] font-[700] tracking-[.12em]`,children:e}),t.map(([e,t,n])=>(0,G.jsxs)(`button`,{className:`nav-main ${S===e?`active`:``}`,title:t,onClick:()=>oe(e),children:[(0,G.jsx)(n,{size:16}),(0,G.jsx)(`span`,{children:t})]},e))]},e))}),!C&&(0,G.jsxs)(`section`,{className:`nav-history-section min-[901px]:[.sidebar.collapsed_&]:hidden flex-1 min-h-0 flex flex-col [margin-top:10px] ${m?`is-expanded`:``}`,"aria-label":u(`navigation:appSidebar.recentChats`),children:[(0,G.jsxs)(`div`,{className:`flex h-[34px] items-center justify-between gap-[6px] [padding:0_4px]`,children:[(0,G.jsxs)(`button`,{className:`nav-history-heading [.nav-list_&]:w-auto [.nav-list_&]:min-w-0 [.nav-list_&]:h-[28px] [.nav-list_&]:[flex:0_1_auto] [.nav-list_&]:gap-[4px] [.nav-list_&]:rounded-[var(--r-xs)] [.nav-list_&]:p-[0_6px] [.nav-list_&]:text-[var(--text-muted)] [.nav-list_&]:text-[11px] [.nav-list_&]:font-[600] [.nav-list_&:hover]:bg-transparent [.nav-list_&:hover]:text-[var(--text-secondary)] [&_>_span]:overflow-hidden [&_>_span]:text-ellipsis [&_>_span]:whitespace-nowrap [&_svg]:flex-none [&_svg]:[transition:transform_var(--d1)_var(--ease-out)] [&_svg.is-open]:[transform:rotate(90deg)]`,"aria-controls":`sidebar-recent-sessions`,"aria-expanded":m,onClick:()=>h(e=>!e),children:[(0,G.jsx)(`span`,{children:u(`navigation:appSidebar.recentChats`)}),(0,G.jsx)(Yr,{className:m?`is-open`:``,size:14})]}),(0,G.jsx)(`button`,{className:`nav-history-view-all [.nav-list_&]:w-auto [.nav-list_&]:h-[28px] [.nav-list_&]:flex-none [.nav-list_&]:rounded-[var(--r-xs)] [.nav-list_&]:p-[0_6px] [.nav-list_&]:text-[var(--text-muted)] [.nav-list_&]:text-[11px] [.nav-list_&]:font-[500] [.nav-list_&:hover]:bg-transparent [.nav-list_&:hover]:text-[var(--star-strong)]`,"aria-label":u(`navigation:appSidebar.viewAllCountChats`,{count:k.length}),onClick:()=>oe(`chatHistory`),children:u(`navigation:appSidebar.viewAll`)})]}),(0,G.jsxs)(`label`,{className:`min-[901px]:[.sidebar.collapsed_&]:hidden flex h-8 flex-none items-center gap-2 rounded-[var(--r-xs)] border border-[var(--stroke-soft)] bg-[var(--solid)] px-2 text-[var(--text-muted)] focus-within:border-[var(--focus)] focus-within:ring-2 focus-within:ring-[var(--focus-ring)]`,children:[(0,G.jsx)(fi,{size:13,"aria-hidden":`true`}),(0,G.jsx)(`input`,{className:`min-w-0 flex-1 border-0 bg-transparent text-[12px] text-[var(--text)] outline-none placeholder:text-[var(--text-muted)]`,value:g,onChange:e=>_(e.target.value),placeholder:u(`navigation:appSidebar.searchChats`),"aria-label":u(`navigation:appSidebar.searchChats`)})]}),m&&(0,G.jsxs)(`div`,{className:`flex flex-1 min-h-0 flex-col gap-[2px] [padding-bottom:2px] overflow-y-auto [animation:page-in_var(--d1)_var(--ease-out)]`,id:`sidebar-recent-sessions`,children:[re.map(e=>{let t=v.has(e.key),n=e.cwd?Pa(e.cwd,d):u(`navigation:appSidebar.noWorkspace`);return(0,G.jsxs)(`div`,{className:`nav-workspace-group [.nav-workspace-group_+_&]:mt-[3px]`,children:[(0,G.jsxs)(`div`,{className:`group/workspace flex min-w-0 items-center gap-[2px]`,children:[(0,G.jsxs)(`button`,{className:`nav-workspace-heading [.nav-list_&]:grid [.nav-list_&]:w-auto [.nav-list_&]:min-w-0 [.nav-list_&]:h-[29px] [.nav-list_&]:min-h-[29px] [.nav-list_&]:flex-1 [.nav-list_&]:grid-cols-[13px_13px_minmax(0,1fr)_auto] [.nav-list_&]:items-center [.nav-list_&]:gap-[6px] [.nav-list_&]:p-[0_8px] [.nav-list_&]:text-[var(--text-muted)] [.nav-list_&]:text-[11px] [.nav-list_&]:font-[650] [.nav-list_&:hover]:bg-transparent [.nav-list_&:hover]:text-[var(--text)] [&_svg:first-child]:[transition:transform_var(--d1)_var(--ease-out)] [&_svg:first-child.is-open]:[transform:rotate(90deg)] [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap [&_small]:!text-[10px] [&_small]:[font-variant-numeric:tabular-nums]`,"aria-expanded":!t,onClick:()=>le(e.key),title:e.cwd||n,children:[(0,G.jsx)(Yr,{className:t?``:`is-open`,size:13}),(0,G.jsx)($r,{size:13}),(0,G.jsx)(`span`,{children:n}),(0,G.jsx)(`small`,{children:e.sessions.length})]}),e.cwd&&(0,G.jsx)(`button`,{type:`button`,className:`nav-workspace-create [.nav-list_&]:grid [.nav-list_&]:w-[28px] [.nav-list_&]:h-[28px] [.nav-list_&]:min-h-[28px] [.nav-list_&]:flex-none [.nav-list_&]:place-items-center [.nav-list_&]:rounded-[var(--r-xs)] [.nav-list_&]:p-0 [.nav-list_&]:text-[var(--text-muted)] [.nav-list_&:hover]:bg-[var(--surface-hover)] [.nav-list_&:hover]:text-[var(--text)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus)] focus-visible:ring-inset`,title:u(`navigation:appSidebar.newChatInWorkspace`,{workspace:e.cwd}),"aria-label":u(`navigation:appSidebar.newChatInWorkspace`,{workspace:e.cwd}),onClick:()=>ae(e.cwd),children:(0,G.jsx)(ci,{size:14})})]}),!t&&e.sessions.map(e=>(0,G.jsx)(`button`,{className:`nav-history-item [.nav-list_&]:flex [.nav-list_&]:w-full [.nav-list_&]:h-[34px] [.nav-list_&]:min-h-[34px] [.nav-list_&]:rounded-[var(--r-sm)] [.nav-list_&]:p-[0_8px_0_24px] [.nav-list_&]:text-[var(--text-secondary)] [.nav-list_&]:text-[12px] [.nav-list_&]:font-[500] [&_>_span]:overflow-hidden [&_>_span]:text-ellipsis [&_>_span]:whitespace-nowrap [.nav-list_&:hover]:bg-[var(--surface-muted)] [.nav-list_&:hover]:text-[var(--text)] min-[901px]:[[data-density='compact']_.nav-list_&]:h-[32px] min-[901px]:[[data-density='compact']_.nav-list_&]:min-h-[32px] ${e.id===b?`active-session [.nav-list_.nav-history-item&]:bg-[var(--surface-muted)] [.nav-list_.nav-history-item&]:text-[var(--text)] [.nav-list_.nav-history-item&]:shadow-[inset_2px_0_var(--brand-blue)]`:``}`,"aria-current":e.id===b?`page`:void 0,title:`${e.name||u(`navigation:appSidebar.untitledChat`)} · ${Aa(e.modified,d)}`,onClick:()=>ie(e.id),children:(0,G.jsx)(`span`,{className:`select-none`,children:e.name||u(`navigation:appSidebar.untitledChat`)})},e.id))]},e.key)}),!ne.length&&(0,G.jsx)(`span`,{className:`[padding:8px] text-[var(--text-muted)] text-[11px]`,children:g.trim()?u(`navigation:appSidebar.noMatchingChats`):u(`navigation:appSidebar.noChatHistoryYet`)})]})]})]}),(0,G.jsxs)(`div`,{className:`mt-auto grid gap-2`,children:[!C&&(0,G.jsxs)(`button`,{className:`sidebar-settings hover:bg-[var(--surface-hover)] hover:text-[var(--text)] [&.active]:bg-[var(--surface-hover)] [&.active]:text-[var(--text)] [&.active_svg]:text-[var(--brand-blue)] min-[901px]:[.sidebar.collapsed_&]:justify-center min-[901px]:[.sidebar.collapsed_&]:gap-[0] min-[901px]:[.sidebar.collapsed_&]:p-0 min-[901px]:[.sidebar.collapsed_&_span]:hidden flex w-full h-[34px] flex-none items-center gap-[9px] border-0 rounded-[var(--r-sm)] bg-transparent [padding:0_10px] text-[var(--text-muted)] text-[12px] font-[600] text-left`,title:u(`navigation:navigation.settings`),onClick:()=>oe(`config`),children:[(0,G.jsx)(He,{size:16}),!o&&(0,G.jsx)(`span`,{children:u(`navigation:navigation.settings`)})]}),(0,G.jsx)(oo,{update:c,collapsed:o,onOpen:l}),(0,G.jsxs)(`button`,{className:`sidebar-collapse hover:bg-[var(--surface-hover)] hover:text-[var(--text)] min-[901px]:[.sidebar.collapsed_&]:justify-center min-[901px]:[.sidebar.collapsed_&]:gap-[0] min-[901px]:[.sidebar.collapsed_&]:p-0 min-[901px]:[.sidebar.collapsed_&_span]:hidden max-[900px]:hidden flex h-[34px] flex-none items-center gap-[8px] [margin-top:auto] [border:1px_solid_var(--stroke)] rounded-[var(--r-sm)] bg-transparent [padding:0_10px] text-[var(--text-muted)] text-[12px] cursor-pointer [transition:var(--d1)_var(--ease-out)] !mt-0`,title:u(o?`navigation:appSidebar.expandSidebar`:`navigation:appSidebar.collapseSidebar`),"aria-label":u(o?`navigation:appSidebar.expandSidebar`:`navigation:appSidebar.collapseSidebar`),onClick:s,children:[o?(0,G.jsx)(oi,{size:16}):(0,G.jsx)(ai,{size:16}),(0,G.jsx)(`span`,{children:u(o?`navigation:appSidebar.expandSidebar`:`navigation:appSidebar.collapseSidebar`)})]})]})]})})}function oo({update:e,collapsed:t,onOpen:n}){let{t:r}=R(),i=e?.status||{state:`idle`},a=!!(e?.info?.desktop||e?.info?.mobile);if(![`available`,`downloading`,`downloaded`].includes(i.state))return null;let o=i.state===`downloading`,s=i.state===`downloaded`,c=r(s?`navigation:appSidebar.readyToRestart`:o?`navigation:appSidebar.downloading`:a?`navigation:appSidebar.updateAvailable`:`navigation:appSidebar.sourceUpdatesAvailable`),l=o?`${Math.round(i.percent||0)}%`:a&&i.availableVersion?`v${i.availableVersion}`:i.behindBy?r(`navigation:appSidebar.countCommitsBehindBranch`,{branch:i.branch||`main`,count:i.behindBy}):i.availableCommit?i.availableCommit.slice(0,7):r(`navigation:appSidebar.viewUpdateDetails`),u=s?di:o?ui:a?Zr:Qr;return(0,G.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center rounded-[var(--r-sm)] border border-[var(--stroke)] bg-[var(--accent-soft)] text-[var(--text)] transition-colors hover:bg-[var(--surface-hover)] ${t?`justify-center px-0`:`gap-2.5 px-3 text-left`}`,title:`${c} · ${l}`,"aria-label":`${c} · ${l}`,onClick:n,children:[(0,G.jsx)(u,{className:o?`animate-spin shrink-0`:`shrink-0`,size:16}),!t&&(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`strong`,{className:`block truncate text-[12px]`,children:c}),(0,G.jsx)(`small`,{className:`mt-0.5 block truncate text-[11px] text-[var(--text-muted)]`,children:l})]})]})}function so({page:e,onNavigate:t}){let{t:n}=R(),r=no(e=>e.capabilities),i=(0,U.useMemo)(()=>Si(n,r).flatMap(([,e])=>e),[r,n]),a=e===`chatHistory`?`chat`:e===`workflowCreate`?`workflows`:e;return(0,G.jsxs)(`nav`,{"aria-label":n(`navigation:appSidebar.mainNavigation`),className:`[[data-mobile-keyboard='open']_&]:pointer-events-none [[data-mobile-keyboard='open']_&]:max-h-0 [[data-mobile-keyboard='open']_&]:border-t-transparent [[data-mobile-keyboard='open']_&]:opacity-0 [[data-mobile-keyboard='open']_&]:pb-0 flex h-[calc(58px_+_env(safe-area-inset-bottom))] max-h-[calc(58px_+_env(safe-area-inset-bottom))] flex-none items-stretch overflow-hidden border-t border-[var(--stroke)] bg-[var(--sidebar-bg)] pb-[env(safe-area-inset-bottom)] shadow-[0_-8px_24px_-20px_var(--main-surface-shadow)] transition-[max-height,opacity,border-color,padding-bottom] duration-200 ease-out`,"data-mobile-navigation":`primary`,children:[i.map(([e,n,r])=>{let i=a===e;return(0,G.jsxs)(`button`,{"aria-current":i?`page`:void 0,className:B(`relative flex min-w-0 flex-1 flex-col items-center justify-center gap-0.5 text-[10px] font-medium transition-colors`,i?`text-[var(--star-strong)]`:`text-[var(--text-muted)]`),onClick:()=>t(e),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:B(`absolute inset-x-[30%] top-0 h-0.5 rounded-full`,i?`bg-[var(--star-strong)]`:`bg-transparent`)}),(0,G.jsx)(r,{"aria-hidden":`true`,size:19,strokeWidth:i?2.2:1.8}),(0,G.jsx)(`span`,{className:`max-w-full whitespace-nowrap`,children:n})]},e)}),(0,G.jsxs)(`button`,{"aria-current":X.has(e)?`page`:void 0,className:B(`relative flex min-w-0 flex-1 flex-col items-center justify-center gap-0.5 text-[10px] font-medium transition-colors`,X.has(e)?`text-[var(--star-strong)]`:`text-[var(--text-muted)]`),onClick:()=>t(`config`),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:B(`absolute inset-x-[30%] top-0 h-0.5 rounded-full`,X.has(e)?`bg-[var(--star-strong)]`:`bg-transparent`)}),(0,G.jsx)(He,{"aria-hidden":`true`,size:19,strokeWidth:X.has(e)?2.2:1.8}),(0,G.jsx)(`span`,{className:`max-w-full whitespace-nowrap`,children:n(`navigation:navigation.settings`)})]})]})}function co({page:e,configSection:t,mobileApp:n,onNavigate:r}){let{t:i}=R(),a=Mi(e,t),o=(0,U.useRef)(null),s=no(e=>e.capabilities),c=(0,U.useMemo)(()=>ji(i,{mobileApp:n,capabilities:s}).flatMap(e=>e.items).filter(e=>e.destination.type!==`config`||e.destination.id!==`desktop-pet`),[s,n,i]);return(0,U.useEffect)(()=>{o.current?.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[a]),(0,G.jsx)(`nav`,{"aria-label":i(`config:settingsShell.settingsNavigation`),className:`flex flex-none gap-2 overflow-x-auto px-4 pb-3 pt-1 [-ms-overflow-style:none] [scrollbar-width:none] max-[650px]:px-2 [&::-webkit-scrollbar]:hidden`,"data-mobile-navigation":`settings`,children:c.map(e=>{let t=a===e.key,n=e.icon;return(0,G.jsxs)(`button`,{"aria-current":t?`page`:void 0,className:B(`flex flex-none items-center gap-1.5 rounded-full border px-3 py-1.5 text-[12px] font-medium transition-colors`,t?`border-[var(--star-strong)] bg-[var(--star-soft)] text-[var(--star-strong)]`:`border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text)]`),onClick:()=>r(e.destination),ref:t?o:void 0,children:[(0,G.jsx)(n,{"aria-hidden":`true`,size:14}),(0,G.jsx)(`span`,{children:e.label})]},e.key)})})}function lo({...e}){return(0,G.jsx)(Pe,{"data-slot":`dialog`,...e})}function uo({...e}){return(0,G.jsx)(ke,{"data-slot":`dialog-trigger`,...e})}function fo({...e}){return(0,G.jsx)(Me,{"data-slot":`dialog-portal`,...e})}function po({className:e,...t}){return(0,G.jsx)(Oe,{"data-slot":`dialog-overlay`,className:B(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function mo({className:e,overlayClassName:t,children:n,showCloseButton:r=!0,...i}){return(0,G.jsxs)(fo,{children:[(0,G.jsx)(po,{className:t}),(0,G.jsxs)(Ne,{"data-slot":`dialog-content`,className:B(`fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto overscroll-contain rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...i,children:[n,r&&(0,G.jsx)(je,{"data-slot":`dialog-close`,asChild:!0,children:(0,G.jsxs)(M,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,G.jsx)(qe,{}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function ho({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`dialog-header`,className:B(`flex flex-col gap-2`,e),...t})}function go({className:e,showCloseButton:t=!1,children:n,...r}){return(0,G.jsxs)(`div`,{"data-slot":`dialog-footer`,className:B(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,G.jsx)(je,{asChild:!0,children:(0,G.jsx)(M,{variant:`outline`,children:`Close`})})]})}function _o({className:e,...t}){return(0,G.jsx)(z,{"data-slot":`dialog-title`,className:B(`font-heading text-base leading-none font-medium`,e),...t})}function vo({className:e,...t}){return(0,G.jsx)(Ae,{"data-slot":`dialog-description`,className:B(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function yo({className:e,...t}){return(0,G.jsx)(pn,{"data-slot":`label`,className:B(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function bo({dialog:e,onClose:t,onFinish:n}){let{t:r}=R(),[i,a]=(0,U.useState)(e?.value||``),o=(0,U.useRef)(null);return(0,U.useEffect)(()=>{a(e?.value||``)},[e]),(0,G.jsx)(lo,{open:!!e,onOpenChange:e=>!e&&t(),children:e&&(0,G.jsx)(mo,{showCloseButton:!1,className:`max-w-[430px] gap-0 rounded-dialog border border-surface-highlight bg-popover p-[18px] text-popover-foreground shadow-dialog ring-0`,onOpenAutoFocus:t=>{e.type===`prompt`&&(t.preventDefault(),o.current?.focus(),o.current?.select())},children:(0,G.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),e&&n(e.type!==`prompt`||i.trim())},children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(_o,{className:`text-[17px] leading-6 font-bold tracking-[0]`,children:e.title}),(0,G.jsx)(vo,{className:e.message?`mt-1.5 text-[13px] leading-5 text-content-muted`:`sr-only`,children:e.message||e.title})]}),(0,G.jsx)(M,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":r(`common:ui.closeDialog`),title:r(`common:ui.closeDialog`),className:`size-8 shrink-0 text-content-muted`,onClick:t,children:(0,G.jsx)(qe,{className:`size-[18px]`})})]}),e.type===`prompt`&&(0,G.jsxs)(yo,{className:`mt-4 block text-[12px] leading-5 font-semibold text-content-soft`,children:[e.inputLabel||r(`common:ui.name`),(0,G.jsx)(H,{ref:o,className:`mt-2 h-10 rounded-lg border-border bg-background px-3 text-[13px]`,value:i,placeholder:e.placeholder,maxLength:e.maxLength||120,onChange:e=>a(e.target.value)})]}),(0,G.jsxs)(`div`,{className:`mt-[18px] flex justify-end gap-2`,children:[(0,G.jsx)(M,{type:`button`,variant:`secondary`,onClick:t,children:r(`common:ui.cancel`)}),(0,G.jsx)(M,{type:`submit`,variant:e.tone===`danger`?`destructive`:`default`,className:e.tone===`danger`?void 0:`text-primary-foreground`,disabled:e.type===`prompt`&&!i.trim(),children:e.confirmLabel||r(`common:ui.confirm`)})]})]})})})}var xo=Ie(`group pointer-events-auto relative flex min-h-11 w-full items-center gap-2 overflow-hidden rounded-surface border px-3.5 py-2.5 pr-10 text-[13px] leading-5 font-semibold tracking-[0] shadow-floating transition data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-right-full data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none`,{variants:{tone:{success:`border-success-border bg-success-soft text-success-strong`,error:`border-danger-border bg-danger-soft text-danger`,info:`border-border bg-surface-muted text-content-soft`}},defaultVariants:{tone:`success`}});function So({className:e,tone:t,...n}){return(0,G.jsx)(Fr,{"data-slot":`toast`,className:B(xo({tone:t}),e),...n})}function Co({...e}){return(0,G.jsx)(Nr,{"data-slot":`toast-provider`,...e})}function wo({className:e,...t}){return(0,G.jsx)(Pr,{"data-slot":`toast-viewport`,className:B(`fixed right-5 bottom-5 z-[80] flex w-[min(420px,calc(100vw-40px))] max-w-full flex-col gap-2 outline-none max-sm:right-3 max-sm:bottom-3 max-sm:left-3 max-sm:w-auto`,e),...t})}function To({className:e,...t}){return(0,G.jsx)(Ir,{"data-slot":`toast-description`,className:B(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e),...t})}function Eo({className:e,...t}){return(0,G.jsx)(Lr,{"data-slot":`toast-close`,className:B(`absolute top-1/2 right-1.5 grid size-7 -translate-y-1/2 place-items-center rounded-md text-current opacity-70 outline-none transition hover:bg-black/5 hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50 dark:hover:bg-white/10`,e),...t})}var Do={success:Xr,error:hi,info:ti};function Oo({message:e,tone:t,closeLabel:n,...r}){let i=Do[t];return(0,G.jsxs)(So,{tone:t,type:t===`error`?`foreground`:`background`,...r,children:[(0,G.jsx)(i,{className:`size-[18px] shrink-0`}),(0,G.jsx)(To,{children:e}),(0,G.jsx)(Eo,{"aria-label":n,title:n,children:(0,G.jsx)(qe,{className:`size-4`})})]})}var ko=`pisper:usage-updated`,Ao=15e3,jo=3e3,Mo=1e4;function No({page:e,pluginStats:t}){let{t:n,language:r}=R(),[i,a]=(0,U.useState)(null),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)(!0),[u,d]=(0,U.useState)(null),f=(0,U.useRef)(!0),p=(0,U.useRef)(null),m=(0,U.useRef)(0),h=(0,U.useRef)(null),{data:g}=_t(E(`config`)),{data:_}=_t(E(`sessions`)),v=(0,U.useCallback)(()=>(h.current||=(async()=>{try{return a(Na(await le(`/api/usage/today`))),!0}catch(e){return e instanceof se&&e.status!=null}})().finally(()=>{h.current=null}),h.current),[]),y=(0,U.useCallback)(e=>{if(f.current===e)return;f.current=e,l(e);let t=Date.now(),r=p.current;r&&r.online===e&&t-r.at<Mo||(p.current={online:e,at:t},m.current+=1,d({id:m.current,message:n(e?`common:statusBar.connectionRestored`:`common:statusBar.connectionLost`),tone:e?`success`:`error`}))},[n]);(0,U.useEffect)(()=>{let e=!0,t=0,n=!1,r=async()=>{if(n)return;n=!0;let i=await v();n=!1,e&&(y(i),t=window.setTimeout(()=>void r(),i?Ao:jo))};r();let i=()=>{document.visibilityState===`visible`&&(window.clearTimeout(t),r())};return document.addEventListener(`visibilitychange`,i),()=>{e=!1,window.clearTimeout(t),document.removeEventListener(`visibilitychange`,i)}},[y,v]);let b=(0,U.useCallback)(()=>{v()},[v]);(0,U.useEffect)(()=>(window.addEventListener(ko,b),()=>window.removeEventListener(ko,b)),[b]);let x=(0,U.useCallback)((e=localStorage.getItem(V.activeSession)||``)=>{let t=_?.sessions?.find(t=>t.id===e)?.model||(g?.model?`${g.provider}/${g.model}`:``);s(/(^|\/)unknown$/i.test(t)?``:t)},[g,_]);(0,U.useEffect)(()=>{let e=e=>{let t=e.detail,n=t?.id||localStorage.getItem(V.activeSession)||``;t?.model?s(/(^|\/)unknown$/i.test(t.model)?``:t.model):x(n)};return x(),window.addEventListener(Z,e),()=>{window.removeEventListener(Z,e)}},[x]);let S=i?n(`navigation:statusBar.inputInputOutputOutputReasoningReasoningCacheReadCacheRead`,{input:i.input.toLocaleString(r),output:i.output.toLocaleString(r),reasoning:i.reasoning.toLocaleString(r),cacheRead:i.cacheRead.toLocaleString(r)}):n(`navigation:statusBar.calculatingTodaySTokenUsage`),C=n(c?`navigation:statusBar.connected`:`common:statusBar.reconnecting`);return(0,G.jsxs)(`footer`,{className:`status-bar [&_em]:text-[var(--star-strong)] [&_em]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] [&_em]:[font-style:normal] [&_em]:font-[700] [&_em::before]:[content:'✦'] [&_em::before]:mr-[4px] [&_em::before]:text-[var(--star)] [&_em::before]:text-[9px] [&_em.amber]:text-[var(--text-muted)] [&_em.amber]:font-[inherit] [&_em.amber::before]:[content:none] max-[900px]:hidden flex h-[28px] flex-none items-center justify-between gap-[12px] [border-top:1px_solid_var(--stroke)] bg-[var(--sidebar-bg)] [padding:0_14px] text-[var(--text-muted)] text-[11px]`,children:[(0,G.jsxs)(`span`,{className:`status-model [.status-bar_&]:flex [.status-bar_&]:min-w-0 [.status-bar_&]:items-center [.status-bar_&]:gap-[6px] [.status-bar_&]:overflow-hidden [.status-bar_&]:text-ellipsis [.status-bar_&]:whitespace-nowrap`,children:[(0,G.jsx)(`span`,{"aria-hidden":!0,title:C,className:B(`size-[7px] flex-none rounded-full`,c?`bg-[var(--success)]`:`animate-pulse bg-[var(--warning-strong)]`)}),(0,G.jsx)(Kr,{size:12}),o||n(`navigation:statusBar.noModelConfigured`)]}),(0,G.jsx)(`span`,{className:`status-usage [.status-bar_&]:flex [.status-bar_&]:flex-none [.status-bar_&]:items-center [.status-bar_&]:gap-[6px]`,children:[`skills`,`mcp`,`workflows`,`workflowCreate`].includes(e)?(0,G.jsxs)(G.Fragment,{children:[n(`navigation:statusBar.nativeRuntime`),` `,c?(0,G.jsx)(`em`,{children:n(`navigation:statusBar.connected`)}):(0,G.jsx)(`span`,{className:`font-[700] text-[var(--warning-strong)]`,children:n(`common:statusBar.reconnecting`)})]}):e===`plugins`?n(`navigation:statusBar.enabledTotalEnabled`,{enabled:t?.enabled??`—`,total:t?.total??`—`}):(0,G.jsxs)(G.Fragment,{children:[n(`navigation:statusBar.todaySTokens`),` `,(0,G.jsx)(`em`,{title:S,children:i?ja(i.totalTokens):`—`}),!c&&(0,G.jsx)(`span`,{className:`font-[700] text-[var(--warning-strong)]`,children:n(`common:statusBar.reconnecting`)})]})}),u&&(0,G.jsx)(Oo,{open:!0,message:u.message,tone:u.tone,closeLabel:n(`common:ui.closeDialog`),onOpenChange:e=>!e&&d(null)},u.id)]})}var Po=192,Fo=288,Io=`pisper-web-desktop-pet-position`,Lo={idle:{row:0,frames:6,durationMs:1100},waving:{row:3,frames:4,durationMs:700},jumping:{row:4,frames:5,durationMs:840},failed:{row:5,frames:8,durationMs:1220},waiting:{row:6,frames:6,durationMs:1010},running:{row:7,frames:6,durationMs:820},review:{row:8,frames:6,durationMs:1030}};function Ro(e){return{x:Math.max(0,Math.min(window.innerWidth-Po,e.x)),y:Math.max(0,Math.min(window.innerHeight-Fo,e.y))}}function zo(){try{let e=JSON.parse(localStorage.getItem(Io)||`{}`);if(Number.isFinite(e?.x)&&Number.isFinite(e?.y))return Ro(e)}catch{}return Ro({x:window.innerWidth-Po-20,y:window.innerHeight-Fo-20})}function Bo(e){return e&&e in Lo?e:`idle`}function Vo(){let{t:e}=R(),[t,n]=(0,U.useState)(null),[r,i]=(0,U.useState)(zo),[a,o]=(0,U.useState)(null),s=(0,U.useRef)(null),c=(0,U.useRef)(void 0),l=(0,U.useCallback)(async()=>{try{n(await le(`/api/desktop-pet`))}catch{}},[]);if((0,U.useEffect)(()=>{if(window.pisperDesktop?.getPetStatus)return;let e,t=()=>{document.visibilityState===`visible`&&e===void 0&&(l(),e=window.setInterval(l,1200))},r=()=>{e!==void 0&&(window.clearInterval(e),e=void 0)},a=()=>{document.visibilityState===`visible`?t():r()},o=e=>{let t=e.detail;t?n(t):l()},s=()=>i(e=>Ro(e));return t(),document.addEventListener(`visibilitychange`,a),window.addEventListener(`pisper:desktop-pet-changed`,o),window.addEventListener(`resize`,s),()=>{r(),window.clearTimeout(c.current),document.removeEventListener(`visibilitychange`,a),window.removeEventListener(`pisper:desktop-pet-changed`,o),window.removeEventListener(`resize`,s)}},[l]),window.pisperDesktop?.getPetStatus||!t?.running||!t.spriteUrl)return null;let u=a||Bo(t.state),d=Lo[u],f={review:e(`config:desktopPetSettings.bubbleThinking`),running:e(`config:desktopPetSettings.bubbleWorking`),waiting:e(`config:desktopPetSettings.bubbleResponding`),waving:e(`config:desktopPetSettings.bubbleDone`),failed:e(`config:desktopPetSettings.bubbleFailed`),jumping:e(`config:desktopPetSettings.bubbleHello`)}[u]||``,p=e=>{let t=s.current;if(!(!t||t.id!==e.pointerId)){if(s.current=null,e.currentTarget.releasePointerCapture(e.pointerId),t.moved){localStorage.setItem(Io,JSON.stringify(r));return}o(`jumping`),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o(null),900)}};return(0,G.jsxs)(`div`,{className:`web-desktop-pet max-[640px]:[transform:scale(0.75)] max-[640px]:origin-[bottom_right] fixed z-[70] w-[192px] h-[288px] cursor-grab [touch-action:none] select-none [filter:drop-shadow(0_12px_14px_rgb(15_23_42_/_0.16))] ${s.current?`dragging [.web-desktop-pet&]:cursor-grabbing`:``}`,style:{left:r.x,top:r.y,opacity:t.opacity??1},onPointerDown:e=>{if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();s.current={id:e.pointerId,offsetX:e.clientX-t.left,offsetY:e.clientY-t.top,startX:e.clientX,startY:e.clientY,moved:!1},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:e=>{let t=s.current;!t||t.id!==e.pointerId||(Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>4&&(t.moved=!0),i(Ro({x:e.clientX-t.offsetX,y:e.clientY-t.offsetY})))},onPointerUp:p,onPointerCancel:p,"aria-label":e(`config:desktopPetSettings.webPetLabel`,{name:t.selectedName||t.selectedSlug}),children:[(0,G.jsx)(`div`,{className:`web-desktop-pet-bubble motion-reduce:[transition:none] absolute z-[2] [left:50%] [bottom:210px] max-w-[180px] [padding:6px_10px] [transform:translateX(-50%)_translateY(4px)] [border:1px_solid_color-mix(in_srgb,_var(--stroke)_75%,_transparent)] rounded-[10px] bg-[color-mix(in_srgb,_var(--surface)_94%,_transparent)] shadow-[0_8px_24px_rgb(15_23_42_/_0.2)] text-[var(--text)] text-[11px] leading-[1.4] opacity-0 pointer-events-none text-center [transition:opacity_0.18s_ease,_transform_0.18s_ease] whitespace-nowrap ${f?`visible [.web-desktop-pet-bubble&]:opacity-100 [.web-desktop-pet-bubble&]:[transform:translateX(-50%)_translateY(0)]`:``}`,role:`status`,children:f}),(0,G.jsx)(`div`,{className:`absolute left-0 bottom-0 w-[192px] h-[208px] [contain:layout_paint] overflow-hidden`,role:`img`,children:(0,G.jsx)(`div`,{className:`web-desktop-pet-sprite [--pet-sprite-y:calc(var(--pet-row)_*_-208px)] [--pet-sprite-end-x:calc(var(--pet-frames)_*_-192px)] w-[192px] h-[208px] [background-image:var(--pet-sprite-url)] [background-repeat:no-repeat] [background-size:var(--pet-sheet-width,_1536px)_var(--pet-sheet-height,_1872px)] [image-rendering:pixelated] [transform:translateZ(0)] origin-[top_left] [will-change:background-position] [animation:web-pet-state_var(--pet-duration)_steps(var(--pet-frames))_infinite] motion-reduce:[animation:none]`,style:{"--pet-sprite-url":`url("${t.spriteUrl}")`,"--pet-sheet-width":`${t.sheetWidth||1536}px`,"--pet-sheet-height":`${t.sheetHeight||1872}px`,"--pet-row":d.row,"--pet-frames":d.frames,"--pet-duration":`${d.durationMs}ms`}})})]})}var Ho;function Uo(e={}){return{windowRef:e.windowRef||(typeof window<`u`?window:void 0),navigatorRef:e.navigatorRef||(typeof navigator<`u`?navigator:void 0)}}function Wo(e={}){let{windowRef:t}=Uo(e),n=t?.Notification;return n?n.permission:`unsupported`}async function Go(e={}){let{windowRef:t}=Uo(e),n=t?.Notification;return n?n.permission==="default"?n.requestPermission():n.permission:`unsupported`}async function Ko(e={}){let{windowRef:t,navigatorRef:n}=Uo(e),r=n?.serviceWorker;return!t?.isSecureContext||!r?null:((!Ho||e.forceRegistration)&&(Ho=r.register(`/notification-sw.js`,{scope:`/`}).then(()=>r.ready).catch(e=>{throw Ho=void 0,e})),Ho)}async function qo({title:e,body:t=``,tag:n=``,url:r=``},i={}){let{windowRef:a}=Uo(i),o=a?.Notification;if(!a||!o)throw Error(`当前浏览器不支持系统通知。`);if(o.permission!==`granted`)throw Error(`通知权限未授权,请在浏览器站点设置中允许通知。`);let s=await Ko(i),c={body:String(t||``),tag:String(n||``),data:{url:String(r||a.location?.href||`/`)}};if(s?.showNotification)return await s.showNotification(String(e||`Pisper`),c),{shown:!0,transport:`service-worker`};let l=new o(String(e||`Pisper`),c);return l.onclick=()=>{a.focus?.(),l.close()},{shown:!0,transport:`window`}}function Jo(){let{t:e}=R(),[t,n]=(0,U.useState)(null),r=(0,U.useRef)(null),i=(0,U.useCallback)(e=>{r.current?.(e),r.current=null,n(null)},[]),a=(0,U.useCallback)(e=>new Promise(t=>{r.current?.(null),r.current=t,n(e)}),[]),o=(0,U.useCallback)((t={})=>a({type:`confirm`,title:e(`common:useAppDialog.confirmAction`),confirmLabel:e(`common:useAppDialog.confirm`),tone:`danger`,...t}).then(e=>e===!0),[a,e]),s=(0,U.useCallback)((t={})=>a({type:`prompt`,title:e(`common:useAppDialog.enterContent`),confirmLabel:e(`common:useAppDialog.save`),tone:`primary`,value:``,...t}).then(e=>typeof e==`string`?e:null),[a,e]),c=(0,U.useCallback)(()=>i(null),[i]);return(0,U.useEffect)(()=>()=>r.current?.(null),[]),{dialog:t,confirm:o,prompt:s,close:c,finish:i}}var Yo=15e3,Xo=216e5,Zo=new Set([`checking`,`downloading`,`downloaded`]);function Qo(e){return!Zo.has(e)}function $o(e,t=window){let n=!1,r=!1,i=()=>{n||r||(n=!0,Promise.resolve().then(e).catch(()=>{}).finally(()=>{n=!1}))},a=t.setTimeout(i,Yo),o=t.setInterval(i,Xo);return()=>{r=!0,t.clearTimeout(a),t.clearInterval(o)}}var es=new Set([`available`,`downloading`,`installed`,`error`]);function ts(e,t){return t?.find(e=>e.component===`desktop`)?.currentVersion.trim()||e}function ns(e){return e.filter(e=>e.size>0&&(es.has(e.state)||e.canInstall))}function rs(e){return e.replace(/\r/g,``).split(`
|
|
34
|
+
`).filter(e=>!/^\s*#{1,6}\s+Pisper\s+(?:Desktop|TUI|Runtime)\s+v?\d+\.\d+\.\d+\s*$/i.test(e)&&!/^\s*#{1,6}\s+What['’]?s Changed\s*$/i.test(e)&&!/^\s*(?:\*\*)?(?:Full Changelog|完整变更)(?:\*\*)?\s*[::].*$/i.test(e)).join(`
|
|
35
|
+
`).replace(/\n{3,}/g,`
|
|
36
|
+
|
|
37
|
+
`).trim()}function is(e){let t=e.filter(e=>e.state===`available`||e.state===`downloading`).map(e=>rs(e.notes)).filter((e,t,n)=>e&&n.indexOf(e)===t);return t.length?`## What's Changed\n\n${t.join(`
|
|
38
|
+
|
|
39
|
+
`)}`:``}function as(e,t=new Date().toISOString()){let n=e.filter(e=>e.state===`error`),r=e.filter(e=>e.state===`available`),i=e.some(e=>e.state===`checking`),a=e.filter(e=>e.state===`downloading`),o=e.some(e=>e.state===`installed`),s=a[0]||r[0]||n[0]||e[0],c=is(e),l=ns(e),u=l.reduce((e,t)=>e+t.size,0),d=l.reduce((e,t)=>t.state===`installed`?e+t.size:t.state===`downloading`?e+Math.min(t.size,Math.max(0,t.transferred||0)):e,0);return{state:a.length?`downloading`:i?`checking`:n.length?`error`:r.length?`available`:o?`installed`:e.length?`current`:`idle`,checkedAt:t,message:n.map(e=>`${e.component}: ${e.message}`).join(`
|
|
40
|
+
`),releaseUrl:s?.releaseUrl,canDownload:r.length>0,availableVersion:s?.availableVersion,notes:c,total:u,transferred:d,percent:u>0?Math.min(100,d/u*100):0}}var os=`https://github.com/ling-kong-ran/pisper/releases`;async function ss({refresh:e=!1,fetcher:t=fetch}={}){let n=await t(`/api/app-update${e?`?refresh=1`:``}`,{cache:`no-store`}),r=await n.json().catch(()=>null);if(!n.ok){let e=r&&`error`in r&&typeof r.error==`string`?r.error.trim():``;throw Error(e||`更新检查失败:HTTP ${n.status}`)}return r}var cs=Object.freeze({desktop:!1,packaged:!1,version:`0.5.48`,platform:`browser`,arch:``,releasesUrl:os});function ls(){let e=window.pisperDesktop,t=e?void 0:window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke,[n,r]=(0,U.useState)(cs),[i,a]=(0,U.useState)({state:`idle`,checkedAt:null}),[o,s]=(0,U.useState)([]),c=(0,U.useRef)(i),l=(0,U.useRef)(null),u=(0,U.useRef)(!1),d=(0,U.useRef)(!1),f=(0,U.useCallback)(e=>{c.current=e,a(e)},[]),p=(0,U.useCallback)(({refresh:n=!0}={})=>{if(l.current)return l.current;f({...c.current,state:`checking`,message:``});let r=(async()=>{try{if(u.current=!1,e?.checkForUpdates)try{let t=await e.checkForUpdates();if(t.state===`available`&&t.canDownload)return u.current=!0,f(t),t}catch{}if(e?.checkComponentUpdates){let t=await e.checkComponentUpdates();s(t);let n=as(t);return f(n),!t.some(e=>e.state===`error`||e.state===`available`)&&t.some(e=>e.restartRequired)&&await e.restartForComponentUpdate?.(),n}if(d.current&&t){let e=await t(`mobile_check_app_update`,{refresh:n});return f(e),e}let r=await ss({refresh:n});return f(r),r}catch(e){let t={state:`error`,message:e instanceof Error?e.message:String(e),checkedAt:new Date().toISOString()};return f(t),t}})();return l.current=r,r.finally(()=>{l.current===r&&(l.current=null)}),r},[f,e,t]);(0,U.useEffect)(()=>{let n=!0,i=()=>{},a=()=>{},o=()=>{i=$o(()=>{if(Qo(c.current.state))return p({refresh:!1})})};if(!e){let e=()=>{n&&p({refresh:!1})};return t?(t(`mobile_app_info`).then(t=>{if(!n)return;if(!t.mobile){e();return}d.current=!0,r(t),s([]),t.update&&f(t.update),p({refresh:!1}),o();let i=()=>{document.visibilityState===`visible`&&Qo(c.current.state)&&p({refresh:!1})};document.addEventListener(`visibilitychange`,i),a=()=>document.removeEventListener(`visibilitychange`,i)}).catch(e),()=>{n=!1,i(),a()}):(e(),()=>{n=!1})}return e.getAppInfo().then(t=>{n&&(r({...t,hostVersion:t.version}),e.componentUpdateStatus?.().then(e=>{n&&(s(e),f(as(e)))}).catch(()=>{}),t.packaged&&o())}).catch(()=>{}),()=>{n=!1,i()}},[f,e,p,t]);let m=(0,U.useCallback)(async()=>{if(u.current&&e?.downloadUpdate){f({...c.current,state:`downloading`,message:``,transferred:0,percent:0});let t=e.onUpdateStatus?.(f);try{let t=await e.downloadUpdate();f(t),t.state===`downloaded`&&t.canInstall&&await e.installUpdate?.()}finally{t?.()}return[]}if(!e?.installComponentUpdates)return[];f({...c.current,state:`downloading`,message:``,transferred:0,percent:0});let t=!1,n=!1,r=async()=>{if(!(n||t||!e.componentUpdateStatus)){t=!0;try{let t=await e.componentUpdateStatus();if(n)return;s(t);let r=as(t);r.state!==`available`&&f(r)}catch{}finally{t=!1}}},i=window.setInterval(()=>void r(),250);try{let t=await e.installComponentUpdates();return n=!0,s(t),f(as(t)),!t.some(e=>e.state===`error`)&&t.some(e=>e.restartRequired)&&await e.restartForComponentUpdate?.(),t}finally{n=!0,window.clearInterval(i)}},[f,e]),h=(0,U.useCallback)(async()=>{if(e)return e.openReleases();let r=i.releaseUrl||n.releasesUrl||`https://github.com/ling-kong-ran/pisper/releases`;return d.current&&t?t(`mobile_open_app_update`,{url:r}):(window.open(r,`_blank`,`noopener,noreferrer`),!0)},[e,n.releasesUrl,t,i.releaseUrl]),g=(0,U.useCallback)(()=>e?.openUpdateLog?.(),[e]),_=(0,U.useCallback)(()=>d.current&&t&&i.downloadUrl?t(`mobile_open_app_update`,{url:i.downloadUrl}):h(),[t,h,i.downloadUrl]),v=(0,U.useCallback)(()=>_(),[_]);return{info:(0,U.useMemo)(()=>({...n,version:n.desktop?ts(n.hostVersion||n.version,o):n.version}),[o,n]),status:i,components:o,check:p,installComponents:m,download:_,install:v,openReleases:h,openUpdateLog:g}}var us={theme:`system`,density:`comfortable`,accent:`neutral`,customAccent:`#1677e8`,fontScale:`default`,radius:`default`,motion:`system`},ds=[`system`,`scheduled`,`light`,`dark`],Q=Le()(Re(e=>({sidebarCollapsed:!1,...us,setSidebarCollapsed:t=>e({sidebarCollapsed:t}),toggleSidebar:()=>e(e=>({sidebarCollapsed:!e.sidebarCollapsed})),setTheme:t=>e({theme:t}),cycleTheme:()=>e(e=>({theme:ds[(ds.indexOf(e.theme)+1)%ds.length]})),setDensity:t=>e({density:t}),setAccent:t=>e({accent:t}),setCustomAccent:t=>e({accent:`custom`,customAccent:t}),setFontScale:t=>e({fontScale:t}),setRadius:t=>e({radius:t}),setMotion:t=>e({motion:t}),resetAppearance:()=>e(us)}),{name:`pisper-ui`,version:1,migrate:(e,t)=>{let n=e;return{sidebarCollapsed:n.sidebarCollapsed??!1,...us,...n,theme:t===0&&n.theme===`system`?`scheduled`:n.theme??`system`}},partialize:({sidebarCollapsed:e,theme:t,density:n,accent:r,customAccent:i,fontScale:a,radius:o,motion:s})=>({sidebarCollapsed:e,theme:t,density:n,accent:r,customAccent:i,fontScale:a,radius:o,motion:s}),merge:(e,t)=>{let n=e,r=localStorage.getItem(V.theme),i=localStorage.getItem(V.sidebarCollapsed),a=localStorage.getItem(V.density);return{...t,...n,theme:n?.theme??(r===`system`?`scheduled`:ds.includes(r)?r:t.theme),sidebarCollapsed:n?.sidebarCollapsed??i===`1`,density:n?.density??(a===`compact`?`compact`:t.density),accent:n?.accent??t.accent,customAccent:n?.customAccent??t.customAccent,fontScale:n?.fontScale??t.fontScale,radius:n?.radius??t.radius,motion:n?.motion??t.motion}}}));function fs(){try{return JSON.parse(localStorage.getItem(V.terminalPanel)||`{}`)}catch{return{}}}function ps(){return window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke}function ms(){return typeof window<`u`&&!!ps()}function hs(e,t){let n=ps();return n?n(e,t):Promise.reject(Error(`Tauri IPC is unavailable.`))}async function gs(){return hs(`plugin:notification|is_permission_granted`)}async function _s(){return hs(`plugin:notification|request_permission`)}async function vs(e,t){return hs(`plugin:notification|notify`,{options:{title:e,body:t}})}var ys=(0,U.lazy)(()=>s(()=>import(`./AppShortcuts-D66c2bOM.js`).then(e=>({default:e.AppShortcuts})),__vite__mapDeps([0,1,2,3,4,5]))),bs=(0,U.lazy)(()=>s(()=>import(`./AppOverlays-DlB6SVT6.js`).then(e=>({default:e.CommandPalette})),__vite__mapDeps([6,1,2,7,8,9,10,11,12,13,14,4,5,15,16,17,18,19,20]))),xs=(0,U.lazy)(()=>s(()=>import(`./AppOverlays-DlB6SVT6.js`).then(e=>({default:e.QuickCreate})),__vite__mapDeps([6,1,2,7,8,9,10,11,12,13,14,4,5,15,16,17,18,19,20]))),Ss=(0,U.lazy)(()=>s(()=>import(`./PageHeader-9ctH9v28.js`).then(e=>({default:e.PageHeader})),__vite__mapDeps([21,1,2,11,12,13,14,4,5,22,23,24,25,26,27,18,3]))),Cs=(0,U.lazy)(()=>s(()=>import(`./TerminalPanel-a4jiIuSs.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([28,1,2,8,9,10,11,12,13,29,26,17,30]))),ws=(0,U.lazy)(()=>s(()=>import(`./MobileViewportStabilizer-CYh5obIv.js`).then(e=>({default:e.MobileViewportStabilizer})),__vite__mapDeps([31,1,2])));function Ts(e){return!!e?.providers?.some(e=>e.configured&&e.enabled&&e.models.some(e=>e.kind===`chat`))}function Es(e,t){return String(e||``).replace(/\{\{\s*([\w.]+)\s*\}\}/g,(e,n)=>{let r=n.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t);return r==null?`{{${n}}}`:String(r)})}function Ds(e){try{return decodeURIComponent(e)}catch{return``}}function Os(e,t){let n=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;return n?n(e,t):Promise.reject(Error(`native bridge unavailable`))}function ks(){let{t:e}=R();(0,U.useEffect)(()=>k(`react-app-mounted`),[]);let t=u(),n=f(),r=no(e=>e.capabilities),i=no(e=>e.loaded),a=no(e=>e.load),o=(0,U.useMemo)(()=>Si(e,r),[r,e]),s=(0,U.useMemo)(()=>Ci(e),[e]),c=Di(t.pathname)||`chat`,l=(0,U.useRef)(c),p=(0,U.useRef)(X.has(c)?`/chat`:t.pathname),[m,h]=(0,U.useState)(``),[g,v]=(0,U.useState)(()=>localStorage.getItem(V.activeSession)||``),[y,b]=(0,U.useState)(!1),x=be(),S=Ge(e=>e.client===`mobile-app`),C=Ge(e=>e.loaded),w=xe(),T=S||w,[D,O]=(0,U.useState)(!1),re=Q(e=>e.sidebarCollapsed),ie=Q(e=>e.setSidebarCollapsed),ae=Q(e=>e.theme),oe=Q(e=>e.cycleTheme),se=Q(e=>e.density),ce=Q(e=>e.accent),ue=Q(e=>e.customAccent),A=Q(e=>e.fontScale),j=Q(e=>e.radius),de=Q(e=>e.motion),[M,fe]=(0,U.useState)(null),[pe,N]=(0,U.useState)(null),me=c===`config`?Ds(t.pathname.split(`/`)[2]||`models`):`models`,P=Ai.has(me)&&xi(r,me)?me:`models`,[F,he]=(0,U.useState)(null),[ge,I]=(0,U.useState)(null),{data:_e,isPending:L,isSuccess:ve}=_t(E(`config`)),{data:ye}=_t(E(`notification-settings`)),[Se,Ce]=(0,U.useState)(!1),[we,Te]=(0,U.useState)({browser:{enabled:!1},connections:{},scopes:[],templates:[]}),[Ee,De]=(0,U.useState)(null),Oe=(0,U.useMemo)(()=>({terminal:e(`terminal:terminalPanel.terminal`),resizeTerminal:e(`terminal:terminalPanel.resizeTerminal`),hideTerminal:e(`terminal:terminalPanel.hideTerminal`),showTerminal:e(`terminal:terminalPanel.showTerminal`),newTerminal:e(`terminal:terminalPanel.newTerminal`),closeTerminal:e(`terminal:terminalPanel.closeTerminal`),maximizeTerminal:e(`terminal:terminalPanel.maximizeTerminal`),openTerminal:e(`terminal:terminalPanel.openTerminal`),usesActiveSessionWorkspace:e(`terminal:terminalPanel.usesActiveSessionWorkspace`),orphanedTerminal:e(`terminal:terminalPanel.orphanedTerminal`),starting:e(`terminal:terminalPanel.starting`),processExited:t=>e(`terminal:terminalPanel.processExited`,{code:t??`-`})}),[e]),[ke,Ae]=(0,U.useState)(()=>!!fs().open),[je,Me]=(0,U.useState)(()=>Math.max(180,Math.min(640,Number(fs().height)||300))),Ne=(0,U.useRef)(``),[z]=(0,U.useState)(Hr),Pe=(0,U.useRef)(null),Fe=(0,U.useRef)(null),Ie=(0,U.useRef)(0),B=Jo(),Le=ls();(0,U.useEffect)(()=>{Yi({accent:ce,density:se,fontScale:A,motion:de,radius:j,customAccent:ue})},[ce,se,A,de,j,ue]),(0,U.useEffect)(()=>{localStorage.setItem(V.terminalPanel,JSON.stringify({open:ke,height:je}))},[je,ke]),(0,U.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{let t=Ji(ae,e.matches);document.documentElement.dataset.theme=t?`dark`:`light`,document.documentElement.classList.toggle(`dark`,t)};if(t(),ae===`system`)return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t);if(ae===`scheduled`){let e=window.setInterval(t,6e4);return()=>window.clearInterval(e)}},[ae]);let Re=()=>{ie(!re)},ze=(0,U.useCallback)(async()=>{try{let e=await te(`plugins`);I({enabled:e.tools.filter(e=>e.enabled).length,total:e.tools.length})}catch{}},[]),Be=(0,U.useCallback)((e,t=`success`)=>{Ie.current+=1,fe({id:Ie.current,message:e,tone:t})},[]);(0,U.useEffect)(()=>{let e=e=>{let t=e.detail?.id;v(t??localStorage.getItem(V.activeSession)??``)};window.addEventListener(Z,e);let t=e=>{let t=e.detail;t?.message&&Be(t.message,t.tone===`error`?`error`:`info`)};return window.addEventListener(Ur,t),Ge.getState().load({refresh:!1}).then(()=>k(`client-info-loaded`)),a({refresh:!1}).then(()=>k(`capabilities-loaded`)),()=>{window.removeEventListener(Z,e),window.removeEventListener(Ur,t)}},[a,Be]);let Ve=(0,U.useRef)(!1);(0,U.useEffect)(()=>{!C||!S||Ve.current||(Ve.current=!0,(async()=>{await Os(`mobile_ensure_local_network_permission`).catch(()=>void 0)})())},[C,S]);let He=(0,U.useCallback)((e,t,{force:n=!1}={})=>{if(we.browser?.enabled&&!(!n&&document.visibilityState===`visible`&&document.hasFocus())){if(window.pisperDesktop?.showNotification){window.pisperDesktop.showNotification({title:e,body:t}).catch(()=>{});return}if(ms()){vs(e,t).catch(()=>{});return}qo({title:e,body:t,tag:`pisper-${e}`,url:window.location.href}).catch(()=>{})}},[we.browser?.enabled]),Ue=(0,U.useCallback)((e,t,n)=>{let r=we.templates?.find(t=>t.id===e),i=r?.channels?.browser?.content;!r?.enabled||!i||He(r.name,Es(i,t||{}),n)},[we.templates,He]),We=(0,U.useCallback)(e=>z.register(e),[z]),Ke=(0,U.useCallback)(()=>{z.invoke()},[z]),qe=(0,U.useCallback)(e=>(De(e),()=>De(t=>t===e?null:t)),[]),H=(0,U.useCallback)((e,t)=>{!wi.has(e)||!bi(r,e)||(n(Ei(e),t),h(``))},[r,n]);(0,U.useEffect)(()=>{if(i&&!bi(r,c)){n(`/chat`,{replace:!0});return}c===`config`&&me!==P&&n(`/config/${P}`,{replace:!0})},[r,i,P,c,me,n]);let W=(0,U.useCallback)(e=>{let t=Ai.has(e)&&xi(r,e)?e:`models`;n(`/config/${t}`),h(``)},[r,n]),Je=(0,U.useCallback)(()=>W(`updates`),[W]),Ye=(0,U.useCallback)(()=>W(`notifications`),[W]),Xe=(0,U.useCallback)(e=>{e.type===`config`?W(e.id):H(e.id)},[H,W]);(0,U.useEffect)(()=>{X.has(c)||(p.current=t.pathname)},[t.pathname,c]);let Ze=(0,U.useCallback)(()=>{n(p.current),h(``)},[n]),Qe=(0,U.useRef)(!1);(0,U.useEffect)(()=>{!Se||Qe.current||(Qe.current=!0,(async()=>{try{let t=((await le(`/api/providers/discovery`)).providers||[]).filter(e=>e.importable&&!e.imported&&!e.conflict).length;if(t<=0)return;await B.confirm({title:e(`common:app.importableProvidersTitle`),message:e(`common:app.importableProvidersMessage`,{count:t}),confirmLabel:e(`common:app.openSettings`),tone:`primary`})&&W(`models`)}catch{}})())},[B,W,Se,e]);let $e=(0,U.useCallback)(async e=>e&&(await te(`sessions`)).sessions?.find(t=>t.id===e)?.cwd||``,[]),et=(0,U.useCallback)(e=>{let t=localStorage.getItem(V.activeSession)||``;he({asset:e,targetSessionId:t}),t&&wa(t),H(`chat`)},[H]),tt=(0,U.useCallback)(()=>{(c!==`config`||P===`models`)&&([`chat`,`config`,`assets`,`plugins`,`channels`,`schedules`,`memory`,`mcp`,`skills`,`workflowCreate`].includes(c)?Ke():c===`chatHistory`?(H(`chat`),Ke()):c===`workflows`?H(`workflowCreate`):N(c))},[P,Ke,H,c]);(0,U.useEffect)(()=>{let e=()=>{!B.dialog&&!pe&&O(!0)},t=e=>{if(!(e.defaultPrevented||e.isComposing||e.keyCode===229)&&e.key===`Escape`&&!B.dialog){D?O(!1):pe?N(null):y&&b(!1);return}};return window.addEventListener(`keydown`,t),window.addEventListener(_a,e),()=>{window.removeEventListener(`keydown`,t),window.removeEventListener(_a,e)}},[B.dialog,y,pe,D]);let nt=(0,U.useRef)(!1);(0,U.useEffect)(()=>{L||nt.current||(nt.current=!0,Ce(!0),!(!ve||!_e)&&(k(`config-loaded`),Ts(_e)||(z.clear(),z.invoke(),X.has(l.current)||H(`config`,{replace:!0}))))},[_e,L,ve,H,z]),(0,U.useEffect)(()=>{Se&&i&&c===`chat`&&k(`chat-shell-ready`)},[i,c,Se]);let rt=(0,U.useRef)(c);(0,U.useLayoutEffect)(()=>{rt.current===`config`&&c!==`config`&&(ee(`config`),ee(`notification-settings`)),rt.current=c},[c]),(0,U.useEffect)(()=>{ze()},[ze]),(0,U.useEffect)(()=>{ye&&Te(ye)},[ye]),(0,U.useEffect)(()=>{let e=!0,t=async()=>{try{let t=Ne.current,n=await _.fetchQuery({queryKey:[`browser-notification-events`,t],queryFn:()=>le(`/api/settings/notifications/browser/events?after=${encodeURIComponent(t)}`),staleTime:0,retry:!1});if(!e)return;for(let e of n.events||[])He(e.title,e.body,{force:!0});Ne.current=n.latestId||Ne.current}catch{}};t();let n=window.setInterval(t,3e3);return()=>{e=!1,window.clearInterval(n)}},[He]);let it=c===`chat`?[e(`common:app.sessions`),T?``:e(`common:app.dragTabsOrSplitChatsInAnyDirectionFromTheSessionList`)]:s[c]||[e(`common:app.sessions`),``],at=(0,U.useCallback)(e=>{_.cancelQueries({queryKey:[`notification-settings`],exact:!0}),_.setQueryData([`notification-settings`],e),Te(e)},[]),ot={query:m,activeSessionId:g,navigate:H,notify:Be,browserNotify:Ue,registerPrimaryAction:We,pendingAsset:F,onAssetConsumed:()=>he(null),onUseAsset:et,requestText:B.prompt,requestConfirm:B.confirm,openNotificationSettings:Ye,configSection:P,setConfigSection:W,setNotificationSettings:at,appUpdate:Le,setPluginStats:I,registerWorkflowActions:qe};return!Se||!i?(0,G.jsxs)(`div`,{className:`app-startup dark:bg-[var(--bg)] dark:text-[var(--text)] flex w-full min-h-[100vh] items-center justify-center gap-[10px] bg-[var(--bg)] text-[var(--text-muted)] text-[13px]`,children:[(0,G.jsx)(Xi,{size:30,className:`startup-logo [.app-startup_&]:mr-[2px]`}),(0,G.jsx)(`strong`,{children:e(`common:app.wakingPisper`)})]}):(0,G.jsx)(Co,{duration:2800,swipeDirection:`right`,children:(0,G.jsxs)(`div`,{ref:Fe,className:`app-shell dark:bg-[var(--bg)] dark:text-[var(--text)] max-[900px]:min-h-[100dvh] max-[900px]:h-auto max-[900px]:overflow-visible flex w-full h-full min-h-[600px] flex-col overflow-hidden bg-[var(--bg)] pt-[env(safe-area-inset-top)] pr-[env(safe-area-inset-right)] pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] [&[data-mobile-app]]:h-[100dvh] [&[data-mobile-app]]:min-h-0 [&[data-mobile-app]]:overflow-hidden [&[data-mobile-app]]:pb-0`,"data-mobile-app":T||void 0,children:[(0,G.jsx)(ea,{}),T&&(0,G.jsx)(U.Suspense,{fallback:null,children:(0,G.jsx)(ws,{enabled:C&&Se,shellRef:Fe})}),_i(r,`desktopPet`)&&(0,G.jsx)(Vo,{}),(0,G.jsxs)(Xa,{className:`app-body max-[900px]:h-[100dvh] max-[900px]:min-h-[620px] max-[900px]:flex-none max-[650px]:h-[100dvh] max-[650px]:min-h-0 max-[650px]:flex-none flex min-h-0 flex-1 [&[data-mobile-app]]:h-auto [&[data-mobile-app]]:min-h-0 [&[data-mobile-app]]:flex-1 [&[data-mobile-app]]:overflow-hidden`,"data-mobile-app":T||void 0,open:!re,onOpenChange:e=>ie(!e),openMobile:y,onOpenMobileChange:b,children:[(0,G.jsx)(U.Suspense,{fallback:null,children:(0,G.jsx)(ys,{blocked:!!(B.dialog||pe||D),onCommandPalette:()=>O(!0),onPrimary:tt,onToggleSidebar:()=>x?b(e=>!e):ie(!re),onSearch:()=>{c===`chat`?(H(`chatHistory`),requestAnimationFrame(()=>requestAnimationFrame(()=>Pe.current?.focus()))):Pe.current?.focus()},onToggleTerminal:window.pisperDesktop?.terminalProfiles&&_i(r,`terminal`)?()=>Ae(e=>!e):void 0,onSettings:()=>H(`config`)})}),(0,G.jsx)(ao,{page:c,configSection:P,navigation:o,navigate:H,navigateSettings:Xe,onExitSettings:Ze,collapsed:re,onToggleCollapse:Re,update:Le,onOpenUpdates:Je}),(0,G.jsxs)($a,{className:`main-surface before:[content:''] before:absolute before:z-[-1] before:inset-[0_0_auto] before:h-[220px] before:bg-[linear-gradient(180deg,var(--main-glow-start)_0%,var(--main-glow-end)_100%)] before:pointer-events-none dark:bg-[var(--main-surface-bg)] dark:before:bg-[linear-gradient(180deg,var(--main-glow-start)_0%,var(--main-glow-end)_100%)] dark:[background-image:radial-gradient(rgba(255,_255,_255,_.05)_1px,_transparent_1.3px),_radial-gradient(rgba(255,_255,_255,_.025)_1px,_transparent_1.3px)] dark:[background-size:26px_26px,_41px_41px] dark:[background-position:0_0,_13px_20px] relative flex min-w-0 flex-1 h-full flex-col overflow-hidden [border-left:0] bg-[var(--main-surface-bg)] shadow-[inset_0_1px_0_var(--main-surface-inset),_0_20px_60px_-28px_var(--main-surface-shadow)]`,children:[(0,G.jsx)(U.Suspense,{fallback:null,children:(0,G.jsx)(Ss,{meta:it,page:c,query:m,setQuery:h,configSection:P,onMenu:()=>b(!0),onPrimary:tt,onConfigSearchSelect:W,searchInputRef:Pe,theme:ae,onCycleTheme:oe,workflowActions:Ee,desktopPlatform:window.pisperDesktop?.platform||``,mobileApp:S,terminalOpen:ke,onToggleTerminal:()=>Ae(e=>!e)})}),C&&T&&X.has(c)&&(0,G.jsx)(co,{page:c,configSection:P,mobileApp:S,onNavigate:Xe}),(0,G.jsx)(`div`,{className:`page-content [&.page-chat]:flex [&.page-chat]:overflow-hidden p-[0_18px_14px] [&.page-workflowCreate]:[padding-inline:24px] min-[651px]:[[data-density='compact']_&]:pb-[14px] max-[900px]:p-[0_16px_18px] max-[650px]:overflow-x-hidden max-[650px]:[&.page-chat]:p-[0_8px_8px] max-[650px]:[&.page-workflowCreate]:overflow-auto flex-1 min-h-0 overflow-auto [scrollbar-color:var(--control-muted)_transparent] [animation:page-in_var(--d2)_var(--ease-out)] page-${c}`,children:(0,G.jsx)(d,{context:ot})},c),window.pisperDesktop?.terminalProfiles&&_i(r,`terminal`)&&(0,G.jsx)(U.Suspense,{fallback:null,children:(0,G.jsx)(Cs,{open:ke,height:je,labels:Oe,activeSessionId:g,resolveSessionCwd:$e,onOpenChange:Ae,onHeightChange:Me})}),C&&T&&(0,G.jsx)(so,{page:c,onNavigate:H})]})]}),C&&!S&&(0,G.jsx)(No,{page:c,pluginStats:ge}),M&&(0,G.jsx)(Oo,{open:!0,message:M.message,tone:M.tone,closeLabel:e(`common:ui.closeDialog`),onOpenChange:e=>!e&&fe(null)},M.id),(0,G.jsx)(wo,{hotkey:[],label:e(`common:ui.notifications`)}),(0,G.jsx)(bo,{dialog:B.dialog,onClose:B.close,onFinish:B.finish}),(0,G.jsxs)(U.Suspense,{fallback:null,children:[D&&(0,G.jsx)(bs,{navigation:o,onClose:()=>O(!1),onNavigate:H,onOpenSession:async(t,n,r)=>{try{n&&!r&&await ne.navigateSessionTreeTarget(t,n),wa(t,`open`,n),H(`chat`)}catch(t){throw Be(e(`navigation:appOverlays.openLabeledTurnFailed`),`error`),t}},onNewChat:()=>{H(`chat`),requestAnimationFrame(()=>requestAnimationFrame(Ke))}}),pe&&(0,G.jsx)(xs,{type:pe,close:()=>N(null),notify:Be})]})]})})}var As=Ie(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function js({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?de:`span`;return(0,G.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:B(As({variant:t}),e),...r})}function Ms({className:e,size:t=`default`,...n}){return(0,G.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:B(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function Ns({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`card-title`,className:B(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function Ps({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`card-content`,className:B(`px-(--card-spacing)`,e),...t})}function Fs({className:e,size:t=`default`,...n}){return(0,G.jsx)(Cn,{"data-slot":`switch`,"data-size":t,className:B(`peer group/switch relative inline-flex min-h-0! shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,G.jsx)(Tn,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}function Is({className:e,orientation:t=`horizontal`,...n}){return(0,G.jsx)(Gn,{"data-slot":`tabs`,"data-orientation":t,className:B(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Ls=Ie(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Rs({className:e,variant:t=`default`,...n}){return(0,G.jsx)(Kn,{"data-slot":`tabs-list`,"data-variant":t,className:B(Ls({variant:t}),e),...n})}function zs({className:e,...t}){return(0,G.jsx)(qn,{"data-slot":`tabs-trigger`,className:B(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}var Bs={blue:`bg-brand-soft text-brand-strong`,green:`bg-success-soft text-success-strong`,red:`bg-danger-soft text-danger`,amber:`bg-warning-soft text-warning-strong`,gray:`bg-surface-muted text-content-muted`};function Vs({className:e,...t}){return(0,G.jsx)(Ms,{className:B(`app-card [&_h2]:text-[16px] [&_h2]:tracking-[-.02em] [.detail-stack_>_&]:[flex:0_0_auto] block min-w-0 gap-0 overflow-visible rounded-surface border border-border bg-card p-3.5 py-3.5 text-card-foreground shadow-surface ring-0 backdrop-blur-[14px]`,e),...t})}function Hs({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`app-card-header`,className:B(`flex min-w-0 items-start justify-between gap-3 [&_h2]:text-base [&_h2]:tracking-[0] [&_h3]:text-sm [&_p]:mt-1 [&_p]:text-[12px] [&_p]:text-content-muted [&_span]:text-[12px] [&_span]:text-content-muted [&_a]:text-[12px] [&_a]:font-semibold [&_a]:text-content-soft [&_a]:no-underline hover:[&_a]:text-content`,e),...t})}function Us({className:e,...t}){return(0,G.jsx)(Vs,{"data-slot":`app-empty-state`,className:B(`col-span-full grid min-h-[300px] place-content-center justify-items-center text-content-muted [&>svg:first-child:not(.animate-spin)]:box-content [&>svg:first-child:not(.animate-spin)]:rounded-full [&>svg:first-child:not(.animate-spin)]:border [&>svg:first-child:not(.animate-spin)]:border-[var(--stroke-soft)] [&>svg:first-child:not(.animate-spin)]:bg-[radial-gradient(circle_at_50%_38%,var(--surface-subtle),var(--panel)_72%)] [&>svg:first-child:not(.animate-spin)]:p-[26px] [&>svg:first-child:not(.animate-spin)]:text-[var(--text-tertiary)] [&>svg:first-child:not(.animate-spin)]:shadow-[inset_0_1px_0_var(--surface-highlight),0_10px_26px_-18px_var(--shadow)] [&_h2]:mt-[18px] [&_h2]:text-[15px] [&_h2]:text-content [&_p]:mt-[7px] [&_p]:max-w-[360px] [&_p]:text-center [&_p]:text-[13px] [&_p]:leading-[1.6]`,e),...t})}function Ws({className:e,...t}){return(0,G.jsx)(`div`,{role:`alert`,"data-slot":`app-error`,className:B(`my-2.5 flex items-start gap-1.5 rounded-[var(--r-xs)] bg-danger-soft p-[7px] text-[13px] leading-[1.4] text-danger`,e),...t})}function Gs({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`app-notice`,className:B(`mt-3 flex gap-2 rounded-[var(--r-sm)] bg-[var(--accent-soft)] p-[9px] text-[var(--star-strong)] [&>span]:flex [&>span]:flex-col [&>span]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[13px] [&_small]:leading-[1.4] [&_small]:text-content-muted`,e),...t})}function Ks({title:e}){return(0,G.jsx)(Ns,{role:`heading`,"aria-level":3,className:`app-section-title [.selection-list_&]:mb-[8px] [.model-config-heading_&]:m-0 [.skill-scope-head_&]:mb-[2px] text-[13px] leading-5 font-bold tracking-[0] text-content-soft`,children:e})}function qs({children:e,tone:t=`blue`,className:n,...r}){return(0,G.jsx)(js,{variant:`secondary`,className:B(`status-badge [.cli-settings-heading_&]:[align-self:center] h-auto min-h-6 rounded-full border-0 px-2 text-[11px] leading-4 font-bold tracking-[0]`,Bs[t],n),...r,children:e})}function Js({defaultOn:e=!1,value:t,onChange:n,ariaLabel:r,density:i=`default`,className:a,onClick:o,...s}){let[c,l]=(0,U.useState)(e);return(0,G.jsx)(Fs,{checked:t??c,onCheckedChange:e=>{t===void 0&&l(e),n?.(e)},"aria-label":r,className:B(`app-switch data-[size=default]:h-8 data-[size=default]:w-12 data-checked:bg-primary data-unchecked:bg-control-muted [&_[data-slot=switch-thumb]]:size-6`,i===`compact`&&`data-[size=default]:h-6 data-[size=default]:w-10 [&_[data-slot=switch-thumb]]:size-5`,a),onClick:e=>{e.stopPropagation(),o?.(e)},...s})}function Ys({options:e,value:t,onChange:n,compact:r=!1,className:i}){return(0,G.jsx)(Is,{value:t,onValueChange:n,className:B(`block min-w-0`,i),children:(0,G.jsx)(Rs,{className:B(`segmented min-h-9 max-w-full justify-start gap-0.5 overflow-x-auto rounded-lg bg-surface-muted p-1 [scrollbar-width:none]`,r&&`compact w-auto border border-border bg-transparent`),children:e.map(e=>(0,G.jsx)(zs,{className:`h-8 min-w-14 flex-none rounded-md border-0 px-3 text-[12px] font-semibold tracking-[0] text-content-muted data-active:bg-card data-active:text-content data-active:shadow-sm`,value:e,children:e},e))})})}function Xs(){let{t:e}=R();return(0,G.jsxs)(Us,{children:[(0,G.jsx)(ui,{className:`animate-spin`,size:24}),(0,G.jsx)(`h2`,{children:e(`navigation:pageLoader.lightingUpThisPage`)}),(0,G.jsx)(`p`,{children:e(`navigation:pageLoader.bringingTheNeededCapabilitiesIntoPlace`)})]})}async function Zs(){window.__PISPER_MOBILE_APP__&&await ce().catch(()=>void 0);let e=new URL(window.location.href);window.__PISPER_MOBILE_APP__&&e.protocol===`http:`&&e.hostname===`127.0.0.1`&&e.searchParams.set(`_pisper_recovery`,String(Date.now())),window.location.replace(e.href)}function Qs(){let e=m(),t=a(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:`页面加载失败`;return(0,G.jsxs)(`main`,{className:`app-startup dark:bg-[var(--bg)] dark:text-[var(--text)] flex w-full min-h-[100vh] items-center justify-center gap-[10px] bg-[var(--bg)] text-[var(--text-muted)] text-[13px]`,role:`alert`,children:[(0,G.jsx)(`strong`,{children:t}),(0,G.jsx)(M,{variant:`outline`,size:`lg`,className:`bg-surface-subtle`,type:`button`,onClick:()=>void Zs(),children:`重新加载`})]})}function $(){return o()}async function $s(){let{ChatPage:e}=await s(async()=>{let{ChatPage:e}=await import(`./ChatPage-CCMsSvJV.js`);return{ChatPage:e}},__vite__mapDeps([32,1,2,9,7,8,10,14,11,12,13,4,5,33,34,35,36,37,38,39,29,40,41,42,43,44,45,15,46,47,48,49,50,24,51,52,53,27,16,54,55,17,18,3,56,57,58,59,60,61,62,63,64,65,66,67,68,69]));function t(){let t=$();return(0,G.jsx)(e,{notify:t.notify,navigate:t.navigate,browserNotify:t.browserNotify,registerPrimaryAction:t.registerPrimaryAction,pendingAsset:t.pendingAsset,onAssetConsumed:t.onAssetConsumed,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}async function ec(){let{ChatHistoryPage:e}=await s(async()=>{let{ChatHistoryPage:e}=await import(`./ChatHistoryPage-BpoHAiYo.js`);return{ChatHistoryPage:e}},__vite__mapDeps([70,1,2,8,9,10,11,12,13,14,4,5,47,48,50,54,71,68,72]));function t(){let t=$();return(0,G.jsx)(e,{query:t.query,navigate:t.navigate,notify:t.notify,requestConfirm:t.requestConfirm,requestText:t.requestText})}return{Component:t}}async function tc(){let{AssetsPage:e}=await s(async()=>{let{AssetsPage:e}=await import(`./AssetsPage-mZkZgR9g.js`);return{AssetsPage:e}},__vite__mapDeps([73,1,2,8,9,10,11,12,13,14,4,5,45,22,49,54,17,19,20,71,67,57,39,58,59,60,61,62,74]));function t(){let t=$();return(0,G.jsx)(e,{query:t.query,notify:t.notify,registerPrimaryAction:t.registerPrimaryAction,requestConfirm:t.requestConfirm,onUse:t.onUseAsset})}return{Component:t}}async function nc(){let{ChannelsPage:e}=await s(async()=>{let{ChannelsPage:e}=await import(`./ChannelsPage-Dau7vaaV.js`);return{ChannelsPage:e}},__vite__mapDeps([75,1,2,8,9,10,11,12,13,14,4,5,38,33,34,36,39,29,76,51,53,54,17,18,19,20,71,67,68]));function t(){let t=$();return(0,G.jsx)(e,{notify:t.notify,registerPrimaryAction:t.registerPrimaryAction,requestConfirm:t.requestConfirm})}return{Component:t}}async function rc(){let{SchedulesPage:e}=await s(async()=>{let{SchedulesPage:e}=await import(`./SchedulesPage-C3sS9Ej3.js`);return{SchedulesPage:e}},__vite__mapDeps([77,1,2,8,9,10,11,12,13,14,4,5,38,33,34,36,39,29,66,41,15,18,63,76,24,51,54,17,19,20,71,67,69]));function t(){let t=$();return(0,G.jsx)(e,{notify:t.notify,registerPrimaryAction:t.registerPrimaryAction,requestConfirm:t.requestConfirm,openNotificationSettings:t.openNotificationSettings})}return{Component:t}}async function ic(){let{ConfigPage:e}=await s(async()=>{let{ConfigPage:e}=await import(`./ConfigPage-BGZoCXnB.js`);return{ConfigPage:e}},__vite__mapDeps([78,1,2,8,9,10,11,12,13,14,4,5,33,34,36,37,38,39,29,20,79,44,80,15,23,81,25,51,53,26,54,55,17,19,3,67,57,58,59,60,61,62,68]));function t(){let t=$();return(0,G.jsx)(e,{notify:t.notify,registerPrimaryAction:t.registerPrimaryAction,section:t.configSection,onBrowserNotificationChange:t.setNotificationSettings,requestConfirm:t.requestConfirm,update:t.appUpdate})}return{Component:t}}async function ac(){let{PluginsPage:e}=await s(async()=>{let{PluginsPage:e}=await import(`./PluginsPage-D-D22LWb.js`);return{PluginsPage:e}},__vite__mapDeps([82,1,2,8,9,10,11,12,13,14,4,5,83,36,34,38,33,39,29,80,84,85,15,52,54,67,69]));function t(){let t=$();return(0,G.jsx)(e,{query:t.query,notify:t.notify,registerPrimaryAction:t.registerPrimaryAction,requestText:t.requestText,requestConfirm:t.requestConfirm,onStatusChange:t.setPluginStats})}return{Component:t}}async function oc(){let{MemoryPage:e}=await s(async()=>{let{MemoryPage:e}=await import(`./MemoryPage-BiAbcHbL.js`);return{MemoryPage:e}},__vite__mapDeps([86,1,2,8,9,10,11,12,13,14,4,5,38,33,34,36,39,29,42,84,15,50,54,17,19,20,87,71,67]));function t(){let t=$();return(0,G.jsx)(e,{query:t.query,notify:t.notify,registerPrimaryAction:t.registerPrimaryAction,requestConfirm:t.requestConfirm})}return{Component:t}}async function sc(){let{McpPage:e}=await s(async()=>{let{McpPage:e}=await import(`./PreviewPages-DUZgwvOb.js`);return{McpPage:e}},__vite__mapDeps([88,1,2,8,9,10,11,12,13,14,4,5,43,54,55,67]));function t(){let t=$();return(0,G.jsx)(e,{query:t.query,notify:t.notify,registerPrimaryAction:t.registerPrimaryAction,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}async function cc(){let{SkillsPage:e}=await s(async()=>{let{SkillsPage:e}=await import(`./SkillsPage-BeeTZyfc.js`);return{SkillsPage:e}},__vite__mapDeps([89,1,2,8,9,10,11,12,13,14,4,5,84,85,25,54,55,67]));function t(){let t=$();return(0,G.jsx)(e,{query:t.query,activeSessionId:t.activeSessionId,notify:t.notify,registerPrimaryAction:t.registerPrimaryAction,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}async function lc(){let{WorkflowsPage:e}=await s(async()=>{let{WorkflowsPage:e}=await import(`./WorkflowsPage-BCdz4ise.js`);return{WorkflowsPage:e}},__vite__mapDeps([90,1,2,9,8,10,11,12,13,14,4,5,38,33,34,36,39,29,40,44,58,84,45,85,76,81,50,24,51,27,54,18,19,20,67,63,91,92]));function t(){let t=$();return(0,G.jsx)(e,{query:t.query,notify:t.notify,requestConfirm:t.requestConfirm})}return{Component:t}}async function uc(){let{WorkflowBuilder:e}=await s(async()=>{let{WorkflowBuilder:e}=await import(`./WorkflowsPage-BCdz4ise.js`);return{WorkflowBuilder:e}},__vite__mapDeps([90,1,2,9,8,10,11,12,13,14,4,5,38,33,34,36,39,29,40,44,58,84,45,85,76,81,50,24,51,27,54,18,19,20,67,63,91,92]));function t(){let t=$();return(0,G.jsx)(e,{notify:t.notify,registerPrimaryAction:t.registerPrimaryAction,registerWorkflowActions:t.registerWorkflowActions})}return{Component:t}}var dc=c([{element:(0,G.jsx)(ks,{}),errorElement:(0,G.jsx)(Qs,{}),hydrateFallbackElement:(0,G.jsx)(Xs,{}),children:[{index:!0,element:(0,G.jsx)(l,{to:Y.chat,replace:!0})},{path:Y.chat,lazy:$s},{path:Y.chatHistory,lazy:ec},{path:Y.assets,lazy:tc},{path:Y.channels,lazy:nc},{path:Y.schedules,lazy:rc},{path:Y.config,lazy:ic},{path:`/config/:configSection`,lazy:ic},{path:`/config`,element:(0,G.jsx)(l,{to:Y.config,replace:!0})},{path:Y.plugins,lazy:ac},{path:Y.memory,lazy:oc},{path:Y.mcp,lazy:sc},{path:Y.skills,lazy:cc},{path:Y.workflows,lazy:lc},{path:Y.workflowCreate,lazy:uc},{path:`/workflows/:workflowId`,lazy:uc},{path:`*`,element:(0,G.jsx)(l,{to:Y.chat,replace:!0})}]}]),fc=()=>{document.documentElement.dataset.pageVisibility=document.visibilityState};fc(),document.addEventListener(`visibilitychange`,fc);var pc=ki(window.location.hash);pc&&window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}#${pc}`);var mc=document.getElementById(`root`);if(!mc)throw Error(`Missing #root application mount point`);(0,W.createRoot)(mc).render((0,G.jsx)(U.StrictMode,{children:(0,G.jsx)(Vr,{children:(0,G.jsx)(p,{router:dc})})}));export{wa as $,mo as A,Xr as At,Aa as B,Nt as Bt,Q as C,ii as Ct,qo as D,ei as Dt,Go as E,ti as Et,uo as F,Wr as Ft,ma as G,Z as H,_t as Ht,no as I,Ur as It,Ea as J,Oa as K,Qa as L,dn as Lt,go as M,qr as Mt,ho as N,Kr as Nt,yo as O,Qr as Ot,_o as P,Gr as Pt,xa as Q,Fa as R,un as Rt,us as S,si as St,Ko as T,ni as Tt,ga as U,Pa as V,yt as Vt,ha as W,Da as X,Ca as Y,Ta as Z,js as _,pi as _t,Gs as a,la as at,vs as b,ui as bt,Ys as c,Zi as ct,Rs as d,Ni as dt,sa as et,zs as f,Y as ft,Ns as g,mi as gt,Ps as h,hi as ht,Ws as i,ia as it,vo as j,Yr as jt,lo as k,Zr as kt,qs as l,$i as lt,Ms as m,_i as mt,Hs as n,ua as nt,Ks as o,aa as ot,Fs as p,Oi as pt,ka as q,Us as r,pa as rt,Js as s,oa as st,Vs as t,ca as tt,Is as u,Xi as ut,ms as v,fi as vt,Wo as w,ri as wt,_s as x,ci as xt,gs as y,di as yt,ja as z,Zt as zt};
|