PageSourceSearch

https://app.codealive.ai/_nuxt/BphaBL7D.js

js codealive.ai collected 2026-10-05 11:56:16 UTC 7,892 bytes, 1 lines download raw bytes

1import{_ as q}from"./Cql0EjBF.js";import{e as G,u as O,a as J,s as W,x as X,M as Y,o as c,D as m,k as s,j as r,N as Z,G as l,H as i,l as o,R as ee,I as U,O as ae,i as ne,T,Q as te,a4 as se,c as v,B as oe,A as k}from"./DLz28qKc.js";import{_ as ie}from"./Bn6_Amr2.js";import{_ as re}from"./B93dViCy.js";import{_ as ce}from"./DbnwS9at.js";import{_ as le}from"./L8BXxyiP.js";import{u as me}from"./iak0dA-i.js";import"./DcdlcbSv.js";import"./nrcmwL85.js";import"./DeJkZx0Z.js";import"./CeH3eWnk.js";(function(){try{var h=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new h.Error().stack;e&&(h._sentryDebugIds=h._sentryDebugIds||{},h._sentryDebugIds[e]="2c0eb0fb-c8fe-4223-9217-7c896e7ca47c",h._sentryDebugIdIdentifier="sentry-dbid-2c0eb0fb-c8fe-4223-9217-7c896e7ca47c")}catch{}})();const de={class:"container mx-auto px-4 py-4"},ue={class:"flex flex-col sm:flex-row items-start sm:items-center gap-4"},ge={class:"flex items-center"},he={class:"text-sm mr-2"},ve={key:0,class:"flex justify-center items-center py-12"},_e={key:1,class:"text-center py-12"},pe={class:"text-lg font-semibold text-gray-700 dark:text-gray-300 mb-2"},fe={class:"text-gray-500 dark:text-gray-400"},ye={key:2,class:"text-center py-12"},xe={class:"text-lg font-semibold text-gray-700 dark:text-gray-300 mb-2"},be={class:"text-gray-500 dark:text-gray-400"},ke={class:"font-medium"},Ce={class:"text-xs text-[var(--ui-text-muted)]"},we={key:0},Ae={key:1,class:"text-[var(--ui-text-muted)]"},Ie={key:0},Se={key:1,class:"text-[var(--ui-text-muted)]"},$e={class:"flex items-center justify-end gap-2"},De={key:0,class:"mt-6 flex items-center justify-center"},Ke=G({__name:"shared-conversations",setup(h){const{t:e}=O();me().set({title:e("sharing.conversation.management.title")});const g=J(),V=W(),C=X(),_=v([]),w=v(!1),A=v(!1),I=oe({}),p=v(""),f=v(1),y=v(10),F=[{accessorKey:"name",header:e("sharing.conversation.management.columnName")},{accessorKey:"sharedAt",header:e("sharing.conversation.management.columnSharedDate")},{accessorKey:"accessCount",header:e("sharing.conversation.management.columnAccess")},{accessorKey:"lastAccessedAt",header:e("sharing.conversation.management.columnLastAccess")},{accessorKey:"isEnabled",header:e("sharing.conversation.management.columnStatus")},{accessorKey:"actions",header:e("sharing.conversation.management.columnActions")}],S=k(()=>{if(!p.value.trim())return _.value;const t=p.value.toLowerCase().trim();return _.value.filter(n=>n.name.toLowerCase().includes(t)||n.dataSources.some(x=>x.toLowerCase().includes(t)))}),E=k(()=>S.value.length),M=k(()=>Math.ceil(E.value/y.value)),N=k(()=>{const t=(f.value-1)*y.value,n=t+y.value;return S.value.slice(t,n)});Y(()=>{$()});const $=async()=>{try{w.value=!0,_.value=await C.workspace.chat.getMySharedConversations(A.value),f.value=1}catch(t){console.error("Failed to load shared conversations:",t),g.error("Failed to load shared conversations")}finally{w.value=!1}},R=async t=>{try{const n=`${window.location.origin}${t.shareUrl}`;await navigator.clipboard.writeText(n),V.track("shared_conversation_link_copied",{conversationId:t.conversationId,conversationName:t.name}),g.success(e("sharing.linkCopied"))}catch(n){console.error("Failed to copy link:",n),g.error("Failed to copy link")}},B=async t=>{try{I[t.conversationId]=!0,t.isEnabled?(await C.workspace.chat.disableConversationSharing(t.conversationId),g.success(e("sharing.conversation.disabledSuccess"))):(await C.workspace.chat.enableConversationSharing(t.conversationId),g.success(e("sharing.conversation.enabledSuccess"))),await $()}catch(n){console.error("Failed to toggle sharing:",n),g.error("Failed to toggle sharing")}finally{I[t.conversationId]=!1}},L=t=>{const n=new Date(t);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(n)},j=t=>{const n=new Date(t),u=Math.floor((new Date().getTime()-n.getTime())/1e3);if(u<60)return e("sharing.conversation.management.justNow");if(u<3600){const d=Math.floor(u/60);return e("sharing.conversation.management.minutesAgo",{count:d})}else if(u<86400){const d=Math.floor(u/3600);return e("sharing.conversation.management.hoursAgo",{count:d})}else{const d=Math.floor(u/86400);return e("sharing.conversation.management.daysAgo",{count:d})}};return(t,n)=>{const x=q,u=se,d=Z,b=ee,K=te,D=ie,z=re,P=ce,H=le;return c(),m("div",de,[s(H,null,{header:r(()=>[l("div",ue,[s(x,{modelValue:p.value,"onUpdate:modelValue":n[0]||(n[0]=a=>p.value=a),placeholder:o(e)("common.search"),icon:"i-heroicons-magnifying-glass",class:"w-full sm:w-64",onInput:n[1]||(n[1]=a=>f.value=1)},null,8,["modelValue","placeholder"]),l("span",ge,[l("span",he,i(o(e)("sharing.conversation.management.includeRevoked")),1
1),s(u,{modelValue:A.value,"onUpdate:modelValue":[n[2]||(n[2]=a=>A.value=a),$]},null,8,["modelValue"])])])]),default:r(()=>[w.value?(c(),m("div",ve,[s(d,{name:"i-heroicons-arrow-path",class:"animate-spin w-8 h-8 text-primary"})])):!_.value||_.value.length===0?(c(),m("div",_e,[s(d,{name:"i-heroicons-share",class:"w-16 h-16 text-gray-400 mx-auto mb-4"}),l("h3",pe,i(o(e)("sharing.conversation.management.empty")),1),l("p",fe,i(o(e)("sharing.conversation.management.emptyDescription")),1)])):S.value.length===0?(c(),m("div",ye,[s(d,{name:"i-heroicons-magnifying-glass",class:"w-16 h-16 text-gray-400 mx-auto mb-4"}),l("h3",xe,i(o(e)("sharing.conversation.management.noSearchResults")),1),l("p",be,i(o(e)("sharing.conversation.management.noSearchResultsDescription")),1),s(b,{color:"neutral",variant:"ghost",class:"mt-4",onClick:n[3]||(n[3]=a=>p.value="")},{default:r(()=>[U(i(o(e)("common.clearFilters")),1)]),_:1})])):(c(),m(ae,{key:3},[s(z,{columns:F,data:N.value},{"name-cell":r(({row:a})=>[l("div",null,[l("div",ke,i(a.original.n
1ame),1),l("div",Ce,i(a.original.dataSources.join(", ")),1)])]),"sharedAt-cell":r(({row:a})=>[U(i(L(a.original.sharedAt)),1)]),"accessCount-cell":r(({row:a})=>[a.original.accessCount!==void 0&&a.original.accessCount!==null?(c(),m("span",we,i(a.original.accessCount),1)):(c(),m("span",Ae,i(o(e)("sharing.conversation.management.neverAccessed")),1))]),"lastAccessedAt-cell":r(({row:a})=>[a.original.lastAccessedAt?(c(),m("span",Ie,i(j(a.original.lastAccessedAt)),1)):(c(),m("span",Se,i(o(e)("sharing.conversation.management.neverAccessed")),1))]),"isEnabled-cell":r(({row:a})=>[s(K,{color:a.original.isEnabled?"success":"neutral",variant:"soft",size:"xs"},{default:r(()=>[U(i(a.original.isEnabled?o(e)("sharing.conversation.management.statusActive"):o(e)("sharing.conversation.management.statusRevoked")),1)]),_:2},1032,["color"])]),"actions-cell":r(({row:a})=>[l("div",$e,[s(D,{text:o(e)("sharing.conversation.management.actionView")},{default:r(()=>[s(b,{color:"primary",variant:"ghost",icon:"i-heroicons-chat-bubble-left-right",size:"xs",to:`/chat/${a.original.conversationId}`},null,8,["to"])]),_:2},1032,["text"]),a.original.isEnabled?(c(),ne(D,{key:0,text:o(e)("sharing.conversation.management.actionCopyLink")},{default:r(()=>[s(b,{color:"primary",variant:"ghost",icon:"i-heroicons-clipboard-document",size:"xs",onClick:Q=>R(a.original)},null,8,["onClick"])]),_:2},1032,["text"])):T("",!0),s(D,{text:a.original.isEnabled?o(e)("sharing.conversation.management.actionRevoke"):o(e)("sharing.conversation.management.actionEnable")},{default:r(()=>[s(b,{color:a.original.isEnabled?"error":"success",variant:"ghost",icon:a.original.isEnabled?"i-heroicons-no-symbol":"i-heroicons-arrow-path",size:"xs",loading:I[a.original.conversationId],onClick:Q=>B(a.original)},null,8,["color","icon","loading","onClick"])]),_:2},1032,["text"])])]),_:1},8,["columns","data"]),M.value>1?(c(),m("div",De,[s(P,{page:f.value,"onUpdate:page":n[4]||(n[4]=a=>f.value=a),"items-per-page":y.value,total:E.value,max:7,ui:{root:"flex items-center gap-1"}},null,8,["page","items-per-page","total"])])):T("",!0)],64))]),_:1})])}}});export{Ke as default};

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.