1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`c7dc5979-4259-4c37-b3e0-4243895e2cb9`,e._sentryDebugIdIdentifier=`sentry-dbid-c7dc5979-4259-4c37-b3e0-4243895e2cb9`)}catch{}})();import{B as e,C as t,wt as n,yt as r}from"./CyU4sjus.js";import{D as i,E as a,Ht as o,_ as s,b as c,g as l,k as u,mt as d,o as f,qt as p,v as m,y as h}from"./Dxi30lUR.js";import{_t as g,gt as _}from"./BsygFA5q.js";import{t as v}from"./WA1QM884.js";import{n as y}from"./DeFb3Kdw.js";import{t as b}from"./BuuqxS5P.js";import{t as x}from"./ClrEVbyJ.js";import{t as S}from"./B8iIAZR4.js";import{t as C}from"./Bmd8yFuG.js";import{t as w}from"./C-05SUrx.js";import{h as T}from"#entry";import{t as E}from"./BtQMW9iX.js";import{t as D}from"./CnbFcQX6.js";import{t as O}from"./CgFN-dvu.js";import{t as k}from"./Dh06wX2m.js";import{r as A}from"./AZKfVBU8.js";import{t as j}from"./WK7BOTMQ.js";import{t as M}from"./D4jC5zP0.js";import{t as N}from"./DnwKpLGI.js";var P={class:`flex flex-col gap-4`},F={class:`flex w-full justify-end gap-2`},I=120,L=2e3,R=20,z=Object.assign(u({__name:`CommunityEditModal`,props:{open:{type:Boolean},project:{}},emits:[`update:open`,`updated`],setup(n,{emit:r}){let a=n,c=r,l=j(),u=y(),f=t(``),h=t(``),v=t([]),b=t(!1);o(()=>a.open,e=>{e&&a.project&&(b.value=!1,f.value=a.project.name,h.value=a.project.description??``,v.value=[...a.project.tags])},{immediate:!0});async function x(){if(b.value=!0,a.project&&f.value.trim()&&!l.sharing)try{let e=await l.update(a.project.id,{name:f.value.trim(),description:h.value.trim()||null,tags:v.value.map(e=>e.trim()).filter(Boolean).slice(0,R)});e&&(u.add({title:`Project updated`,color:`success`}),c(`updated`,e),c(`update:open`,!1))}catch(e){let t=e;u.add({title:`Could not update project`,description:t?.data?.message||t?.message,color:`error`})}}return(t,r)=>{let a=w,o=E,u=O,y=S,T=C,k=D;return d(),m(k,{open:n.open,title:`Edit project`,description:`Update the name, description and tags. The icon itself is edited from the editor.`,"onUpdate:open":r[4]||=e=>c(`update:open`,e)},{body:p(()=>[s(`div`,P,[i(o,{label:`Name`,required:``,error:b.value&&!f.value.trim()?`Give it a name`:void 0},{default:p(()=>[i(a,{modelValue:f.value,"onUpdate:modelValue":r[0]||=e=>f.value=e,size:`lg`,class:`w-full`,maxlength:I,autofocus:``,onKeydown:_(g(x,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`])]),_:1},8,[`error`]),i(o,{label:`Description`},{default:p(()=>[i(u,{modelValue:h.value,"onUpdate:modelValue":r[1]||=e=>h.value=e,rows:3,autoresize:``,maxrows:8,size:`lg`,class:`w-full`,maxlength:L},null,8,[`modelValue`])]),_:1}),i(o,{label:`Tags`},{default:p(()=>[i(y,{modelValue:v.value,"onUpdate:modelValue":r[2]||=e=>v.value=e,size:`lg`,class:`w-full`,max:R,"add-on-blur":``,"add-on-paste":``},null,8,[`modelValue`])]),_:1})])]),footer:p(()=>[s(`div`,F,[i(T,{color:`neutral`,variant:`ghost`,label:`Cancel`,onClick:r[3]||=e=>c(`update:open`,!1)}),i(T,{color:`primary`,label:`Save`,loading:e(l).sharing,disabled:!f.value.trim(),onClick:x},null,8,[`loading`,`disabled`])])]),_:1},8,[`open`])}}}),{__name:`CommunityEditModal`}),B={class:`cp-stage`},V=[`src`,`alt`],H={key:1,class:`cp-art-empty`},U={key:2,class:`cp-flag`,title:`Duplicated from another project`},W={class:`cp-meta`},G={class:`cp-name`},K={key:0,class:`cp-by`},q={class:`cp-stats`},J=[`title`],Y=[`title`],X=[`title`],Z={class:`flex w-full justify-end gap-2`},Q=Object.assign(b(u({__name:`CommunityProjectCard`,props:{project:{}},setup(u){let g=u,_=j(),b=y(),S=k(),w=l(()=>g.project.isOwner||S.value),E=t(!1),O=t(!1),P=t(!1),F=l(()=>[[{label:`Edit`,icon:`i-lucide-pencil`,onSelect:()=>{E.value=!0}}],[{label:g.project.isOwner?`Unpublish`:`Delete`,icon:`i-lucide-trash-2`,color:`error`,onSelect:()=>{O.value=!0}}]]);async function I(){if(!P.value){P.value=!0;try{let e=await _.remove(g.project.id);b.add(e?{title:`Removed from the community`,color:`success`}:{title:`Could not remove this project`,color:`error`})}finally{P.value=!1,O.value=!1}}}let L=t(!1),R=l(()=>L.value?null:N(g.project.thumbnail)),Q=l(()=>T(g.project.creatorName));o(()=>g.project.thumbnail,()=>{L.value=!1});function $(){L.value=!0}return(t,o)=>{let l=x,g=v,_=M,y=z,b=C,S=D;return d(),c(f,null,[i(_,{items:F.value,disabled:!w.value},{default:p(()=>[i(g,{to:e(A)(u.project.id),class:`cp-card group`},{default:p(()=>[s(`div`,B,[R.value?(d(),c(`img`,{key:0,src:R.value,alt:u.project.name,class:`cp-art`,draggable:`false`,loading:`lazy`,decoding:`async`,onError:$},null,40,V)):(d(),c(`div`,H,[i(l,{name:`i-lucide-image`,class:`size-7`})])),u.project.derivedFromId?(d(),c(`span`,U,[i(l,{name:`i-lucide-git-fork`,class:`size-3`})])):h(``,!0)]),s(`div`,W,[s(`p`,G,n(u.project.name),1),Q.value?(d(),c(`p`,K,`by `+n(Q.value),1)):h(``,!0),s(`div`,q,[s(`span`,{class:r([`cp-stat`,{"cp-stat--liked":u.project.liked}]),title:`${u.project.likeCount} likes`},[i(l,{name:u.project.liked?`i-heroicons-heart-20-solid`:`i-lucide-heart`,class:`cp-stat-icon`},null,8,[`name`]),a(` `+n(u.project.likeCount),1)],10,J),s(`span`,{class:`cp-stat`,title:`${u.project.downloadCount} duplicates`},[i(l,{name:`i-lucide-copy`,class:`cp-stat-icon`}),a(` `+n(u.project.downloadCount),1)],8,Y),u.project.commentCount?(d(),c(`span`,{key:0,class:`cp-stat`,title:`${u.project.commentCount} comments`},[i(l,{name:`i-lucide-message-circle`,class:`cp-stat-icon`}),a(` `+n(u.project.commentCount),1)],8,X)):h(``,!0)])])]),_:1},8,[`to`])]),_:1},8,[`items`,`disabled`]),w.value?(d(),m(y,{key:0,open:E.value,"onUpdate:open":o[0]||=e=>E.value=e,project:u.project},null,8,[`open`,`project`])):h(``,!0),w.value?(d(),m(S,{key:1,open:O.value,"onUpdate:open":o[2]||=e=>O.value=e,title:u.project.isOwner?`Unpublish this project?`:`Delete this project?`,description:u.project.isOwner?`It disappears from the community along with its likes and comments. Your own document is not affected.`:`It disappears from the community along with its likes and comments.`},{footer:p(()=>[s(`div`,Z,[i(b,{label:`Keep it`,color:`neutral`,variant:`ghost`,onClick:o[1]||=e=>O.value=!1}),i(b,{label:u.project.isOwner?`Unpublish`:`Delete`,color:`error`,loading:P.value,onClick:I},null,8,[`label`,`loading`])])]),_:1},8,[`open`,`title`,`description`])):h(``,!0)],64)}}}),[[`__scopeId`,`data-v-79f94fd5`]]),{__name:`CommunityProjectCard`});export{z as n,Q 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.