moi-computer 0.13.1-next.5 → 0.14.1-next.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.
Files changed (29) hide show
  1. package/dist/{chunk-cb2a4cjk.js → chunk-828s864r.js} +21 -21
  2. package/dist/{chunk-4arsawe0.js → chunk-gh11h6dc.js} +2 -2
  3. package/dist/chunk-hhgsmxsq.js +1 -0
  4. package/dist/{chunk-6aq60rm2.js → chunk-ht9zmff2.js} +4 -4
  5. package/dist/{chunk-ghyzbqgb.js → chunk-jqa4c92z.js} +2 -2
  6. package/dist/{chunk-v0w55vnq.js → chunk-kkhswjz8.js} +2 -2
  7. package/dist/{chunk-0xy5nenk.js → chunk-nqh3kx2x.js} +1 -1
  8. package/dist/chunk-rb2vsqvb.js +1 -0
  9. package/dist/{chunk-9vy2z8hd.js → chunk-t22yw8s6.js} +1 -1
  10. package/dist/chunk-yv6n9e3z.js +72 -0
  11. package/dist/index.html +1 -1
  12. package/package.json +1 -1
  13. package/runtime/{chunk-fdbkvdht.js → chunk-03750sma.js} +63 -65
  14. package/runtime/{chunk-g9saang0.js → chunk-1drras3j.js} +1 -1
  15. package/runtime/{chunk-f56xzjzw.js → chunk-1p8ynb23.js} +1 -1
  16. package/runtime/{chunk-mjwz158z.js → chunk-1zeee31e.js} +1 -1
  17. package/runtime/{chunk-9dr0dhxj.js → chunk-4y27q16x.js} +2 -2
  18. package/runtime/{chunk-8jg7v8y7.js → chunk-5nx3tssz.js} +1 -1
  19. package/runtime/chunk-an9r5st9.js +2 -0
  20. package/runtime/{chunk-pt32r350.js → chunk-c6mrjx7n.js} +1 -1
  21. package/runtime/{chunk-67h4jd69.js → chunk-j853vhne.js} +2 -2
  22. package/runtime/{chunk-q2t18c1t.js → chunk-jr7b4rnn.js} +1 -1
  23. package/runtime/{chunk-hrtaxw37.js → chunk-zehpaa3c.js} +1 -1
  24. package/runtime/cli.js +5 -5
  25. package/runtime/gateway-client.js +1 -1
  26. package/dist/chunk-5eb7n6xw.js +0 -1
  27. package/dist/chunk-j3djs7ta.js +0 -72
  28. package/dist/chunk-yff16m73.js +0 -1
  29. package/runtime/chunk-30dzwptp.js +0 -2
