opencami 1.9.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{CSPContext-B3PAVjBL.js → CSPContext-CxrBvJ99.js} +1 -1
- package/dist/client/assets/{DirectionContext-CR5CCisG.js → DirectionContext-BOL0P_1j.js} +1 -1
- package/dist/client/assets/_sessionKey-CTtu2ipR.js +25 -0
- package/dist/client/assets/agents-D7JS19Lo.js +2 -0
- package/dist/client/assets/{agents-screen--ZMzN5cB.js → agents-screen-CqdzZKaR.js} +1 -1
- package/dist/client/assets/bots-DAInzfLx.js +2 -0
- package/dist/client/assets/{bots-screen-C_uJBNwI.js → bots-screen-RYovD6cu.js} +1 -1
- package/dist/client/assets/button-Bv-7bwZZ.js +1 -0
- package/dist/client/assets/{composite-DArWbFHm.js → composite-DwQIZFe9.js} +1 -1
- package/dist/client/assets/{connect-B48HecjN.js → connect-DZSrhhNT.js} +1 -1
- package/dist/client/assets/{dashboard-BVKx9FMy.js → dashboard-y8KVUVF-.js} +1 -1
- package/dist/client/assets/{event-BCwqPPkP.js → event-Cnr9OETn.js} +1 -1
- package/dist/client/assets/file-explorer-screen-C_mYUJsr.js +1 -0
- package/dist/client/assets/files-CG0jFYdO.js +2 -0
- package/dist/client/assets/follow-up-suggestions-C6RzpstA.js +2 -0
- package/dist/client/assets/{index-0gdwm1_H.js → index-3-ASY4Cl.js} +1 -1
- package/dist/client/assets/index-BZxJSF4T.js +3 -0
- package/dist/client/assets/{keyboard-shortcuts-dialog-CK_XTzLr.js → keyboard-shortcuts-dialog-jm4-DftO.js} +1 -1
- package/dist/client/assets/{main-B2CrcRuC.js → main-CbISK-pm.js} +3 -3
- package/dist/client/assets/{markdown-CdkuX06F.js → markdown-UD7RzskQ.js} +1 -1
- package/dist/client/assets/memory-BYRJ1l_4.js +2 -0
- package/dist/client/assets/{memory-screen-C1RfLy-d.js → memory-screen-BRsm-Q8A.js} +1 -1
- package/dist/client/assets/{menu-CIwnliij.js → menu-DRjoHFvG.js} +1 -1
- package/dist/client/assets/{opencami-logo-SVuYD55V.js → opencami-logo-D2mv84sX.js} +1 -1
- package/dist/client/assets/{proxy-BijR8W1L.js → proxy-DtxqfBHY.js} +1 -1
- package/dist/client/assets/{react-DWx7OvUo.js → react-C_7UlEtd.js} +1 -1
- package/dist/client/assets/{search-dialog-CB4KE8ec.js → search-dialog-lsT8JUtT.js} +1 -1
- package/dist/client/assets/{search-sources-badge-B8Z-8sSf.js → search-sources-badge-BnqKxoia.js} +1 -1
- package/dist/client/assets/{session-export-dialog-tDiFuv3a.js → session-export-dialog-DHHpvwI8.js} +1 -1
- package/dist/client/assets/settings-dialog-vrd0eJGw.js +1 -0
- package/dist/client/assets/skills-Svd-7oxQ.js +2 -0
- package/dist/client/assets/{skills-panel-fjJQVMog.js → skills-panel-Dkuo0yyD.js} +1 -1
- package/dist/client/assets/styles-CWabEzNU.css +1 -0
- package/dist/client/assets/{switch-Bn5uei2k.js → switch-BYFBYPmi.js} +1 -1
- package/dist/client/assets/{tabs-DOBNAUVE.js → tabs-1jrPkdUE.js} +1 -1
- package/dist/client/assets/{thinking-dfGrFAMV.js → thinking-D9BBn5kK.js} +1 -1
- package/dist/client/assets/{tooltip-DOKkNFvu.js → tooltip-DzFgDY86.js} +1 -1
- package/dist/client/assets/{use-file-explorer-state-BAa6Cxyr.js → use-file-explorer-state-Dwhw6Mpg.js} +2 -2
- package/dist/client/assets/{useBaseUiId-DFpBD0sg.js → useBaseUiId-BdQC9KF3.js} +1 -1
- package/dist/client/assets/useCompositeItem-BI09zNFD.js +1 -0
- package/dist/client/assets/{useControlled-CQHE0ITz.js → useControlled-Bc2Emhlx.js} +1 -1
- package/dist/client/assets/{useMutation-BFl-7GnD.js → useMutation-CMp81lDO.js} +1 -1
- package/dist/client/assets/{useOnFirstRender-DlXHIIGk.js → useOnFirstRender-DpB3w0o4.js} +1 -1
- package/dist/client/assets/{useQuery-D-sF8Tld.js → useQuery-_BEWdUe1.js} +1 -1
- package/dist/server/assets/{_sessionKey-D8TGrDRM.js → _sessionKey-COz7RLKC.js} +170 -279
- package/dist/server/assets/_tanstack-start-manifest_v-D0f-0Utn.js +4 -0
- package/dist/server/assets/{connect-CTVBm0Vc.js → connect-sd_NDvQN.js} +1 -1
- package/dist/server/assets/follow-up-suggestions-DRQqO8_S.js +183 -0
- package/dist/server/assets/{index-B_F4DTUu.js → index-197lqzv2.js} +2 -0
- package/dist/server/assets/{index-gRco4Ina.js → index-sXe2QC5V.js} +1 -1
- package/dist/server/assets/{markdown-CFdYXCRQ.js → markdown-Dk1YdosA.js} +1 -1
- package/dist/server/assets/{memory-screen-vqXczcVo.js → memory-screen-DA_o-N1Z.js} +2 -2
- package/dist/server/assets/{memory-rBB015W-.js → memory-woPzJFfs.js} +1 -1
- package/dist/server/assets/{router-DaKDqc9w.js → router-CZhxPkYW.js} +347 -355
- package/dist/server/assets/{search-dialog-DSSK93kq.js → search-dialog-DlvWfq1e.js} +5 -5
- package/dist/server/assets/{settings-dialog-DyWNblva.js → settings-dialog-BGtrS2RJ.js} +63 -255
- package/dist/server/assets/{thinking-CU0FRlzT.js → thinking-fzwT_aVT.js} +5 -5
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/_sessionKey-Bg_9uype.js +0 -23
- package/dist/client/assets/agents-BiTHBb6Z.js +0 -2
- package/dist/client/assets/bots-DxhRnQp5.js +0 -2
- package/dist/client/assets/button-BciDmec0.js +0 -1
- package/dist/client/assets/file-explorer-screen-DPs-FWeA.js +0 -1
- package/dist/client/assets/files-SEycwYCa.js +0 -2
- package/dist/client/assets/follow-up-suggestions-BPjWBpiy.js +0 -5
- package/dist/client/assets/index-CGeJcqZ3.js +0 -3
- package/dist/client/assets/memory-C7lKdkmc.js +0 -2
- package/dist/client/assets/settings-dialog-aL-AH4Rt.js +0 -1
- package/dist/client/assets/skills-D1T6uemU.js +0 -2
- package/dist/client/assets/styles-D0L88B64.css +0 -1
- package/dist/client/assets/useCompositeItem-B-Axq9-D.js +0 -1
- package/dist/server/assets/_tanstack-start-manifest_v-DalBo2bY.js +0 -4
- package/dist/server/assets/follow-up-suggestions-C65ptDij.js +0 -336
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-explorer-screen-C_mYUJsr.js","assets/main-CbISK-pm.js","assets/useQuery-_BEWdUe1.js","assets/button-Bv-7bwZZ.js","assets/tooltip-DzFgDY86.js","assets/useOnFirstRender-DpB3w0o4.js","assets/useBaseUiId-BdQC9KF3.js","assets/event-Cnr9OETn.js","assets/visuallyHidden-COI6QeQH.js","assets/DirectionContext-BOL0P_1j.js","assets/use-file-explorer-state-Dwhw6Mpg.js","assets/composite-DwQIZFe9.js","assets/react-C_7UlEtd.js","assets/proxy-DtxqfBHY.js","assets/menu-DRjoHFvG.js","assets/useCompositeItem-BI09zNFD.js","assets/useMutation-CMp81lDO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r,_ as s}from"./main-CbISK-pm.js";const n=r.lazy(()=>s(()=>import("./file-explorer-screen-C_mYUJsr.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])).then(t=>({default:t.FileExplorerScreen})));function o(){return e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"flex h-screen items-center justify-center text-primary-500 text-sm",children:"Loading…"}),children:e.jsx(n,{})})}export{o as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as l,j as r}from"./main-CbISK-pm.js";import{H as w,p as N,l as R,c as j}from"./button-Bv-7bwZZ.js";import{u as $}from"./index-BZxJSF4T.js";import"./react-C_7UlEtd.js";async function E(e,i,f){const s=await fetch("/api/llm-features",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"followups",conversationContext:e,model:i}),signal:f});if(!s.ok)throw new Error(`API error: ${s.status}`);const t=await s.json();return t.ok&&Array.isArray(t.suggestions)&&t.suggestions.length>0?t.suggestions:[]}function k(e,i,f){const{settings:s}=$(),{minResponseLength:t=50,heuristicsOnly:u=!1,enabled:a=!0}=f??{},[x,n]=l.useState([]),[g,o]=l.useState(!1),[S,m]=l.useState(null),[F,c]=l.useState(null),y=l.useRef(""),d=l.useRef(null);return l.useEffect(()=>{if(!a){d.current&&d.current.abort(),n([]),c(null),o(!1),m(null);return}if(!e||e.trim().length<t){n([]),c(null),o(!1),m(null);return}const b=`${s.llmFeaturesModel}:${e.slice(0,200)}${e.length}`;if(b===y.current)return;if(y.current=b,d.current&&d.current.abort(),u){n([]),c(null),o(!1),m(null);return}const h=new AbortController;d.current=h,o(!0),m(null),n([]),c(null);const v=i?.trim().length?i.trim():`Assistant's response:
|
|
2
|
+
${e.slice(0,2e3)}`;E(v,s.llmFeaturesModel?`openclaw/${s.llmFeaturesModel}`:void 0,h.signal).then(p=>{h.signal.aborted||(p.length>0&&(n(p),c("openclaw")),o(!1))}).catch(p=>{h.signal.aborted||(n([]),c(null),m(p instanceof Error?p.message:String(p)),o(!1))})},[e,i,a,t,u,s.llmFeaturesModel]),{suggestions:x,isLoading:g,error:S,source:F}}function A({responseText:e,conversationContext:i,onSuggestionClick:f,disabled:s=!1,className:t}){const{suggestions:u,isLoading:a,source:x}=k(e,i,{minResponseLength:50});if(u.length===0&&!a)return null;const n=a||u.length>0;return r.jsxs("div",{className:j("flex flex-col gap-2 mt-3",t),children:[n?r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-primary-500",children:[r.jsx("span",{className:"text-primary-400",children:"✨"}),r.jsx("span",{children:a?r.jsxs("span",{className:"flex items-center gap-1",children:["Thinking of follow-ups",r.jsx(w,{icon:N,size:12,strokeWidth:2,className:"animate-spin text-primary-400"})]}):x==="openclaw"?"AI suggestions":"Follow-up suggestions"})]}):null,r.jsx("div",{className:"flex flex-wrap gap-2",children:u.map((g,o)=>r.jsxs("button",{type:"button",disabled:s,onClick:()=>f(g),className:j("group inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full","text-sm text-primary-700 bg-primary-50 border border-primary-200","hover:bg-primary-100 hover:border-primary-300 hover:text-primary-900","focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:ring-offset-1","transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-primary-50 disabled:hover:border-primary-200",a&&"opacity-75"),children:[r.jsx("span",{children:g}),r.jsx(w,{icon:R,size:14,strokeWidth:2,className:"text-primary-400 group-hover:text-primary-600 group-hover:translate-x-0.5 transition-all duration-150"})]},`${o}-${g.slice(0,20)}`))})]})}const I=l.memo(A);export{I as FollowUpSuggestions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as t,r as s,j as a}from"./main-
|
|
1
|
+
import{R as t,r as s,j as a}from"./main-CbISK-pm.js";function n(){const e=t.useNavigate();return s.useEffect(()=>{e({to:"/chat/$sessionKey",params:{sessionKey:"main"},replace:!0})},[e]),a.jsx("div",{className:"h-screen flex items-center justify-center text-primary-600",children:"Loading…"})}export{n as component};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cpp-B-lmv-kZ.js","assets/regexp-CDVJQ6XC.js","assets/c-BIGW1oBm.js","assets/sql-BLtJtn59.js","assets/graphql-ChdNCCLP.js","assets/javascript-wDzz0qaB.js","assets/typescript-BPQ3VLAy.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/html-GMplVEZG.js","assets/css-DPfMkruS.js","assets/php-Dhbhpdrm.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/ruby-NiQIzKut.js","assets/shell-DfDnw5Jg.js","assets/yaml-Buea-lGh.js","assets/core-BrHBc0Zp.js","assets/index-T4TOjvD0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as _,j as u,_ as r}from"./main-CbISK-pm.js";import{H as A,n as q,B as N,F as z,X as G,x as X,c as P}from"./button-Bv-7bwZZ.js";import{c as $}from"./react-C_7UlEtd.js";function Q(e,o){let t;try{t=e()}catch{return}return{getItem:i=>{var s;const f=h=>h===null?null:JSON.parse(h,void 0),d=(s=t.getItem(i))!=null?s:null;return d instanceof Promise?d.then(f):f(d)},setItem:(i,s)=>t.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>t.removeItem(i)}}const j=e=>o=>{try{const t=e(o);return t instanceof Promise?t:{then(n){return j(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return j(n)(t)}}}},Y=(e,o)=>(t,n,i)=>{let s={storage:Q(()=>window.localStorage),partialize:a=>a,version:0,merge:(a,v)=>({...v,...a}),...o},f=!1,d=0;const h=new Set,y=new Set;let c=s.storage;if(!c)return e((...a)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),t(...a)},n,i);const I=()=>{const a=s.partialize({...n()});return c.setItem(s.name,{state:a,version:s.version})},T=i.setState;i.setState=(a,v)=>(T(a,v),I());const x=e((...a)=>(t(...a),I()),n,i);i.getInitialState=()=>x;let g;const E=()=>{var a,v;if(!c)return;const L=++d;f=!1,h.forEach(l=>{var m;return l((m=n())!=null?m:x)});const w=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(a=n())!=null?a:x))||void 0;return j(c.getItem.bind(c))(s.name).then(l=>{if(l)if(typeof l.version=="number"&&l.version!==s.version){if(s.migrate){const m=s.migrate(l.state,l.version);return m instanceof Promise?m.then(S=>[!0,S]):[!0,m]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,l.state];return[!1,void 0]}).then(l=>{var m;if(L!==d)return;const[S,O]=l;if(g=s.merge(O,(m=n())!=null?m:x),t(g,!0),S)return I()}).then(()=>{L===d&&(w?.(g,void 0),g=n(),f=!0,y.forEach(l=>l(g)))}).catch(l=>{L===d&&w?.(void 0,l)})};return i.persist={setOptions:a=>{s={...s,...a},a.storage&&(c=a.storage)},clearStorage:()=>{c?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>E(),hasHydrated:()=>f,onHydrate:a=>(h.add(a),()=>{h.delete(a)}),onFinishHydration:a=>(y.add(a),()=>{y.delete(a)})},s.skipHydration||E(),g||x},K=Y,D=$()(K(e=>({settings:{showToolMessages:!0,showReasoningBlocks:!0,showSearchSources:!0,showFollowUps:!0,inlineFilePreview:!1,llmFeaturesModel:"gpt54mini",theme:"system",fontFamily:"system",density:"comfortable",accentColor:"green",chatWidth:"wide",sidebarWidth:"normal",bubbleStyle:"default"},updateSettings:o=>e(t=>({settings:{...t.settings,...o}}))}),{name:"chat-settings",merge:(e,o)=>{const t=e;return{...o,...t,settings:{...o.settings,...t?.settings??{}}}}}));function de(){const e=D(t=>t.settings),o=D(t=>t.updateSettings);return{settings:e,updateSettings:o}}function Z(){const e=D(n=>n.settings.theme),[o,t]=_.useState(!1);return _.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches);function i(s){t(s.matches)}return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),_.useMemo(()=>e==="dark"?"dark":e==="light"||e==="frost-light"?"light":e==="frost-dark"||o?"dark":"light",[e,o])}const ee=new Set(["bash","c","cpp","csharp","css","diff","dockerfile","go","graphql","html","java","javascript","json","jsx","kotlin","markdown","php","python","regexp","ruby","rust","shell","sql","swift","toml","typescript","tsx","xml","yaml"]),te={js:"javascript",ts:"typescript",tsx:"tsx",jsx:"jsx",typescriptreact:"tsx",javascriptreact:"jsx",react:"jsx",sh:"bash",shell:"bash",yml:"yaml",md:"markdown",txt:"text"};function F(e){const t=e.trim().toLowerCase().replace(/^language-/,"").replace(/^\[|\]$/g,"").split(/[\s,]+/)[0]||"text";return te[t]??t}function re(e){const o=F(e);return ee.has(o)?o:"text"}function ne(e){return{bash:"Bash",python:"Python",javascript:"JavaScript",typescript:"TypeScript",tsx:"TSX",jsx:"JSX",json:"JSON",html:"HTML",css:"CSS",sql:"SQL",yaml:"YAML",markdown:"Markdown",text:"Plain Text"}[e]||e.charAt(0).toUpperCase()+e.slice(1)}const se={bash:()=>r(()=>import("./shell-DfDnw5Jg.js").then(e=>e.b),[]).then(e=>e.default),c:()=>r(()=>import("./c-BIGW1oBm.js"),[]).then(e=>e.default),cpp:()=>r(()=>import("./cpp-B-lmv-kZ.js"),__vite__mapDeps([0,1,2,3])).then(e=>e.default),csharp:()=>r(()=>import("./csharp-COcwbKMJ.js"),[]).then(e=>e.default),css:()=>r(()=>import("./css-DPfMkruS.js"),[]).then(e=>e.default),diff:()=>r(()=>import("./diff-D97Zzqfu.js"),[]).then(e=>e.default),dockerfile:()=>r(()=>import("./dockerfile-BcOcwvcX.js"),[]).then(e=>e.default),go:()=>r(()=>import("./go-CxLEBnE3.js"),[]).then(e=>e.default),graphql:()=>r(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([4,5,6,7,8])).then(e=>e.default),html:()=>r(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([9,5,10])).then(e=>e.default),java:()=>r(()=>import("./java-CylS5w8V.js"),[]).then(e=>e.default),javascript:()=>r(()=>import("./javascript-wDzz0qaB.js"),[]).then(e=>e.default),json:()=>r(()=>import("./json-Cp-IABpG.js"),[]).then(e=>e.default),jsx:()=>r(()=>import("./jsx-g9-lgVsj.js"),[]).then(e=>e.default),kotlin:()=>r(()=>import("./kotlin-BdnUsdx6.js"),[]).then(e=>e.default),markdown:()=>r(()=>import("./markdown-Cvjx9yec.js"),[]).then(e=>e.default),php:()=>r(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([11,9,5,10,12,13,3,14])).then(e=>e.default),python:()=>r(()=>import("./python-B6aJPvgy.js"),[]).then(e=>e.default),regexp:()=>r(()=>import("./regexp-CDVJQ6XC.js"),[]).then(e=>e.default),ruby:()=>r(()=>import("./ruby-NiQIzKut.js"),__vite__mapDeps([15,9,5,10,12,13,3,4,6,7,8,0,1,2,16,17])).then(e=>e.default),rust:()=>r(()=>import("./rust-B1yitclQ.js"),[]).then(e=>e.default),shell:()=>r(()=>import("./shell-DfDnw5Jg.js").then(e=>e.a),[]).then(e=>e.default),sql:()=>r(()=>import("./sql-BLtJtn59.js"),[]).then(e=>e.default),swift:()=>r(()=>import("./swift-D82vCrfD.js"),[]).then(e=>e.default),toml:()=>r(()=>import("./toml-vGWfd6FD.js"),[]).then(e=>e.default),typescript:()=>r(()=>import("./typescript-BPQ3VLAy.js"),[]).then(e=>e.default),tsx:()=>r(()=>import("./tsx-COt5Ahok.js"),[]).then(e=>e.default),xml:()=>r(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([12,13])).then(e=>e.default),yaml:()=>r(()=>import("./yaml-Buea-lGh.js"),[]).then(e=>e.default)},ae={sh:"bash",zsh:"bash",js:"javascript",ts:"typescript",py:"python",rb:"ruby",rs:"rust",cs:"csharp","c++":"cpp",yml:"yaml",md:"markdown",docker:"dockerfile"};let k=null;const H=new Set;async function oe(){if(!k){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:o},t,n]=await Promise.all([r(()=>import("./core-BrHBc0Zp.js"),__vite__mapDeps([18,19])),r(()=>import("./engine-javascript-PwbX1GN8.js"),[]),r(()=>import("./vitesse-dark-D0r3Knsf.js"),[]).then(i=>i.default),r(()=>import("./vitesse-light-CVO1_9PV.js"),[]).then(i=>i.default)]);k=e({themes:[t,n],langs:[],engine:o()})}return k}async function ie(e,o){const t=ae[o]||o;if(H.has(t))return t;const n=se[t];if(!n)return"text";try{const i=await n();return await e.loadLanguage(i),H.add(t),t}catch{return"text"}}function me({content:e,ariaLabel:o,language:t="text",filename:n,className:i,isStreaming:s=!1}){const f=Z(),[d,h]=_.useState(!1),[y,c]=_.useState(null),[I,T]=_.useState("text"),[x,g]=_.useState(),[E,a]=_.useState(!1),v=_.useMemo(()=>e,[e]),L=F(t||"text"),w=f==="dark"?"vitesse-dark":"vitesse-light";_.useEffect(()=>{let p=!0,b=null;const V=re(L);if(T(V),s)return c(null),()=>{p=!1};async function B(){try{const R=await oe();if(!p)return;const C=await ie(R,V);if(!p)return;const J=R.codeToHtml(e,{lang:C,theme:w});if(p){T(C),c(J);const U=R.getTheme(w);g(U.bg)}}catch{p&&c(null)}}return b=window.setTimeout(()=>{B()},160),()=>{p=!1,b&&window.clearTimeout(b)}},[e,s,L,w]),_.useEffect(()=>{if(typeof window>"u")return;const p=window.localStorage.getItem("opencami-code-wrap");a(p==="1")},[]);function l(){a(p=>{const b=!p;return typeof window<"u"&&window.localStorage.setItem("opencami-code-wrap",b?"1":"0"),b})}async function m(){try{await navigator.clipboard.writeText(e),h(!0),window.setTimeout(()=>h(!1),1600)}catch{h(!1)}}const M=!(e.replace(/\n$/,"").split(`
|
|
3
|
+
`).length<=1),W=ne(I);return u.jsxs("div",{className:P("code-block group relative w-full min-w-0 max-w-full overflow-hidden rounded-lg border border-primary-200",i),children:[u.jsxs("div",{className:P("flex items-center justify-between px-3 pt-2"),style:{backgroundColor:x},children:[u.jsx("span",{className:"text-xs font-medium text-primary-500 flex items-center gap-1.5 min-w-0",children:n?u.jsxs(u.Fragment,{children:[u.jsx(A,{icon:q,size:14,strokeWidth:1.8}),u.jsx("span",{className:"truncate",children:n})]}):W}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs(N,{variant:"ghost","aria-label":E?"Disable wrap":"Enable wrap",className:"h-auto px-0 text-xs font-medium text-primary-500 hover:text-primary-800 hover:bg-transparent",onClick:l,children:[u.jsx(A,{icon:z,size:14,strokeWidth:1.8}),E?"No wrap":"Wrap"]}),u.jsxs(N,{variant:"ghost","aria-label":o??"Copy code",className:"h-auto px-0 text-xs font-medium text-primary-500 hover:text-primary-800 hover:bg-transparent",onClick:()=>{m().catch(()=>{})},children:[u.jsx(A,{icon:d?G:X,size:14,strokeWidth:1.8}),d?"Copied":"Copy"]})]})]}),y?u.jsx("div",{className:P("w-full min-w-0 max-w-full text-sm text-primary-900 overflow-x-hidden [&>pre]:w-full [&>pre]:min-w-0 [&>pre]:max-w-full [&>pre]:px-3 [&>pre]:py-3",E?"[&>pre]:whitespace-pre-wrap [&>pre]:break-words [&_.line]:whitespace-pre-wrap [&_.line]:break-words":"overflow-x-auto [&>pre]:whitespace-pre [&>pre]:overflow-x-auto",M&&"[&>pre]:[counter-reset:line] [&_.line]:before:content-[counter(line)] [&_.line]:before:[counter-increment:line] [&_.line]:before:inline-block [&_.line]:before:w-8 [&_.line]:before:mr-4 [&_.line]:before:text-right [&_.line]:before:select-none [&_.line]:before:text-primary-500/60"),dangerouslySetInnerHTML:{__html:y}}):u.jsx("pre",{className:P("w-full min-w-0 max-w-full text-sm px-3 py-3 overflow-x-auto",E?"whitespace-pre-wrap break-words":"whitespace-pre overflow-x-auto"),children:u.jsx("code",{className:"block",children:v})})]})}export{me as C,K as p,re as r,de as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./main-
|
|
1
|
+
import{j as e}from"./main-CbISK-pm.js";import{D as l,a as c,b as p,c as d,d as m}from"./use-file-explorer-state-Dwhw6Mpg.js";import{B as x}from"./button-Bv-7bwZZ.js";import"./useOnFirstRender-DpB3w0o4.js";import"./useBaseUiId-BdQC9KF3.js";import"./event-Cnr9OETn.js";import"./visuallyHidden-COI6QeQH.js";import"./composite-DwQIZFe9.js";import"./react-C_7UlEtd.js";const s=typeof navigator<"u"&&navigator.platform.toUpperCase().indexOf("MAC")>=0,h=[{keys:[s?"⌘":"Ctrl","K"],description:"Start a new chat"},{keys:[s?"⌘":"Ctrl","F"],description:"Search current conversation"},{keys:[s?"⌘":"Ctrl","Shift","F"],description:"Search all conversations"},{keys:[s?"⌘":"Ctrl","/"],description:"Focus message input"},{keys:["Esc"],description:"Close dialogs / Clear focus"},{keys:[s?"⌘":"Ctrl","Shift","C"],description:"Copy last response"},{keys:["?"],description:"Show this help dialog"}];function v({open:t,onOpenChange:a}){return e.jsx(l,{open:t,onOpenChange:a,children:e.jsx(c,{className:"w-[min(500px,92vw)]",children:e.jsxs("div",{className:"p-6",children:[e.jsx(p,{className:"mb-2",children:"Keyboard Shortcuts"}),e.jsx(d,{className:"mb-6",children:"Speed up your workflow with these keyboard shortcuts"}),e.jsx("div",{className:"space-y-3",children:h.map((r,o)=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-primary-100 last:border-0",children:[e.jsx("span",{className:"text-sm text-primary-700",children:r.description}),e.jsx("div",{className:"flex items-center gap-1",children:r.keys.map((n,i)=>e.jsxs("span",{className:"inline-flex items-center",children:[e.jsx("kbd",{className:"px-2 py-1 text-xs font-semibold text-primary-800 bg-primary-100 border border-primary-200 rounded",children:n}),i<r.keys.length-1&&e.jsx("span",{className:"mx-1 text-primary-400",children:"+"})]},i))})]},o))}),e.jsx("div",{className:"mt-6 flex justify-end",children:e.jsx(m,{children:e.jsx(x,{variant:"outline",children:"Close"})})})]})})})}export{v as KeyboardShortcutsDialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dashboard-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dashboard-y8KVUVF-.js","assets/useQuery-_BEWdUe1.js","assets/connect-DZSrhhNT.js","assets/index-BZxJSF4T.js","assets/button-Bv-7bwZZ.js","assets/react-C_7UlEtd.js","assets/_sessionKey-CTtu2ipR.js","assets/tooltip-DzFgDY86.js","assets/useOnFirstRender-DpB3w0o4.js","assets/useBaseUiId-BdQC9KF3.js","assets/event-Cnr9OETn.js","assets/visuallyHidden-COI6QeQH.js","assets/DirectionContext-BOL0P_1j.js","assets/useMutation-CMp81lDO.js","assets/use-file-explorer-state-Dwhw6Mpg.js","assets/composite-DwQIZFe9.js","assets/useControlled-Bc2Emhlx.js","assets/CSPContext-CxrBvJ99.js","assets/menu-DRjoHFvG.js","assets/useCompositeItem-BI09zNFD.js","assets/opencami-logo-D2mv84sX.js","assets/proxy-DtxqfBHY.js","assets/markdown-UD7RzskQ.js","assets/index-T4TOjvD0.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function Y0(a,i){for(var s=0;s<i.length;s++){const r=i[s];if(typeof r!="string"&&!Array.isArray(r)){for(const c in r)if(c!=="default"&&!(c in a)){const f=Object.getOwnPropertyDescriptor(r,c);f&&Object.defineProperty(a,c,f.get?f:{enumerable:!0,get:()=>r[c]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}function Q0(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var fc={exports:{}},Hi={};var ip;function G0(){if(ip)return Hi;ip=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(r,c,f){var y=null;if(f!==void 0&&(y=""+f),c.key!==void 0&&(y=""+c.key),"key"in c){f={};for(var h in c)h!=="key"&&(f[h]=c[h])}else f=c;return c=f.ref,{$$typeof:a,type:r,key:y,ref:c!==void 0?c:null,props:f}}return Hi.Fragment=i,Hi.jsx=s,Hi.jsxs=s,Hi}var sp;function V0(){return sp||(sp=1,fc.exports=G0()),fc.exports}var Z=V0(),dc={exports:{}},rt={};var up;function X0(){if(up)return rt;up=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),y=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),_=Symbol.iterator;function E(O){return O===null||typeof O!="object"?null:(O=_&&O[_]||O["@@iterator"],typeof O=="function"?O:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,w={};function L(O,Q,J){this.props=O,this.context=Q,this.refs=w,this.updater=J||M}L.prototype.isReactComponent={},L.prototype.setState=function(O,Q){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,Q,"setState")},L.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function V(){}V.prototype=L.prototype;function X(O,Q,J){this.props=O,this.context=Q,this.refs=w,this.updater=J||M}var q=X.prototype=new V;q.constructor=X,C(q,L.prototype),q.isPureReactComponent=!0;var F=Array.isArray;function I(){}var K={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function k(O,Q,J){var $=J.ref;return{$$typeof:a,type:O,key:Q,ref:$!==void 0?$:null,props:J}}function ct(O,Q){return k(O.type,Q,O.props)}function it(O){return typeof O=="object"&&O!==null&&O.$$typeof===a}function nt(O){var Q={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(J){return Q[J]})}var Bt=/\/+/g;function Rt(O,Q){return typeof O=="object"&&O!==null&&O.key!=null?nt(""+O.key):Q.toString(36)}function Kt(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(I,I):(O.status="pending",O.then(function(Q){O.status==="pending"&&(O.status="fulfilled",O.value=Q)},function(Q){O.status==="pending"&&(O.status="rejected",O.reason=Q)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function j(O,Q,J,$,at){var dt=typeof O;(dt==="undefined"||dt==="boolean")&&(O=null);var vt=!1;if(O===null)vt=!0;else switch(dt){case"bigint":case"string":case"number":vt=!0;break;case"object":switch(O.$$typeof){case a:case i:vt=!0;break;case v:return vt=O._init,j(vt(O._payload),Q,J,$,at)}}if(vt)return at=at(O),vt=$===""?"."+Rt(O,0):$,F(at)?(J="",vt!=null&&(J=vt.replace(Bt,"$&/")+"/"),j(at,Q,J,"",function(on){return on})):at!=null&&(it(at)&&(at=ct(at,J+(at.key==null||O&&O.key===at.key?"":(""+at.key).replace(Bt,"$&/")+"/")+vt)),Q.push(at)),1;vt=0;var Gt=$===""?".":$+":";if(F(O))for(var Ut=0;Ut<O.length;Ut++)$=O[Ut],dt=Gt+Rt($,Ut),vt+=j($,Q,J,dt,at);else if(Ut=E(O),typeof Ut=="function")for(O=Ut.call(O),Ut=0;!($=O.next()).done;)$=$.value,dt=Gt+Rt($,Ut++),vt+=j($,Q,J,dt,at);else if(dt==="object"){if(typeof O.then=="function")return j(Kt(O),Q,J,$,at);throw Q=String(O),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return vt}function P(O,Q,J){if(O==null)return O;var $=[],at=0;return j(O,$,"","",function(dt){return Q.call(J,dt,at++)}),$}function ut(O){if(O._status===-1){var Q=O._result;Q=Q(),Q.then(function(J){(O._status===0||O._status===-1)&&(O._status=1,O._result=J)},function(J){(O._status===0||O._status===-1)&&(O._status=2,O._result=J)}),O._status===-1&&(O._status=0,O._result=Q)}if(O._status===1)return O._result.default;throw O._result}var wt=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},Tt={map:P,forEach:function(O,Q,J){P(O,function(){Q.apply(this,arguments)},J)},count:function(O){var Q=0;return P(O,function(){Q++}),Q},toArray:function(O){return P(O,function(Q){return Q})||[]},only:function(O){if(!it(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return rt.Activity=S,rt.Children=Tt,rt.Component=L,rt.Fragment=s,rt.Profiler=c,rt.PureComponent=X,rt.StrictMode=r,rt.Suspense=p,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,rt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return K.H.useMemoCache(O)}},rt.cache=function(O){return function(){return O.apply(null,arguments)}},rt.cacheSignal=function(){return null},rt.cloneElement=function(O,Q,J){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var $=C({},O.props),at=O.key;if(Q!=null)for(dt in Q.key!==void 0&&(at=""+Q.key),Q)!G.call(Q,dt)||dt==="key"||dt==="__self"||dt==="__source"||dt==="ref"&&Q.ref===void 0||($[dt]=Q[dt]);var dt=arguments.length-2;if(dt===1)$.children=J;else if(1<dt){for(var vt=Array(dt),Gt=0;Gt<dt;Gt++)vt[Gt]=arguments[Gt+2];$.children=vt}return k(O.type,at,$)},rt.createContext=function(O){return O={$$typeof:y,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:f,_context:O},O},rt.createElement=function(O,Q,J){var $,at={},dt=null;if(Q!=null)for($ in Q.key!==void 0&&(dt=""+Q.key),Q)G.call(Q,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(at[$]=Q[$]);var vt=arguments.length-2;if(vt===1)at.children=J;else if(1<vt){for(var Gt=Array(vt),Ut=0;Ut<vt;Ut++)Gt[Ut]=arguments[Ut+2];at.children=Gt}if(O&&O.defaultProps)for($ in vt=O.defaultProps,vt)at[$]===void 0&&(at[$]=vt[$]);return k(O,dt,at)},rt.createRef=function(){return{current:null}},rt.forwardRef=function(O){return{$$typeof:h,render:O}},rt.isValidElement=it,rt.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:ut}},rt.memo=function(O,Q){return{$$typeof:m,type:O,compare:Q===void 0?null:Q}},rt.startTransition=function(O){var Q=K.T,J={};K.T=J;try{var $=O(),at=K.S;at!==null&&at(J,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(I,wt)}catch(dt){wt(dt)}finally{Q!==null&&J.types!==null&&(Q.types=J.types),K.T=Q}},rt.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},rt.use=function(O){return K.H.use(O)},rt.useActionState=function(O,Q,J){return K.H.useActionState(O,Q,J)},rt.useCallback=function(O,Q){return K.H.useCallback(O,Q)},rt.useContext=function(O){return K.H.useContext(O)},rt.useDebugValue=function(){},rt.useDeferredValue=function(O,Q){return K.H.useDeferredValue(O,Q)},rt.useEffect=function(O,Q){return K.H.useEffect(O,Q)},rt.useEffectEvent=function(O){return K.H.useEffectEvent(O)},rt.useId=function(){return K.H.useId()},rt.useImperativeHandle=function(O,Q,J){return K.H.useImperativeHandle(O,Q,J)},rt.useInsertionEffect=function(O,Q){return K.H.useInsertionEffect(O,Q)},rt.useLayoutEffect=function(O,Q){return K.H.useLayoutEffect(O,Q)},rt.useMemo=function(O,Q){return K.H.useMemo(O,Q)},rt.useOptimistic=function(O,Q){return K.H.useOptimistic(O,Q)},rt.useReducer=function(O,Q,J){return K.H.useReducer(O,Q,J)},rt.useRef=function(O){return K.H.useRef(O)},rt.useState=function(O){return K.H.useState(O)},rt.useSyncExternalStore=function(O,Q,J){return K.H.useSyncExternalStore(O,Q,J)},rt.useTransition=function(){return K.H.useTransition()},rt.version="19.2.4",rt}var rp;function $i(){return rp||(rp=1,dc.exports=X0()),dc.exports}var et=$i();const Ql=Q0(et),K0=Y0({__proto__:null,default:Ql},[et]);var hc={exports:{}},qi={},mc={exports:{}},pc={};var op;function Z0(){return op||(op=1,(function(a){function i(j,P){var ut=j.length;j.push(P);t:for(;0<ut;){var wt=ut-1>>>1,Tt=j[wt];if(0<c(Tt,P))j[wt]=P,j[ut]=Tt,ut=wt;else break t}}function s(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var P=j[0],ut=j.pop();if(ut!==P){j[0]=ut;t:for(var wt=0,Tt=j.length,O=Tt>>>1;wt<O;){var Q=2*(wt+1)-1,J=j[Q],$=Q+1,at=j[$];if(0>c(J,ut))$<Tt&&0>c(at,J)?(j[wt]=at,j[$]=ut,wt=$):(j[wt]=J,j[Q]=ut,wt=Q);else if($<Tt&&0>c(at,ut))j[wt]=at,j[$]=ut,wt=$;else break t}}return P}function c(j,P){var ut=j.sortIndex-P.sortIndex;return ut!==0?ut:j.id-P.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var y=Date,h=y.now();a.unstable_now=function(){return y.now()-h}}var p=[],m=[],v=1,S=null,_=3,E=!1,M=!1,C=!1,w=!1,L=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function q(j){for(var P=s(m);P!==null;){if(P.callback===null)r(m);else if(P.startTime<=j)r(m),P.sortIndex=P.expirationTime,i(p,P);else break;P=s(m)}}function F(j){if(C=!1,q(j),!M)if(s(p)!==null)M=!0,I||(I=!0,nt());else{var P=s(m);P!==null&&Kt(F,P.startTime-j)}}var I=!1,K=-1,G=5,k=-1;function ct(){return w?!0:!(a.unstable_now()-k<G)}function it(){if(w=!1,I){var j=a.unstable_now();k=j;var P=!0;try{t:{M=!1,C&&(C=!1,V(K),K=-1),E=!0;var ut=_;try{e:{for(q(j),S=s(p);S!==null&&!(S.expirationTime>j&&ct());){var wt=S.callback;if(typeof wt=="function"){S.callback=null,_=S.priorityLevel;var Tt=wt(S.expirationTime<=j);if(j=a.unstable_now(),typeof Tt=="function"){S.callback=Tt,q(j),P=!0;break e}S===s(p)&&r(p),q(j)}else r(p);S=s(p)}if(S!==null)P=!0;else{var O=s(m);O!==null&&Kt(F,O.startTime-j),P=!1}}break t}finally{S=null,_=ut,E=!1}P=void 0}}finally{P?nt():I=!1}}}var nt;if(typeof X=="function")nt=function(){X(it)};else if(typeof MessageChannel<"u"){var Bt=new MessageChannel,Rt=Bt.port2;Bt.port1.onmessage=it,nt=function(){Rt.postMessage(null)}}else nt=function(){L(it,0)};function Kt(j,P){K=L(function(){j(a.unstable_now())},P)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(j){j.callback=null},a.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<j?Math.floor(1e3/j):5},a.unstable_getCurrentPriorityLevel=function(){return _},a.unstable_next=function(j){switch(_){case 1:case 2:case 3:var P=3;break;default:P=_}var ut=_;_=P;try{return j()}finally{_=ut}},a.unstable_requestPaint=function(){w=!0},a.unstable_runWithPriority=function(j,P){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var ut=_;_=j;try{return P()}finally{_=ut}},a.unstable_scheduleCallback=function(j,P,ut){var wt=a.unstable_now();switch(typeof ut=="object"&&ut!==null?(ut=ut.delay,ut=typeof ut=="number"&&0<ut?wt+ut:wt):ut=wt,j){case 1:var Tt=-1;break;case 2:Tt=250;break;case 5:Tt=1073741823;break;case 4:Tt=1e4;break;default:Tt=5e3}return Tt=ut+Tt,j={id:v++,callback:P,priorityLevel:j,startTime:ut,expirationTime:Tt,sortIndex:-1},ut>wt?(j.sortIndex=ut,i(m,j),s(p)===null&&j===s(m)&&(C?(V(K),K=-1):C=!0,Kt(F,ut-wt))):(j.sortIndex=Tt,i(p,j),M||E||(M=!0,I||(I=!0,nt()))),j},a.unstable_shouldYield=ct,a.unstable_wrapCallback=function(j){var P=_;return function(){var ut=_;_=P;try{return j.apply(this,arguments)}finally{_=ut}}}})(pc)),pc}var cp;function P0(){return cp||(cp=1,mc.exports=Z0()),mc.exports}var yc={exports:{}},oe={};var fp;function k0(){if(fp)return oe;fp=1;var a=$i();function i(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(i(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},c=Symbol.for("react.portal");function f(p,m,v){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:S==null?null:""+S,children:p,containerInfo:m,implementation:v}}var y=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return oe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,oe.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return f(p,m,null,v)},oe.flushSync=function(p){var m=y.T,v=r.p;try{if(y.T=null,r.p=2,p)return p()}finally{y.T=m,r.p=v,r.d.f()}},oe.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(p,m))},oe.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},oe.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,S=h(v,m.crossOrigin),_=typeof m.integrity=="string"?m.integrity:void 0,E=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?r.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:S,integrity:_,fetchPriority:E}):v==="script"&&r.d.X(p,{crossOrigin:S,integrity:_,fetchPriority:E,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},oe.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=h(m.as,m.crossOrigin);r.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(p)},oe.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,S=h(v,m.crossOrigin);r.d.L(p,v,{crossOrigin:S,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},oe.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=h(m.as,m.crossOrigin);r.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(p)},oe.requestFormReset=function(p){r.d.r(p)},oe.unstable_batchedUpdates=function(p,m){return p(m)},oe.useFormState=function(p,m,v){return y.H.useFormState(p,m,v)},oe.useFormStatus=function(){return y.H.useHostTransitionStatus()},oe.version="19.2.4",oe}var dp;function sy(){if(dp)return yc.exports;dp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),yc.exports=k0(),yc.exports}var hp;function J0(){if(hp)return qi;hp=1;var a=P0(),i=$i(),s=sy();function r(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function y(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function h(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function p(t){if(f(t)!==t)throw Error(r(188))}function m(t){var e=t.alternate;if(!e){if(e=f(t),e===null)throw Error(r(188));return e!==t?null:t}for(var n=t,l=e;;){var u=n.return;if(u===null)break;var o=u.alternate;if(o===null){if(l=u.return,l!==null){n=l;continue}break}if(u.child===o.child){for(o=u.child;o;){if(o===n)return p(u),t;if(o===l)return p(u),e;o=o.sibling}throw Error(r(188))}if(n.return!==l.return)n=u,l=o;else{for(var d=!1,g=u.child;g;){if(g===n){d=!0,n=u,l=o;break}if(g===l){d=!0,l=u,n=o;break}g=g.sibling}if(!d){for(g=o.child;g;){if(g===n){d=!0,n=o,l=u;break}if(g===l){d=!0,l=o,n=u;break}g=g.sibling}if(!d)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?t:e}function v(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=v(t),e!==null)return e;t=t.sibling}return null}var S=Object.assign,_=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),X=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),ct=Symbol.for("react.memo_cache_sentinel"),it=Symbol.iterator;function nt(t){return t===null||typeof t!="object"?null:(t=it&&t[it]||t["@@iterator"],typeof t=="function"?t:null)}var Bt=Symbol.for("react.client.reference");function Rt(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Bt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case L:return"Profiler";case w:return"StrictMode";case F:return"Suspense";case I:return"SuspenseList";case k:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case M:return"Portal";case X:return t.displayName||"Context";case V:return(t._context.displayName||"Context")+".Consumer";case q:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case K:return e=t.displayName||null,e!==null?e:Rt(t.type)||"Memo";case G:e=t._payload,t=t._init;try{return Rt(t(e))}catch{}}return null}var Kt=Array.isArray,j=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut={pending:!1,data:null,method:null,action:null},wt=[],Tt=-1;function O(t){return{current:t}}function Q(t){0>Tt||(t.current=wt[Tt],wt[Tt]=null,Tt--)}function J(t,e){Tt++,wt[Tt]=t.current,t.current=e}var $=O(null),at=O(null),dt=O(null),vt=O(null);function Gt(t,e){switch(J(dt,e),J(at,t),J($,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Mm(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Mm(e),t=xm(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Q($),J($,t)}function Ut(){Q($),Q(at),Q(dt)}function on(t){t.memoizedState!==null&&J(vt,t);var e=$.current,n=xm(e,t.type);e!==n&&(J(at,t),J($,n))}function cn(t){at.current===t&&(Q($),Q(at)),vt.current===t&&(Q(vt),Ui._currentValue=ut)}var Nn,Vl;function Ie(t){if(Nn===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Nn=e&&e[1]||"",Vl=-1<n.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+Nn+t+Vl}var Xl=!1;function Za(t,e){if(!t||Xl)return"";Xl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(e){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(N){var U=N}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(N){U=N}t.call(Y.prototype)}}else{try{throw Error()}catch(N){U=N}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(N){if(N&&U&&typeof N.stack=="string")return[N.stack,U.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),d=o[0],g=o[1];if(d&&g){var R=d.split(`
|
|
@@ -15,7 +15,7 @@ Error generating stack: `+l.message+`
|
|
|
15
15
|
`)}else{const m=c.indexOf(`
|
|
16
16
|
`);if(m>=0){const v=c.slice(0,m).trim();c=c.slice(m+1),v.length>0&&(y=JSON.parse(v),f=!0)}}}return(async()=>{try{for(;;){const{value:h,done:p}=await r.read();h&&(c+=h);const m=c.lastIndexOf(`
|
|
17
17
|
`);if(m>=0){const v=c.slice(0,m);c=c.slice(m+1);const S=v.split(`
|
|
18
|
-
`).filter(Boolean);for(const _ of S)try{i(JSON.parse(_))}catch(E){s?.(`Invalid JSON line: ${_}`,E)}}if(p)break}}catch(h){s?.("Stream processing error:",h)}})(),i(y)}async function vR({jsonStream:a,onMessage:i,onError:s}){const r=a.getReader(),{value:c,done:f}=await r.read();if(f||!c)throw new Error("Stream ended before first object");const y=JSON.parse(c);return(async()=>{try{for(;;){const{value:h,done:p}=await r.read();if(p)break;if(h)try{i(JSON.parse(h))}catch(m){s?.(`Invalid JSON: ${h}`,m)}}}catch(h){s?.("Stream processing error:",h)}})(),i(y)}function SR(a){const i="/_serverFn/"+a;return Object.assign((...c)=>{const f=fg()?.serverFns?.fetch;return mR(i,c,f??fetch)},{url:i,serverFnMeta:{id:a},[jc]:!0})}const bR={key:"$TSS/serverfn",test:a=>typeof a!="function"||!(jc in a)?!1:!!a[jc],toSerializable:({serverFnMeta:a})=>({functionId:a.id}),fromSerializable:({functionId:a})=>SR(a)};var Ju=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_R={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},ER=class{#t=_R;#n=!1;setTimeoutProvider(a){this.#t=a}setTimeout(a,i){return this.#t.setTimeout(a,i)}clearTimeout(a){this.#t.clearTimeout(a)}setInterval(a,i){return this.#t.setInterval(a,i)}clearInterval(a){this.#t.clearInterval(a)}},Bc=new ER;function RR(a){setTimeout(a,0)}var Fu=typeof window>"u"||"Deno"in globalThis;function Fe(){}function TR(a,i){return typeof a=="function"?a(i):a}function wR(a){return typeof a=="number"&&a>=0&&a!==1/0}function AR(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Hc(a,i){return typeof a=="function"?a(i):a}function OR(a,i){return typeof a=="function"?a(i):a}function $p(a,i){const{type:s="all",exact:r,fetchStatus:c,predicate:f,queryKey:y,stale:h}=a;if(y){if(r){if(i.queryHash!==sf(y,i.options))return!1}else if(!Fi(i.queryKey,y))return!1}if(s!=="all"){const p=i.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof h=="boolean"&&i.isStale()!==h||c&&c!==i.state.fetchStatus||f&&!f(i))}function Ip(a,i){const{exact:s,status:r,predicate:c,mutationKey:f}=a;if(f){if(!i.options.mutationKey)return!1;if(s){if(Ji(i.options.mutationKey)!==Ji(f))return!1}else if(!Fi(i.options.mutationKey,f))return!1}return!(r&&i.state.status!==r||c&&!c(i))}function sf(a,i){return(i?.queryKeyHashFn||Ji)(a)}function Ji(a){return JSON.stringify(a,(i,s)=>qc(s)?Object.keys(s).sort().reduce((r,c)=>(r[c]=s[c],r),{}):s)}function Fi(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(s=>Fi(a[s],i[s])):!1}var MR=Object.prototype.hasOwnProperty;function pg(a,i,s=0){if(a===i)return a;if(s>500)return i;const r=Wp(a)&&Wp(i);if(!r&&!(qc(a)&&qc(i)))return i;const f=(r?a:Object.keys(a)).length,y=r?i:Object.keys(i),h=y.length,p=r?new Array(h):{};let m=0;for(let v=0;v<h;v++){const S=r?v:y[v],_=a[S],E=i[S];if(_===E){p[S]=_,(r?v<f:MR.call(a,S))&&m++;continue}if(_===null||E===null||typeof _!="object"||typeof E!="object"){p[S]=E;continue}const M=pg(_,E,s+1);p[S]=M,M===_&&m++}return f===h&&m===f?a:p}function eT(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const s in a)if(a[s]!==i[s])return!1;return!0}function Wp(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function qc(a){if(!ty(a))return!1;const i=a.constructor;if(i===void 0)return!0;const s=i.prototype;return!(!ty(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function ty(a){return Object.prototype.toString.call(a)==="[object Object]"}function xR(a){return new Promise(i=>{Bc.setTimeout(i,a)})}function CR(a,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(a,i):s.structuralSharing!==!1?pg(a,i):i}function zR(a,i,s=0){const r=[...a,i];return s&&r.length>s?r.slice(1):r}function DR(a,i,s=0){const r=[i,...a];return s&&r.length>s?r.slice(0,-1):r}var uf=Symbol();function yg(a,i){return!a.queryFn&&i?.initialPromise?()=>i.initialPromise:!a.queryFn||a.queryFn===uf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function nT(a,i){return typeof a=="function"?a(...i):!!a}function LR(a,i,s){let r=!1,c;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(c??=i(),r||(r=!0,c.aborted?s():c.addEventListener("abort",s,{once:!0})),c)}),a}var UR=class extends Ju{#t;#n;#e;constructor(){super(),this.#e=a=>{if(!Fu&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(a){this.#t!==a&&(this.#t=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},gg=new UR;function NR(){let a,i;const s=new Promise((c,f)=>{a=c,i=f});s.status="pending",s.catch(()=>{});function r(c){Object.assign(s,c),delete s.resolve,delete s.reject}return s.resolve=c=>{r({status:"fulfilled",value:c}),a(c)},s.reject=c=>{r({status:"rejected",reason:c}),i(c)},s}var jR=RR;function BR(){let a=[],i=0,s=h=>{h()},r=h=>{h()},c=jR;const f=h=>{i?a.push(h):c(()=>{s(h)})},y=()=>{const h=a;a=[],h.length&&c(()=>{r(()=>{h.forEach(p=>{s(p)})})})};return{batch:h=>{let p;i++;try{p=h()}finally{i--,i||y()}return p},batchCalls:h=>(...p)=>{f(()=>{h(...p)})},schedule:f,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{r=h},setScheduler:h=>{c=h}}}var he=BR(),HR=class extends Ju{#t=!0;#n;#e;constructor(){super(),this.#e=a=>{if(!Fu&&window.addEventListener){const i=()=>a(!0),s=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(this.setOnline.bind(this))}setOnline(a){this.#t!==a&&(this.#t=a,this.listeners.forEach(s=>{s(a)}))}isOnline(){return this.#t}},qu=new HR;function qR(a){return Math.min(1e3*2**a,3e4)}function vg(a){return(a??"online")==="online"?qu.isOnline():!0}var Yc=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function Sg(a){let i=!1,s=0,r;const c=NR(),f=()=>c.status!=="pending",y=C=>{if(!f()){const w=new Yc(C);_(w),a.onCancel?.(w)}},h=()=>{i=!0},p=()=>{i=!1},m=()=>gg.isFocused()&&(a.networkMode==="always"||qu.isOnline())&&a.canRun(),v=()=>vg(a.networkMode)&&a.canRun(),S=C=>{f()||(r?.(),c.resolve(C))},_=C=>{f()||(r?.(),c.reject(C))},E=()=>new Promise(C=>{r=w=>{(f()||m())&&C(w)},a.onPause?.()}).then(()=>{r=void 0,f()||a.onContinue?.()}),M=()=>{if(f())return;let C;const w=s===0?a.initialPromise:void 0;try{C=w??a.fn()}catch(L){C=Promise.reject(L)}Promise.resolve(C).then(S).catch(L=>{if(f())return;const V=a.retry??(Fu?0:3),X=a.retryDelay??qR,q=typeof X=="function"?X(s,L):X,F=V===!0||typeof V=="number"&&s<V||typeof V=="function"&&V(s,L);if(i||!F){_(L);return}s++,a.onFail?.(s,L),xR(q).then(()=>m()?void 0:E()).then(()=>{i?_(L):M()})})};return{promise:c,status:()=>c.status,cancel:y,continue:()=>(r?.(),c),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?M():E().then(M),c)}}var bg=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wR(this.gcTime)&&(this.#t=Bc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Fu?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Bc.clearTimeout(this.#t),this.#t=void 0)}},YR=class extends bg{#t;#n;#e;#l;#a;#s;#u;constructor(a){super(),this.#u=!1,this.#s=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#l=a.client,this.#e=this.#l.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#t=ny(this.options),this.state=a.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(a){if(this.options={...this.#s,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=ny(this.options);i.data!==void 0&&(this.setState(ey(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#e.remove(this)}setData(a,i){const s=CR(this.state.data,a,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),s}setState(a,i){this.#i({type:"setState",state:a,setStateOptions:i})}cancel(a){const i=this.#a?.promise;return this.#a?.cancel(a),i?i.then(Fe).catch(Fe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(a=>OR(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Hc(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!AR(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(this.#a&&(this.#u?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#e.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(a,i){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(a&&this.setOptions(a),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#u=!0,s.signal)})},c=()=>{const h=yg(this.options,i),m=(()=>{const v={client:this.#l,queryKey:this.queryKey,meta:this.meta};return r(v),v})();return this.#u=!1,this.options.persister?this.options.persister(h,m,this):h(m)},y=(()=>{const h={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:c};return r(h),h})();this.options.behavior?.onFetch(y,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==y.fetchOptions?.meta)&&this.#i({type:"fetch",meta:y.fetchOptions?.meta}),this.#a=Sg({initialPromise:i?.initialPromise,fn:y.fetchFn,onCancel:h=>{h instanceof Yc&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#e.config.onSuccess?.(h,this),this.#e.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Yc){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#e.config.onError?.(h,this),this.#e.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(a){const i=s=>{switch(a.type){case"failed":return{...s,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...QR(s.data,this.options),fetchMeta:a.meta??null};case"success":const r={...s,...ey(a.data,a.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=a.manual?r:void 0,r;case"error":const c=a.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...a.state}}};this.state=i(this.state),he.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#e.notify({query:this,type:"updated",action:a})})}};function QR(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vg(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function ey(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ny(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,s=i!==void 0,r=s?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function ay(a){return{onFetch:(i,s)=>{const r=i.options,c=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],y=i.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const S=M=>{LR(M,()=>i.signal,()=>v=!0)},_=yg(i.options,i.fetchOptions),E=async(M,C,w)=>{if(v)return Promise.reject();if(C==null&&M.pages.length)return Promise.resolve(M);const V=(()=>{const I={client:i.client,queryKey:i.queryKey,pageParam:C,direction:w?"backward":"forward",meta:i.options.meta};return S(I),I})(),X=await _(V),{maxPages:q}=i.options,F=w?DR:zR;return{pages:F(M.pages,X,q),pageParams:F(M.pageParams,C,q)}};if(c&&f.length){const M=c==="backward",C=M?GR:ly,w={pages:f,pageParams:y},L=C(r,w);h=await E(w,L,M)}else{const M=a??f.length;do{const C=p===0?y[0]??r.initialPageParam:ly(r,h);if(p>0&&C==null)break;h=await E(h,C),p++}while(p<M)}return h};i.options.persister?i.fetchFn=()=>i.options.persister?.(m,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s):i.fetchFn=m}}}function ly(a,{pages:i,pageParams:s}){const r=i.length-1;return i.length>0?a.getNextPageParam(i[r],i,s[r],s):void 0}function GR(a,{pages:i,pageParams:s}){return i.length>0?a.getPreviousPageParam?.(i[0],i,s[0],s):void 0}var VR=class extends bg{#t;#n;#e;#l;constructor(a){super(),this.#t=a.client,this.mutationId=a.mutationId,this.#e=a.mutationCache,this.#n=[],this.state=a.state||XR(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#n.includes(a)||(this.#n.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#n=this.#n.filter(i=>i!==a),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(a){const i=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=Sg({fn:()=>this.options.mutationFn?this.options.mutationFn(a,s):Promise.reject(new Error("No mutationFn found")),onFail:(f,y)=>{this.#a({type:"failed",failureCount:f,error:y})},onPause:()=>{this.#a({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const r=this.state.status==="pending",c=!this.#l.canStart();try{if(r)i();else{this.#a({type:"pending",variables:a,isPaused:c}),this.#e.config.onMutate&&await this.#e.config.onMutate(a,this,s);const y=await this.options.onMutate?.(a,s);y!==this.state.context&&this.#a({type:"pending",context:y,variables:a,isPaused:c})}const f=await this.#l.start();return await this.#e.config.onSuccess?.(f,a,this.state.context,this,s),await this.options.onSuccess?.(f,a,this.state.context,s),await this.#e.config.onSettled?.(f,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(f,null,a,this.state.context,s),this.#a({type:"success",data:f}),f}catch(f){try{await this.#e.config.onError?.(f,a,this.state.context,this,s)}catch(y){Promise.reject(y)}try{await this.options.onError?.(f,a,this.state.context,s)}catch(y){Promise.reject(y)}try{await this.#e.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,s)}catch(y){Promise.reject(y)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,s)}catch(y){Promise.reject(y)}throw this.#a({type:"error",error:f}),f}finally{this.#e.runNext(this)}}#a(a){const i=s=>{switch(a.type){case"failed":return{...s,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...s,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:a.error,failureCount:s.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),he.batch(()=>{this.#n.forEach(s=>{s.onMutationUpdate(a)}),this.#e.notify({mutation:this,type:"updated",action:a})})}};function XR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var KR=class extends Ju{constructor(a={}){super(),this.config=a,this.#t=new Set,this.#n=new Map,this.#e=0}#t;#n;#e;build(a,i,s){const r=new VR({client:a,mutationCache:this,mutationId:++this.#e,options:a.defaultMutationOptions(i),state:s});return this.add(r),r}add(a){this.#t.add(a);const i=Ru(a);if(typeof i=="string"){const s=this.#n.get(i);s?s.push(a):this.#n.set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#t.delete(a)){const i=Ru(a);if(typeof i=="string"){const s=this.#n.get(i);if(s)if(s.length>1){const r=s.indexOf(a);r!==-1&&s.splice(r,1)}else s[0]===a&&this.#n.delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=Ru(a);if(typeof i=="string"){const r=this.#n.get(i)?.find(c=>c.state.status==="pending");return!r||r===a}else return!0}runNext(a){const i=Ru(a);return typeof i=="string"?this.#n.get(i)?.find(r=>r!==a&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){he.batch(()=>{this.#t.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#t.clear(),this.#n.clear()})}getAll(){return Array.from(this.#t)}find(a){const i={exact:!0,...a};return this.getAll().find(s=>Ip(i,s))}findAll(a={}){return this.getAll().filter(i=>Ip(a,i))}notify(a){he.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return he.batch(()=>Promise.all(a.map(i=>i.continue().catch(Fe))))}};function Ru(a){return a.options.scope?.id}var ZR=class extends Ju{constructor(a={}){super(),this.config=a,this.#t=new Map}#t;build(a,i,s){const r=i.queryKey,c=i.queryHash??sf(r,i);let f=this.get(c);return f||(f=new YR({client:a,queryKey:r,queryHash:c,options:a.defaultQueryOptions(i),state:s,defaultOptions:a.getQueryDefaults(r)}),this.add(f)),f}add(a){this.#t.has(a.queryHash)||(this.#t.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=this.#t.get(a.queryHash);i&&(a.destroy(),i===a&&this.#t.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){he.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#t.get(a)}getAll(){return[...this.#t.values()]}find(a){const i={exact:!0,...a};return this.getAll().find(s=>$p(i,s))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(s=>$p(a,s)):i}notify(a){he.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){he.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){he.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},PR=class{#t;#n;#e;#l;#a;#s;#u;#i;constructor(a={}){this.#t=a.queryCache||new ZR,this.#n=a.mutationCache||new KR,this.#e=a.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#u=gg.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=qu.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#u?.(),this.#u=void 0,this.#i?.(),this.#i=void 0)}isFetching(a){return this.#t.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#n.findAll({...a,status:"pending"}).length}getQueryData(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),s=this.#t.build(this,i),r=s.state.data;return r===void 0?this.fetchQuery(a):(a.revalidateIfStale&&s.isStaleByTime(Hc(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(r))}getQueriesData(a){return this.#t.findAll(a).map(({queryKey:i,state:s})=>{const r=s.data;return[i,r]})}setQueryData(a,i,s){const r=this.defaultQueryOptions({queryKey:a}),f=this.#t.get(r.queryHash)?.state.data,y=TR(i,f);if(y!==void 0)return this.#t.build(this,r).setData(y,{...s,manual:!0})}setQueriesData(a,i,s){return he.batch(()=>this.#t.findAll(a).map(({queryKey:r})=>[r,this.setQueryData(r,i,s)]))}getQueryState(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state}removeQueries(a){const i=this.#t;he.batch(()=>{i.findAll(a).forEach(s=>{i.remove(s)})})}resetQueries(a,i){const s=this.#t;return he.batch(()=>(s.findAll(a).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const s={revert:!0,...i},r=he.batch(()=>this.#t.findAll(a).map(c=>c.cancel(s)));return Promise.all(r).then(Fe).catch(Fe)}invalidateQueries(a,i={}){return he.batch(()=>(this.#t.findAll(a).forEach(s=>{s.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},i)))}refetchQueries(a,i={}){const s={...i,cancelRefetch:i.cancelRefetch??!0},r=he.batch(()=>this.#t.findAll(a).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,s);return s.throwOnError||(f=f.catch(Fe)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(r).then(Fe)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const s=this.#t.build(this,i);return s.isStaleByTime(Hc(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Fe).catch(Fe)}fetchInfiniteQuery(a){return a.behavior=ay(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Fe).catch(Fe)}ensureInfiniteQueryData(a){return a.behavior=ay(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return qu.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#n}getDefaultOptions(){return this.#e}setDefaultOptions(a){this.#e=a}setQueryDefaults(a,i){this.#l.set(Ji(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...this.#l.values()],s={};return i.forEach(r=>{Fi(a,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(a,i){this.#a.set(Ji(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...this.#a.values()],s={};return i.forEach(r=>{Fi(a,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(a){if(a._defaulted)return a;const i={...this.#e.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=sf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===uf&&(i.enabled=!1),i}defaultMutationOptions(a){return a?._defaulted?a:{...this.#e.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#t.clear(),this.#n.clear()}},_g=et.createContext(void 0),aT=a=>{const i=et.useContext(_g);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},kR=({client:a,children:i})=>(et.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),Z.jsx(_g.Provider,{value:a,children:i}));const JR="/assets/styles-D0L88B64.css",FR=`
|
|
18
|
+
`).filter(Boolean);for(const _ of S)try{i(JSON.parse(_))}catch(E){s?.(`Invalid JSON line: ${_}`,E)}}if(p)break}}catch(h){s?.("Stream processing error:",h)}})(),i(y)}async function vR({jsonStream:a,onMessage:i,onError:s}){const r=a.getReader(),{value:c,done:f}=await r.read();if(f||!c)throw new Error("Stream ended before first object");const y=JSON.parse(c);return(async()=>{try{for(;;){const{value:h,done:p}=await r.read();if(p)break;if(h)try{i(JSON.parse(h))}catch(m){s?.(`Invalid JSON: ${h}`,m)}}}catch(h){s?.("Stream processing error:",h)}})(),i(y)}function SR(a){const i="/_serverFn/"+a;return Object.assign((...c)=>{const f=fg()?.serverFns?.fetch;return mR(i,c,f??fetch)},{url:i,serverFnMeta:{id:a},[jc]:!0})}const bR={key:"$TSS/serverfn",test:a=>typeof a!="function"||!(jc in a)?!1:!!a[jc],toSerializable:({serverFnMeta:a})=>({functionId:a.id}),fromSerializable:({functionId:a})=>SR(a)};var Ju=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_R={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},ER=class{#t=_R;#n=!1;setTimeoutProvider(a){this.#t=a}setTimeout(a,i){return this.#t.setTimeout(a,i)}clearTimeout(a){this.#t.clearTimeout(a)}setInterval(a,i){return this.#t.setInterval(a,i)}clearInterval(a){this.#t.clearInterval(a)}},Bc=new ER;function RR(a){setTimeout(a,0)}var Fu=typeof window>"u"||"Deno"in globalThis;function Fe(){}function TR(a,i){return typeof a=="function"?a(i):a}function wR(a){return typeof a=="number"&&a>=0&&a!==1/0}function AR(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Hc(a,i){return typeof a=="function"?a(i):a}function OR(a,i){return typeof a=="function"?a(i):a}function $p(a,i){const{type:s="all",exact:r,fetchStatus:c,predicate:f,queryKey:y,stale:h}=a;if(y){if(r){if(i.queryHash!==sf(y,i.options))return!1}else if(!Fi(i.queryKey,y))return!1}if(s!=="all"){const p=i.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof h=="boolean"&&i.isStale()!==h||c&&c!==i.state.fetchStatus||f&&!f(i))}function Ip(a,i){const{exact:s,status:r,predicate:c,mutationKey:f}=a;if(f){if(!i.options.mutationKey)return!1;if(s){if(Ji(i.options.mutationKey)!==Ji(f))return!1}else if(!Fi(i.options.mutationKey,f))return!1}return!(r&&i.state.status!==r||c&&!c(i))}function sf(a,i){return(i?.queryKeyHashFn||Ji)(a)}function Ji(a){return JSON.stringify(a,(i,s)=>qc(s)?Object.keys(s).sort().reduce((r,c)=>(r[c]=s[c],r),{}):s)}function Fi(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(s=>Fi(a[s],i[s])):!1}var MR=Object.prototype.hasOwnProperty;function pg(a,i,s=0){if(a===i)return a;if(s>500)return i;const r=Wp(a)&&Wp(i);if(!r&&!(qc(a)&&qc(i)))return i;const f=(r?a:Object.keys(a)).length,y=r?i:Object.keys(i),h=y.length,p=r?new Array(h):{};let m=0;for(let v=0;v<h;v++){const S=r?v:y[v],_=a[S],E=i[S];if(_===E){p[S]=_,(r?v<f:MR.call(a,S))&&m++;continue}if(_===null||E===null||typeof _!="object"||typeof E!="object"){p[S]=E;continue}const M=pg(_,E,s+1);p[S]=M,M===_&&m++}return f===h&&m===f?a:p}function eT(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const s in a)if(a[s]!==i[s])return!1;return!0}function Wp(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function qc(a){if(!ty(a))return!1;const i=a.constructor;if(i===void 0)return!0;const s=i.prototype;return!(!ty(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function ty(a){return Object.prototype.toString.call(a)==="[object Object]"}function xR(a){return new Promise(i=>{Bc.setTimeout(i,a)})}function CR(a,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(a,i):s.structuralSharing!==!1?pg(a,i):i}function zR(a,i,s=0){const r=[...a,i];return s&&r.length>s?r.slice(1):r}function DR(a,i,s=0){const r=[i,...a];return s&&r.length>s?r.slice(0,-1):r}var uf=Symbol();function yg(a,i){return!a.queryFn&&i?.initialPromise?()=>i.initialPromise:!a.queryFn||a.queryFn===uf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function nT(a,i){return typeof a=="function"?a(...i):!!a}function LR(a,i,s){let r=!1,c;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(c??=i(),r||(r=!0,c.aborted?s():c.addEventListener("abort",s,{once:!0})),c)}),a}var UR=class extends Ju{#t;#n;#e;constructor(){super(),this.#e=a=>{if(!Fu&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(a){this.#t!==a&&(this.#t=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},gg=new UR;function NR(){let a,i;const s=new Promise((c,f)=>{a=c,i=f});s.status="pending",s.catch(()=>{});function r(c){Object.assign(s,c),delete s.resolve,delete s.reject}return s.resolve=c=>{r({status:"fulfilled",value:c}),a(c)},s.reject=c=>{r({status:"rejected",reason:c}),i(c)},s}var jR=RR;function BR(){let a=[],i=0,s=h=>{h()},r=h=>{h()},c=jR;const f=h=>{i?a.push(h):c(()=>{s(h)})},y=()=>{const h=a;a=[],h.length&&c(()=>{r(()=>{h.forEach(p=>{s(p)})})})};return{batch:h=>{let p;i++;try{p=h()}finally{i--,i||y()}return p},batchCalls:h=>(...p)=>{f(()=>{h(...p)})},schedule:f,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{r=h},setScheduler:h=>{c=h}}}var he=BR(),HR=class extends Ju{#t=!0;#n;#e;constructor(){super(),this.#e=a=>{if(!Fu&&window.addEventListener){const i=()=>a(!0),s=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(this.setOnline.bind(this))}setOnline(a){this.#t!==a&&(this.#t=a,this.listeners.forEach(s=>{s(a)}))}isOnline(){return this.#t}},qu=new HR;function qR(a){return Math.min(1e3*2**a,3e4)}function vg(a){return(a??"online")==="online"?qu.isOnline():!0}var Yc=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function Sg(a){let i=!1,s=0,r;const c=NR(),f=()=>c.status!=="pending",y=C=>{if(!f()){const w=new Yc(C);_(w),a.onCancel?.(w)}},h=()=>{i=!0},p=()=>{i=!1},m=()=>gg.isFocused()&&(a.networkMode==="always"||qu.isOnline())&&a.canRun(),v=()=>vg(a.networkMode)&&a.canRun(),S=C=>{f()||(r?.(),c.resolve(C))},_=C=>{f()||(r?.(),c.reject(C))},E=()=>new Promise(C=>{r=w=>{(f()||m())&&C(w)},a.onPause?.()}).then(()=>{r=void 0,f()||a.onContinue?.()}),M=()=>{if(f())return;let C;const w=s===0?a.initialPromise:void 0;try{C=w??a.fn()}catch(L){C=Promise.reject(L)}Promise.resolve(C).then(S).catch(L=>{if(f())return;const V=a.retry??(Fu?0:3),X=a.retryDelay??qR,q=typeof X=="function"?X(s,L):X,F=V===!0||typeof V=="number"&&s<V||typeof V=="function"&&V(s,L);if(i||!F){_(L);return}s++,a.onFail?.(s,L),xR(q).then(()=>m()?void 0:E()).then(()=>{i?_(L):M()})})};return{promise:c,status:()=>c.status,cancel:y,continue:()=>(r?.(),c),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?M():E().then(M),c)}}var bg=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wR(this.gcTime)&&(this.#t=Bc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Fu?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Bc.clearTimeout(this.#t),this.#t=void 0)}},YR=class extends bg{#t;#n;#e;#l;#a;#s;#u;constructor(a){super(),this.#u=!1,this.#s=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#l=a.client,this.#e=this.#l.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#t=ny(this.options),this.state=a.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(a){if(this.options={...this.#s,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=ny(this.options);i.data!==void 0&&(this.setState(ey(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#e.remove(this)}setData(a,i){const s=CR(this.state.data,a,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),s}setState(a,i){this.#i({type:"setState",state:a,setStateOptions:i})}cancel(a){const i=this.#a?.promise;return this.#a?.cancel(a),i?i.then(Fe).catch(Fe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(a=>OR(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Hc(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!AR(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(this.#a&&(this.#u?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#e.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(a,i){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(a&&this.setOptions(a),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#u=!0,s.signal)})},c=()=>{const h=yg(this.options,i),m=(()=>{const v={client:this.#l,queryKey:this.queryKey,meta:this.meta};return r(v),v})();return this.#u=!1,this.options.persister?this.options.persister(h,m,this):h(m)},y=(()=>{const h={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:c};return r(h),h})();this.options.behavior?.onFetch(y,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==y.fetchOptions?.meta)&&this.#i({type:"fetch",meta:y.fetchOptions?.meta}),this.#a=Sg({initialPromise:i?.initialPromise,fn:y.fetchFn,onCancel:h=>{h instanceof Yc&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#e.config.onSuccess?.(h,this),this.#e.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Yc){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#e.config.onError?.(h,this),this.#e.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(a){const i=s=>{switch(a.type){case"failed":return{...s,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...QR(s.data,this.options),fetchMeta:a.meta??null};case"success":const r={...s,...ey(a.data,a.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=a.manual?r:void 0,r;case"error":const c=a.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...a.state}}};this.state=i(this.state),he.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#e.notify({query:this,type:"updated",action:a})})}};function QR(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vg(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function ey(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ny(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,s=i!==void 0,r=s?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function ay(a){return{onFetch:(i,s)=>{const r=i.options,c=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],y=i.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const S=M=>{LR(M,()=>i.signal,()=>v=!0)},_=yg(i.options,i.fetchOptions),E=async(M,C,w)=>{if(v)return Promise.reject();if(C==null&&M.pages.length)return Promise.resolve(M);const V=(()=>{const I={client:i.client,queryKey:i.queryKey,pageParam:C,direction:w?"backward":"forward",meta:i.options.meta};return S(I),I})(),X=await _(V),{maxPages:q}=i.options,F=w?DR:zR;return{pages:F(M.pages,X,q),pageParams:F(M.pageParams,C,q)}};if(c&&f.length){const M=c==="backward",C=M?GR:ly,w={pages:f,pageParams:y},L=C(r,w);h=await E(w,L,M)}else{const M=a??f.length;do{const C=p===0?y[0]??r.initialPageParam:ly(r,h);if(p>0&&C==null)break;h=await E(h,C),p++}while(p<M)}return h};i.options.persister?i.fetchFn=()=>i.options.persister?.(m,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s):i.fetchFn=m}}}function ly(a,{pages:i,pageParams:s}){const r=i.length-1;return i.length>0?a.getNextPageParam(i[r],i,s[r],s):void 0}function GR(a,{pages:i,pageParams:s}){return i.length>0?a.getPreviousPageParam?.(i[0],i,s[0],s):void 0}var VR=class extends bg{#t;#n;#e;#l;constructor(a){super(),this.#t=a.client,this.mutationId=a.mutationId,this.#e=a.mutationCache,this.#n=[],this.state=a.state||XR(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#n.includes(a)||(this.#n.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#n=this.#n.filter(i=>i!==a),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(a){const i=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=Sg({fn:()=>this.options.mutationFn?this.options.mutationFn(a,s):Promise.reject(new Error("No mutationFn found")),onFail:(f,y)=>{this.#a({type:"failed",failureCount:f,error:y})},onPause:()=>{this.#a({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const r=this.state.status==="pending",c=!this.#l.canStart();try{if(r)i();else{this.#a({type:"pending",variables:a,isPaused:c}),this.#e.config.onMutate&&await this.#e.config.onMutate(a,this,s);const y=await this.options.onMutate?.(a,s);y!==this.state.context&&this.#a({type:"pending",context:y,variables:a,isPaused:c})}const f=await this.#l.start();return await this.#e.config.onSuccess?.(f,a,this.state.context,this,s),await this.options.onSuccess?.(f,a,this.state.context,s),await this.#e.config.onSettled?.(f,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(f,null,a,this.state.context,s),this.#a({type:"success",data:f}),f}catch(f){try{await this.#e.config.onError?.(f,a,this.state.context,this,s)}catch(y){Promise.reject(y)}try{await this.options.onError?.(f,a,this.state.context,s)}catch(y){Promise.reject(y)}try{await this.#e.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,s)}catch(y){Promise.reject(y)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,s)}catch(y){Promise.reject(y)}throw this.#a({type:"error",error:f}),f}finally{this.#e.runNext(this)}}#a(a){const i=s=>{switch(a.type){case"failed":return{...s,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...s,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:a.error,failureCount:s.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),he.batch(()=>{this.#n.forEach(s=>{s.onMutationUpdate(a)}),this.#e.notify({mutation:this,type:"updated",action:a})})}};function XR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var KR=class extends Ju{constructor(a={}){super(),this.config=a,this.#t=new Set,this.#n=new Map,this.#e=0}#t;#n;#e;build(a,i,s){const r=new VR({client:a,mutationCache:this,mutationId:++this.#e,options:a.defaultMutationOptions(i),state:s});return this.add(r),r}add(a){this.#t.add(a);const i=Ru(a);if(typeof i=="string"){const s=this.#n.get(i);s?s.push(a):this.#n.set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#t.delete(a)){const i=Ru(a);if(typeof i=="string"){const s=this.#n.get(i);if(s)if(s.length>1){const r=s.indexOf(a);r!==-1&&s.splice(r,1)}else s[0]===a&&this.#n.delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=Ru(a);if(typeof i=="string"){const r=this.#n.get(i)?.find(c=>c.state.status==="pending");return!r||r===a}else return!0}runNext(a){const i=Ru(a);return typeof i=="string"?this.#n.get(i)?.find(r=>r!==a&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){he.batch(()=>{this.#t.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#t.clear(),this.#n.clear()})}getAll(){return Array.from(this.#t)}find(a){const i={exact:!0,...a};return this.getAll().find(s=>Ip(i,s))}findAll(a={}){return this.getAll().filter(i=>Ip(a,i))}notify(a){he.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return he.batch(()=>Promise.all(a.map(i=>i.continue().catch(Fe))))}};function Ru(a){return a.options.scope?.id}var ZR=class extends Ju{constructor(a={}){super(),this.config=a,this.#t=new Map}#t;build(a,i,s){const r=i.queryKey,c=i.queryHash??sf(r,i);let f=this.get(c);return f||(f=new YR({client:a,queryKey:r,queryHash:c,options:a.defaultQueryOptions(i),state:s,defaultOptions:a.getQueryDefaults(r)}),this.add(f)),f}add(a){this.#t.has(a.queryHash)||(this.#t.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=this.#t.get(a.queryHash);i&&(a.destroy(),i===a&&this.#t.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){he.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#t.get(a)}getAll(){return[...this.#t.values()]}find(a){const i={exact:!0,...a};return this.getAll().find(s=>$p(i,s))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(s=>$p(a,s)):i}notify(a){he.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){he.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){he.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},PR=class{#t;#n;#e;#l;#a;#s;#u;#i;constructor(a={}){this.#t=a.queryCache||new ZR,this.#n=a.mutationCache||new KR,this.#e=a.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#u=gg.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=qu.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#u?.(),this.#u=void 0,this.#i?.(),this.#i=void 0)}isFetching(a){return this.#t.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#n.findAll({...a,status:"pending"}).length}getQueryData(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),s=this.#t.build(this,i),r=s.state.data;return r===void 0?this.fetchQuery(a):(a.revalidateIfStale&&s.isStaleByTime(Hc(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(r))}getQueriesData(a){return this.#t.findAll(a).map(({queryKey:i,state:s})=>{const r=s.data;return[i,r]})}setQueryData(a,i,s){const r=this.defaultQueryOptions({queryKey:a}),f=this.#t.get(r.queryHash)?.state.data,y=TR(i,f);if(y!==void 0)return this.#t.build(this,r).setData(y,{...s,manual:!0})}setQueriesData(a,i,s){return he.batch(()=>this.#t.findAll(a).map(({queryKey:r})=>[r,this.setQueryData(r,i,s)]))}getQueryState(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state}removeQueries(a){const i=this.#t;he.batch(()=>{i.findAll(a).forEach(s=>{i.remove(s)})})}resetQueries(a,i){const s=this.#t;return he.batch(()=>(s.findAll(a).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const s={revert:!0,...i},r=he.batch(()=>this.#t.findAll(a).map(c=>c.cancel(s)));return Promise.all(r).then(Fe).catch(Fe)}invalidateQueries(a,i={}){return he.batch(()=>(this.#t.findAll(a).forEach(s=>{s.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},i)))}refetchQueries(a,i={}){const s={...i,cancelRefetch:i.cancelRefetch??!0},r=he.batch(()=>this.#t.findAll(a).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,s);return s.throwOnError||(f=f.catch(Fe)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(r).then(Fe)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const s=this.#t.build(this,i);return s.isStaleByTime(Hc(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Fe).catch(Fe)}fetchInfiniteQuery(a){return a.behavior=ay(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Fe).catch(Fe)}ensureInfiniteQueryData(a){return a.behavior=ay(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return qu.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#n}getDefaultOptions(){return this.#e}setDefaultOptions(a){this.#e=a}setQueryDefaults(a,i){this.#l.set(Ji(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...this.#l.values()],s={};return i.forEach(r=>{Fi(a,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(a,i){this.#a.set(Ji(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...this.#a.values()],s={};return i.forEach(r=>{Fi(a,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(a){if(a._defaulted)return a;const i={...this.#e.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=sf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===uf&&(i.enabled=!1),i}defaultMutationOptions(a){return a?._defaulted?a:{...this.#e.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#t.clear(),this.#n.clear()}},_g=et.createContext(void 0),aT=a=>{const i=et.useContext(_g);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},kR=({client:a,children:i})=>(et.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),Z.jsx(_g.Provider,{value:a,children:i}));const JR="/assets/styles-CWabEzNU.css",FR=`
|
|
19
19
|
(() => {
|
|
20
20
|
// Skip PWA service worker inside Capacitor native shell — they conflict
|
|
21
21
|
// with the native networking layer and caching.
|
|
@@ -209,4 +209,4 @@ Error generating stack: `+l.message+`
|
|
|
209
209
|
document.documentElement.setAttribute('data-opencami-bubble-style', value)
|
|
210
210
|
} catch {}
|
|
211
211
|
})()
|
|
212
|
-
`;function s2(){return typeof window<"u"&&(window.location.href="/chat/main"),null}const $e=qE({notFoundComponent:s2,head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"},{title:"OpenCami"},{name:"description",content:"a fast web client for OpenClaw"},{property:"og:image",content:"/cover.webp"},{property:"og:image:type",content:"image/webp"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:image",content:"/cover.webp"},{name:"theme-color",content:"#0a0a0a"},{name:"apple-mobile-web-app-capable",content:"yes"},{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"},{name:"apple-mobile-web-app-title",content:"OpenCami"},{name:"mobile-web-app-capable",content:"yes"}],links:[{rel:"stylesheet",href:JR},{rel:"icon",type:"image/svg+xml",href:"/favicon.svg"},{rel:"apple-touch-icon",href:"/apple-touch-icon-180x180.png"},{rel:"manifest",href:"/manifest.json"}]}),shellComponent:o2,component:r2}),u2=new PR;function r2(){return Z.jsx(kR,{client:u2,children:Z.jsx(rg,{})})}function o2({children:a}){return Z.jsxs("html",{lang:"en",suppressHydrationWarning:!0,children:[Z.jsxs("head",{children:[Z.jsx("script",{dangerouslySetInnerHTML:{__html:IR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:WR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:t2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:e2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:n2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:a2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:l2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:i2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:$R}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:FR}}),Z.jsx(tR,{})]}),Z.jsxs("body",{children:[Z.jsx("div",{className:"root",children:a}),Z.jsx(eR,{})]})]})}const c2="modulepreload",f2=function(a){return"/"+a},iy={},rn=function(i,s,r){let c=Promise.resolve();if(s&&s.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};document.getElementsByTagName("link");const y=document.querySelector("meta[property=csp-nonce]"),h=y?.nonce||y?.getAttribute("nonce");c=p(s.map(m=>{if(m=f2(m),m in iy)return;iy[m]=!0;const v=m.endsWith(".css"),S=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${S}`))return;const _=document.createElement("link");if(_.rel=v?"stylesheet":c2,v||(_.as="script"),_.crossOrigin="",_.href=m,h&&_.setAttribute("nonce",h),document.head.appendChild(_),v)return new Promise((E,M)=>{_.addEventListener("load",E),_.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${m}`)))})}))}function f(y){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=y,window.dispatchEvent(h),!h.defaultPrevented)throw y}return c.then(y=>{for(const h of y||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},d2=()=>rn(()=>import("./skills-
|
|
212
|
+
`;function s2(){return typeof window<"u"&&(window.location.href="/chat/main"),null}const $e=qE({notFoundComponent:s2,head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"},{title:"OpenCami"},{name:"description",content:"a fast web client for OpenClaw"},{property:"og:image",content:"/cover.webp"},{property:"og:image:type",content:"image/webp"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:image",content:"/cover.webp"},{name:"theme-color",content:"#0a0a0a"},{name:"apple-mobile-web-app-capable",content:"yes"},{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"},{name:"apple-mobile-web-app-title",content:"OpenCami"},{name:"mobile-web-app-capable",content:"yes"}],links:[{rel:"stylesheet",href:JR},{rel:"icon",type:"image/svg+xml",href:"/favicon.svg"},{rel:"apple-touch-icon",href:"/apple-touch-icon-180x180.png"},{rel:"manifest",href:"/manifest.json"}]}),shellComponent:o2,component:r2}),u2=new PR;function r2(){return Z.jsx(kR,{client:u2,children:Z.jsx(rg,{})})}function o2({children:a}){return Z.jsxs("html",{lang:"en",suppressHydrationWarning:!0,children:[Z.jsxs("head",{children:[Z.jsx("script",{dangerouslySetInnerHTML:{__html:IR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:WR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:t2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:e2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:n2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:a2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:l2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:i2}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:$R}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:FR}}),Z.jsx(tR,{})]}),Z.jsxs("body",{children:[Z.jsx("div",{className:"root",children:a}),Z.jsx(eR,{})]})]})}const c2="modulepreload",f2=function(a){return"/"+a},iy={},rn=function(i,s,r){let c=Promise.resolve();if(s&&s.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};document.getElementsByTagName("link");const y=document.querySelector("meta[property=csp-nonce]"),h=y?.nonce||y?.getAttribute("nonce");c=p(s.map(m=>{if(m=f2(m),m in iy)return;iy[m]=!0;const v=m.endsWith(".css"),S=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${S}`))return;const _=document.createElement("link");if(_.rel=v?"stylesheet":c2,v||(_.as="script"),_.crossOrigin="",_.href=m,h&&_.setAttribute("nonce",h),document.head.appendChild(_),v)return new Promise((E,M)=>{_.addEventListener("load",E),_.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${m}`)))})}))}function f(y){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=y,window.dispatchEvent(h),!h.defaultPrevented)throw y}return c.then(y=>{for(const h of y||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},d2=()=>rn(()=>import("./skills-Svd-7oxQ.js"),[]),h2=Ke("/skills")({component:un(d2,"component")}),m2=()=>rn(()=>import("./new-DLlBm66g.js"),[]),p2=Ke("/new")({beforeLoad:function(){throw Pc({to:"/chat/$sessionKey",params:{sessionKey:"new"},replace:!0})},component:un(m2,"component")}),y2=()=>rn(()=>import("./memory-BYRJ1l_4.js"),[]),g2=Ke("/memory")({component:un(y2,"component")}),v2=()=>rn(()=>import("./files-CG0jFYdO.js"),[]),S2=Ke("/files")({component:un(v2,"component")}),b2=()=>rn(()=>import("./dashboard-y8KVUVF-.js"),__vite__mapDeps([0,1])),_2=Ke("/dashboard")({component:un(b2,"component")}),E2=()=>rn(()=>import("./connect-DZSrhhNT.js"),__vite__mapDeps([2,3,4,5])),R2=Ke("/connect")({component:un(E2,"component")}),T2=()=>rn(()=>import("./bots-DAInzfLx.js"),[]),w2=Ke("/bots")({component:un(T2,"component")}),A2=()=>rn(()=>import("./agents-D7JS19Lo.js"),[]),O2=Ke("/agents")({component:un(A2,"component")}),M2=()=>rn(()=>import("./index-3-ASY4Cl.js"),[]),x2=Ke("/")({component:un(M2,"component")}),C2=()=>rn(()=>import("./_sessionKey-CTtu2ipR.js").then(a=>a.$),__vite__mapDeps([6,1,7,4,8,9,10,11,12,13,14,15,5,16,17,18,19,20,21,3,22,23])),z2=Ke("/chat/$sessionKey")({component:un(C2,"component")}),D2=h2.update({id:"/skills",path:"/skills",getParentRoute:()=>$e}),L2=p2.update({id:"/new",path:"/new",getParentRoute:()=>$e}),U2=g2.update({id:"/memory",path:"/memory",getParentRoute:()=>$e}),N2=S2.update({id:"/files",path:"/files",getParentRoute:()=>$e}),j2=_2.update({id:"/dashboard",path:"/dashboard",getParentRoute:()=>$e}),B2=R2.update({id:"/connect",path:"/connect",getParentRoute:()=>$e}),H2=w2.update({id:"/bots",path:"/bots",getParentRoute:()=>$e}),q2=O2.update({id:"/agents",path:"/agents",getParentRoute:()=>$e}),Y2=x2.update({id:"/",path:"/",getParentRoute:()=>$e}),Q2=z2.update({id:"/chat/$sessionKey",path:"/chat/$sessionKey",getParentRoute:()=>$e}),G2={IndexRoute:Y2,AgentsRoute:q2,BotsRoute:H2,ConnectRoute:B2,DashboardRoute:j2,FilesRoute:N2,MemoryRoute:U2,NewRoute:L2,SkillsRoute:D2,ChatSessionKeyRoute:Q2},V2=$e._addFileChildren(G2),X2=()=>PE({routeTree:V2,context:{},scrollRestoration:!0,defaultPreloadStaleTime:0});async function K2(){const a=await X2();let i;return i=[],window.__TSS_START_OPTIONS__={serializationAdapters:i},i.push(bR),a.options.serializationAdapters&&i.push(...a.options.serializationAdapters),a.update({basepath:"",serializationAdapters:i}),a.state.matches.length||await aR(a),a}async function Z2(){const a=await K2();return window.$_TSR?.h(),a}let Cc;function P2(){return Cc||(Cc=Z2()),Z.jsx(hE,{promise:Cc,children:a=>Z.jsx(FE,{router:a})})}et.startTransition(()=>{$0.hydrateRoot(document,Z.jsx(et.StrictMode,{children:Z.jsx(P2,{})}))});export{Q0 as A,ig as L,x2 as R,Ju as S,rn as _,Ql as a,Fe as b,nT as c,lf as d,OR as e,Hc as f,XR as g,Ji as h,Fu as i,Z as j,wR as k,Bc as l,gg as m,he as n,QR as o,NR as p,CR as q,et as r,eT as s,AR as t,aT as u,K0 as v,AE as w,SE as x,EE as y,z2 as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as Ir,j as _,r as he,d as Xi,L as _n}from"./main-
|
|
1
|
+
import{A as Ir,j as _,r as he,d as Xi,L as _n}from"./main-CbISK-pm.js";import{r as Yi,C as Jt}from"./index-BZxJSF4T.js";import{u as Ct,D as Ji,a as Ki,b as el,d as tl}from"./use-file-explorer-state-Dwhw6Mpg.js";import{c as nl,B as Ln}from"./button-Bv-7bwZZ.js";import{s as Kt,h as rl,w as il,f as ll,a as sl,b as al,c as Fn}from"./index-T4TOjvD0.js";function en(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ze=en();function Tr(e){ze=e}var Ie={exec:()=>null};function O(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(J.caret,"$1"),n=n.replace(i,l),r},getRegex:()=>new RegExp(n,t)};return r}var ol=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),J={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},ul=/^(?:[ \t]*(?:\n|$))+/,cl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Je=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ar=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zr=O(Ar).replace(/bull/g,tn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),pl=O(Ar).replace(/bull/g,tn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ml=/^[^\n]+/,rn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,gl=O(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dl=O(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tn).getRegex(),dt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ln=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,kl=O("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ln).replace("tag",dt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Rr=O(nn).replace("hr",Je).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex(),xl=O(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Rr).getRegex(),sn={blockquote:xl,code:cl,def:gl,fences:hl,heading:fl,hr:Je,html:kl,lheading:zr,list:dl,newline:ul,paragraph:Rr,table:Ie,text:ml},Dn=O("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Je).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex(),yl={...sn,lheading:pl,table:Dn,paragraph:O(nn).replace("hr",Je).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Dn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex()},bl={...sn,html:O(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ln).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ie,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:O(nn).replace("hr",Je).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",zr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},wl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Sl=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pr=/^( {2,}|\\)\n(?!\s*$)/,Cl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,kt=/[\p{P}\p{S}]/u,an=/[\s\p{P}\p{S}]/u,_r=/[^\s\p{P}\p{S}]/u,El=O(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,an).getRegex(),Lr=/(?!~)[\p{P}\p{S}]/u,Il=/(?!~)[\s\p{P}\p{S}]/u,Tl=/(?:[^\s\p{P}\p{S}]|~)/u,Fr=/(?![*_])[\p{P}\p{S}]/u,Al=/(?![*_])[\s\p{P}\p{S}]/u,zl=/(?:[^\s\p{P}\p{S}]|[*_])/u,Rl=O(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ol?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Dr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Pl=O(Dr,"u").replace(/punct/g,kt).getRegex(),_l=O(Dr,"u").replace(/punct/g,Lr).getRegex(),vr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ll=O(vr,"gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,an).replace(/punct/g,kt).getRegex(),Fl=O(vr,"gu").replace(/notPunctSpace/g,Tl).replace(/punctSpace/g,Il).replace(/punct/g,Lr).getRegex(),Dl=O("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,an).replace(/punct/g,kt).getRegex(),vl=O(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Fr).getRegex(),Nl="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",$l=O(Nl,"gu").replace(/notPunctSpace/g,zl).replace(/punctSpace/g,Al).replace(/punct/g,Fr).getRegex(),Bl=O(/\\(punct)/,"gu").replace(/punct/g,kt).getRegex(),Ol=O(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),jl=O(ln).replace("(?:-->|$)","-->").getRegex(),Ml=O("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",jl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ot=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,ql=O(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ot).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nr=O(/^!?\[(label)\]\[(ref)\]/).replace("label",ot).replace("ref",rn).getRegex(),$r=O(/^!?\[(ref)\](?:\[\])?/).replace("ref",rn).getRegex(),Hl=O("reflink|nolink(?!\\()","g").replace("reflink",Nr).replace("nolink",$r).getRegex(),vn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,on={_backpedal:Ie,anyPunctuation:Bl,autolink:Ol,blockSkip:Rl,br:Pr,code:Sl,del:Ie,delLDelim:Ie,delRDelim:Ie,emStrongLDelim:Pl,emStrongRDelimAst:Ll,emStrongRDelimUnd:Dl,escape:wl,link:ql,nolink:$r,punctuation:El,reflink:Nr,reflinkSearch:Hl,tag:Ml,text:Cl,url:Ie},Vl={...on,link:O(/^!?\[(label)\]\((.*?)\)/).replace("label",ot).getRegex(),reflink:O(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ot).getRegex()},Mt={...on,emStrongRDelimAst:Fl,emStrongLDelim:_l,delLDelim:vl,delRDelim:$l,url:O(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",vn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:O(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",vn).getRegex()},Ul={...Mt,br:O(Pr).replace("{2,}","*").getRegex(),text:O(Mt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},nt={normal:sn,gfm:yl,pedantic:bl},je={normal:on,gfm:Mt,breaks:Ul,pedantic:Vl},Wl={"&":"&","<":"<",">":">",'"':""","'":"'"},Nn=e=>Wl[e];function ce(e,t){if(t){if(J.escapeTest.test(e))return e.replace(J.escapeReplace,Nn)}else if(J.escapeTestNoEncode.test(e))return e.replace(J.escapeReplaceNoEncode,Nn);return e}function $n(e){try{e=encodeURI(e).replace(J.percentDecode,"%")}catch{return null}return e}function Bn(e,t){let n=e.replace(J.findPipe,(s,l,a)=>{let o=!1,u=l;for(;--u>=0&&a[u]==="\\";)o=!o;return o?"|":" |"}),r=n.split(J.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(J.slashPipe,"|");return r}function Me(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function Ql(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Zl(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function On(e,t,n,r,i){let s=t.href,l=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:l,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,o}function Gl(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
3
3
|
`).map(s=>{let l=s.match(n.other.beginningSpace);if(l===null)return s;let[a]=l;return a.length>=i.length?s.slice(i.length):s}).join(`
|
|
4
4
|
`)}var ut=class{options;rules;lexer;constructor(e){this.options=e||ze}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Me(n,`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/memory-screen-BRsm-Q8A.js","assets/main-CbISK-pm.js","assets/useQuery-_BEWdUe1.js","assets/useMutation-CMp81lDO.js","assets/button-Bv-7bwZZ.js","assets/markdown-UD7RzskQ.js","assets/index-BZxJSF4T.js","assets/react-C_7UlEtd.js","assets/use-file-explorer-state-Dwhw6Mpg.js","assets/useOnFirstRender-DpB3w0o4.js","assets/useBaseUiId-BdQC9KF3.js","assets/event-Cnr9OETn.js","assets/visuallyHidden-COI6QeQH.js","assets/composite-DwQIZFe9.js","assets/index-T4TOjvD0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r,_ as s}from"./main-CbISK-pm.js";const n=r.lazy(()=>s(()=>import("./memory-screen-BRsm-Q8A.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(t=>({default:t.MemoryScreen})));function a(){return e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"flex h-screen items-center justify-center text-primary-500 text-sm",children:"Loading…"}),children:e.jsx(n,{})})}export{a as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as h,u as N,L as R}from"./main-
|
|
1
|
+
import{j as e,r as h,u as N,L as R}from"./main-CbISK-pm.js";import{u as g}from"./useQuery-_BEWdUe1.js";import{u as S}from"./useMutation-CMp81lDO.js";import{c as M,B as f,b as k}from"./button-Bv-7bwZZ.js";import{M as C}from"./markdown-UD7RzskQ.js";import"./index-BZxJSF4T.js";import"./react-C_7UlEtd.js";import"./use-file-explorer-state-Dwhw6Mpg.js";import"./useOnFirstRender-DpB3w0o4.js";import"./useBaseUiId-BdQC9KF3.js";import"./event-Cnr9OETn.js";import"./visuallyHidden-COI6QeQH.js";import"./composite-DwQIZFe9.js";import"./index-T4TOjvD0.js";const w=/\/(\d{4}-\d{2}-\d{2})/;function j({path:r,label:n,selected:o,onSelect:m}){return e.jsx("button",{type:"button",onClick:()=>m(r),className:M("w-full text-left px-2.5 py-1.5 rounded-md text-sm transition-colors",o?"text-primary-900":"text-primary-600 hover:text-primary-900 hover:bg-primary-50"),style:o?{backgroundColor:"var(--opencami-accent-light)"}:void 0,children:n})}function b(r){return r==="/MEMORY.md"?"📋 MEMORY.md":r.match(w)?`📅 ${r.replace(/^\/?memory\//,"")}`:`📄 ${r.replace(/^\/?memory\//,"")}`}function F({files:r,selectedPath:n,onSelect:o,loading:m}){const i=r.filter(t=>t==="/MEMORY.md"),s=r.filter(t=>t!=="/MEMORY.md"&&w.test(t)),l=r.filter(t=>t!=="/MEMORY.md"&&!w.test(t));return e.jsxs("aside",{className:"border-r border-primary-200 bg-primary-100 md:w-72 w-full md:h-full h-auto overflow-y-auto",children:[e.jsx("div",{className:"px-4 py-3 border-b border-primary-200",children:e.jsx("h2",{className:"text-sm font-semibold text-primary-800",children:"Memory Files"})}),e.jsx("div",{className:"p-2 space-y-0.5",children:m?e.jsx("div",{className:"px-2 py-2 text-sm text-primary-500",children:"Loading files…"}):r.length===0?e.jsx("div",{className:"px-2 py-2 text-sm text-primary-500",children:"No memory files found."}):e.jsxs(e.Fragment,{children:[i.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t)),s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 pt-3 pb-1 text-xs font-medium text-primary-400 uppercase tracking-wider",children:"Daily"}),s.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t))]}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 pt-3 pb-1 text-xs font-medium text-primary-400 uppercase tracking-wider",children:"Notes"}),l.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t))]})]})})]})}function O({filePath:r,content:n,isLoading:o,onSave:m,onBack:i}){const[s,l]=h.useState(!1),[t,x]=h.useState(n),[u,p]=h.useState(!1);h.useEffect(()=>{x(n),l(!1)},[r,n]);const a=async()=>{p(!0);try{await m(t),l(!1)}finally{p(!1)}};return e.jsxs("section",{className:"flex-1 min-h-0 flex flex-col",children:[e.jsxs("header",{className:"border-b border-primary-100 px-4 py-3 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i?e.jsx(f,{size:"sm",variant:"ghost",onClick:i,children:"Back"}):null,e.jsx("h1",{className:"text-sm font-semibold text-primary-800 truncate",children:r})]}),!o&&e.jsx("div",{className:"flex items-center gap-2",children:s?e.jsxs(e.Fragment,{children:[e.jsx(f,{size:"sm",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(f,{size:"sm",onClick:()=>{a()},disabled:u,children:u?"Saving…":"Save"})]}):e.jsx(f,{size:"sm",variant:"outline",onClick:()=>l(!0),children:"Edit"})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-4",children:o?e.jsx("div",{className:"text-sm text-primary-500",children:"Loading content…"}):s?e.jsx("textarea",{value:t,onChange:c=>x(c.target.value),className:"w-full min-h-[60vh] rounded-md border border-primary-200 bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"}):e.jsx(C,{className:"prose prose-invert max-w-none",children:n||"_Empty file_"})})]})}const Y=/\/(\d{4}-\d{2}-\d{2})/;function z(r){const n=r.includes("/MEMORY.md")?["/MEMORY.md"]:[],o=r.filter(s=>s!=="/MEMORY.md"&&(s.startsWith("memory/")||s.startsWith("/memory/"))&&s.endsWith(".md")),m=[],i=[];for(const s of o)Y.test(s)?m.push(s):i.push(s);return m.sort((s,l)=>l.localeCompare(s)),i.sort((s,l)=>s.localeCompare(l)),[...n,...m,...i]}function J(){const r=N(),[n,o]=h.useState("/MEMORY.md"),m=g({queryKey:["memory","files"],queryFn:async({signal:a})=>{const[c,d]=await Promise.all([fetch("/api/files/read?path=/MEMORY.md",{signal:a}),fetch("/api/files/list?path=/memory",{signal:a})]),y=[];if(c.ok&&y.push("/MEMORY.md"),d.ok){const E=await d.json();for(const v of E.items)!v.isDir&&v.path.endsWith(".md")&&y.push(v.path)}return z(y)},staleTime:3e4}),i=n??m.data?.[0]??null,s=g({queryKey:["memory","content",i],queryFn:async({signal:a})=>{const c=i.startsWith("/")?i:`/${i}`,d=await fetch(`/api/files/read?path=${encodeURIComponent(c)}`,{signal:a});if(!d.ok)throw new Error("Failed to read memory file");return d.json()},enabled:!!i}),l=S({mutationFn:async a=>{const c=a.path.startsWith("/")?a.path:`/${a.path}`,d=await fetch("/api/files/save",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...a,path:c})});if(!d.ok)throw new Error("Failed to save memory file");return d.json()},onSuccess:async(a,c)=>{await r.invalidateQueries({queryKey:["memory","content",c.path]}),await r.invalidateQueries({queryKey:["memory","files"]})}}),[t,x]=h.useState(()=>typeof window<"u"?window.innerWidth<768:!1);h.useEffect(()=>{if(typeof window>"u")return;const a=()=>x(window.innerWidth<768);return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]);const u=t&&!i,p=h.useCallback(a=>{o(a)},[]);return e.jsxs("div",{className:"h-screen bg-surface text-primary-900",children:[e.jsxs("div",{className:"h-12 border-b border-primary-100 px-3 flex items-center justify-between",children:[e.jsx("h1",{className:"text-sm font-semibold",children:"Memory Viewer"}),e.jsx(R,{to:"/chat/$sessionKey",params:{sessionKey:"main"},className:M(k({variant:"ghost",size:"sm"})),children:"Back to Chat"})]}),e.jsxs("div",{className:"h-[calc(100vh-48px)] md:grid md:grid-cols-[18rem_1fr]",children:[(!t||u)&&e.jsx(F,{files:m.data??[],selectedPath:i,onSelect:p,loading:m.isLoading}),i&&(!t||!u)?e.jsx(O,{filePath:i,content:s.data?.content??"",isLoading:s.isLoading,onBack:t?()=>o(null):void 0,onSave:async a=>{await l.mutateAsync({path:i,content:a})}}):e.jsx("div",{className:"p-4 text-sm text-primary-500",children:"Select a file to view."})]}),(m.isError||s.isError||l.isError)&&e.jsxs("div",{className:"fixed bottom-4 right-4 rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700",children:["Something went wrong. ",e.jsx(f,{size:"sm",variant:"ghost",onClick:()=>{m.refetch()},children:"Retry"})]})]})}export{J as MemoryScreen};
|