1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/authToken-CLNeTvwT.js","assets/react-B8HINTYZ.js","assets/esm-BKRY2ZS7.js","assets/preload-helper-DNPLdxEY.js","assets/dist-DClLACgm.js","assets/config-BAVuX3Do.js"])))=>i.map(i=>d[i]); 2import{t as e}from"./preload-helper-DNPLdxEY.js";import{t}from"./queryOptions-C6eUkPeV.js";import{t as n}from"./infiniteQueryOptions-D2eYqJfN.js";import{c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,t as f,u as p}from"./schemas-yJwYz_QM.js";import{s as m,t as h}from"./client-BP9RQxQS.js";import{t as g}from"./queryKeys-DQZ5qimK.js";var _=s({id:i(),status:i(),current_round:r().optional(),last_seq:r().optional(),stream_url:i().optional(),created_at:i().optional()}),v=s({id:i(),title:i(),model:i().nullable().optional(),type:f([`direct`,`group`,`shared`]).optional(),created_at:r(),updated_at:r(),is_pinned:o().optional(),pinned_at:r().nullable().optional(),project_pinned:o().optional(),share_url:i().nullable().optional(),has_shares:o().optional(),is_owner:o().optional(),can_edit:o().optional(),is_active:o().optional(),pending_question:o().optional(),active:_.nullable().optional(),project:s({id:i(),title:i()}).nullable().optional(),branch_meta:s({source_conversation_id:i(),source_conversation_title:i(),source_message_id:i()}).nullable().optional()}),y=s({id:i(),role:i(),chat_request_id:i().nullable().optional(),content:i(),metadata:a([p(i(),u()),i(),c()]).optional(),attachments:d(s({id:i(),name:i(),extension:i(),size:r(),url:i().optional()})).nullable().optional(),reaction:f([`like`,`dislike`]).nullable().optional(),source:f([`user`,`steer`,`regenerate`,`revise`,`search`]).nullable().optional(),sender:s({id:i(),name:i()}).optional(),status:f([`complete`,`streaming`,`error`]).optional(),checkpoint_seq:r().nullable().optional(),seq:r().nullable().optional(),images:d(s({url:i().optional().catch(void 0),thumbnail:i().optional().catch(void 0),title:i().optional().catch(void 0),source:i().optional().catch(void 0),preview:i().optional().catch(void 0)})).nullable().optional().catch(void 0),widget:p(i(),u()).nullable().optional().catch(void 0),created_at:r()}),b=s({limit:r(),oldest_seq:r().nullable(),newest_seq:r().nullable(),has_more:a([o(),r()]).transform(e=>!!e),messages_total:r()}),x=a([s({pinned:d(v),conversations:d(v),next_cursor:i().nullable().optional(),has_more:o(),limit:r().optional()}),s({conversations:d(v)})]),S=s({conversation:v,messages:d(y),pagination:b.optional(),viewer_state:s({can_edit:o(),requires_premium:o().optional(),owner_is_premium:o().optional(),viewer_is_premium:o().optional()}).optional()}),C=s({ok:l(!0)});s({conversation:v});var w=s({conversation:v});s({share_url:i(),conversation:v}),s({share_url:c(),conversation:v}),s({share_url:i().nullable().optional(),conversation:v});var T=s({data:d(s({path:i(),title:i(),kind:i(),tool_use_id:i(),message_id:i(),created_at:r(),download_url:i().nullable(),thumb_url:i().nullable().optional(),preview_url:i().nullish(),inline:o().optional(),can_download:o().optional(),can_preview:o().optional(),can_open_on_disk:o().optional(),disk_folder:i().nullable().optional()})),expires_at:r().nullable().optional()});function E(e){return[...e].sort((e,t)=>{let n=Number(!!t.is_pinned)-Number(!!e.is_pinned);return n===0?t.updated_at-e.updated_at:n})}async function D(e,t){let n=new URLSearchParams;e&&n.set(`cursor`,e),t&&n.set(`project_id`,t);let r=await h(`/api/conversations${n.toString()?`?${n.toString()}`:``}`,{},x);if(`pinned`in r)return{pinned:r.pinned,conversations:r.conversations,nextCursor:r.next_cursor??null,hasMore:r.has_more};let i=E(r.conversations);return{pinned:i.filter(e=>e.is_pinned),conversations:i.filter(e=>!e.is_pinned),nextCursor:null,hasMore:!1}}var O=s({conversations:d(v.extend({match_type:f([`title`,`content`]).optional(),snippet:i().nullable().optional()}))});async function k(e){let t=e.trim();return t.length<2?[]:(await h(`/api/conversations/search?${new URLSearchParams({q:t}).toString()}`,{},O)).conversations}var A=s({conversation_id:i(),chat_request_id:i(),status:i(),current_round:r().optional(),last_seq:r().optional()}),j=s({now:r(),latest_updated_at:r(),new_count:r(),active:d(A),revisions:s({conversations:r(),projects:r()}).optional(),usage:s({short:s({percent:r(),resets_at:i().nullable()}),weekly:s({percent:r(),resets_at:i().nullable()})}).nullish()});async function M(e){let t=new URLSearchParams;return e&&e>0&&t.set(`since`,String(e)),h(`/api/conversations/heartbeat${t.toString()?`?${t.toString()}`:``}`,{},j)}var N=5e3;async function P(){let e=await D();return[...e.pinned,...e.conversations]}async function F(e){let t=await D(null,e);return[...t.pinned,...t.conversations]}async function I(e,t={}){let n=new URLSearchParams;t.paginate&&n.set(`paginate`,`1`),t.limit!==void 0&&n.set(`limit`,String(t.limit)),t.beforeSeq!==void 0&&n.set(`before_seq`,String(t.beforeSeq));let r=`/api/conversations/${e}${n.toString()?`?${n.toString()}`:``}`;try{return await h(r,{},S)}catch(e){throw m(e)&&e.status,e}}async function L(e){return h(`/api/conversations/${e}`,{method:`DELETE`},C)}async function R(e){return h(`/api/conversations/${e}/leave`,{method:`POST`},C)}async function z(e,t){return h(`/api/conversations/${e}`,{method:`PATCH`,body:JSON.stringify(t)},w)}async function B(e,t){return h(`/api/conversations/${e}/pin`,{method:`PATCH`,body:JSON.stringify(t)},w)}async function V(e){return h(`/api/conversations/${e}/artifacts`,{},T)}async function H(t){let{getAccessToken:n}=await e(async()=>{let{getAccessToken:e}=await import(`./authToken-CLNeTvwT.js`).then(e=>e.n);return{getAccessToken:e}},__vite__mapDeps([0,1,2,3,4,5])),{API_BASE_URL:r}=await e(async()=>{let{API_BASE_URL:e}=await import(`./config-BAVuX3Do.js`).then(e=>e.f);return{API_BASE_URL:e}},__vite__mapDeps([5,1,4])),i=n(),a=await fetch(`${r}/api/conversations/${t}/artifacts/zip`,{method:`POST`,headers:{"Content-Type":`application/json`,...i?{"X-Auth-Token":i}:{}},body:`{}`});if(!a.ok){let e=await a.text().catch(()=>``),t=e?JSON.parse(e):{};throw Error(t.error||`HTTP ${a.status}`)}let o=await a.blob(),s=a.headers.get(`Content-Disposition`)?.match(/filename="?([^";\n]+)"?/)?.[1]??`artifacts.zip`,c=URL.createObjectURL(o),l=document.createElement(`a`);l.href=c,l.download=s,l.click(),URL.revokeObjectURL(c)}var U={getConversationsQueryOptions:()=>t({queryKey:g.conversations.all,queryFn:P}),getProjectConversationsQueryOptions:e=>t({queryKey:g.conversations.byProject(e),queryFn:()=>F(e),enabled:!!e}),getConversationsInfiniteQueryOptions:()=>n({queryKey:g.conversations.list,queryFn:({pageParam:e})=>D(e),initialPageParam:null,getNextPageParam:e=>e.hasMore?e.nextCursor:null,refetchInterval:e=>(e.state.data?.pages??[]).some(e=>[...e.pinned,...e.conversations].some(e=>e.is_active))?N:!1}),getConversationsSearchQueryOptions:e=>t({queryKey:g.conversations.search(e.trim()),queryFn:()=>k(e),enabled:e.trim().length>=2,staleTime:1e4}),getConversationQueryOptions:(e,n={paginate:!0})=>t({queryKey:g.conversations.detail(e),queryFn:()=>I(e,n),enabled:!!e}),getArtifactsQueryOptions:(e,n=!0)=>t({queryKey:g.conversations.artifacts(e??``),queryFn:()=>V(e),enabled:!!e&&n,staleTime:3e3*1e3})};export{I as a,z as c,H as i,B as l,U as n,M as o,L as r,R as s,v as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.