@@ -1,2 +1,2 @@
1
- class zo extends Error{status;constructor(e,t){super(t);this.status=e;this.name="HttpError"}}async function o(e,t){let s=await e.text();return new zo(e.status,s||t)}async function h(e,t,s="Request failed"){let n=await fetch(e,t);if(!n.ok)throw await o(n,s);return n.json()}async function he(e,t,s="Request failed"){let n=await fetch(e,t);if(!n.ok)throw await o(n,s)}function w(e,t){return{method:e,headers:{"Content-Type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}}
2
- export{zo,h,he,w};
1
+ class Uo extends Error{status;constructor(e,t){super(t);this.status=e;this.name="HttpError"}}async function o(e,t){let s=await e.text();return new Uo(e.status,s||t)}async function h(e,t,s="Request failed"){let n=await fetch(e,t);if(!n.ok)throw await o(n,s);return n.json()}async function he(e,t,s="Request failed"){let n=await fetch(e,t);if(!n.ok)throw await o(n,s)}function w(e,t){return{method:e,headers:{"Content-Type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}}
2
+ export{Uo,h,he,w};
@@ -1,2 +1,2 @@
1
- var Ct=Object.create;var{getPrototypeOf:Dt,defineProperty:tr,getOwnPropertyNames:jt}=Object;var yr=Object.prototype.hasOwnProperty;function Et(r){return this[r]}var $t,Ot,e=(r,t,o)=>{var i=r!=null&&typeof r==="object";if(i){var n=t?$t??=new WeakMap:Ot??=new WeakMap,l=n.get(r);if(l)return l}o=r!=null?Ct(Dt(r)):{};let d=t||!r||!r.__esModule||!yr.call(r,"default")?tr(o,"default",{value:r,enumerable:!0}):o;if(r&&typeof r==="object"||typeof r==="function"){for(let s of jt(r))if(!yr.call(d,s))tr(d,s,{get:Et.bind(r,s),enumerable:!0})}if(i)n.set(r,d);return d};var k=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var Rt=(r)=>r;function Tt(r,t){this[r]=Rt.bind(null,t)}var Ht=(r,t)=>{for(var o in t)tr(r,o,{get:t[o],enumerable:!0,configurable:!0,set:Tt.bind(t,o)})};var un=((r)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var zr,er,H,Fe=(r,t)=>{for(var[o,i,n]of zr||[])for(var l=[r],d=globalThis,s=d.document,c,p,g,h,u;p=l.pop();)if(!er[p]&&(g=i[p])){er[p]=1;for(h=1;h<g.length;h++)l.push(n[g[h]]);if(!t&&p!==r&&(c=s&&s.head)){if(H===void 0)H=(h=s.querySelector("meta[property=csp-nonce]"))&&(h.nonce||h.getAttribute("nonce"))||"";if(u=s.createElement("link"),u.rel="modulepreload",u.crossOrigin="",H)u.nonce=H;u.href=new d.URL(g[0],o),c.appendChild(u)}}},Mt=(r,t,o,i)=>{for(var n={},l=0;l<t.length;l++)n[t[l]]=o[l];(zr||=[]).push([r,n,t]),er||={},Fe(t[i],1)};Mt(import.meta.url,["v0w55vnq","j3djs7ta","yff16m73","0xy5nenk","nf2wkvf9","cb2a4cjk","6aq60rm2","4arsawe0","ghyzbqgb","5eb7n6xw","9vy2z8hd"],[["/chunk-v0w55vnq.js"],["/chunk-j3djs7ta.js",6,0,7,8],["/chunk-yff16m73.js",7],["/chunk-0xy5nenk.js",0,8],["/chunk-nf2wkvf9.js"],["/chunk-cb2a4cjk.js",6,7,0,10,8],["/chunk-6aq60rm2.js",0,7,8],["/chunk-4arsawe0.js",0,8],["/chunk-ghyzbqgb.js"],["/chunk-5eb7n6xw.js",10],["/chunk-9vy2z8hd.js"]],0);
2
- if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);var Zt=(r)=>crypto.getRandomValues(new Uint8Array(r)),Nt=(r,t,o)=>{let i=256-256%r.length;if(i===256){let l=r.length-1;return(d=t)=>{if(!d)return"";let s="";while(!0){let c=o(d),p=d;while(p--)if(s+=r[c[p]&l],s.length>=d)return s}}}let n=Math.ceil(409.6*t/i);return(l=t)=>{if(!l)return"";let d="";while(!0){let s=o(n),c=n;while(c--)if(s[c]<i){if(d+=r[s[c]%r.length],d.length>=l)return d}}}},cr=(r,t=21)=>Nt(r,t|0,Zt);var Cr=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,Ir="agent:",Dr=(r)=>Ir+r,kr=(r)=>r.startsWith(Ir),jr="0123456789abcdefghijklmnopqrstuvwxyz",xa=cr(jr,10),_r=["create","discover","order","previews"];function dn(r){if(!r)return"Workspace id is required";if(r.length>64)return"Workspace id is too long (max 64 characters)";if(!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(r))return"Use letters, numbers, dashes and underscores, starting with a letter or number";if(_r.includes(r.toLowerCase()))return`Workspace id ${r} is reserved (${_r.join(", ")})`;return null}var ya=cr(jr,6);var D=["pink","orange","amber","lime","emerald","cyan","blue","violet"];function N(r){return typeof r==="string"&&D.includes(r)}function so(r){let t=2166136261;for(let o=0;o<r.length;o++)t^=r.charCodeAt(o),t=Math.imul(t,16777619);return D[(t>>>0)%D.length]??D[0]}var pn=1;var Ft=8192,Bt=320;function Be(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)}function F(r,t=256){return typeof r==="string"&&r.length>0&&!r.includes("\x00")&&new TextEncoder().encode(r).length<=t}function Wr(r){return Be(r)&&F(r.id,240)&&r.id.trim().length>0&&(r.name===void 0||F(r.name)&&r.name.trim().length>0)&&N(r.color)&&(r.avatar===void 0||F(r.avatar,Ft))&&(r.email===void 0||F(r.email,Bt))}function S(r,t){return typeof r==="string"&&r.length<=t&&!r.includes("\x00")}function qt(r){if(!S(r,2048))return!1;try{return["http:","https:"].includes(new URL(r).protocol)}catch{return!1}}function nt(r){if(!Be(r)||!S(r.id,240)||!r.id.trim()||r.id!==r.id.trim()||!S(r.name,256)||r.avatar!==void 0&&!qt(r.avatar))throw Error("Invalid identity");let t={id:r.id,name:r.name,...r.avatar!==void 0?{avatar:r.avatar}:{}};if(r.type==="agent")return{...t,type:"agent",...S(r.client,256)&&{client:r.client}};if(r.type==="user"&&S(r.email,320)&&typeof r.isAnonymous==="boolean")return{...t,type:"user",email:r.email,isAnonymous:r.isAnonymous};throw Error("Invalid identity")}var ze=(r)=>`${r.type}:${r.id}`,rr=(r)=>r.type==="agent"?Dr(r.id):r.id;var B,$r=0,Or=0,lr=new Set,Te=()=>B,Tr=()=>Or,ne=()=>$r;function ao(r){return lr.add(r),()=>{lr.delete(r)}}function wt(r){let t=r===null?null:nt(r);if((B&&ze(B))!==(t&&ze(t)))$r++;Or++,B=t,lr.forEach((i)=>i())}var Sr="/dot-2bdkpg3k.png";var Mr="/duet-3ab8xyzd.png";var Zr="/grok-bot-yv07qj9f.png";var Hr="/instinct-ypmq6t0w.png";var Nr="/muse-qr7zwsvf.png";var Kt=new Map(Object.entries({dot:Sr,duet:Mr,"grok-bot":Zr,instinct:Hr,muse:Nr}));function Fr(r){return r?Kt.get(r):void 0}function fn(r){if(!r||r==="unknown"||!Cr.test(r))return"Other";return r.split("-").map((t)=>t[0].toUpperCase()+t.slice(1)).join(" ")}var Xt=["Curious Kiwi","Cheerful Cherry","Sleepy Peach","Excited Banana","Cosmic Mango","Velvet Lemon","Electric Plum","Wandering Pear","Dramatic Papaya","Suspicious Pineapple","Confused Coconut","Sneaky Tangerine","Gentle Fig","Quiet Apricot","Mellow Melon","Dreamy Guava"];function Ur(r,t){let o=r.filter((i)=>i!==t);return o[Math.floor(Math.random()*o.length)]??r[0]}function Gt(r){return{name:Ur(Xt,r?.name),color:Ur(D,r?.color)}}function ra(r,t){let o=t.name.trim();return{id:r,...o?{name:o}:{},color:t.color}}function Br(){return ra(`local-${crypto.randomUUID().slice(0,8)}`,Gt())}var pr="moi:local-profile",A,C,R=new Set;function hr(r,t){return JSON.stringify(r)===JSON.stringify(t)}function q(r){if(!r||typeof r.id!=="string"||!r.id.trim())throw Error("A user profile needs an id.");if(r.name!==void 0&&typeof r.name!=="string")throw Error("A user profile name must be a string when provided.");if(r.color!==void 0&&!N(r.color))throw Error("A user profile color must be one of the user palette names.");let t=r.id.trim(),o=r.name?.trim(),i={id:t,...o?{name:o}:{},color:r.color??so(t),...r.avatar!==void 0?{avatar:r.avatar}:{},...r.email!==void 0?{email:r.email}:{}};if(!Wr(i))throw Error("Invalid user profile.");return Object.freeze(i)}function Pr(r){return q({id:rr(r),name:r.name||void 0,avatar:r.avatar??(r.type==="agent"?Fr(r.client):void 0),email:r.type==="user"?r.email||void 0:void 0})}var dr,qr;function pe(){let r=Te();if(r===void 0)return A;if(r!==qr){qr=r;let t=!r||r.type==="user"&&r.isAnonymous?void 0:Pr(r);if(!hr(dr,t))dr=t}return dr}function St(r){let t=pe(),o=we(),i=()=>{let l=pe(),d=we();if(t===l&&o===d)return;t=l,o=d,r()};R.add(i);let n=ao(i);return()=>{R.delete(i),n()}}function we(){return Te()!==void 0?"external":C}function mn({provider:r,profile:t}){if(we()==="external")return;if(r===void 0){if(C===void 0||C==="local")return;C=void 0,A=void 0}else{let o=t===void 0?void 0:q(t);if(C===r&&hr(A,o))return;C=r,A=o}R.forEach((o)=>o())}function ta(){try{localStorage.setItem(pr,JSON.stringify(A))}catch{}}function lo(r){if(we()!==void 0&&we()!=="local")return;let t=q(r);C="local",A=t,ta(),R.forEach((o)=>o())}function Jr(r,t){if(!r||!t||t.provider!==void 0||we()!==void 0)return;try{let o=localStorage.getItem(pr);if(o){lo(JSON.parse(o));return}}catch{}lo(Br())}function Lr(r){if(r.key!==pr||!r.newValue||we()!=="local")return;try{let t=q(JSON.parse(r.newValue));if(hr(t,A))return;A=t,R.forEach((o)=>o())}catch{}}function Vr(){return window.addEventListener("storage",Lr),()=>window.removeEventListener("storage",Lr)}var aa={setTimeout:(r,t)=>setTimeout(r,t),clearTimeout:(r)=>clearTimeout(r),setInterval:(r,t)=>setInterval(r,t),clearInterval:(r)=>clearInterval(r)},ea=class{#r=aa;#t=!1;setTimeoutProvider(r){this.#r=r}setTimeout(r,t){return this.#r.setTimeout(r,t)}clearTimeout(r){this.#r.clearTimeout(r)}setInterval(r,t){return this.#r.setInterval(r,t)}clearInterval(r){this.#r.clearInterval(r)}},He=new ea;function Qr(r){setTimeout(r,0)}var ur=typeof window>"u"||"Deno"in globalThis;function U(){}function Xr(r,t){return typeof r==="function"?r(t):r}function co(r){return typeof r==="number"&&r>=0&&r!==1/0}function uo(r,t){return Math.max(r+(t||0)-Date.now(),0)}function W(r,t){return typeof r==="function"?r(t):r}function or(r,t){let{type:o="all",exact:i,fetchStatus:n,predicate:l,queryKey:d,stale:s}=r;if(d){if(i){if(t.queryHash!==T(d,t.options))return!1}else if(!P(t.queryKey,d))return!1}if(o!=="all"){let c=t.isActive();if(o==="active"&&!c)return!1;if(o==="inactive"&&c)return!1}if(typeof s==="boolean"&&t.isStale()!==s)return!1;if(n&&n!==t.state.fetchStatus)return!1;if(l&&!l(t))return!1;return!0}function L(r,t){let{exact:o,status:i,predicate:n,mutationKey:l}=r;if(l){if(!t.options.mutationKey)return!1;if(o){if(Ue(t.options.mutationKey)!==Ue(l))return!1}else if(!P(t.options.mutationKey,l))return!1}if(i&&t.state.status!==i)return!1;if(n&&!n(t))return!1;return!0}function T(r,t){return(t?.queryKeyHashFn||Ue)(r)}function Ue(r){return JSON.stringify(r,(t,o)=>gr(o)?Object.keys(o).sort().reduce((i,n)=>(i[n]=o[n],i),{}):o)}function P(r,t){if(r===t)return!0;if(typeof r!==typeof t)return!1;if(r&&t&&typeof r==="object"&&typeof t==="object"){if(Array.isArray(r)&&Array.isArray(t)){for(let i=0;i<t.length;i++)if(!P(r[i],t[i]))return!1;return!0}let o=Object.keys(t);for(let i of o)if(!P(r[i],t[i]))return!1;return!0}return!1}var oa=Object.prototype.hasOwnProperty;function We(r,t,o=0){if(r===t)return r;if(o>500)return t;let i=Yr(r)&&Yr(t);if(!i&&!(gr(r)&&gr(t)))return t;let n=(i?r:Object.keys(r)).length,l=i?t:Object.keys(t),d=l.length,s=i?Array(d):{},c=0;for(let p=0;p<d;p++){let g=i?p:l[p],h=r[g],u=t[g];if(h===u){if(s[g]=h,i?p<n:oa.call(r,g))c++;continue}if(h===null||u===null||typeof h!=="object"||typeof u!=="object"){s[g]=u;continue}let y=We(h,u,o+1);if(s[g]=y,y===h)c++}return n===d&&c===n?r:s}function It(r,t){if(!t||Object.keys(r).length!==Object.keys(t).length)return!1;for(let o in r)if(r[o]!==t[o])return!1;return!0}function Yr(r){return Array.isArray(r)&&r.length===Object.keys(r).length}function gr(r){if(!Kr(r))return!1;let t=r.constructor;if(t===void 0)return!0;let o=t.prototype;if(!Kr(o))return!1;if(!o.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf(r)!==Object.prototype)return!1;return!0}function Kr(r){return Object.prototype.toString.call(r)==="[object Object]"}function Gr(r){return new Promise((t)=>{He.setTimeout(t,r)})}function Er(r,t,o){if(typeof o.structuralSharing==="function")return o.structuralSharing(r,t);else if(o.structuralSharing!==!1)return We(r,t);return t}function rt(r,t,o=0){let i=[...r,t];return o&&i.length>o?i.slice(1):i}function tt(r,t,o=0){let i=[t,...r];return o&&i.length>o?i.slice(0,-1):i}var j=Symbol();function J(r,t){if(!r.queryFn&&t?.initialPromise)return()=>t.initialPromise;if(!r.queryFn||r.queryFn===j)return()=>Promise.reject(Error(`Missing queryFn: '${r.queryHash}'`));return r.queryFn}function nr(r,t){if(typeof r==="function")return r(...t);return!!r}function at(r,t,o){let i=!1,n;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>{if(n??=t(),i)return n;if(i=!0,n.aborted)o();else n.addEventListener("abort",o,{once:!0});return n}}),r}var ia=()=>ur,ir=()=>ia();var ye=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var na=class extends ye{#r;#t;#a;constructor(){super();this.#a=(r)=>{if(typeof window<"u"&&window.addEventListener){let t=()=>r();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){if(!this.#t)this.setEventListener(this.#a)}onUnsubscribe(){if(!this.hasListeners())this.#t?.(),this.#t=void 0}setEventListener(r){this.#a=r,this.#t?.(),this.#t=r((t)=>{if(typeof t==="boolean")this.setFocused(t);else this.onFocus()})}setFocused(r){if(this.#r!==r)this.#r=r,this.onFocus()}onFocus(){let r=this.isFocused();this.listeners.forEach((t)=>{t(r)})}isFocused(){if(typeof this.#r==="boolean")return this.#r;return globalThis.document?.visibilityState!=="hidden"}},sr=new na;var et=Qr;function sa(){let r=[],t=0,o=(s)=>{s()},i=(s)=>{s()},n=et,l=(s)=>{if(t)r.push(s);else n(()=>{o(s)})},d=()=>{let s=r;if(r=[],s.length)n(()=>{i(()=>{s.forEach((c)=>{o(c)})})})};return{batch:(s)=>{let c;t++;try{c=s()}finally{if(t--,!t)d()}return c},batchCalls:(s)=>(...c)=>{l(()=>{s(...c)})},schedule:l,setNotifyFunction:(s)=>{o=s},setBatchNotifyFunction:(s)=>{i=s},setScheduler:(s)=>{n=s}}}var M=sa();var ca=class extends ye{#r=!0;#t;#a;constructor(){super();this.#a=(r)=>{if(typeof window<"u"&&window.addEventListener){let t=()=>r(!0),o=()=>r(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",o)}}}}onSubscribe(){if(!this.#t)this.setEventListener(this.#a)}onUnsubscribe(){if(!this.hasListeners())this.#t?.(),this.#t=void 0}setEventListener(r){this.#a=r,this.#t?.(),this.#t=r(this.setOnline.bind(this))}setOnline(r){if(this.#r!==r)this.#r=r,this.listeners.forEach((t)=>{t(r)})}isOnline(){return this.#r}},E=new ca;function la(r){return Math.min(1000*2**r,30000)}function vr(r){return(r??"online")==="online"?E.isOnline():!0}var V=class extends Error{constructor(r){super("CancelledError");this.revert=r?.revert,this.silent=r?.silent}};function Q(r){let t=!1,o=0,i,n="pending",l,d,s=new Promise((v,f)=>{l=v,d=f});s.catch(U);let c=()=>n!=="pending",p=(v)=>{if(!c()){let f=new V(v);m(f),r.onCancel?.(f)}},g=()=>{t=!0},h=()=>{t=!1},u=()=>sr.isFocused()&&(r.networkMode==="always"||E.isOnline())&&r.canRun(),y=()=>vr(r.networkMode)&&r.canRun(),w=(v)=>{if(!c())i?.(),n="resolved",l(v)},m=(v)=>{if(!c())i?.(),n="rejected",d(v)},z=()=>new Promise((v)=>{i=(f)=>{if(c()||u())v(f)},r.onPause?.()}).then(()=>{if(i=void 0,!c())r.onContinue?.()}),Z=()=>{if(c())return;let v,f=o===0?r.initialPromise:void 0;try{v=f??r.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(w).catch((b)=>{if(c())return;let _=r.retry??(ir()?0:3),I=r.retryDelay??la,At=typeof I==="function"?I(o,b):I,Pt=_===!0||typeof _==="number"&&o<_||typeof _==="function"&&_(o,b);if(t||!Pt){m(b);return}o++,r.onFail?.(o,b),Gr(At).then(()=>u()?void 0:z()).then(()=>{if(t)m(b);else Z()})})};return{promise:s,status:()=>n,cancel:p,continue:()=>(i?.(),s),cancelRetry:g,continueRetry:h,canStart:y,start:()=>{if(y())Z();else z().then(Z);return s}}}var Y=class{#r;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),co(this.gcTime))this.#r=He.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(ir()?1/0:300000))}clearGcTimeout(){if(this.#r!==void 0)He.clearTimeout(this.#r),this.#r=void 0}};function st(r){return{onFetch:(t,o)=>{let i=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],d=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,p=async()=>{let g=!1,h=(w)=>{at(w,()=>t.signal,()=>g=!0)},u=J(t.options,t.fetchOptions),y=async(w,m,z)=>{if(g)return Promise.reject(t.signal.reason);if(m==null&&w.pages.length)return Promise.resolve(w);let v=(()=>{let I={client:t.client,queryKey:t.queryKey,pageParam:m,direction:z?"backward":"forward",meta:t.options.meta};return h(I),I})(),f=await u(v),{maxPages:b}=t.options,_=z?tt:rt;return{pages:_(w.pages,f,b),pageParams:_(w.pageParams,m,b)}};if(n&&l.length){let w=n==="backward",m=w?da:ot,z={pages:l,pageParams:d};s=await y(z,m(i,z),w)}else{let w=r??l.length;do{let m=c===0?d[0]??i.initialPageParam:ot(i,s);if(c>0&&m==null)break;s=await y(s,m),c++}while(c<w)}return s};if(t.options.persister)t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},o);else t.fetchFn=p}}}function ot(r,{pages:t,pageParams:o}){let i=t.length-1;return t.length>0?r.getNextPageParam(t[i],t,o[i],o):void 0}function da(r,{pages:t,pageParams:o}){return t.length>0?r.getPreviousPageParam?.(t[0],t,o[0],o):void 0}var dt=class extends Y{#r;#t;#a;#o;#i;#e;#c;#n;constructor(r){super();this.#n=!1,this.#c=r.defaultOptions,this.setOptions(r.options),this.observers=[],this.#i=r.client,this.#o=this.#i.getQueryCache(),this.queryKey=r.queryKey,this.queryHash=r.queryHash,this.#t=lt(this.options),this.state=r.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#r}get promise(){return this.#e?.promise}setOptions(r){if(this.options={...this.#c,...r},r?._type)this.#r=r._type;if(this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let t=lt(this.options);if(t.data!==void 0)this.setState(ct(t.data,t.dataUpdatedAt)),this.#t=t}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#o.remove(this)}setData(r,t){let o=Er(this.state.data,r,this.options);return this.#s({data:o,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),o}setState(r){this.#s({type:"setState",state:r})}cancel(r){let t=this.#e?.promise;return this.#e?.cancel(r),t?t.then(U).catch(U):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some((r)=>W(r.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some((r)=>W(r.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some((r)=>r.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){if(this.state.data===void 0)return!0;if(r==="static")return!1;if(this.state.isInvalidated)return!0;return!uo(this.state.dataUpdatedAt,r)}onFocus(){this.observers.find((r)=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#e?.continue()}onOnline(){this.observers.find((r)=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#e?.continue()}addObserver(r){if(!this.observers.includes(r))this.observers.push(r),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",query:this,observer:r})}removeObserver(r){let t=this.observers.indexOf(r);if(t!==-1){if(this.observers.splice(t,1),!this.observers.length){if(this.#e)if(this.#n||this.state.fetchStatus==="paused"&&this.state.status==="pending")this.#e.cancel({revert:!0});else this.#e.cancelRetry();this.scheduleGc()}this.#o.notify({type:"observerRemoved",query:this,observer:r})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#s({type:"invalidate"})}async fetch(r,t){if(this.state.fetchStatus!=="idle"&&this.#e?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#e)return this.#e.continueRetry(),this.#e.promise}if(r)this.setOptions(r);if(!this.options.queryFn){let c=this.observers.find((p)=>p.options.queryFn);if(c)this.setOptions(c.options)}let o=new AbortController,i=(c)=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#n=!0,o.signal)})},n=()=>{let c=J(this.options,t),g=(()=>{let h={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(h),h})();if(this.#n=!1,this.options.persister)return this.options.persister(c,g,this);return c(g)},d=(()=>{let c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:n};return i(c),c})();if((this.#r==="infinite"?st(this.options.pages):this.options.behavior)?.onFetch(d,this),this.#a=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)this.#s({type:"fetch",meta:d.fetchOptions?.meta});let s=this.#e=Q({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:(c)=>{if(c instanceof V&&c.revert)this.setState({...this.#a,fetchStatus:"idle"});o.abort()},onFail:(c,p)=>{this.#s({type:"failed",failureCount:c,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{let c=await s.start();if(c===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#o.config.onSuccess?.(c,this),this.#o.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof V){if(c.silent)return this.#e.promise;else if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#o.config.onError?.(c,this),this.#o.config.onSettled?.(this.state.data,c,this),c}finally{if(this.#e===s)this.#e=void 0;this.scheduleGc()}}#s(r){let t=(o)=>{switch(r.type){case"failed":return{...o,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...Ho(o.data,this.options),fetchMeta:r.meta??null};case"success":let i={...o,...ct(r.data,r.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#a=r.manual?i:void 0,i;case"error":let n=r.error;return{...o,error:n,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...r.state}}};this.state=t(this.state),M.batch(()=>{this.observers.slice().forEach((o)=>{o.onQueryUpdate()}),this.#o.notify({query:this,type:"updated",action:r})})}};function Ho(r,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vr(t.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function ct(r,t){return{data:r,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function lt(r){let t=typeof r.initialData==="function"?r.initialData():r.initialData,o=t!==void 0,i=o?typeof r.initialDataUpdatedAt==="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:o?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var pt=class extends Y{#r;#t;#a;#o;constructor(r){super();this.#r=r.client,this.mutationId=r.mutationId,this.#a=r.mutationCache,this.#t=[],this.state=r.state||Uo(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){if(!this.#t.includes(r))this.#t.push(r),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:r})}removeObserver(r){this.#t=this.#t.filter((t)=>t!==r),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){if(!this.#t.length)if(this.state.status==="pending")this.scheduleGc();else this.#a.remove(this)}continue(){return this.#o?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(r){let t=()=>{this.#i({type:"continue"})},o={client:this.#r,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#o=Q({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn(r,o)},onFail:(d,s)=>{this.#i({type:"failed",failureCount:d,error:s})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)}),n=this.state.status==="pending",l=!i.canStart();try{if(n)t();else{if(this.#i({type:"pending",variables:r,isPaused:l}),this.#a.config.onMutate)await this.#a.config.onMutate(r,this,o);let s=await this.options.onMutate?.(r,o);if(s!==this.state.context)this.#i({type:"pending",context:s,variables:r,isPaused:l})}let d=await i.start();return await this.#a.config.onSuccess?.(d,r,this.state.context,this,o),await this.options.onSuccess?.(d,r,this.state.context,o),await this.#a.config.onSettled?.(d,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(d,null,r,this.state.context,o),this.#i({type:"success",data:d}),d}catch(d){try{await this.#a.config.onError?.(d,r,this.state.context,this,o)}catch(s){Promise.reject(s)}try{await this.options.onError?.(d,r,this.state.context,o)}catch(s){Promise.reject(s)}try{await this.#a.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,o)}catch(s){Promise.reject(s)}try{await this.options.onSettled?.(void 0,d,r,this.state.context,o)}catch(s){Promise.reject(s)}throw this.#i({type:"error",error:d}),d}finally{if(this.#o===i)this.#o=void 0;this.#a.runNext(this)}}#i(r){let t=(o)=>{switch(r.type){case"failed":return{...o,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...o,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:r.error,failureCount:o.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=t(this.state),M.batch(()=>{this.#t.forEach((o)=>{o.onMutationUpdate(r)}),this.#a.notify({mutation:this,type:"updated",action:r})})}};function Uo(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ht=class extends ye{#r;#t;#a;constructor(r={}){super();this.config=r,this.#r=new Set,this.#t=new Map,this.#a=0}build(r,t,o){let i=new pt({client:r,mutationCache:this,mutationId:++this.#a,options:r.defaultMutationOptions(t),state:o});return this.add(i),i}add(r){this.#r.add(r);let t=K(r);if(typeof t==="string"){let o=this.#t.get(t);if(o)o.push(r);else this.#t.set(t,[r])}this.notify({type:"added",mutation:r})}remove(r){if(this.#r.delete(r)){let t=K(r);if(typeof t==="string"){let o=this.#t.get(t);if(o){if(o.length>1){let i=o.indexOf(r);if(i!==-1)o.splice(i,1)}else if(o[0]===r)this.#t.delete(t)}}}this.notify({type:"removed",mutation:r})}canRun(r){let t=K(r);if(typeof t==="string"){let o=this.#t.get(t)?.find((i)=>i.state.status==="pending");return!o||o===r}else return!0}runNext(r){let t=K(r);if(typeof t==="string")return this.#t.get(t)?.find((o)=>o!==r&&o.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){M.batch(()=>{this.#r.forEach((r)=>{this.notify({type:"removed",mutation:r})}),this.#r.clear(),this.#t.clear()})}getAll(){return Array.from(this.#r)}find(r){let t={exact:!0,...r};return this.getAll().find((o)=>L(t,o))}findAll(r={}){return this.getAll().filter((t)=>L(r,t))}notify(r){M.batch(()=>{this.listeners.forEach((t)=>{t(r)})})}resumePausedMutations(){let r=this.getAll().filter((t)=>t.state.isPaused);return M.batch(()=>Promise.all(r.map((t)=>t.continue().catch(U))))}};function K(r){return r.options.scope?.id}var gt=class extends ye{#r;constructor(r={}){super();this.config=r,this.#r=new Map}build(r,t,o){let i=t.queryKey,n=t.queryHash??T(i,t),l=this.get(n);if(!l)l=new dt({client:r,queryKey:i,queryHash:n,options:r.defaultQueryOptions(t),state:o,defaultOptions:r.getQueryDefaults(i)}),this.add(l);return l}add(r){if(!this.#r.has(r.queryHash))this.#r.set(r.queryHash,r),this.notify({type:"added",query:r})}remove(r){let t=this.#r.get(r.queryHash);if(t){if(r.destroy(),t===r)this.#r.delete(r.queryHash);this.notify({type:"removed",query:r})}}clear(){M.batch(()=>{this.getAll().forEach((r)=>{this.remove(r)})})}get(r){return this.#r.get(r)}getAll(){return[...this.#r.values()]}find(r){let t={exact:!0,...r};return this.getAll().find((o)=>or(t,o))}findAll(r={}){let t=this.getAll();return Object.keys(r).length>0?t.filter((o)=>or(r,o)):t}notify(r){M.batch(()=>{this.listeners.forEach((t)=>{t(r)})})}onFocus(){M.batch(()=>{this.getAll().forEach((r)=>{r.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach((r)=>{r.onOnline()})})}};var wr=class{#r;#t;#a;#o;#i;#e;#c;#n;constructor(r={}){this.#r=r.queryCache||new gt,this.#t=r.mutationCache||new ht,this.#a=r.defaultOptions||{},this.#o=new Map,this.#i=new Map,this.#e=0}mount(){if(this.#e++,this.#e!==1)return;this.#c=sr.subscribe(async(r)=>{if(r)await this.resumePausedMutations(),this.#r.onFocus()}),this.#n=E.subscribe(async(r)=>{if(r)await this.resumePausedMutations(),this.#r.onOnline()})}unmount(){if(this.#e--,this.#e!==0)return;this.#c?.(),this.#c=void 0,this.#n?.(),this.#n=void 0}isFetching(r){return this.#r.findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return this.#t.findAll({...r,status:"pending"}).length}getQueryData(r){let t=this.defaultQueryOptions({queryKey:r});return this.#r.get(t.queryHash)?.state.data}ensureQueryData(r){let t=this.defaultQueryOptions(r),o=this.#r.build(this,t),i=o.state.data;if(i===void 0)return this.fetchQuery(r);if(r.revalidateIfStale&&o.isStaleByTime(W(t.staleTime,o)))this.prefetchQuery(t);return Promise.resolve(i)}getQueriesData(r){return this.#r.findAll(r).map(({queryKey:t,state:o})=>[t,o.data])}setQueryData(r,t,o){let i=this.defaultQueryOptions({queryKey:r}),n=this.#r.get(i.queryHash)?.state.data,l=Xr(t,n);if(l===void 0)return;return this.#r.build(this,i).setData(l,{...o,manual:!0})}setQueriesData(r,t,o){return M.batch(()=>this.#r.findAll(r).map(({queryKey:i})=>[i,this.setQueryData(i,t,o)]))}getQueryState(r){let t=this.defaultQueryOptions({queryKey:r});return this.#r.get(t.queryHash)?.state}removeQueries(r){let t=this.#r;M.batch(()=>{t.findAll(r).forEach((o)=>{t.remove(o)})})}resetQueries(r,t){let o=this.#r;return M.batch(()=>{let i=o.findAll(r),n=new Set(i);return i.forEach((l)=>{l.reset()}),this.refetchQueries({type:"active",predicate:(l)=>n.has(l)},t)})}cancelQueries(r,t={}){let o={revert:!0,...t},i=M.batch(()=>this.#r.findAll(r).map((n)=>n.cancel(o)));return Promise.all(i).then(U).catch(U)}invalidateQueries(r,t={}){return M.batch(()=>{if(this.#r.findAll(r).forEach((o)=>{o.invalidate()}),r?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...r,type:r?.refetchType??r?.type??"active"},t)})}refetchQueries(r,t={}){let o={...t,cancelRefetch:t.cancelRefetch??!0},i=M.batch(()=>this.#r.findAll(r).filter((n)=>!n.isDisabled()&&!n.isStatic()).map((n)=>{let l=n.fetch(void 0,o);if(!o.throwOnError)l=l.catch(U);return n.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(U)}async query(r){let t=this.defaultQueryOptions(r);if(t.retry===void 0)t.retry=!1;let o=this.#r.build(this,t),i=o.isStaleByTime(W(t.staleTime,o))?await o.fetch(t):o.state.data,n=t.select;if(n)return n(i);return i}fetchQuery(r){let t=this.defaultQueryOptions(r);if(t.retry===void 0)t.retry=!1;let o=this.#r.build(this,t);return o.isStaleByTime(W(t.staleTime,o))?o.fetch(t):Promise.resolve(o.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(U).catch(U)}infiniteQuery(r){return r._type="infinite",this.query(r)}fetchInfiniteQuery(r){return r._type="infinite",this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(U).catch(U)}ensureInfiniteQueryData(r){return r._type="infinite",this.ensureQueryData(r)}resumePausedMutations(){if(E.isOnline())return this.#t.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#t}getDefaultOptions(){return this.#a}setDefaultOptions(r){this.#a=r}setQueryDefaults(r,t){this.#o.set(Ue(r),{queryKey:r,defaultOptions:t})}getQueryDefaults(r){let t=[...this.#o.values()],o={};return t.forEach((i)=>{if(P(r,i.queryKey))Object.assign(o,i.defaultOptions)}),o}setMutationDefaults(r,t){this.#i.set(Ue(r),{mutationKey:r,defaultOptions:t})}getMutationDefaults(r){let t=[...this.#i.values()],o={};return t.forEach((i)=>{if(P(r,i.mutationKey))Object.assign(o,i.defaultOptions)}),o}defaultQueryOptions(r){if(r._defaulted)return r;let t={...this.#a.queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};if(!t.queryHash)t.queryHash=T(t.queryKey,t);if(t.refetchOnReconnect===void 0)t.refetchOnReconnect=t.networkMode!=="always";if(t.throwOnError===void 0)t.throwOnError=!!t.suspense;if(!t.networkMode&&t.persister)t.networkMode="offlineFirst";if(t.queryFn===j)t.enabled=!1;return t}defaultMutationOptions(r){if(r?._defaulted)return r;return{...this.#a.mutations,...r?.mutationKey&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){this.#r.clear(),this.#t.clear()}};var it=new wr;var a={all:["workspaces"],discover:["workspaces","discover"],previews:["workspaces","previews"],layout:(r)=>["workspaces","layout",r],widgets:(r)=>["workspaces","widgets",r],appletThumbnails:(r)=>["workspaces","applet-thumbnails",r],views:(r)=>["workspaces","views",r],sessions:(r)=>["workspaces","sessions",r],events:(r,t)=>["workspaces","events",r,t],state:(r)=>["workspaces","state",r],mcp:(r)=>["workspaces","mcp",r],harness:(r)=>["workspaces","harness",r],skills:(r)=>["workspaces","skills",r],env:(r)=>["workspaces","env",r]};function ar(r){return`${location.protocol==="https:"?"wss":"ws"}://${location.host}${r}`}class Ut{url;options;listeners=new Set;socket;holders=0;attempts=0;lastMessageAt=0;retry;heartbeat;constructor(r,t={}){this.url=r;this.options=t}get isOpen(){return this.socket?.readyState===WebSocket.OPEN}subscribe(r){return this.listeners.add(r),()=>{this.listeners.delete(r)}}start(){let r=!0;if(this.holders++===0)this.open();return()=>{if(!r)return;if(r=!1,--this.holders===0)this.drop()}}reconnect(){if(this.drop(),this.holders)this.retry=setTimeout(()=>this.open(),0)}send(r){if(!this.isOpen)return;try{this.socket?.send(JSON.stringify(r))}catch{this.socket?.close()}}open(){if(this.socket||!this.holders)return;let r=new WebSocket(this.url());this.socket=r,r.onopen=()=>{if(r!==this.socket)return;if(this.attempts=0,this.lastMessageAt=Date.now(),this.options.ping)this.heartbeat=setInterval(()=>{if(Date.now()-this.lastMessageAt>45000)r.close();else this.send({type:"ping"})},15000);for(let t of this.listeners)t.open?.()},r.onmessage=(t)=>{if(r!==this.socket)return;this.lastMessageAt=Date.now();let o;try{o=JSON.parse(String(t.data))}catch{return}for(let i of this.listeners)i.message?.(o)},r.onerror=()=>r.close(),r.onclose=()=>{if(r!==this.socket)return;clearInterval(this.heartbeat),this.socket=void 0;for(let i of this.listeners)i.close?.();let o=Math.min((this.options.baseDelayMs??500)*2**this.attempts++,1e4)*(0.5+Math.random()*0.5);this.retry=setTimeout(()=>this.open(),o)}}drop(){clearTimeout(this.retry),clearInterval(this.heartbeat);let r=this.socket;if(!r)return;this.socket=void 0,r.close();for(let t of this.listeners)t.close?.()}}var mr=(r,t)=>t.getQueryData(a.layout(r));function Wt(r,t=it){return mr(r,t)?.isRemote??!1}function ie(r,t=it){let o=mr(r,t)?.apiBase;if(!o)throw Error("Workspace identity is not loaded");return o}function Rr(r,t=it){let o=mr(r,t)?.apiBase;return o?decodeURIComponent(o.slice(16)):r}function po(r){return new Ut(()=>ar(`${ie(r)}/events`),{ping:!0})}function fr(r){if(!Be(r)||!Array.isArray(r.members)||!Array.isArray(r.invitations))throw Error("Invalid workspace members");let t=r.members.map((i)=>{let n=nt(i);if(Be(i)&&i.membershipId!==void 0){if(typeof i.membershipId!=="string"||!i.membershipId||i.membershipId.length>240)throw Error("Invalid membership id");return{...n,membershipId:i.membershipId}}return n}),o=r.invitations.map((i)=>{if(!Be(i)||typeof i.id!=="string"||!i.id||typeof i.email!=="string"||!i.email||typeof i.expiresAt!=="string"||!Number.isFinite(Date.parse(i.expiresAt)))throw Error("Invalid invitation");return{id:i.id,email:i.email,expiresAt:i.expiresAt}});if(new Set(t.map(ze)).size!==t.length||new Set(o.map((i)=>i.id)).size!==o.length)throw Error("Duplicate workspace member or invitation");return{members:t,invitations:o}}function X(r){if(!/^(?:[A-Za-z0-9_-]{1,64}:)?[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/.test(r))throw Error("Invalid workspace id");return r}var br;function x(){let r=ne();if(br?.accountGeneration!==r)br={accountGeneration:r,lists:new Map,complete:!1};return br}var mt=0,xr=new Set;function O(){mt++,xr.forEach((r)=>r())}var ft=()=>mt,ut=new WeakMap,pa={members:[],invitations:[]},vt=new WeakMap;function bt(r){if(!x().complete)return;if(r.includes(":"))return pa;let t=Te();if(t?.type!=="user"||t.isAnonymous)return;let o=ut.get(t);if(!o)o={members:[t],invitations:[]},ut.set(t,o);return o}function G(r,t){let{lists:o}=x();o.set(r,We(o.get(r),t))}function xt(r,t){G(X(r),fr(t)),O()}function yt(r){if(!Array.isArray(r))throw Error("Invalid workspace members");let t=r.map((n)=>[X(n.id),fr(n)]),o=new Set(t.map(([n])=>n));if(o.size!==t.length)throw Error("Duplicate workspace id");let{lists:i}=x();for(let n of i.keys())if(!o.has(n))i.delete(n);for(let[n,l]of t)G(n,l);x().complete=!0,O()}function kt(r){x().lists.delete(X(r)),O()}function zt(){x().lists.clear(),O()}function hn(r,t){let o=Rr(r),i=x().lists.get(o)??bt(o),n=i&&t(i);if(!n)return;G(o,n),O()}function gn(r){let t=ze(r);for(let[o,i]of x().lists)G(o,{...i,members:i.members.map((n)=>ze(n)===t?{...r,...n.membershipId&&{membershipId:n.membershipId}}:n)});O()}function Wo(r){let t=Rr(r);return x().lists.get(t)??bt(t)}function xn(r){let t=Wo(r);if(!t)return;let o=vt.get(t);if(!o)o=t.members.map(Pr),vt.set(t,o);return o}function Ar(r){xr.add(r);let t=it.getQueryCache().subscribe((o)=>{let[i,n]=o.query.queryKey;if(i===a.all[0]&&n==="layout")r()});return()=>{xr.delete(r),t()}}function _t(){if(typeof window>"u")return;let r=window;r.moi??={},r.moi.identity={set:wt,getRevision:Tr},r.moi.workspaceMembers={set:xt,setAll:yt,remove:kt,clear:zt,getRevision:ft}}_t();Vr();async function ha(r){let[{mount:t},o,i]=await Promise.all([(Fe("j3djs7ta"),import("/chunk-j3djs7ta.js")),(Fe("yff16m73"),import("/chunk-yff16m73.js")).then((n)=>n.loadAppConfig()),(Fe("0xy5nenk"),import("/chunk-0xy5nenk.js")).then((n)=>n.loadProxyUser())]);Jr(o?.environment==="local"&&!o.demo,i),t(r)}globalThis.__init=ha;export{e,k,Ht,un,Fe,kr,dn,so,pn,Be,nt,ze,rr,Te,Tr,ne,ao,wt,fn,Pr,pe,St,we,mn,lo,He,U,co,uo,W,or,Ue,We,It,Er,nr,ir,ye,sr,M,Ho,Uo,it,a,ar,Ut,Wt,ie,Rr,po,hn,gn,Wo,xn,Ar};
1
+ var Ct=Object.create;var{getPrototypeOf:Dt,defineProperty:tr,getOwnPropertyNames:jt}=Object;var yr=Object.prototype.hasOwnProperty;function Et(r){return this[r]}var $t,Ot,e=(r,t,o)=>{var i=r!=null&&typeof r==="object";if(i){var n=t?$t??=new WeakMap:Ot??=new WeakMap,l=n.get(r);if(l)return l}o=r!=null?Ct(Dt(r)):{};let d=t||!r||!r.__esModule||!yr.call(r,"default")?tr(o,"default",{value:r,enumerable:!0}):o;if(r&&typeof r==="object"||typeof r==="function"){for(let s of jt(r))if(!yr.call(d,s))tr(d,s,{get:Et.bind(r,s),enumerable:!0})}if(i)n.set(r,d);return d};var k=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var Rt=(r)=>r;function Tt(r,t){this[r]=Rt.bind(null,t)}var Ht=(r,t)=>{for(var o in t)tr(r,o,{get:t[o],enumerable:!0,configurable:!0,set:Tt.bind(t,o)})};var pn=((r)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var zr,er,H,Fe=(r,t)=>{for(var[o,i,n]of zr||[])for(var l=[r],d=globalThis,s=d.document,c,p,g,h,u;p=l.pop();)if(!er[p]&&(g=i[p])){er[p]=1;for(h=1;h<g.length;h++)l.push(n[g[h]]);if(!t&&p!==r&&(c=s&&s.head)){if(H===void 0)H=(h=s.querySelector("meta[property=csp-nonce]"))&&(h.nonce||h.getAttribute("nonce"))||"";if(u=s.createElement("link"),u.rel="modulepreload",u.crossOrigin="",H)u.nonce=H;u.href=new d.URL(g[0],o),c.appendChild(u)}}},Mt=(r,t,o,i)=>{for(var n={},l=0;l<t.length;l++)n[t[l]]=o[l];(zr||=[]).push([r,n,t]),er||={},Fe(t[i],1)};Mt(import.meta.url,["kkhswjz8","yv6n9e3z","rb2vsqvb","nqh3kx2x","nf2wkvf9","828s864r","ht9zmff2","gh11h6dc","jqa4c92z","hhgsmxsq","t22yw8s6"],[["/chunk-kkhswjz8.js"],["/chunk-yv6n9e3z.js",6,0,7,8],["/chunk-rb2vsqvb.js",7],["/chunk-nqh3kx2x.js",0,8],["/chunk-nf2wkvf9.js"],["/chunk-828s864r.js",6,7,0,10,8],["/chunk-ht9zmff2.js",0,7,8],["/chunk-gh11h6dc.js",0,8],["/chunk-jqa4c92z.js"],["/chunk-hhgsmxsq.js",10],["/chunk-t22yw8s6.js"]],0);
2
+ if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);var Zt=(r)=>crypto.getRandomValues(new Uint8Array(r)),Nt=(r,t,o)=>{let i=256-256%r.length;if(i===256){let l=r.length-1;return(d=t)=>{if(!d)return"";let s="";while(!0){let c=o(d),p=d;while(p--)if(s+=r[c[p]&l],s.length>=d)return s}}}let n=Math.ceil(409.6*t/i);return(l=t)=>{if(!l)return"";let d="";while(!0){let s=o(n),c=n;while(c--)if(s[c]<i){if(d+=r[s[c]%r.length],d.length>=l)return d}}}},cr=(r,t=21)=>Nt(r,t|0,Zt);var Cr=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,Ir="agent:",Dr=(r)=>Ir+r,kr=(r)=>r.startsWith(Ir),jr="0123456789abcdefghijklmnopqrstuvwxyz",xa=cr(jr,10),_r=["create","discover","order","previews"];function fn(r){if(!r)return"Workspace id is required";if(r.length>64)return"Workspace id is too long (max 64 characters)";if(!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(r))return"Use letters, numbers, dashes and underscores, starting with a letter or number";if(_r.includes(r.toLowerCase()))return`Workspace id ${r} is reserved (${_r.join(", ")})`;return null}var ya=cr(jr,6);var D=["pink","orange","amber","lime","emerald","cyan","blue","violet"];function N(r){return typeof r==="string"&&D.includes(r)}function lo(r){let t=2166136261;for(let o=0;o<r.length;o++)t^=r.charCodeAt(o),t=Math.imul(t,16777619);return D[(t>>>0)%D.length]??D[0]}var mn=1;var Ft=8192,Bt=320;function Be(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)}function F(r,t=256){return typeof r==="string"&&r.length>0&&!r.includes("\x00")&&new TextEncoder().encode(r).length<=t}function Wr(r){return Be(r)&&F(r.id,240)&&r.id.trim().length>0&&(r.name===void 0||F(r.name)&&r.name.trim().length>0)&&N(r.color)&&(r.avatar===void 0||F(r.avatar,Ft))&&(r.email===void 0||F(r.email,Bt))}function S(r,t){return typeof r==="string"&&r.length<=t&&!r.includes("\x00")}function qt(r){if(!S(r,2048))return!1;try{return["http:","https:"].includes(new URL(r).protocol)}catch{return!1}}function nt(r){if(!Be(r)||!S(r.id,240)||!r.id.trim()||r.id!==r.id.trim()||!S(r.name,256)||r.avatar!==void 0&&!qt(r.avatar))throw Error("Invalid identity");let t={id:r.id,name:r.name,...r.avatar!==void 0?{avatar:r.avatar}:{}};if(r.type==="agent")return{...t,type:"agent",...S(r.client,256)&&{client:r.client}};if(r.type==="user"&&S(r.email,320)&&typeof r.isAnonymous==="boolean")return{...t,type:"user",email:r.email,isAnonymous:r.isAnonymous};throw Error("Invalid identity")}var ze=(r)=>`${r.type}:${r.id}`,rr=(r)=>r.type==="agent"?Dr(r.id):r.id;var B,$r=0,Or=0,lr=new Set,Te=()=>B,Tr=()=>Or,ne=()=>$r;function co(r){return lr.add(r),()=>{lr.delete(r)}}function wt(r){let t=r===null?null:nt(r);if((B&&ze(B))!==(t&&ze(t)))$r++;Or++,B=t,lr.forEach((i)=>i())}var Sr="/dot-2bdkpg3k.png";var Mr="/duet-3ab8xyzd.png";var Zr="/grok-bot-yv07qj9f.png";var Hr="/instinct-ypmq6t0w.png";var Nr="/muse-qr7zwsvf.png";var Kt=new Map(Object.entries({dot:Sr,duet:Mr,"grok-bot":Zr,instinct:Hr,muse:Nr}));function Fr(r){return r?Kt.get(r):void 0}function hn(r){if(!r||r==="unknown"||!Cr.test(r))return"Other";return r.split("-").map((t)=>t[0].toUpperCase()+t.slice(1)).join(" ")}var Xt=["Curious Kiwi","Cheerful Cherry","Sleepy Peach","Excited Banana","Cosmic Mango","Velvet Lemon","Electric Plum","Wandering Pear","Dramatic Papaya","Suspicious Pineapple","Confused Coconut","Sneaky Tangerine","Gentle Fig","Quiet Apricot","Mellow Melon","Dreamy Guava"];function Ur(r,t){let o=r.filter((i)=>i!==t);return o[Math.floor(Math.random()*o.length)]??r[0]}function Gt(r){return{name:Ur(Xt,r?.name),color:Ur(D,r?.color)}}function ra(r,t){let o=t.name.trim();return{id:r,...o?{name:o}:{},color:t.color}}function Br(){return ra(`local-${crypto.randomUUID().slice(0,8)}`,Gt())}var pr="moi:local-profile",A,C,R=new Set;function hr(r,t){return JSON.stringify(r)===JSON.stringify(t)}function q(r){if(!r||typeof r.id!=="string"||!r.id.trim())throw Error("A user profile needs an id.");if(r.name!==void 0&&typeof r.name!=="string")throw Error("A user profile name must be a string when provided.");if(r.color!==void 0&&!N(r.color))throw Error("A user profile color must be one of the user palette names.");let t=r.id.trim(),o=r.name?.trim(),i={id:t,...o?{name:o}:{},color:r.color??lo(t),...r.avatar!==void 0?{avatar:r.avatar}:{},...r.email!==void 0?{email:r.email}:{}};if(!Wr(i))throw Error("Invalid user profile.");return Object.freeze(i)}function Pr(r){return q({id:rr(r),name:r.name||void 0,avatar:r.avatar??(r.type==="agent"?Fr(r.client):void 0),email:r.type==="user"?r.email||void 0:void 0})}var dr,qr;function pe(){let r=Te();if(r===void 0)return A;if(r!==qr){qr=r;let t=!r||r.type==="user"&&r.isAnonymous?void 0:Pr(r);if(!hr(dr,t))dr=t}return dr}function St(r){let t=pe(),o=we(),i=()=>{let l=pe(),d=we();if(t===l&&o===d)return;t=l,o=d,r()};R.add(i);let n=co(i);return()=>{R.delete(i),n()}}function we(){return Te()!==void 0?"external":C}function gn({provider:r,profile:t}){if(we()==="external")return;if(r===void 0){if(C===void 0||C==="local")return;C=void 0,A=void 0}else{let o=t===void 0?void 0:q(t);if(C===r&&hr(A,o))return;C=r,A=o}R.forEach((o)=>o())}function ta(){try{localStorage.setItem(pr,JSON.stringify(A))}catch{}}function uo(r){if(we()!==void 0&&we()!=="local")return;let t=q(r);C="local",A=t,ta(),R.forEach((o)=>o())}function Jr(r,t){if(!r||!t||t.provider!==void 0||we()!==void 0)return;try{let o=localStorage.getItem(pr);if(o){uo(JSON.parse(o));return}}catch{}uo(Br())}function Lr(r){if(r.key!==pr||!r.newValue||we()!=="local")return;try{let t=q(JSON.parse(r.newValue));if(hr(t,A))return;A=t,R.forEach((o)=>o())}catch{}}function Vr(){return window.addEventListener("storage",Lr),()=>window.removeEventListener("storage",Lr)}var aa={setTimeout:(r,t)=>setTimeout(r,t),clearTimeout:(r)=>clearTimeout(r),setInterval:(r,t)=>setInterval(r,t),clearInterval:(r)=>clearInterval(r)},ea=class{#r=aa;#t=!1;setTimeoutProvider(r){this.#r=r}setTimeout(r,t){return this.#r.setTimeout(r,t)}clearTimeout(r){this.#r.clearTimeout(r)}setInterval(r,t){return this.#r.setInterval(r,t)}clearInterval(r){this.#r.clearInterval(r)}},He=new ea;function Qr(r){setTimeout(r,0)}var ur=typeof window>"u"||"Deno"in globalThis;function U(){}function Xr(r,t){return typeof r==="function"?r(t):r}function po(r){return typeof r==="number"&&r>=0&&r!==1/0}function fo(r,t){return Math.max(r+(t||0)-Date.now(),0)}function W(r,t){return typeof r==="function"?r(t):r}function or(r,t){let{type:o="all",exact:i,fetchStatus:n,predicate:l,queryKey:d,stale:s}=r;if(d){if(i){if(t.queryHash!==T(d,t.options))return!1}else if(!P(t.queryKey,d))return!1}if(o!=="all"){let c=t.isActive();if(o==="active"&&!c)return!1;if(o==="inactive"&&c)return!1}if(typeof s==="boolean"&&t.isStale()!==s)return!1;if(n&&n!==t.state.fetchStatus)return!1;if(l&&!l(t))return!1;return!0}function L(r,t){let{exact:o,status:i,predicate:n,mutationKey:l}=r;if(l){if(!t.options.mutationKey)return!1;if(o){if(Ue(t.options.mutationKey)!==Ue(l))return!1}else if(!P(t.options.mutationKey,l))return!1}if(i&&t.state.status!==i)return!1;if(n&&!n(t))return!1;return!0}function T(r,t){return(t?.queryKeyHashFn||Ue)(r)}function Ue(r){return JSON.stringify(r,(t,o)=>gr(o)?Object.keys(o).sort().reduce((i,n)=>(i[n]=o[n],i),{}):o)}function P(r,t){if(r===t)return!0;if(typeof r!==typeof t)return!1;if(r&&t&&typeof r==="object"&&typeof t==="object"){if(Array.isArray(r)&&Array.isArray(t)){for(let i=0;i<t.length;i++)if(!P(r[i],t[i]))return!1;return!0}let o=Object.keys(t);for(let i of o)if(!P(r[i],t[i]))return!1;return!0}return!1}var oa=Object.prototype.hasOwnProperty;function We(r,t,o=0){if(r===t)return r;if(o>500)return t;let i=Yr(r)&&Yr(t);if(!i&&!(gr(r)&&gr(t)))return t;let n=(i?r:Object.keys(r)).length,l=i?t:Object.keys(t),d=l.length,s=i?Array(d):{},c=0;for(let p=0;p<d;p++){let g=i?p:l[p],h=r[g],u=t[g];if(h===u){if(s[g]=h,i?p<n:oa.call(r,g))c++;continue}if(h===null||u===null||typeof h!=="object"||typeof u!=="object"){s[g]=u;continue}let y=We(h,u,o+1);if(s[g]=y,y===h)c++}return n===d&&c===n?r:s}function It(r,t){if(!t||Object.keys(r).length!==Object.keys(t).length)return!1;for(let o in r)if(r[o]!==t[o])return!1;return!0}function Yr(r){return Array.isArray(r)&&r.length===Object.keys(r).length}function gr(r){if(!Kr(r))return!1;let t=r.constructor;if(t===void 0)return!0;let o=t.prototype;if(!Kr(o))return!1;if(!o.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf(r)!==Object.prototype)return!1;return!0}function Kr(r){return Object.prototype.toString.call(r)==="[object Object]"}function Gr(r){return new Promise((t)=>{He.setTimeout(t,r)})}function Er(r,t,o){if(typeof o.structuralSharing==="function")return o.structuralSharing(r,t);else if(o.structuralSharing!==!1)return We(r,t);return t}function rt(r,t,o=0){let i=[...r,t];return o&&i.length>o?i.slice(1):i}function tt(r,t,o=0){let i=[t,...r];return o&&i.length>o?i.slice(0,-1):i}var j=Symbol();function J(r,t){if(!r.queryFn&&t?.initialPromise)return()=>t.initialPromise;if(!r.queryFn||r.queryFn===j)return()=>Promise.reject(Error(`Missing queryFn: '${r.queryHash}'`));return r.queryFn}function nr(r,t){if(typeof r==="function")return r(...t);return!!r}function at(r,t,o){let i=!1,n;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>{if(n??=t(),i)return n;if(i=!0,n.aborted)o();else n.addEventListener("abort",o,{once:!0});return n}}),r}var ia=()=>ur,ir=()=>ia();var ye=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var na=class extends ye{#r;#t;#a;constructor(){super();this.#a=(r)=>{if(typeof window<"u"&&window.addEventListener){let t=()=>r();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){if(!this.#t)this.setEventListener(this.#a)}onUnsubscribe(){if(!this.hasListeners())this.#t?.(),this.#t=void 0}setEventListener(r){this.#a=r,this.#t?.(),this.#t=r((t)=>{if(typeof t==="boolean")this.setFocused(t);else this.onFocus()})}setFocused(r){if(this.#r!==r)this.#r=r,this.onFocus()}onFocus(){let r=this.isFocused();this.listeners.forEach((t)=>{t(r)})}isFocused(){if(typeof this.#r==="boolean")return this.#r;return globalThis.document?.visibilityState!=="hidden"}},sr=new na;var et=Qr;function sa(){let r=[],t=0,o=(s)=>{s()},i=(s)=>{s()},n=et,l=(s)=>{if(t)r.push(s);else n(()=>{o(s)})},d=()=>{let s=r;if(r=[],s.length)n(()=>{i(()=>{s.forEach((c)=>{o(c)})})})};return{batch:(s)=>{let c;t++;try{c=s()}finally{if(t--,!t)d()}return c},batchCalls:(s)=>(...c)=>{l(()=>{s(...c)})},schedule:l,setNotifyFunction:(s)=>{o=s},setBatchNotifyFunction:(s)=>{i=s},setScheduler:(s)=>{n=s}}}var M=sa();var ca=class extends ye{#r=!0;#t;#a;constructor(){super();this.#a=(r)=>{if(typeof window<"u"&&window.addEventListener){let t=()=>r(!0),o=()=>r(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",o)}}}}onSubscribe(){if(!this.#t)this.setEventListener(this.#a)}onUnsubscribe(){if(!this.hasListeners())this.#t?.(),this.#t=void 0}setEventListener(r){this.#a=r,this.#t?.(),this.#t=r(this.setOnline.bind(this))}setOnline(r){if(this.#r!==r)this.#r=r,this.listeners.forEach((t)=>{t(r)})}isOnline(){return this.#r}},E=new ca;function la(r){return Math.min(1000*2**r,30000)}function vr(r){return(r??"online")==="online"?E.isOnline():!0}var V=class extends Error{constructor(r){super("CancelledError");this.revert=r?.revert,this.silent=r?.silent}};function Q(r){let t=!1,o=0,i,n="pending",l,d,s=new Promise((v,f)=>{l=v,d=f});s.catch(U);let c=()=>n!=="pending",p=(v)=>{if(!c()){let f=new V(v);m(f),r.onCancel?.(f)}},g=()=>{t=!0},h=()=>{t=!1},u=()=>sr.isFocused()&&(r.networkMode==="always"||E.isOnline())&&r.canRun(),y=()=>vr(r.networkMode)&&r.canRun(),w=(v)=>{if(!c())i?.(),n="resolved",l(v)},m=(v)=>{if(!c())i?.(),n="rejected",d(v)},z=()=>new Promise((v)=>{i=(f)=>{if(c()||u())v(f)},r.onPause?.()}).then(()=>{if(i=void 0,!c())r.onContinue?.()}),Z=()=>{if(c())return;let v,f=o===0?r.initialPromise:void 0;try{v=f??r.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(w).catch((b)=>{if(c())return;let _=r.retry??(ir()?0:3),I=r.retryDelay??la,At=typeof I==="function"?I(o,b):I,Pt=_===!0||typeof _==="number"&&o<_||typeof _==="function"&&_(o,b);if(t||!Pt){m(b);return}o++,r.onFail?.(o,b),Gr(At).then(()=>u()?void 0:z()).then(()=>{if(t)m(b);else Z()})})};return{promise:s,status:()=>n,cancel:p,continue:()=>(i?.(),s),cancelRetry:g,continueRetry:h,canStart:y,start:()=>{if(y())Z();else z().then(Z);return s}}}var Y=class{#r;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),po(this.gcTime))this.#r=He.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(ir()?1/0:300000))}clearGcTimeout(){if(this.#r!==void 0)He.clearTimeout(this.#r),this.#r=void 0}};function st(r){return{onFetch:(t,o)=>{let i=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],d=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,p=async()=>{let g=!1,h=(w)=>{at(w,()=>t.signal,()=>g=!0)},u=J(t.options,t.fetchOptions),y=async(w,m,z)=>{if(g)return Promise.reject(t.signal.reason);if(m==null&&w.pages.length)return Promise.resolve(w);let v=(()=>{let I={client:t.client,queryKey:t.queryKey,pageParam:m,direction:z?"backward":"forward",meta:t.options.meta};return h(I),I})(),f=await u(v),{maxPages:b}=t.options,_=z?tt:rt;return{pages:_(w.pages,f,b),pageParams:_(w.pageParams,m,b)}};if(n&&l.length){let w=n==="backward",m=w?da:ot,z={pages:l,pageParams:d};s=await y(z,m(i,z),w)}else{let w=r??l.length;do{let m=c===0?d[0]??i.initialPageParam:ot(i,s);if(c>0&&m==null)break;s=await y(s,m),c++}while(c<w)}return s};if(t.options.persister)t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},o);else t.fetchFn=p}}}function ot(r,{pages:t,pageParams:o}){let i=t.length-1;return t.length>0?r.getNextPageParam(t[i],t,o[i],o):void 0}function da(r,{pages:t,pageParams:o}){return t.length>0?r.getPreviousPageParam?.(t[0],t,o[0],o):void 0}var dt=class extends Y{#r;#t;#a;#o;#i;#e;#c;#n;constructor(r){super();this.#n=!1,this.#c=r.defaultOptions,this.setOptions(r.options),this.observers=[],this.#i=r.client,this.#o=this.#i.getQueryCache(),this.queryKey=r.queryKey,this.queryHash=r.queryHash,this.#t=lt(this.options),this.state=r.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#r}get promise(){return this.#e?.promise}setOptions(r){if(this.options={...this.#c,...r},r?._type)this.#r=r._type;if(this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let t=lt(this.options);if(t.data!==void 0)this.setState(ct(t.data,t.dataUpdatedAt)),this.#t=t}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#o.remove(this)}setData(r,t){let o=Er(this.state.data,r,this.options);return this.#s({data:o,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),o}setState(r){this.#s({type:"setState",state:r})}cancel(r){let t=this.#e?.promise;return this.#e?.cancel(r),t?t.then(U).catch(U):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some((r)=>W(r.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===j||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some((r)=>W(r.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some((r)=>r.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){if(this.state.data===void 0)return!0;if(r==="static")return!1;if(this.state.isInvalidated)return!0;return!fo(this.state.dataUpdatedAt,r)}onFocus(){this.observers.find((r)=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#e?.continue()}onOnline(){this.observers.find((r)=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#e?.continue()}addObserver(r){if(!this.observers.includes(r))this.observers.push(r),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",query:this,observer:r})}removeObserver(r){let t=this.observers.indexOf(r);if(t!==-1){if(this.observers.splice(t,1),!this.observers.length){if(this.#e)if(this.#n||this.state.fetchStatus==="paused"&&this.state.status==="pending")this.#e.cancel({revert:!0});else this.#e.cancelRetry();this.scheduleGc()}this.#o.notify({type:"observerRemoved",query:this,observer:r})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#s({type:"invalidate"})}async fetch(r,t){if(this.state.fetchStatus!=="idle"&&this.#e?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#e)return this.#e.continueRetry(),this.#e.promise}if(r)this.setOptions(r);if(!this.options.queryFn){let c=this.observers.find((p)=>p.options.queryFn);if(c)this.setOptions(c.options)}let o=new AbortController,i=(c)=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#n=!0,o.signal)})},n=()=>{let c=J(this.options,t),g=(()=>{let h={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(h),h})();if(this.#n=!1,this.options.persister)return this.options.persister(c,g,this);return c(g)},d=(()=>{let c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:n};return i(c),c})();if((this.#r==="infinite"?st(this.options.pages):this.options.behavior)?.onFetch(d,this),this.#a=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)this.#s({type:"fetch",meta:d.fetchOptions?.meta});let s=this.#e=Q({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:(c)=>{if(c instanceof V&&c.revert)this.setState({...this.#a,fetchStatus:"idle"});o.abort()},onFail:(c,p)=>{this.#s({type:"failed",failureCount:c,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{let c=await s.start();if(c===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#o.config.onSuccess?.(c,this),this.#o.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof V){if(c.silent)return this.#e.promise;else if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#o.config.onError?.(c,this),this.#o.config.onSettled?.(this.state.data,c,this),c}finally{if(this.#e===s)this.#e=void 0;this.scheduleGc()}}#s(r){let t=(o)=>{switch(r.type){case"failed":return{...o,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...Wo(o.data,this.options),fetchMeta:r.meta??null};case"success":let i={...o,...ct(r.data,r.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#a=r.manual?i:void 0,i;case"error":let n=r.error;return{...o,error:n,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...r.state}}};this.state=t(this.state),M.batch(()=>{this.observers.slice().forEach((o)=>{o.onQueryUpdate()}),this.#o.notify({query:this,type:"updated",action:r})})}};function Wo(r,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vr(t.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function ct(r,t){return{data:r,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function lt(r){let t=typeof r.initialData==="function"?r.initialData():r.initialData,o=t!==void 0,i=o?typeof r.initialDataUpdatedAt==="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:o?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var pt=class extends Y{#r;#t;#a;#o;constructor(r){super();this.#r=r.client,this.mutationId=r.mutationId,this.#a=r.mutationCache,this.#t=[],this.state=r.state||$o(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){if(!this.#t.includes(r))this.#t.push(r),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:r})}removeObserver(r){this.#t=this.#t.filter((t)=>t!==r),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){if(!this.#t.length)if(this.state.status==="pending")this.scheduleGc();else this.#a.remove(this)}continue(){return this.#o?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(r){let t=()=>{this.#i({type:"continue"})},o={client:this.#r,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#o=Q({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn(r,o)},onFail:(d,s)=>{this.#i({type:"failed",failureCount:d,error:s})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)}),n=this.state.status==="pending",l=!i.canStart();try{if(n)t();else{if(this.#i({type:"pending",variables:r,isPaused:l}),this.#a.config.onMutate)await this.#a.config.onMutate(r,this,o);let s=await this.options.onMutate?.(r,o);if(s!==this.state.context)this.#i({type:"pending",context:s,variables:r,isPaused:l})}let d=await i.start();return await this.#a.config.onSuccess?.(d,r,this.state.context,this,o),await this.options.onSuccess?.(d,r,this.state.context,o),await this.#a.config.onSettled?.(d,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(d,null,r,this.state.context,o),this.#i({type:"success",data:d}),d}catch(d){try{await this.#a.config.onError?.(d,r,this.state.context,this,o)}catch(s){Promise.reject(s)}try{await this.options.onError?.(d,r,this.state.context,o)}catch(s){Promise.reject(s)}try{await this.#a.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,o)}catch(s){Promise.reject(s)}try{await this.options.onSettled?.(void 0,d,r,this.state.context,o)}catch(s){Promise.reject(s)}throw this.#i({type:"error",error:d}),d}finally{if(this.#o===i)this.#o=void 0;this.#a.runNext(this)}}#i(r){let t=(o)=>{switch(r.type){case"failed":return{...o,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...o,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:r.error,failureCount:o.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=t(this.state),M.batch(()=>{this.#t.forEach((o)=>{o.onMutationUpdate(r)}),this.#a.notify({mutation:this,type:"updated",action:r})})}};function $o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ht=class extends ye{#r;#t;#a;constructor(r={}){super();this.config=r,this.#r=new Set,this.#t=new Map,this.#a=0}build(r,t,o){let i=new pt({client:r,mutationCache:this,mutationId:++this.#a,options:r.defaultMutationOptions(t),state:o});return this.add(i),i}add(r){this.#r.add(r);let t=K(r);if(typeof t==="string"){let o=this.#t.get(t);if(o)o.push(r);else this.#t.set(t,[r])}this.notify({type:"added",mutation:r})}remove(r){if(this.#r.delete(r)){let t=K(r);if(typeof t==="string"){let o=this.#t.get(t);if(o){if(o.length>1){let i=o.indexOf(r);if(i!==-1)o.splice(i,1)}else if(o[0]===r)this.#t.delete(t)}}}this.notify({type:"removed",mutation:r})}canRun(r){let t=K(r);if(typeof t==="string"){let o=this.#t.get(t)?.find((i)=>i.state.status==="pending");return!o||o===r}else return!0}runNext(r){let t=K(r);if(typeof t==="string")return this.#t.get(t)?.find((o)=>o!==r&&o.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){M.batch(()=>{this.#r.forEach((r)=>{this.notify({type:"removed",mutation:r})}),this.#r.clear(),this.#t.clear()})}getAll(){return Array.from(this.#r)}find(r){let t={exact:!0,...r};return this.getAll().find((o)=>L(t,o))}findAll(r={}){return this.getAll().filter((t)=>L(r,t))}notify(r){M.batch(()=>{this.listeners.forEach((t)=>{t(r)})})}resumePausedMutations(){let r=this.getAll().filter((t)=>t.state.isPaused);return M.batch(()=>Promise.all(r.map((t)=>t.continue().catch(U))))}};function K(r){return r.options.scope?.id}var gt=class extends ye{#r;constructor(r={}){super();this.config=r,this.#r=new Map}build(r,t,o){let i=t.queryKey,n=t.queryHash??T(i,t),l=this.get(n);if(!l)l=new dt({client:r,queryKey:i,queryHash:n,options:r.defaultQueryOptions(t),state:o,defaultOptions:r.getQueryDefaults(i)}),this.add(l);return l}add(r){if(!this.#r.has(r.queryHash))this.#r.set(r.queryHash,r),this.notify({type:"added",query:r})}remove(r){let t=this.#r.get(r.queryHash);if(t){if(r.destroy(),t===r)this.#r.delete(r.queryHash);this.notify({type:"removed",query:r})}}clear(){M.batch(()=>{this.getAll().forEach((r)=>{this.remove(r)})})}get(r){return this.#r.get(r)}getAll(){return[...this.#r.values()]}find(r){let t={exact:!0,...r};return this.getAll().find((o)=>or(t,o))}findAll(r={}){let t=this.getAll();return Object.keys(r).length>0?t.filter((o)=>or(r,o)):t}notify(r){M.batch(()=>{this.listeners.forEach((t)=>{t(r)})})}onFocus(){M.batch(()=>{this.getAll().forEach((r)=>{r.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach((r)=>{r.onOnline()})})}};var wr=class{#r;#t;#a;#o;#i;#e;#c;#n;constructor(r={}){this.#r=r.queryCache||new gt,this.#t=r.mutationCache||new ht,this.#a=r.defaultOptions||{},this.#o=new Map,this.#i=new Map,this.#e=0}mount(){if(this.#e++,this.#e!==1)return;this.#c=sr.subscribe(async(r)=>{if(r)await this.resumePausedMutations(),this.#r.onFocus()}),this.#n=E.subscribe(async(r)=>{if(r)await this.resumePausedMutations(),this.#r.onOnline()})}unmount(){if(this.#e--,this.#e!==0)return;this.#c?.(),this.#c=void 0,this.#n?.(),this.#n=void 0}isFetching(r){return this.#r.findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return this.#t.findAll({...r,status:"pending"}).length}getQueryData(r){let t=this.defaultQueryOptions({queryKey:r});return this.#r.get(t.queryHash)?.state.data}ensureQueryData(r){let t=this.defaultQueryOptions(r),o=this.#r.build(this,t),i=o.state.data;if(i===void 0)return this.fetchQuery(r);if(r.revalidateIfStale&&o.isStaleByTime(W(t.staleTime,o)))this.prefetchQuery(t);return Promise.resolve(i)}getQueriesData(r){return this.#r.findAll(r).map(({queryKey:t,state:o})=>[t,o.data])}setQueryData(r,t,o){let i=this.defaultQueryOptions({queryKey:r}),n=this.#r.get(i.queryHash)?.state.data,l=Xr(t,n);if(l===void 0)return;return this.#r.build(this,i).setData(l,{...o,manual:!0})}setQueriesData(r,t,o){return M.batch(()=>this.#r.findAll(r).map(({queryKey:i})=>[i,this.setQueryData(i,t,o)]))}getQueryState(r){let t=this.defaultQueryOptions({queryKey:r});return this.#r.get(t.queryHash)?.state}removeQueries(r){let t=this.#r;M.batch(()=>{t.findAll(r).forEach((o)=>{t.remove(o)})})}resetQueries(r,t){let o=this.#r;return M.batch(()=>{let i=o.findAll(r),n=new Set(i);return i.forEach((l)=>{l.reset()}),this.refetchQueries({type:"active",predicate:(l)=>n.has(l)},t)})}cancelQueries(r,t={}){let o={revert:!0,...t},i=M.batch(()=>this.#r.findAll(r).map((n)=>n.cancel(o)));return Promise.all(i).then(U).catch(U)}invalidateQueries(r,t={}){return M.batch(()=>{if(this.#r.findAll(r).forEach((o)=>{o.invalidate()}),r?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...r,type:r?.refetchType??r?.type??"active"},t)})}refetchQueries(r,t={}){let o={...t,cancelRefetch:t.cancelRefetch??!0},i=M.batch(()=>this.#r.findAll(r).filter((n)=>!n.isDisabled()&&!n.isStatic()).map((n)=>{let l=n.fetch(void 0,o);if(!o.throwOnError)l=l.catch(U);return n.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(U)}async query(r){let t=this.defaultQueryOptions(r);if(t.retry===void 0)t.retry=!1;let o=this.#r.build(this,t),i=o.isStaleByTime(W(t.staleTime,o))?await o.fetch(t):o.state.data,n=t.select;if(n)return n(i);return i}fetchQuery(r){let t=this.defaultQueryOptions(r);if(t.retry===void 0)t.retry=!1;let o=this.#r.build(this,t);return o.isStaleByTime(W(t.staleTime,o))?o.fetch(t):Promise.resolve(o.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(U).catch(U)}infiniteQuery(r){return r._type="infinite",this.query(r)}fetchInfiniteQuery(r){return r._type="infinite",this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(U).catch(U)}ensureInfiniteQueryData(r){return r._type="infinite",this.ensureQueryData(r)}resumePausedMutations(){if(E.isOnline())return this.#t.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#t}getDefaultOptions(){return this.#a}setDefaultOptions(r){this.#a=r}setQueryDefaults(r,t){this.#o.set(Ue(r),{queryKey:r,defaultOptions:t})}getQueryDefaults(r){let t=[...this.#o.values()],o={};return t.forEach((i)=>{if(P(r,i.queryKey))Object.assign(o,i.defaultOptions)}),o}setMutationDefaults(r,t){this.#i.set(Ue(r),{mutationKey:r,defaultOptions:t})}getMutationDefaults(r){let t=[...this.#i.values()],o={};return t.forEach((i)=>{if(P(r,i.mutationKey))Object.assign(o,i.defaultOptions)}),o}defaultQueryOptions(r){if(r._defaulted)return r;let t={...this.#a.queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};if(!t.queryHash)t.queryHash=T(t.queryKey,t);if(t.refetchOnReconnect===void 0)t.refetchOnReconnect=t.networkMode!=="always";if(t.throwOnError===void 0)t.throwOnError=!!t.suspense;if(!t.networkMode&&t.persister)t.networkMode="offlineFirst";if(t.queryFn===j)t.enabled=!1;return t}defaultMutationOptions(r){if(r?._defaulted)return r;return{...this.#a.mutations,...r?.mutationKey&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){this.#r.clear(),this.#t.clear()}};var it=new wr;var a={all:["workspaces"],discover:["workspaces","discover"],previews:["workspaces","previews"],layout:(r)=>["workspaces","layout",r],widgets:(r)=>["workspaces","widgets",r],appletThumbnails:(r)=>["workspaces","applet-thumbnails",r],views:(r)=>["workspaces","views",r],sessions:(r)=>["workspaces","sessions",r],events:(r,t)=>["workspaces","events",r,t],state:(r)=>["workspaces","state",r],mcp:(r)=>["workspaces","mcp",r],harness:(r)=>["workspaces","harness",r],skills:(r)=>["workspaces","skills",r],env:(r)=>["workspaces","env",r]};function ar(r){return`${location.protocol==="https:"?"wss":"ws"}://${location.host}${r}`}class Ut{url;options;listeners=new Set;socket;holders=0;attempts=0;lastMessageAt=0;retry;heartbeat;constructor(r,t={}){this.url=r;this.options=t}get isOpen(){return this.socket?.readyState===WebSocket.OPEN}subscribe(r){return this.listeners.add(r),()=>{this.listeners.delete(r)}}start(){let r=!0;if(this.holders++===0)this.open();return()=>{if(!r)return;if(r=!1,--this.holders===0)this.drop()}}reconnect(){if(this.drop(),this.holders)this.retry=setTimeout(()=>this.open(),0)}send(r){if(!this.isOpen)return;try{this.socket?.send(JSON.stringify(r))}catch{this.socket?.close()}}open(){if(this.socket||!this.holders)return;let r=new WebSocket(this.url());this.socket=r,r.onopen=()=>{if(r!==this.socket)return;if(this.attempts=0,this.lastMessageAt=Date.now(),this.options.ping)this.heartbeat=setInterval(()=>{if(Date.now()-this.lastMessageAt>45000)r.close();else this.send({type:"ping"})},15000);for(let t of this.listeners)t.open?.()},r.onmessage=(t)=>{if(r!==this.socket)return;this.lastMessageAt=Date.now();let o;try{o=JSON.parse(String(t.data))}catch{return}for(let i of this.listeners)i.message?.(o)},r.onerror=()=>r.close(),r.onclose=()=>{if(r!==this.socket)return;clearInterval(this.heartbeat),this.socket=void 0;for(let i of this.listeners)i.close?.();let o=Math.min((this.options.baseDelayMs??500)*2**this.attempts++,1e4)*(0.5+Math.random()*0.5);this.retry=setTimeout(()=>this.open(),o)}}drop(){clearTimeout(this.retry),clearInterval(this.heartbeat);let r=this.socket;if(!r)return;this.socket=void 0,r.close();for(let t of this.listeners)t.close?.()}}var mr=(r,t)=>t.getQueryData(a.layout(r));function Wt(r,t=it){return mr(r,t)?.isRemote??!1}function ie(r,t=it){let o=mr(r,t)?.apiBase;if(!o)throw Error("Workspace identity is not loaded");return o}function Rr(r,t=it){let o=mr(r,t)?.apiBase;return o?decodeURIComponent(o.slice(16)):r}function mo(r){return new Ut(()=>ar(`${ie(r)}/events`),{ping:!0})}function fr(r){if(!Be(r)||!Array.isArray(r.members)||!Array.isArray(r.invitations))throw Error("Invalid workspace members");let t=r.members.map((i)=>{let n=nt(i);if(Be(i)&&i.membershipId!==void 0){if(typeof i.membershipId!=="string"||!i.membershipId||i.membershipId.length>240)throw Error("Invalid membership id");return{...n,membershipId:i.membershipId}}return n}),o=r.invitations.map((i)=>{if(!Be(i)||typeof i.id!=="string"||!i.id||typeof i.email!=="string"||!i.email||typeof i.expiresAt!=="string"||!Number.isFinite(Date.parse(i.expiresAt)))throw Error("Invalid invitation");return{id:i.id,email:i.email,expiresAt:i.expiresAt}});if(new Set(t.map(ze)).size!==t.length||new Set(o.map((i)=>i.id)).size!==o.length)throw Error("Duplicate workspace member or invitation");return{members:t,invitations:o}}function X(r){if(!/^(?:[A-Za-z0-9_-]{1,64}:)?[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/.test(r))throw Error("Invalid workspace id");return r}var br;function x(){let r=ne();if(br?.accountGeneration!==r)br={accountGeneration:r,lists:new Map,complete:!1};return br}var mt=0,xr=new Set;function O(){mt++,xr.forEach((r)=>r())}var ft=()=>mt,ut=new WeakMap,pa={members:[],invitations:[]},vt=new WeakMap;function bt(r){if(!x().complete)return;if(r.includes(":"))return pa;let t=Te();if(t?.type!=="user"||t.isAnonymous)return;let o=ut.get(t);if(!o)o={members:[t],invitations:[]},ut.set(t,o);return o}function G(r,t){let{lists:o}=x();o.set(r,We(o.get(r),t))}function xt(r,t){G(X(r),fr(t)),O()}function yt(r){if(!Array.isArray(r))throw Error("Invalid workspace members");let t=r.map((n)=>[X(n.id),fr(n)]),o=new Set(t.map(([n])=>n));if(o.size!==t.length)throw Error("Duplicate workspace id");let{lists:i}=x();for(let n of i.keys())if(!o.has(n))i.delete(n);for(let[n,l]of t)G(n,l);x().complete=!0,O()}function kt(r){x().lists.delete(X(r)),O()}function zt(){x().lists.clear(),O()}function xn(r,t){let o=Rr(r),i=x().lists.get(o)??bt(o),n=i&&t(i);if(!n)return;G(o,n),O()}function yn(r){let t=ze(r);for(let[o,i]of x().lists)G(o,{...i,members:i.members.map((n)=>ze(n)===t?{...r,...n.membershipId&&{membershipId:n.membershipId}}:n)});O()}function Vo(r){let t=Rr(r);return x().lists.get(t)??bt(t)}function bn(r){let t=Vo(r);if(!t)return;let o=vt.get(t);if(!o)o=t.members.map(Pr),vt.set(t,o);return o}function Ar(r){xr.add(r);let t=it.getQueryCache().subscribe((o)=>{let[i,n]=o.query.queryKey;if(i===a.all[0]&&n==="layout")r()});return()=>{xr.delete(r),t()}}function _t(){if(typeof window>"u")return;let r=window;r.moi??={},r.moi.identity={set:wt,getRevision:Tr},r.moi.workspaceMembers={set:xt,setAll:yt,remove:kt,clear:zt,getRevision:ft}}_t();Vr();async function ha(r){let[{mount:t},o,i]=await Promise.all([(Fe("yv6n9e3z"),import("/chunk-yv6n9e3z.js")),(Fe("rb2vsqvb"),import("/chunk-rb2vsqvb.js")).then((n)=>n.loadAppConfig()),(Fe("nqh3kx2x"),import("/chunk-nqh3kx2x.js")).then((n)=>n.loadProxyUser())]);Jr(o?.environment==="local"&&!o.demo,i),t(r)}globalThis.__init=ha;export{e,k,Ht,pn,Fe,kr,fn,lo,mn,Be,nt,ze,rr,Te,Tr,ne,co,wt,hn,Pr,pe,St,we,gn,uo,He,U,po,fo,W,or,Ue,We,It,Er,nr,ir,ye,sr,M,Wo,$o,it,a,ar,Ut,Wt,ie,Rr,mo,xn,yn,Vo,bn,Ar};
@@ -1 +1 @@
1
- import{mn}from"/chunk-v0w55vnq.js";import{h}from"/chunk-ghyzbqgb.js";async function r(){try{let e=await h("/api/proxy-user");if(!e||typeof e!=="object"||Array.isArray(e)||e.provider!==void 0&&e.provider!=="cloudflare-access"||e.provider===void 0&&e.profile!==void 0)return;return mn(e),e}catch{}}async function n(){return r()}export{n as loadProxyUser};
1
+ import{gn}from"/chunk-kkhswjz8.js";import{h}from"/chunk-jqa4c92z.js";async function r(){try{let e=await h("/api/proxy-user");if(!e||typeof e!=="object"||Array.isArray(e)||e.provider!==void 0&&e.provider!=="cloudflare-access"||e.provider===void 0&&e.profile!==void 0)return;return gn(e),e}catch{}}async function n(){return r()}export{n as loadProxyUser};
@@ -0,0 +1 @@
1
+ import{di,oe,N}from"/chunk-gh11h6dc.js";export{oe as homePath,di as loadAppConfig,N as useAppConfig};
@@ -2,4 +2,4 @@
2
2
  * SVG/attribute allowlists and URI sanitization approach derived from DOMPurify.
3
3
  * DOMPurify — MIT License, Copyright (c) 2015 Mario Heiderich
4
4
  * https://github.com/cure53/DOMPurify/blob/main/LICENSE
5
- */var v=new Set(["svg","a","altglyph","altglyphdef","altglyphitem","animate","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","feblend","fecolormatrix","fecomponenttransfer","fecomposite","feconvolvematrix","fediffuselighting","fedisplacementmap","fedistantlight","fedropshadow","feflood","fefunca","fefuncb","fefuncg","fefuncr","fegaussianblur","feimage","femerge","femergenode","femorphology","feoffset","fepointlight","fespecularlighting","fespotlight","fetile","feturbulence","filter","font","foreignobject","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","set","stop","style","switch","symbol","text","textpath","title","tref","tspan","use","view","vkern"]),y=new Set(["a","b","blockquote","body","br","code","del","div","em","h1","h2","h3","h4","h5","h6","i","li","mark","ol","p","pre","span","strong","s","sub","sup","table","tbody","td","th","thead","tr","u","ul"]),A=new Set(["script","iframe","object","embed","form","input","textarea","select","button","link","meta","base","img","video","audio","source","picture","svg"]),x=new Set(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","clippathunits","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","diffuseconstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","from","fx","fy","g1","g2","glyph-name","glyphref","gradienttransform","gradientunits","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","kernelmatrix","kernelunitlength","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","mask","mask-type","maskcontentunits","maskunits","max","media","method","min","mode","name","numoctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","radius","refx","refy","repeatcount","repeatdur","requiredfeatures","restart","result","role","rotate","rx","ry","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","text-anchor","text-decoration","text-rendering","textlength","to","transform","transform-origin","type","u1","u2","unicode","values","version","vert-adv-y","vert-origin-x","vert-origin-y","viewbox","visibility","width","word-spacing","wrap","writing-mode","x","x1","x2","xchannelselector","xlink:href","xml:id","xml:space","xlink:title","xmlns","xmlns:xlink","y","y1","y2","z","zoomandpan"]),k=new Set(["class","dir","href","id","lang","role","style","tabindex","title"]),d=/^data-/,p=/^aria-/,o=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,g=/^(?:https?:|mailto:)/i,S=/^data:/i,T=/^data:image\/(?:png|jpeg|jpg|gif|webp|avif|bmp|tiff|x-icon|vnd\.microsoft\.icon)[;,]/i,_=/^data:image\/svg\+xml[;,]/i,u=/^#/;function w(t){return t.replace(/\\([0-9a-fA-F]{1,6})\s?|\\([^\n])/g,(i,r,n)=>{if(r){let e=parseInt(r,16);if(e>1114111||e===0)return"�";return String.fromCodePoint(e)}return n})}var E=/^data:(?:image\/(?:png|jpeg|jpg|gif|webp|avif)|font\/(?:woff2?|opentype|truetype|sfnt)|application\/(?:x-font-woff|font-woff2?|x-font-ttf|x-font-opentype|font-sfnt))[;,]/i;function f(t){let i=w(t);return i=i.replace(/@import\s+(?:url\s*\([^)]*\)|"[^"]*"|'[^']*')[^;]*;?|@import\b[^;]*;?/gi,""),i=i.replace(/expression\s*\([^)]*\)/gi,""),i=i.replace(/-moz-binding\s*:[^;]*/gi,""),i=i.replace(/behavior\s*:[^;]*/gi,""),i=i.replace(/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gis,(r,n,e)=>{let a=e.replace(o,"");if(E.test(a)||u.test(a))return r;return""}),i}function L(t){return f(t)}var N=new Set(["animate","set","animatecolor","animatetransform"]),R=/^(?:href|xlink:href|on)/i;function z(t){let i=t.getAttribute("attributeName");if(!i)return!1;return R.test(i.replace(o,""))}var h=/^on/i,D=new Set(["clip-path","cursor","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),m=10;function I(t){let i=t.search(/;base64,/i);if(i>=0){let n=t.slice(i+8),e=Uint8Array.from(atob(n),(a)=>a.charCodeAt(0));return new TextDecoder().decode(e)}let r=t.indexOf(",");if(r<0)return null;return decodeURIComponent(t.slice(r+1))}function C(t){let i=new TextEncoder().encode(t),r=Array.from(i,(n)=>String.fromCharCode(n)).join("");return"data:image/svg+xml;base64,"+btoa(r)}function G(t,i){if(i>=m)return console.warn(`Embedded SVG data URI recursion depth limit (${m}) reached`),null;let r;try{let e=I(t);if(e===null)return null;r=e}catch{return null}let n=b(r,i+1);if(!n)return null;return C(n)}function O(t,i,r,n){let e=r.replace(o,""),a=t.tagName.toLowerCase();if(a==="image"||a==="feimage"){if(T.test(e))return r;if(_.test(e))return G(e,n);return null}if(a==="use"){if(u.test(e))return r;return null}if(a==="a"){if(g.test(e))return r;return null}if(S.test(e)||u.test(e))return r;return null}function l(t,i){for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r],e=n.name.toLowerCase(),a=e.replace(o,"");if(h.test(a)){t.removeAttribute(n.name);continue}if(d.test(e)||p.test(e))continue;if(!x.has(e)){t.removeAttribute(n.name);continue}if(e==="href"||e==="xlink:href"){let s=O(t,e,n.value,i);if(s===null)t.removeAttribute(n.name);else if(s!==n.value)n.value=s;continue}if(e==="style"){n.value=f(n.value);continue}if(D.has(e)&&/url\s*\(/i.test(n.value))n.value=f(n.value)}}function M(t){let i=t.tagName.toLowerCase();for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r],e=n.name.toLowerCase(),a=e.replace(o,"");if(h.test(a)){t.removeAttribute(n.name);continue}if(d.test(e)||p.test(e))continue;if(!k.has(e)){t.removeAttribute(n.name);continue}if(e==="href"){if(i!=="a"){t.removeAttribute(n.name);continue}let s=n.value.replace(o,"");if(!g.test(s))t.removeAttribute(n.name);continue}if(e==="style")n.value=f(n.value)}}function c(t,i,r){for(let n=t.children.length-1;n>=0;n--){let e=t.children[n],a=e.tagName.toLowerCase();if(i==="svg")if(a==="foreignobject")l(e,r),c(e,"html",r);else if(a==="style"){if(l(e,r),e.textContent)e.textContent=L(e.textContent)}else if(N.has(a)&&z(e))e.remove();else if(v.has(a))l(e,r),c(e,"svg",r);else e.remove();else if(A.has(a))e.remove();else if(y.has(a))M(e),c(e,"html",r);else e.remove()}}function b(t,i){let r=new DOMParser().parseFromString(t,"image/svg+xml");if(r.querySelector("parsererror"))return"";let e=r.documentElement;if(e.tagName.toLowerCase()!=="svg")return"";if(l(e,i),c(e,"svg",i),e.children.length===0)return"";return new XMLSerializer().serializeToString(e)}function li(t){return b(t,0)}export{li};
5
+ */var v=new Set(["svg","a","altglyph","altglyphdef","altglyphitem","animate","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","feblend","fecolormatrix","fecomponenttransfer","fecomposite","feconvolvematrix","fediffuselighting","fedisplacementmap","fedistantlight","fedropshadow","feflood","fefunca","fefuncb","fefuncg","fefuncr","fegaussianblur","feimage","femerge","femergenode","femorphology","feoffset","fepointlight","fespecularlighting","fespotlight","fetile","feturbulence","filter","font","foreignobject","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","set","stop","style","switch","symbol","text","textpath","title","tref","tspan","use","view","vkern"]),y=new Set(["a","b","blockquote","body","br","code","del","div","em","h1","h2","h3","h4","h5","h6","i","li","mark","ol","p","pre","span","strong","s","sub","sup","table","tbody","td","th","thead","tr","u","ul"]),A=new Set(["script","iframe","object","embed","form","input","textarea","select","button","link","meta","base","img","video","audio","source","picture","svg"]),x=new Set(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","clippathunits","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","diffuseconstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","from","fx","fy","g1","g2","glyph-name","glyphref","gradienttransform","gradientunits","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","kernelmatrix","kernelunitlength","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","mask","mask-type","maskcontentunits","maskunits","max","media","method","min","mode","name","numoctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","radius","refx","refy","repeatcount","repeatdur","requiredfeatures","restart","result","role","rotate","rx","ry","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","text-anchor","text-decoration","text-rendering","textlength","to","transform","transform-origin","type","u1","u2","unicode","values","version","vert-adv-y","vert-origin-x","vert-origin-y","viewbox","visibility","width","word-spacing","wrap","writing-mode","x","x1","x2","xchannelselector","xlink:href","xml:id","xml:space","xlink:title","xmlns","xmlns:xlink","y","y1","y2","z","zoomandpan"]),k=new Set(["class","dir","href","id","lang","role","style","tabindex","title"]),d=/^data-/,p=/^aria-/,o=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,g=/^(?:https?:|mailto:)/i,S=/^data:/i,T=/^data:image\/(?:png|jpeg|jpg|gif|webp|avif|bmp|tiff|x-icon|vnd\.microsoft\.icon)[;,]/i,_=/^data:image\/svg\+xml[;,]/i,u=/^#/;function w(t){return t.replace(/\\([0-9a-fA-F]{1,6})\s?|\\([^\n])/g,(i,r,n)=>{if(r){let e=parseInt(r,16);if(e>1114111||e===0)return"�";return String.fromCodePoint(e)}return n})}var E=/^data:(?:image\/(?:png|jpeg|jpg|gif|webp|avif)|font\/(?:woff2?|opentype|truetype|sfnt)|application\/(?:x-font-woff|font-woff2?|x-font-ttf|x-font-opentype|font-sfnt))[;,]/i;function f(t){let i=w(t);return i=i.replace(/@import\s+(?:url\s*\([^)]*\)|"[^"]*"|'[^']*')[^;]*;?|@import\b[^;]*;?/gi,""),i=i.replace(/expression\s*\([^)]*\)/gi,""),i=i.replace(/-moz-binding\s*:[^;]*/gi,""),i=i.replace(/behavior\s*:[^;]*/gi,""),i=i.replace(/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gis,(r,n,e)=>{let a=e.replace(o,"");if(E.test(a)||u.test(a))return r;return""}),i}function L(t){return f(t)}var N=new Set(["animate","set","animatecolor","animatetransform"]),R=/^(?:href|xlink:href|on)/i;function z(t){let i=t.getAttribute("attributeName");if(!i)return!1;return R.test(i.replace(o,""))}var h=/^on/i,D=new Set(["clip-path","cursor","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),m=10;function I(t){let i=t.search(/;base64,/i);if(i>=0){let n=t.slice(i+8),e=Uint8Array.from(atob(n),(a)=>a.charCodeAt(0));return new TextDecoder().decode(e)}let r=t.indexOf(",");if(r<0)return null;return decodeURIComponent(t.slice(r+1))}function C(t){let i=new TextEncoder().encode(t),r=Array.from(i,(n)=>String.fromCharCode(n)).join("");return"data:image/svg+xml;base64,"+btoa(r)}function G(t,i){if(i>=m)return console.warn(`Embedded SVG data URI recursion depth limit (${m}) reached`),null;let r;try{let e=I(t);if(e===null)return null;r=e}catch{return null}let n=b(r,i+1);if(!n)return null;return C(n)}function O(t,i,r,n){let e=r.replace(o,""),a=t.tagName.toLowerCase();if(a==="image"||a==="feimage"){if(T.test(e))return r;if(_.test(e))return G(e,n);return null}if(a==="use"){if(u.test(e))return r;return null}if(a==="a"){if(g.test(e))return r;return null}if(S.test(e)||u.test(e))return r;return null}function l(t,i){for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r],e=n.name.toLowerCase(),a=e.replace(o,"");if(h.test(a)){t.removeAttribute(n.name);continue}if(d.test(e)||p.test(e))continue;if(!x.has(e)){t.removeAttribute(n.name);continue}if(e==="href"||e==="xlink:href"){let s=O(t,e,n.value,i);if(s===null)t.removeAttribute(n.name);else if(s!==n.value)n.value=s;continue}if(e==="style"){n.value=f(n.value);continue}if(D.has(e)&&/url\s*\(/i.test(n.value))n.value=f(n.value)}}function M(t){let i=t.tagName.toLowerCase();for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r],e=n.name.toLowerCase(),a=e.replace(o,"");if(h.test(a)){t.removeAttribute(n.name);continue}if(d.test(e)||p.test(e))continue;if(!k.has(e)){t.removeAttribute(n.name);continue}if(e==="href"){if(i!=="a"){t.removeAttribute(n.name);continue}let s=n.value.replace(o,"");if(!g.test(s))t.removeAttribute(n.name);continue}if(e==="style")n.value=f(n.value)}}function c(t,i,r){for(let n=t.children.length-1;n>=0;n--){let e=t.children[n],a=e.tagName.toLowerCase();if(i==="svg")if(a==="foreignobject")l(e,r),c(e,"html",r);else if(a==="style"){if(l(e,r),e.textContent)e.textContent=L(e.textContent)}else if(N.has(a)&&z(e))e.remove();else if(v.has(a))l(e,r),c(e,"svg",r);else e.remove();else if(A.has(a))e.remove();else if(y.has(a))M(e),c(e,"html",r);else e.remove()}}function b(t,i){let r=new DOMParser().parseFromString(t,"image/svg+xml");if(r.querySelector("parsererror"))return"";let e=r.documentElement;if(e.tagName.toLowerCase()!=="svg")return"";if(l(e,i),c(e,"svg",i),e.children.length===0)return"";return new XMLSerializer().serializeToString(e)}function ui(t){return b(t,0)}export{ui};