@opengis/widgets 0.0.6 → 0.0.7

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.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const M=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),W=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,s,t)=>t?t.toUpperCase():s.toLowerCase()),q=l=>{const n=W(l);return n.charAt(0).toUpperCase()+n.slice(1)},P=(...l)=>l.filter((n,s,t)=>!!n&&n.trim()!==""&&t.indexOf(n)===s).join(" ").trim();/**
6
+ */const L=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),W=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,s,t)=>t?t.toUpperCase():s.toLowerCase()),q=r=>{const n=W(r);return n.charAt(0).toUpperCase()+n.slice(1)},P=(...r)=>r.filter((n,s,t)=>!!n&&n.trim()!==""&&t.indexOf(n)===s).join(" ").trim();/**
7
7
  * @license lucide-vue-next v0.535.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
@@ -13,12 +13,12 @@
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const G=({size:l,strokeWidth:n=2,absoluteStrokeWidth:s,color:t,iconNode:o,name:d,class:r,...c},{slots:a})=>e.h("svg",{...V,width:l||V.width,height:l||V.height,stroke:t||V.stroke,"stroke-width":s?Number(n)*24/Number(l):n,class:P("lucide",...d?[`lucide-${M(q(d))}-icon`,`lucide-${M(d)}`]:["lucide-icon"]),...c},[...o.map(f=>e.h(...f)),...a.default?[a.default()]:[]]);/**
16
+ */const G=({size:r,strokeWidth:n=2,absoluteStrokeWidth:s,color:t,iconNode:o,name:m,class:c,...d},{slots:a})=>e.h("svg",{...V,width:r||V.width,height:r||V.height,stroke:t||V.stroke,"stroke-width":s?Number(n)*24/Number(r):n,class:P("lucide",...m?[`lucide-${L(q(m))}-icon`,`lucide-${L(m)}`]:["lucide-icon"]),...d},[...o.map(i=>e.h(...i)),...a.default?[a.default()]:[]]);/**
17
17
  * @license lucide-vue-next v0.535.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const h=(l,n)=>(s,{slots:t})=>e.h(G,{...s,iconNode:n,name:l},t);/**
21
+ */const h=(r,n)=>(s,{slots:t})=>e.h(G,{...s,iconNode:n,name:r},t);/**
22
22
  * @license lucide-vue-next v0.535.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
@@ -88,7 +88,7 @@
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
- */const D=h("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
91
+ */const T=h("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
92
92
  * @license lucide-vue-next v0.535.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
@@ -123,7 +123,7 @@
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
126
- */const $=h("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
126
+ */const C=h("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
127
127
  * @license lucide-vue-next v0.535.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
@@ -133,4 +133,4 @@
133
133
  *
134
134
  * This source code is licensed under the ISC license.
135
135
  * See the LICENSE file in the root directory of this source tree.
136
- */const N=h("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),de={class:"border-t pt-3 mt-4"},me={class:"flex gap-2"},pe={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},fe={class:"flex-1 space-y-2"},he={class:"flex justify-between items-center"},ge={class:"flex gap-2"},ye=["disabled"],S=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(l,{emit:n}){const s=e.useModel(l,"isReply"),t=e.ref(""),o=n,d=()=>{t.value.trim()&&(o("sendComment",t.value),t.value="")},r=c=>{(c.ctrlKey||c.metaKey)&&c.key==="Enter"&&(c.preventDefault(),d())};return(c,a)=>(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",me,[e.createElementVNode("span",pe,[e.createVNode(e.unref($),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",fe,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":a[0]||(a[0]=f=>t.value=f),onKeydown:r,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[e.vModelText,t.value]]),e.createElementVNode("div",he,[a[4]||(a[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",ge,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:a[1]||(a[1]=f=>s.value=!1)},[e.createVNode(e.unref(N),{class:"h-3 w-3"}),a[2]||(a[2]=e.createTextVNode(" Cancel ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!t.value.trim(),onClick:d},[e.createVNode(e.unref(D),{class:"h-3 w-3 mr-1"}),a[3]||(a[3]=e.createTextVNode(" Send ",-1))],8,ye)])])])])]))}}),ke={class:"z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md w-32 outline-none pointer-events-auto"},be=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(l,{emit:n}){const s=n,t=e.useModel(l,"showMoreOptions"),o=e.ref(),d=e.ref(!0),r=async f=>{t.value&&o.value&&!o.value.contains(f.target)&&!d.value&&(t.value=!1),d.value=!1},c=()=>{t.value=!1,s("edit")},a=()=>{t.value=!1,s("delete")};return e.onMounted(()=>{document.addEventListener("click",r)}),e.onUnmounted(()=>{document.removeEventListener("click",r)}),(f,i)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:o},[e.createElementVNode("div",ke,[e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",onClick:c},[e.createVNode(e.unref(re),{class:"h-3 w-3 mr-2"}),i[0]||(i[0]=e.createTextVNode(" Edit ",-1))]),e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",onClick:a},[e.createVNode(e.unref(E),{class:"h-3 w-3 mr-2"}),i[1]||(i[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),xe={class:"space-y-2"},_e={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},we={class:"flex-1 min-w-0 space-y-1 relative"},ue={class:"flex items-center gap-2"},Ve={class:"font-medium text-xs"},Ee={class:"text-xs text-gray-500"},Ne={key:0,class:"text-xs text-gray-700 leading-relaxed"},Be={class:"flex justify-between text-xs"},$e={class:"flex items-center gap-2"},Ce={key:0,class:"flex gap-2"},Me=["disabled"],De={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},Se=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(l,{emit:n}){const s=n,t=l,o=e.ref(t.comment.text),d=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),r=e.ref("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"),c=e.ref(!1),a=e.ref(!1),f=e.ref(!1),i=e.ref(!1),m=g=>{const p=new Date,w=Math.floor((p.getTime()-g.getTime())/(1e3*60*60));return w<1?`${Math.floor((p.getTime()-g.getTime())/6e4)}m`:w<24?`${w}h`:`${Math.floor(w/24)}d`},b=()=>{i.value=!i.value,i.value?s("like",t.comment.id,"add"):s("like",t.comment.id,"delete")},U=()=>{s("edit",t.comment.id,o.value),f.value=!1},Fo=(g,p)=>{s("like",g,p)},Ro=(g,p)=>{s("edit",g,p)};return(g,p)=>{const w=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",f.value?"bg-gray-50":""])},[e.createElementVNode("span",_e,[e.createVNode(e.unref($),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",we,[e.createElementVNode("div",ue,[e.createElementVNode("span",Ve,e.toDisplayString(g.comment?.author),1),e.createElementVNode("span",Ee,e.toDisplayString(m(g.comment?.createdAt)),1)]),f.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":p[0]||(p[0]=y=>o.value=y),class:e.normalizeClass(f.value?r.value:d.value)},null,2)),[[e.vModelText,o.value]]):(e.openBlock(),e.createElementBlock("p",Ne,e.toDisplayString(g.comment?.text),1)),e.createElementVNode("div",Be,[e.createElementVNode("div",$e,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",i.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:p[1]||(p[1]=y=>b())},[e.createVNode(e.unref(v),{class:e.normalizeClass(["h-3 w-3",i.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(g.comment?.likes),1)],2),g.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:p[2]||(p[2]=y=>a.value=!0)},[e.createVNode(e.unref(ne),{class:"h-3 w-3"})])),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:p[3]||(p[3]=y=>c.value=!0)},[e.createVNode(e.unref(J),{class:"h-3 w-3"})])]),f.value?(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:p[4]||(p[4]=y=>f.value=!1)},[e.createVNode(e.unref(N),{class:"h-3 w-3"}),p[11]||(p[11]=e.createTextVNode(" Cancel ",-1))]),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!o.value.trim(),onClick:p[5]||(p[5]=y=>U())},[e.createVNode(e.unref(D),{class:"h-3 w-3 mr-1"}),p[12]||(p[12]=e.createTextVNode(" Send ",-1))],8,Me)])):e.createCommentVNode("",!0)])]),c.value?(e.openBlock(),e.createBlock(be,{key:0,showMoreOptions:c.value,"onUpdate:showMoreOptions":p[6]||(p[6]=y=>c.value=y),onEdit:p[7]||(p[7]=y=>f.value=!0),onDelete:p[8]||(p[8]=y=>g.$emit("delete",g.comment?.id)),comment:g.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),g.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.comment?.replies,y=>(e.openBlock(),e.createBlock(w,{key:y.id,comment:y,isInside:!0,onDelete:Go=>g.$emit("delete",y.id),onLike:Fo,onEdit:Ro},null,8,["comment","onDelete"]))),128)),a.value&&!g.isInside?(e.openBlock(),e.createBlock(S,{key:0,onSendComment:p[9]||(p[9]=y=>g.$emit("reply",g.comment?.id,y)),isReply:a.value,"onUpdate:isReply":p[10]||(p[10]=y=>a.value=y)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),ze=["id"],Le={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},z=e.defineComponent({__name:"CommentsWidget",props:{title:{},comments:{},maxHeight:{},onAddComment:{type:Function},onReply:{type:Function},onLike:{type:Function},onDelete:{type:Function},onEdit:{type:Function},id:{},className:{},style:{}},emits:["add","reply","like","delete","edit"],setup(l,{emit:n}){const s=n,t=(r,c)=>{s("like",r,c)},o=(r,c)=>{s("reply",r,c)},d=(r,c)=>{s("edit",r,c)};return(r,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",r.className]),id:r.id,style:e.normalizeStyle(r.style)},[r.title?(e.openBlock(),e.createElementBlock("h3",Le,e.toDisplayString(r.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([r.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:r.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.comments,a=>(e.openBlock(),e.createBlock(Se,{key:a.id,comment:a,onReply:o,onLike:t,onDelete:c[0]||(c[0]=f=>r.$emit("delete",f)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(S,{onSendComment:c[1]||(c[1]=a=>r.$emit("add",a))})],14,ze))}}),L=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:_}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:le}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:ie}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:ee}]]),Te={class:"mx-auto font-sans"},Ie={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},je={class:"relative"},He={class:"space-y-3"},Fe={class:"flex-1 min-w-0 pb-2"},Re={class:"flex items-center gap-1.5 mb-1 mt-0.5"},Ae={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Oe={class:"font-medium text-xs"},Ue={class:"text-xs text-gray-500"},We={class:"space-y-1"},qe={class:"text-xs text-gray-700"},Pe={class:"capitalize mr-1"},Ge={key:0,class:"inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"},Ke={key:0,class:"flex items-center gap-1 text-xs"},Ze={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Xe={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},T=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(l){return(n,s)=>(e.openBlock(),e.createElementBlock("div",Te,[n.title?(e.openBlock(),e.createElementBlock("h3",Ie,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(n.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:n.maxHeight+"px"})},[e.createElementVNode("div",je,[s[0]||(s[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,t=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:t?.id},[e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${e.unref(L).get(t?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(L).get(t?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",Fe,[e.createElementVNode("div",Re,[e.createElementVNode("span",Ae,[e.createVNode(e.unref($),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",Oe,e.toDisplayString(t?.userName),1),e.createElementVNode("span",Ue,e.toDisplayString(t?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",We,[e.createElementVNode("div",qe,[e.createElementVNode("span",Pe,e.toDisplayString(t?.action),1),t?.entityId?(e.openBlock(),e.createElementBlock("span",Ge,e.toDisplayString(t?.entityId),1)):e.createCommentVNode("",!0)]),t?.changes?.[t?.entityId]?(e.openBlock(),e.createElementBlock("div",Ke,[t?.changes?.[t?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(t?.changes?.[t?.entityId]?.old),1)):e.createCommentVNode("",!0),t?.changes?.[t?.entityId]?.old&&t?.changes?.[t?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(Z),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),t?.changes?.[t?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Xe,e.toDisplayString(t?.changes?.[t?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Je={key:0,class:"text-xl font-semibold"},Qe={class:"flex gap-1"},Ye=e.defineComponent({__name:"FileHeader",props:e.mergeModels({title:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const n=e.useModel(l,"modelValue"),s={active:"bg-black text-white hover:bg-black",inactive:"bg-white text-black hover:bg-gray-100"};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Je,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Qe,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?s.active:s.inactive]),onClick:o[0]||(o[0]=d=>n.value="list")},[e.createVNode(e.unref(oe),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?s.active:s.inactive]),onClick:o[1]||(o[1]=d=>n.value="grid")},[e.createVNode(e.unref(Y),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="compact"?s.active:s.inactive]),onClick:o[2]||(o[2]=d=>n.value="compact")},[e.createVNode(e.unref(ae),{class:"h-4 w-4"})],2)])],2))}}),u={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:_,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Q,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:ce,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:_,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:K,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:te,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:_,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:_,label:"PPT"}};function I(l,n="en"){const s={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,s).format(l)}function j(l){if(l===0)return"0 B";const n=1024,s=["B","KB","MB","GB","TB"],t=Math.floor(Math.log(l)/Math.log(n));return`${parseFloat((l/Math.pow(n,t)).toFixed(1))} ${s[t]}`}const ve={class:"space-y-0.5"},et={class:"flex-1 min-w-0 cursor-pointer"},tt={class:"flex items-center gap-2"},ot={class:"font-medium text-xs truncate hover:text-blue-600"},nt={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},st={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},lt={class:"flex items-center gap-1"},rt=["href"],at=["onClick"],it=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete"],setup(l){return(n,s)=>(e.openBlock(),e.createElementBlock("div",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,t=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",key:t.id},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(u)[t.type].color])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(u)[t.type].icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",ot,e.toDisplayString(t.name),1),e.createElementVNode("div",{class:e.normalizeClass(["inline-flex items-center rounded-full border py-0.5 font-semibold text-xs px-1",e.unref(u)[t.type].color])},e.toDisplayString(t.type),3)])]),e.createElementVNode("div",nt,e.toDisplayString(e.unref(j)(t.size)),1),e.createElementVNode("div",st,e.toDisplayString(e.unref(I)(t.createdAt)),1),e.createElementVNode("div",lt,[e.createElementVNode("a",{href:t.path,target:"_blank",download:"",class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"},[e.createVNode(e.unref(B),{class:"h-3 w-3"})],8,rt),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",onClick:o=>n.$emit("delete",t.id)},[e.createVNode(e.unref(E),{class:"h-3 w-3"})],8,at)])]))),128))]))}}),ct={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},dt={class:"space-y-2"},mt={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},pt={class:"space-y-1"},ft=["title"],ht={class:"text-xs text-gray-500 text-left"},gt=["onClick"],yt=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete"],setup(l){return(n,s)=>(e.openBlock(),e.createElementBlock("div",ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id,class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",dt,[e.createElementVNode("div",mt,[e.createVNode(e.unref(_),{class:"h-10 w-10 text-gray-500"})]),e.createElementVNode("div",pt,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:t.name},e.toDisplayString(t.name),9,ft),e.createElementVNode("p",ht,e.toDisplayString(e.unref(I)(t.createdAt))+", "+e.toDisplayString(e.unref(j)(t.size)),1)])]),e.createElementVNode("a",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md absolute top-2 right-2 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",onClick:o=>n.$emit("delete",t.id)},[e.createVNode(e.unref(E),{class:"h-3 w-3"})],8,gt)]))),128))]))}}),kt={class:"flex flex-wrap gap-1"},bt=["title"],xt={class:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity ml-1"},_t=["href"],wt=["onClick"],ut=e.defineComponent({__name:"FileCompact",props:{files:{}},emits:["delete"],setup(l){return(n,s)=>(e.openBlock(),e.createElementBlock("div",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id,class:"group flex items-center gap-1 p-1 rounded border hover:bg-gray-50 hover:shadow-sm transition-all"},[e.createElementVNode("div",{class:e.normalizeClass(["p-0.5 rounded",e.unref(u)[t.type].color])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(u)[t.type].icon),{class:"h-3 w-3"}))],2),e.createElementVNode("span",{class:"text-xs font-medium truncate max-w-24",title:t.name},e.toDisplayString(t.name),9,bt),e.createElementVNode("div",xt,[e.createElementVNode("a",{class:"ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground rounded-md h-4 w-4 p-0",href:t.path,target:"_blank",download:""},[e.createVNode(e.unref(B),{class:"h-2.5 w-2.5"})],8,_t),e.createElementVNode("button",{class:"ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors hover:bg-accent rounded-md h-4 w-4 p-0 text-red-600 hover:text-red-700",onClick:o=>n.$emit("delete",t.id)},[e.createVNode(e.unref(E),{class:"h-2.5 w-2.5"})],8,wt)])]))),128))]))}}),Vt={class:"mx-auto font-sans"},H=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{},maxHeight:{}},emits:["delete"],setup(l){const n=l,s=e.ref("list");return(t,o)=>(e.openBlock(),e.createElementBlock("div",Vt,[e.createVNode(Ye,{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=d=>s.value=d),title:n.title},null,8,["modelValue","title"]),e.createElementVNode("div",{class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[s.value==="list"?(e.openBlock(),e.createBlock(it,{key:0,onDelete:o[1]||(o[1]=d=>t.$emit("delete",d)),files:n.files},null,8,["files"])):e.createCommentVNode("",!0),s.value==="grid"?(e.openBlock(),e.createBlock(yt,{key:1,onDelete:o[2]||(o[2]=d=>t.$emit("delete",d)),files:n.files},null,8,["files"])):e.createCommentVNode("",!0),s.value==="compact"?(e.openBlock(),e.createBlock(ut,{key:2,onDelete:o[3]||(o[3]=d=>t.$emit("delete",d)),files:n.files},null,8,["files"])):e.createCommentVNode("",!0)],6)]))}}),Et=["onClick"],Nt=e.defineComponent({__name:"CopyNotification",setup(l,{expose:n}){const s=e.ref([]);let t=1;const o=()=>{if(s.value.length>=10){const c=s.value[0];clearTimeout(c.timer),s.value.shift()}const r={id:t++,timer:setTimeout(()=>{d(r.id)},1500)};s.value.push(r)},d=r=>{const c=s.value.findIndex(a=>a.id===r);if(c!==-1){const a=s.value[c];clearTimeout(a.timer),s.value.splice(c,1)}};return n({addNotification:o}),e.onUnmounted(()=>{s.value.forEach(r=>{clearTimeout(r.timer)})}),(r,c)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(X),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),c[0]||(c[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:f=>d(a.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(N),{class:"h-4 w-4"})],8,Et)]))),128))]),_:1})]))}}),x=(l,n)=>{const s=l.__vccOpts||l;for(const[t,o]of n)s[t]=o;return s},C=x(Nt,[["__scopeId","data-v-7b0d3ace"]]),Bt={class:"fixed inset-0 z-50 bg-black/80"},$t={class:"fixed bg-white left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 sm:rounded-lg max-w-4xl max-h-[90vh] p-0"},Ct={class:"flex flex-col space-y-1.5 text-center sm:text-left p-4 pb-2"},Mt={class:"flex items-center justify-between"},Dt={class:"flex items-center gap-2"},St={class:"tracking-tight text-base font-medium"},zt={class:"p-4 pt-0"},Lt={class:"flex flex-col items-center"},Tt=["src","alt"],It={class:"mt-3 flex items-center gap-4 text-sm text-gray-600"},jt={class:"mt-3 flex gap-2"},Ht=e.defineComponent({__name:"GalleryModal",props:{item:{}},emits:["close"],setup(l){const n=e.ref(),s=r=>new Date(r).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"}),t=r=>r>=1024*1024*1024?(r/(1024*1024*1024)).toFixed(2)+" GB":r>=1024*1024?(r/(1024*1024)).toFixed(2)+" MB":r>=1024?(r/1024).toFixed(2)+" KB":r+" B",o=r=>{navigator.clipboard.writeText(r),n.value?.addNotification()},d=async(r,c)=>{try{const f=await(await fetch(r)).blob(),i=window.URL.createObjectURL(f),m=document.createElement("a");m.href=i,m.download=c,document.body.appendChild(m),m.click(),window.URL.revokeObjectURL(i),document.body.removeChild(m)}catch(a){console.error("Download failed:",a),alert("Download failed. Please try opening the image in a new tab.")}};return(r,c)=>(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("div",$t,[e.createElementVNode("div",Ct,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Dt,[e.createElementVNode("h2",St,e.toDisplayString(r.item.name),1)])])]),e.createElementVNode("div",zt,[e.createElementVNode("div",Lt,[e.createElementVNode("img",{src:r.item.path,alt:r.item.name,class:"max-w-full max-h-[60vh] object-contain rounded border"},null,8,Tt),e.createElementVNode("div",It,[e.createElementVNode("span",null,"Size: "+e.toDisplayString(t(r.item.size)),1),c[3]||(c[3]=e.createElementVNode("span",null,"•",-1)),e.createElementVNode("span",null,"Date: "+e.toDisplayString(s(r.item.createdAt)),1)]),e.createElementVNode("div",jt,[e.createElementVNode("button",{onClick:c[0]||(c[0]=a=>d(r.item.path,r.item.name)),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border h-9 rounded-md px-3"},[e.createVNode(e.unref(B),{class:"h-3 w-3 mr-1"}),c[4]||(c[4]=e.createTextVNode(" Download ",-1))]),e.createElementVNode("button",{onClick:c[1]||(c[1]=a=>o(r.item.path)),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border h-9 rounded-md px-3"},[e.createVNode(e.unref(se),{class:"h-3 w-3 mr-1"}),c[5]||(c[5]=e.createTextVNode(" Share ",-1))])])])]),e.createElementVNode("button",{type:"button",onClick:c[2]||(c[2]=a=>r.$emit("close")),class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},[e.createVNode(e.unref(N),{class:"h-4 w-4"}),c[6]||(c[6]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))])]),e.createVNode(C,{ref_key:"copyNotificationRef",ref:n},null,512)]))}}),Ft={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Rt=["onClick"],At=["src","alt"],F=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{},columns:{},maxHeight:{},id:{},className:{},style:{}},setup(l){const n=l,s=e.ref(!1),t=e.ref(null),o=e.ref(),d=e.ref(0);let r=null;const c=e.computed(()=>{const i=n.columns||4;return d.value>=1440?i:d.value>=1024?Math.max(1,i-1):d.value>=768?Math.max(1,i-2):d.value>=640?Math.max(1,i-3):1}),a=()=>{o.value&&(d.value=o.value.offsetWidth)};e.onMounted(()=>{e.nextTick(()=>{o.value&&(r=new ResizeObserver(i=>{for(const m of i)m.target===o.value&&(d.value=m.contentRect.width)}),r.observe(o.value),a())})}),e.onUnmounted(()=>{r&&r.disconnect()});const f=i=>{t.value=i,s.value=!0};return(i,m)=>(e.openBlock(),e.createElementBlock("div",{class:"w-full mx-auto font-sans",ref_key:"containerRef",ref:o},[i.title?(e.openBlock(),e.createElementBlock("h3",Ft,e.toDisplayString(i.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(i.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:i.maxHeight+"px"})},[e.createElementVNode("div",{style:e.normalizeStyle({columns:c.value+" auto",gap:"12px"}),class:"space-y-3"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.items,b=>(e.openBlock(),e.createElementBlock("div",{key:b.id,onClick:U=>f(b),class:"group relative break-inside-avoid bg-gray-200 rounded-lg overflow-hidden cursor-pointer hover:shadow-md transition-all mb-3"},[e.createElementVNode("img",{src:b.path,alt:b.name,class:"w-full h-auto min-h-40 rounded-md object-contain"},null,8,At),m[1]||(m[1]=e.createElementVNode("div",{class:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 pt-12"},[e.createElementVNode("h3",{class:"text-white font-medium text-base leading-tight mb-1"},"Mountain Landscape"),e.createElementVNode("p",{class:"text-white/90 text-sm"},"2.4 MB")],-1)),m[2]||(m[2]=e.createElementVNode("div",{class:"absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-200"},null,-1))],8,Rt))),128))],4)],6),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[s.value&&t.value?(e.openBlock(),e.createBlock(Ht,{key:0,item:t.value,onClose:m[0]||(m[0]=b=>s.value=!1)},null,8,["item"])):e.createCommentVNode("",!0)]))],512))}}),Ot={key:0,class:"overflow-hidden"},Ut={class:"flex border-b border-gray-200 bg-gray-50"},Wt=["onClick"],qt={class:"p-4"},Pt=["innerHTML"],Gt={key:1,class:"p-4"},Kt={class:"grid grid-cols-12 gap-4"},Zt={key:0,class:"mb-4 pb-2 border-b border-gray-200"},Xt={class:"text-lg font-semibold text-gray-900"},Jt=["innerHTML"],R=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},id:{},className:{},style:{}},setup(l){const n=l,s=e.ref(0),t=e.computed(()=>n.panels&&n.panels.length>0?n.panels:n.data&&Array.isArray(n.data)?n.data.filter(f=>f.type==="tabs")[0]?.items||[]:[]),o=e.computed(()=>n.panels&&n.panels.length>0?n.panels:n.data&&Array.isArray(n.data)?n.data:[]),d=e.computed(()=>({[`view-${n.view}`]:!0})),r=a=>{const f={};return a.count&&(f.count=a.count),a.col&&(f.col=a.col),f.data&&(f.data=f.data),f},c=a=>a.width?{gridColumn:`span ${a.width}`}:{};return(a,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["bg-white rounded-lg shadow-sm border border-gray-200",d.value])},[a.view==="tab"?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",Ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(i,m)=>(e.openBlock(),e.createElementBlock("button",{key:i.name||m,onClick:b=>s.value=m,class:e.normalizeClass(["px-4 py-3 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 transition-colors",{"text-blue-600 bg-white border-b-2 border-blue-600":s.value===m}])},e.toDisplayString(i.title||i.label||i.name||`Tab ${m+1}`),11,Wt))),128))]),e.createElementVNode("div",qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(i,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:i.name||m,class:e.normalizeClass(["min-h-[400px] w-full",`col-span-${i.col||12}`])},[i.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:i.html,class:"text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"},null,8,Pt)):a.$slots[`tab-${m}`]?e.renderSlot(a.$slots,`tab-${m}`,{key:1,item:i,data:a.data}):i.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),e.mergeProps({key:2,ref_for:!0},r(i),{class:"w-full h-full"}),null,16)):e.renderSlot(a.$slots,i.slot||`tab-${m}`,{key:3,item:i,data:a.data})],2)),[[e.vShow,s.value===m]])),128))])])):(e.openBlock(),e.createElementBlock("div",Gt,[e.createElementVNode("div",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(i,m)=>(e.openBlock(),e.createElementBlock("div",{key:i.name||m,class:e.normalizeClass(["bg-gray-50 rounded-lg p-4 min-h-[300px]",`col-span-${i.col||12}`]),style:e.normalizeStyle(c(i))},[i.title||i.label?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("h3",Xt,e.toDisplayString(i.title||i.label),1)])):e.createCommentVNode("",!0),i.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:i.html,class:"text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"},null,8,Jt)):a.$slots[`panel-${m}`]?e.renderSlot(a.$slots,`panel-${m}`,{key:2,item:i,data:a.data}):i.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),e.mergeProps({key:3,ref_for:!0},r(i),{class:"w-full h-full"}),null,16)):e.renderSlot(a.$slots,i.slot||`panel-${m}`,{key:4,item:i,data:a.data})],6))),128))])]))],2))}}),Qt=["innerHTML"],A=e.defineComponent({__name:"CardItem",props:{name:{},label:{},component:{},slot:{},col:{default:12},html:{},title:{},id:{},className:{},style:{}},setup(l){const n=l,s=e.computed(()=>({[`col-span-${n.col}`]:!0})),t=e.computed(()=>{const o={};return o.col&&(o.col=o.col),o});return(o,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full",s.value])},[o.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:o.html,class:"text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"},null,8,Qt)):o.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.component),e.mergeProps({key:1},t.value,{class:"w-full"}),null,16)):e.renderSlot(o.$slots,"default",{key:2})],2))}}),Yt={class:"text-value"},vt={class:"text-sm text-gray-900"},eo=x(e.defineComponent({__name:"TextValue",props:{item:{}},setup(l){const n=l,s=e.computed(()=>{const t=n.item.value;return typeof t=="boolean"?t?"Так":"Ні":t==null?"—":String(t)});return(t,o)=>(e.openBlock(),e.createElementBlock("div",Yt,[e.createElementVNode("span",vt,e.toDisplayString(s.value),1)]))}}),[["__scopeId","data-v-c14550b7"]]),to={class:"link-value"},oo=["href"],no=x(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(l){const n=l,s=e.computed(()=>{const t=String(n.item.value);try{const o=new URL(t);return o.hostname+o.pathname}catch{return t}});return(t,o)=>(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("a",{href:String(t.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),o[0]||(o[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,oo)]))}}),[["__scopeId","data-v-e6eb07a6"]]),so={class:"date-value"},lo={class:"text-sm text-gray-900"},ro=x(e.defineComponent({__name:"DateValue",props:{item:{}},setup(l){const n=l,s=e.computed(()=>{const t=n.item.value;if(t instanceof Date)return t.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof t=="string"){const o=new Date(t);if(!isNaN(o.getTime()))return o.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(t)});return(t,o)=>(e.openBlock(),e.createElementBlock("div",so,[e.createElementVNode("span",lo,e.toDisplayString(s.value),1)]))}}),[["__scopeId","data-v-b9600618"]]),ao={class:"status-value"},io={key:0,class:"mr-1"},co=x(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(l){const n=l,s=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"bg-green-100 text-green-800";case"inactive":case"неактивний":case"pending":case"очікує":return"bg-yellow-100 text-yellow-800";case"error":case"помилка":case"failed":case"неуспішно":return"bg-red-100 text-red-800";case"draft":case"чернетка":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}}),t=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(o,d)=>(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",s.value])},[t.value?(e.openBlock(),e.createElementBlock("span",io,[e.createElementVNode("i",{class:e.normalizeClass(t.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(o.item.value)),1)],2)]))}}),[["__scopeId","data-v-c72e0b01"]]),mo={class:"custom-value"},po={class:"text-sm text-gray-900"},fo=x(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(l){return(n,s)=>(e.openBlock(),e.createElementBlock("div",mo,[e.renderSlot(n.$slots,"default",{item:n.item,value:n.item.value},()=>[e.createElementVNode("span",po,e.toDisplayString(String(n.item.value)),1)],!0)]))}}),[["__scopeId","data-v-11a73810"]]),ho=["id"],go={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},yo={key:1,class:"overflow-x-auto"},ko={class:"min-w-full divide-y divide-gray-200"},bo={class:"bg-white divide-y divide-gray-200"},xo={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},_o={class:"flex items-center gap-2"},wo=["title"],uo={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Vo={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Eo={class:"flex items-start gap-3"},No={key:0,class:"flex-shrink-0"},Bo={class:"flex-1 min-w-0"},$o={class:"flex items-center gap-2 mb-2"},Co={class:"text-sm font-medium text-gray-900"},Mo=["title"],Do={key:3,class:"overflow-x-auto"},So={class:"min-w-full divide-y divide-gray-200"},zo={class:"bg-white divide-y divide-gray-200"},Lo={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},To={class:"flex items-center gap-2"},Io=["title"],jo={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},O=x(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(l){const n=s=>{switch(s.type){case"link":return no;case"date":return ro;case"status":return co;case"custom":return fo;default:return eo}};return(s,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",s.className]),id:s.id,style:e.normalizeStyle(s.style)},[s.title?(e.openBlock(),e.createElementBlock("h3",go,e.toDisplayString(s.title),1)):e.createCommentVNode("",!0),s.view==="table"?(e.openBlock(),e.createElementBlock("div",yo,[e.createElementVNode("table",ko,[e.createElementVNode("tbody",bo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,o=>(e.openBlock(),e.createElementBlock("tr",{key:o.id||o.label},[e.createElementVNode("td",xo,[e.createElementVNode("div",_o,[o.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([o.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label)+" ",1),o.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:o.tooltip},t[0]||(t[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,wo)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",uo,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(o)),{item:o},null,8,["item"]))])]))),128))])])])):s.view==="grid"?(e.openBlock(),e.createElementBlock("div",Vo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id||o.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Eo,[o.icon?(e.openBlock(),e.createElementBlock("div",No,[e.createElementVNode("i",{class:e.normalizeClass([o.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Bo,[e.createElementVNode("div",$o,[e.createElementVNode("h4",Co,e.toDisplayString(o.label),1),o.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:o.tooltip},t[1]||(t[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Mo)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(o)),{item:o},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("table",So,[e.createElementVNode("tbody",zo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,o=>(e.openBlock(),e.createElementBlock("tr",{key:o.id||o.label},[e.createElementVNode("td",Lo,[e.createElementVNode("div",To,[o.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([o.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label)+" ",1),o.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:o.tooltip},t[2]||(t[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Io)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",jo,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(o)),{item:o},null,8,["item"]))])]))),128))])])]))],14,ho))}}),[["__scopeId","data-v-36d43e50"]]),Ho={install:l=>{l.component("CommentsWidget",z),l.component("HistoryWidget",T),l.component("GalleryWidget",F),l.component("FilesWidget",H),l.component("Card",R),l.component("CardItem",A),l.component("DescriptionListWidget",O),l.component("CopyNotification",C)}};k.Card=R,k.CardItem=A,k.CommentsWidget=z,k.CopyNotification=C,k.DescriptionListWidget=O,k.FilesWidget=H,k.GalleryWidget=F,k.HistoryWidget=T,k.default=Ho,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
136
+ */const N=h("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),de={class:"border-t pt-3 mt-4"},me={class:"flex gap-2"},pe={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},fe={class:"flex-1 space-y-2"},he={class:"flex justify-between items-center"},ge={class:"flex gap-2"},ye=["disabled"],j=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(r,{emit:n}){const s=e.useModel(r,"isReply"),t=e.ref(""),o=n,m=()=>{t.value.trim()&&(o("sendComment",t.value),t.value="")},c=d=>{(d.ctrlKey||d.metaKey)&&d.key==="Enter"&&(d.preventDefault(),m())};return(d,a)=>(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",me,[e.createElementVNode("span",pe,[e.createVNode(e.unref(C),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",fe,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":a[0]||(a[0]=i=>t.value=i),onKeydown:c,placeholder:"Add a comment...",class:"w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"},null,544),[[e.vModelText,t.value]]),e.createElementVNode("div",he,[a[4]||(a[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",ge,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:a[1]||(a[1]=i=>s.value=!1)},[e.createVNode(e.unref(N),{class:"h-3 w-3"}),a[2]||(a[2]=e.createTextVNode(" Cancel ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!t.value.trim(),onClick:m},[e.createVNode(e.unref(T),{class:"h-3 w-3 mr-1"}),a[3]||(a[3]=e.createTextVNode(" Send ",-1))],8,ye)])])])])]))}}),ke={class:"z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md w-32 outline-none pointer-events-auto"},be=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(r,{emit:n}){const s=n,t=e.useModel(r,"showMoreOptions"),o=e.ref(),m=e.ref(!0),c=async i=>{t.value&&o.value&&!o.value.contains(i.target)&&!m.value&&(t.value=!1),m.value=!1},d=()=>{t.value=!1,s("edit")},a=()=>{t.value=!1,s("delete")};return e.onMounted(()=>{document.addEventListener("click",c)}),e.onUnmounted(()=>{document.removeEventListener("click",c)}),(i,l)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:o},[e.createElementVNode("div",ke,[e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",onClick:d},[e.createVNode(e.unref(re),{class:"h-3 w-3 mr-2"}),l[0]||(l[0]=e.createTextVNode(" Edit ",-1))]),e.createElementVNode("div",{class:"relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",onClick:a},[e.createVNode(e.unref(E),{class:"h-3 w-3 mr-2"}),l[1]||(l[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),xe={class:"space-y-2"},_e={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},we={class:"flex-1 min-w-0 space-y-1 relative"},ue={class:"flex items-center gap-2"},Ve={class:"font-medium text-xs"},Ee={class:"text-xs text-gray-500"},Ne={key:0,class:"text-xs text-gray-700 leading-relaxed"},Be={class:"flex justify-between text-xs"},Ce={class:"flex items-center gap-2"},$e={key:0,class:"flex gap-2"},Me=["disabled"],De={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},Se=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(r,{emit:n}){const s=n,t=r,o=e.ref(t.comment.text),m=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),c=e.ref("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"),d=e.ref(!1),a=e.ref(!1),i=e.ref(!1),l=e.ref(!1),p=g=>{const f=new Date,w=Math.floor((f.getTime()-g.getTime())/(1e3*60*60));return w<1?`${Math.floor((f.getTime()-g.getTime())/6e4)}m`:w<24?`${w}h`:`${Math.floor(w/24)}d`},b=()=>{l.value=!l.value,l.value?s("like",t.comment.id,"add"):s("like",t.comment.id,"delete")},U=()=>{s("edit",t.comment.id,o.value),i.value=!1},Fo=(g,f)=>{s("like",g,f)},Ro=(g,f)=>{s("edit",g,f)};return(g,f)=>{const w=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",i.value?"bg-gray-50":""])},[e.createElementVNode("span",_e,[e.createVNode(e.unref(C),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",we,[e.createElementVNode("div",ue,[e.createElementVNode("span",Ve,e.toDisplayString(g.comment?.author),1),e.createElementVNode("span",Ee,e.toDisplayString(p(g.comment?.createdAt)),1)]),i.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":f[0]||(f[0]=y=>o.value=y),class:e.normalizeClass(i.value?c.value:m.value)},null,2)),[[e.vModelText,o.value]]):(e.openBlock(),e.createElementBlock("p",Ne,e.toDisplayString(g.comment?.text),1)),e.createElementVNode("div",Be,[e.createElementVNode("div",Ce,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",l.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:f[1]||(f[1]=y=>b())},[e.createVNode(e.unref(v),{class:e.normalizeClass(["h-3 w-3",l.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(g.comment?.likes),1)],2),g.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:f[2]||(f[2]=y=>a.value=!0)},[e.createVNode(e.unref(ne),{class:"h-3 w-3"})])),e.createElementVNode("button",{class:"text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",type:"button",onClick:f[3]||(f[3]=y=>d.value=!0)},[e.createVNode(e.unref(J),{class:"h-3 w-3"})])]),i.value?(e.openBlock(),e.createElementBlock("div",$e,[e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",onClick:f[4]||(f[4]=y=>i.value=!1)},[e.createVNode(e.unref(N),{class:"h-3 w-3"}),f[11]||(f[11]=e.createTextVNode(" Cancel ",-1))]),e.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",disabled:!o.value.trim(),onClick:f[5]||(f[5]=y=>U())},[e.createVNode(e.unref(T),{class:"h-3 w-3 mr-1"}),f[12]||(f[12]=e.createTextVNode(" Send ",-1))],8,Me)])):e.createCommentVNode("",!0)])]),d.value?(e.openBlock(),e.createBlock(be,{key:0,showMoreOptions:d.value,"onUpdate:showMoreOptions":f[6]||(f[6]=y=>d.value=y),onEdit:f[7]||(f[7]=y=>i.value=!0),onDelete:f[8]||(f[8]=y=>g.$emit("delete",g.comment?.id)),comment:g.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),g.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.comment?.replies,y=>(e.openBlock(),e.createBlock(w,{key:y.id,comment:y,isInside:!0,onDelete:Go=>g.$emit("delete",y.id),onLike:Fo,onEdit:Ro},null,8,["comment","onDelete"]))),128)),a.value&&!g.isInside?(e.openBlock(),e.createBlock(j,{key:0,onSendComment:f[9]||(f[9]=y=>g.$emit("reply",g.comment?.id,y)),isReply:a.value,"onUpdate:isReply":f[10]||(f[10]=y=>a.value=y)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),ze=["id"],Le={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},$=e.defineComponent({__name:"CommentsWidget",props:{title:{},comments:{},maxHeight:{},onAddComment:{type:Function},onReply:{type:Function},onLike:{type:Function},onDelete:{type:Function},onEdit:{type:Function},id:{},className:{},style:{}},emits:["add","reply","like","delete","edit"],setup(r,{emit:n}){const s=r,t=n,o=i=>{s.onAddComment(i),t("add",i)},m=(i,l)=>{s.onLike(i,l),t("like",i,l)},c=(i,l)=>{s.onReply(i,l),t("reply",i,l)},d=(i,l)=>{s.onEdit(i,l),t("edit",i,l)},a=i=>{s.onDelete(i),t("delete",i)};return(i,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",i.className]),id:i.id,style:e.normalizeStyle(i.style)},[i.title?(e.openBlock(),e.createElementBlock("h3",Le,e.toDisplayString(i.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([i.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:i.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.comments,p=>(e.openBlock(),e.createBlock(Se,{key:p.id,comment:p,onReply:c,onLike:m,onDelete:l[0]||(l[0]=b=>a(b)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(j,{onSendComment:l[1]||(l[1]=p=>o(p))})],14,ze))}}),H=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:_}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:le}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:ie}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:ee}]]),Te={class:"mx-auto font-sans"},je={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},He={class:"relative"},Ie={class:"space-y-3"},Fe={class:"flex-1 min-w-0 pb-2"},Re={class:"flex items-center gap-1.5 mb-1 mt-0.5"},Ae={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Oe={class:"font-medium text-xs"},Ue={class:"text-xs text-gray-500"},We={class:"space-y-1"},qe={class:"text-xs text-gray-700"},Pe={class:"capitalize mr-1"},Ge={key:0,class:"inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"},Ke={key:0,class:"flex items-center gap-1 text-xs"},Ze={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Xe={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},M=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(r){return(n,s)=>(e.openBlock(),e.createElementBlock("div",Te,[n.title?(e.openBlock(),e.createElementBlock("h3",je,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(n.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:n.maxHeight+"px"})},[e.createElementVNode("div",He,[s[0]||(s[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,t=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:t?.id},[e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${e.unref(H).get(t?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(H).get(t?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",Fe,[e.createElementVNode("div",Re,[e.createElementVNode("span",Ae,[e.createVNode(e.unref(C),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",Oe,e.toDisplayString(t?.userName),1),e.createElementVNode("span",Ue,e.toDisplayString(t?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",We,[e.createElementVNode("div",qe,[e.createElementVNode("span",Pe,e.toDisplayString(t?.action),1),t?.entityId?(e.openBlock(),e.createElementBlock("span",Ge,e.toDisplayString(t?.entityId),1)):e.createCommentVNode("",!0)]),t?.changes?.[t?.entityId]?(e.openBlock(),e.createElementBlock("div",Ke,[t?.changes?.[t?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(t?.changes?.[t?.entityId]?.old),1)):e.createCommentVNode("",!0),t?.changes?.[t?.entityId]?.old&&t?.changes?.[t?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(Z),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),t?.changes?.[t?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Xe,e.toDisplayString(t?.changes?.[t?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Je={key:0,class:"text-xl font-semibold"},Qe={class:"flex gap-1"},Ye=e.defineComponent({__name:"FileHeader",props:e.mergeModels({title:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const n=e.useModel(r,"modelValue"),s={active:"bg-black text-white hover:bg-black",inactive:"bg-white text-black hover:bg-gray-100"};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Je,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Qe,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?s.active:s.inactive]),onClick:o[0]||(o[0]=m=>n.value="list")},[e.createVNode(e.unref(oe),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?s.active:s.inactive]),onClick:o[1]||(o[1]=m=>n.value="grid")},[e.createVNode(e.unref(Y),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="compact"?s.active:s.inactive]),onClick:o[2]||(o[2]=m=>n.value="compact")},[e.createVNode(e.unref(ae),{class:"h-4 w-4"})],2)])],2))}}),u={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:_,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Q,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:ce,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:_,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:K,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:te,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:_,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:_,label:"PPT"}};function I(r,n="en"){const s={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,s).format(r)}function F(r){if(r===0)return"0 B";const n=1024,s=["B","KB","MB","GB","TB"],t=Math.floor(Math.log(r)/Math.log(n));return`${parseFloat((r/Math.pow(n,t)).toFixed(1))} ${s[t]}`}const ve={class:"space-y-0.5"},et={class:"flex-1 min-w-0 cursor-pointer"},tt={class:"flex items-center gap-2"},ot={class:"font-medium text-xs truncate hover:text-blue-600"},nt={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},st={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},lt={class:"flex items-center gap-1"},rt=["href"],at=["onClick"],it=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete"],setup(r){return(n,s)=>(e.openBlock(),e.createElementBlock("div",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,t=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",key:t.id},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(u)[t.type].color])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(u)[t.type].icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",ot,e.toDisplayString(t.name),1),e.createElementVNode("div",{class:e.normalizeClass(["inline-flex items-center rounded-full border py-0.5 font-semibold text-xs px-1",e.unref(u)[t.type].color])},e.toDisplayString(t.type),3)])]),e.createElementVNode("div",nt,e.toDisplayString(e.unref(F)(t.size)),1),e.createElementVNode("div",st,e.toDisplayString(e.unref(I)(t.createdAt)),1),e.createElementVNode("div",lt,[e.createElementVNode("a",{href:t.path,target:"_blank",download:"",class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"},[e.createVNode(e.unref(B),{class:"h-3 w-3"})],8,rt),e.createElementVNode("button",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",onClick:o=>n.$emit("delete",t.id)},[e.createVNode(e.unref(E),{class:"h-3 w-3"})],8,at)])]))),128))]))}}),ct={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},dt={class:"space-y-2"},mt={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},pt={class:"space-y-1"},ft=["title"],ht={class:"text-xs text-gray-500 text-left"},gt=["onClick"],yt=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete"],setup(r){return(n,s)=>(e.openBlock(),e.createElementBlock("div",ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id,class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",dt,[e.createElementVNode("div",mt,[e.createVNode(e.unref(_),{class:"h-10 w-10 text-gray-500"})]),e.createElementVNode("div",pt,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:t.name},e.toDisplayString(t.name),9,ft),e.createElementVNode("p",ht,e.toDisplayString(e.unref(I)(t.createdAt))+", "+e.toDisplayString(e.unref(F)(t.size)),1)])]),e.createElementVNode("a",{class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md absolute top-2 right-2 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",onClick:o=>n.$emit("delete",t.id)},[e.createVNode(e.unref(E),{class:"h-3 w-3"})],8,gt)]))),128))]))}}),kt={class:"flex flex-wrap gap-1"},bt=["title"],xt={class:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity ml-1"},_t=["href"],wt=["onClick"],ut=e.defineComponent({__name:"FileCompact",props:{files:{}},emits:["delete"],setup(r){return(n,s)=>(e.openBlock(),e.createElementBlock("div",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.files,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id,class:"group flex items-center gap-1 p-1 rounded border hover:bg-gray-50 hover:shadow-sm transition-all"},[e.createElementVNode("div",{class:e.normalizeClass(["p-0.5 rounded",e.unref(u)[t.type].color])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(u)[t.type].icon),{class:"h-3 w-3"}))],2),e.createElementVNode("span",{class:"text-xs font-medium truncate max-w-24",title:t.name},e.toDisplayString(t.name),9,bt),e.createElementVNode("div",xt,[e.createElementVNode("a",{class:"ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground rounded-md h-4 w-4 p-0",href:t.path,target:"_blank",download:""},[e.createVNode(e.unref(B),{class:"h-2.5 w-2.5"})],8,_t),e.createElementVNode("button",{class:"ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors hover:bg-accent rounded-md h-4 w-4 p-0 text-red-600 hover:text-red-700",onClick:o=>n.$emit("delete",t.id)},[e.createVNode(e.unref(E),{class:"h-2.5 w-2.5"})],8,wt)])]))),128))]))}}),Vt={class:"mx-auto font-sans"},D=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{},maxHeight:{}},emits:["delete"],setup(r){const n=r,s=e.ref("list");return(t,o)=>(e.openBlock(),e.createElementBlock("div",Vt,[e.createVNode(Ye,{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=m=>s.value=m),title:n.title},null,8,["modelValue","title"]),e.createElementVNode("div",{class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[s.value==="list"?(e.openBlock(),e.createBlock(it,{key:0,onDelete:o[1]||(o[1]=m=>t.$emit("delete",m)),files:n.files},null,8,["files"])):e.createCommentVNode("",!0),s.value==="grid"?(e.openBlock(),e.createBlock(yt,{key:1,onDelete:o[2]||(o[2]=m=>t.$emit("delete",m)),files:n.files},null,8,["files"])):e.createCommentVNode("",!0),s.value==="compact"?(e.openBlock(),e.createBlock(ut,{key:2,onDelete:o[3]||(o[3]=m=>t.$emit("delete",m)),files:n.files},null,8,["files"])):e.createCommentVNode("",!0)],6)]))}}),Et=["onClick"],Nt=e.defineComponent({__name:"CopyNotification",setup(r,{expose:n}){const s=e.ref([]);let t=1;const o=()=>{if(s.value.length>=10){const d=s.value[0];clearTimeout(d.timer),s.value.shift()}const c={id:t++,timer:setTimeout(()=>{m(c.id)},1500)};s.value.push(c)},m=c=>{const d=s.value.findIndex(a=>a.id===c);if(d!==-1){const a=s.value[d];clearTimeout(a.timer),s.value.splice(d,1)}};return n({addNotification:o}),e.onUnmounted(()=>{s.value.forEach(c=>{clearTimeout(c.timer)})}),(c,d)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(X),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),d[0]||(d[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:i=>m(a.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(N),{class:"h-4 w-4"})],8,Et)]))),128))]),_:1})]))}}),x=(r,n)=>{const s=r.__vccOpts||r;for(const[t,o]of n)s[t]=o;return s},S=x(Nt,[["__scopeId","data-v-7b0d3ace"]]),Bt={class:"fixed inset-0 z-50 bg-black/80"},Ct={class:"fixed bg-white left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 sm:rounded-lg max-w-4xl max-h-[90vh] p-0"},$t={class:"flex flex-col space-y-1.5 text-center sm:text-left p-4 pb-2"},Mt={class:"flex items-center justify-between"},Dt={class:"flex items-center gap-2"},St={class:"tracking-tight text-base font-medium"},zt={class:"p-4 pt-0"},Lt={class:"flex flex-col items-center"},Tt=["src","alt"],jt={class:"mt-3 flex items-center gap-4 text-sm text-gray-600"},Ht={class:"mt-3 flex gap-2"},It=e.defineComponent({__name:"GalleryModal",props:{item:{}},emits:["close"],setup(r){const n=e.ref(),s=c=>new Date(c).toLocaleDateString("uk-UA",{day:"2-digit",month:"2-digit",year:"numeric"}),t=c=>c>=1024*1024*1024?(c/(1024*1024*1024)).toFixed(2)+" GB":c>=1024*1024?(c/(1024*1024)).toFixed(2)+" MB":c>=1024?(c/1024).toFixed(2)+" KB":c+" B",o=c=>{navigator.clipboard.writeText(c),n.value?.addNotification()},m=async(c,d)=>{try{const i=await(await fetch(c)).blob(),l=window.URL.createObjectURL(i),p=document.createElement("a");p.href=l,p.download=d,document.body.appendChild(p),p.click(),window.URL.revokeObjectURL(l),document.body.removeChild(p)}catch(a){console.error("Download failed:",a),alert("Download failed. Please try opening the image in a new tab.")}};return(c,d)=>(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("div",Ct,[e.createElementVNode("div",$t,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Dt,[e.createElementVNode("h2",St,e.toDisplayString(c.item.name),1)])])]),e.createElementVNode("div",zt,[e.createElementVNode("div",Lt,[e.createElementVNode("img",{src:c.item.path,alt:c.item.name,class:"max-w-full max-h-[60vh] object-contain rounded border"},null,8,Tt),e.createElementVNode("div",jt,[e.createElementVNode("span",null,"Size: "+e.toDisplayString(t(c.item.size)),1),d[3]||(d[3]=e.createElementVNode("span",null,"•",-1)),e.createElementVNode("span",null,"Date: "+e.toDisplayString(s(c.item.createdAt)),1)]),e.createElementVNode("div",Ht,[e.createElementVNode("button",{onClick:d[0]||(d[0]=a=>m(c.item.path,c.item.name)),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border h-9 rounded-md px-3"},[e.createVNode(e.unref(B),{class:"h-3 w-3 mr-1"}),d[4]||(d[4]=e.createTextVNode(" Download ",-1))]),e.createElementVNode("button",{onClick:d[1]||(d[1]=a=>o(c.item.path)),class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border h-9 rounded-md px-3"},[e.createVNode(e.unref(se),{class:"h-3 w-3 mr-1"}),d[5]||(d[5]=e.createTextVNode(" Share ",-1))])])])]),e.createElementVNode("button",{type:"button",onClick:d[2]||(d[2]=a=>c.$emit("close")),class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},[e.createVNode(e.unref(N),{class:"h-4 w-4"}),d[6]||(d[6]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))])]),e.createVNode(S,{ref_key:"copyNotificationRef",ref:n},null,512)]))}}),Ft={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Rt=["onClick"],At=["src","alt"],z=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{},columns:{},maxHeight:{},id:{},className:{},style:{}},setup(r){const n=r,s=e.ref(!1),t=e.ref(null),o=e.ref(),m=e.ref(0);let c=null;const d=e.computed(()=>{const l=n.columns||4;return m.value>=1440?l:m.value>=1024?Math.max(1,l-1):m.value>=768?Math.max(1,l-2):m.value>=640?Math.max(1,l-3):1}),a=()=>{o.value&&(m.value=o.value.offsetWidth)};e.onMounted(()=>{e.nextTick(()=>{o.value&&(c=new ResizeObserver(l=>{for(const p of l)p.target===o.value&&(m.value=p.contentRect.width)}),c.observe(o.value),a())})}),e.onUnmounted(()=>{c&&c.disconnect()});const i=l=>{t.value=l,s.value=!0};return(l,p)=>(e.openBlock(),e.createElementBlock("div",{class:"w-full mx-auto font-sans",ref_key:"containerRef",ref:o},[l.title?(e.openBlock(),e.createElementBlock("h3",Ft,e.toDisplayString(l.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(l.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:l.maxHeight+"px"})},[e.createElementVNode("div",{style:e.normalizeStyle({columns:d.value+" auto",gap:"12px"}),class:"space-y-3"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,b=>(e.openBlock(),e.createElementBlock("div",{key:b.id,onClick:U=>i(b),class:"group relative break-inside-avoid bg-gray-200 rounded-lg overflow-hidden cursor-pointer hover:shadow-md transition-all mb-3"},[e.createElementVNode("img",{src:b.path,alt:b.name,class:"w-full h-auto min-h-40 rounded-md object-contain"},null,8,At),p[1]||(p[1]=e.createElementVNode("div",{class:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 pt-12"},[e.createElementVNode("h3",{class:"text-white font-medium text-base leading-tight mb-1"},"Mountain Landscape"),e.createElementVNode("p",{class:"text-white/90 text-sm"},"2.4 MB")],-1)),p[2]||(p[2]=e.createElementVNode("div",{class:"absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-200"},null,-1))],8,Rt))),128))],4)],6),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[s.value&&t.value?(e.openBlock(),e.createBlock(It,{key:0,item:t.value,onClose:p[0]||(p[0]=b=>s.value=!1)},null,8,["item"])):e.createCommentVNode("",!0)]))],512))}}),Ot={key:0,class:"overflow-hidden"},Ut={class:"flex border-b border-gray-200 bg-gray-50"},Wt=["onClick"],qt={class:"p-4"},Pt=["innerHTML"],Gt={key:1,class:"p-4"},Kt={class:"grid grid-cols-12 gap-4"},Zt={key:0,class:"mb-4 pb-2 border-b border-gray-200"},Xt={class:"text-lg font-semibold text-gray-900"},Jt=["innerHTML"],R=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},id:{},className:{},style:{}},setup(r){const n=r,s=e.ref(0),t=e.computed(()=>n.panels&&n.panels.length>0?n.panels:n.data&&Array.isArray(n.data)?n.data.filter(i=>i.type==="tabs")[0]?.items||[]:[]),o=e.computed(()=>n.panels&&n.panels.length>0?n.panels:n.data&&Array.isArray(n.data)?n.data:[]),m=e.computed(()=>({[`view-${n.view}`]:!0})),c=a=>{const i={};return a.count&&(i.count=a.count),a.col&&(i.col=a.col),n.data&&a.name&&Object.assign(i,n.data[a.name]),i},d=a=>a.width?{gridColumn:`span ${a.width}`}:{};return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["bg-white rounded-lg shadow-sm border border-gray-200",m.value])},[a.view==="tab"?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",Ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(l,p)=>(e.openBlock(),e.createElementBlock("button",{key:l.name||p,onClick:b=>s.value=p,class:e.normalizeClass(["px-4 py-3 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 transition-colors",{"text-blue-600 bg-white border-b-2 border-blue-600":s.value===p}])},e.toDisplayString(l.title||l.label||l.name||`Tab ${p+1}`),11,Wt))),128))]),e.createElementVNode("div",qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(l,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:l.name||p,class:e.normalizeClass(["min-h-[400px] w-full",`col-span-${l.col||12}`])},[l.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:l.html,class:"text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"},null,8,Pt)):a.$slots[`tab-${p}`]?e.renderSlot(a.$slots,`tab-${p}`,{key:1,item:l,data:a.data}):l.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),e.mergeProps({key:2,ref_for:!0},c(l),{class:"w-full h-full"}),null,16)):e.renderSlot(a.$slots,l.slot||`tab-${p}`,{key:3,item:l,data:a.data})],2)),[[e.vShow,s.value===p]])),128))])])):(e.openBlock(),e.createElementBlock("div",Gt,[e.createElementVNode("div",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,p)=>(e.openBlock(),e.createElementBlock("div",{key:l.name||p,class:e.normalizeClass(["bg-gray-50 rounded-lg p-4 min-h-[300px]",`col-span-${l.col||12}`]),style:e.normalizeStyle(d(l))},[l.title||l.label?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("h3",Xt,e.toDisplayString(l.title||l.label),1)])):e.createCommentVNode("",!0),l.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:l.html,class:"text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"},null,8,Jt)):a.$slots[`panel-${p}`]?e.renderSlot(a.$slots,`panel-${p}`,{key:2,item:l,data:a.data}):l.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),e.mergeProps({key:3,ref_for:!0},c(l),{class:"w-full h-full"}),null,16)):e.renderSlot(a.$slots,l.slot||`panel-${p}`,{key:4,item:l,data:a.data})],6))),128))])]))],2))}}),Qt=["innerHTML"],A=e.defineComponent({__name:"CardItem",props:{name:{},label:{},component:{},slot:{},col:{default:12},html:{},title:{},id:{},className:{},style:{}},setup(r){const n=r,s=e.computed(()=>({[`col-span-${n.col}`]:!0})),t=e.computed(()=>{const o={};return o.col&&(o.col=o.col),o});return(o,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full",s.value])},[o.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:o.html,class:"text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"},null,8,Qt)):o.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.component),e.mergeProps({key:1},t.value,{class:"w-full"}),null,16)):e.renderSlot(o.$slots,"default",{key:2})],2))}}),Yt={class:"text-value"},vt={class:"text-sm text-gray-900"},eo=x(e.defineComponent({__name:"TextValue",props:{item:{}},setup(r){const n=r,s=e.computed(()=>{const t=n.item.value;return typeof t=="boolean"?t?"Так":"Ні":t==null?"—":String(t)});return(t,o)=>(e.openBlock(),e.createElementBlock("div",Yt,[e.createElementVNode("span",vt,e.toDisplayString(s.value),1)]))}}),[["__scopeId","data-v-c14550b7"]]),to={class:"link-value"},oo=["href"],no=x(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(r){const n=r,s=e.computed(()=>{const t=String(n.item.value);try{const o=new URL(t);return o.hostname+o.pathname}catch{return t}});return(t,o)=>(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("a",{href:String(t.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),o[0]||(o[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,oo)]))}}),[["__scopeId","data-v-e6eb07a6"]]),so={class:"date-value"},lo={class:"text-sm text-gray-900"},ro=x(e.defineComponent({__name:"DateValue",props:{item:{}},setup(r){const n=r,s=e.computed(()=>{const t=n.item.value;if(t instanceof Date)return t.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof t=="string"){const o=new Date(t);if(!isNaN(o.getTime()))return o.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(t)});return(t,o)=>(e.openBlock(),e.createElementBlock("div",so,[e.createElementVNode("span",lo,e.toDisplayString(s.value),1)]))}}),[["__scopeId","data-v-b9600618"]]),ao={class:"status-value"},io={key:0,class:"mr-1"},co=x(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(r){const n=r,s=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"bg-green-100 text-green-800";case"inactive":case"неактивний":case"pending":case"очікує":return"bg-yellow-100 text-yellow-800";case"error":case"помилка":case"failed":case"неуспішно":return"bg-red-100 text-red-800";case"draft":case"чернетка":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}}),t=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(o,m)=>(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",s.value])},[t.value?(e.openBlock(),e.createElementBlock("span",io,[e.createElementVNode("i",{class:e.normalizeClass(t.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(o.item.value)),1)],2)]))}}),[["__scopeId","data-v-c72e0b01"]]),mo={class:"custom-value"},po={class:"text-sm text-gray-900"},fo=x(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(r){return(n,s)=>(e.openBlock(),e.createElementBlock("div",mo,[e.renderSlot(n.$slots,"default",{item:n.item,value:n.item.value},()=>[e.createElementVNode("span",po,e.toDisplayString(String(n.item.value)),1)],!0)]))}}),[["__scopeId","data-v-11a73810"]]),ho=["id"],go={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},yo={key:1,class:"overflow-x-auto"},ko={class:"min-w-full divide-y divide-gray-200"},bo={class:"bg-white divide-y divide-gray-200"},xo={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},_o={class:"flex items-center gap-2"},wo=["title"],uo={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Vo={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Eo={class:"flex items-start gap-3"},No={key:0,class:"flex-shrink-0"},Bo={class:"flex-1 min-w-0"},Co={class:"flex items-center gap-2 mb-2"},$o={class:"text-sm font-medium text-gray-900"},Mo=["title"],Do={key:3,class:"overflow-x-auto"},So={class:"min-w-full divide-y divide-gray-200"},zo={class:"bg-white divide-y divide-gray-200"},Lo={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},To={class:"flex items-center gap-2"},jo=["title"],Ho={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},O=x(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(r){const n=s=>{switch(s.type){case"link":return no;case"date":return ro;case"status":return co;case"custom":return fo;default:return eo}};return(s,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",s.className]),id:s.id,style:e.normalizeStyle(s.style)},[s.title?(e.openBlock(),e.createElementBlock("h3",go,e.toDisplayString(s.title),1)):e.createCommentVNode("",!0),s.view==="table"?(e.openBlock(),e.createElementBlock("div",yo,[e.createElementVNode("table",ko,[e.createElementVNode("tbody",bo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,o=>(e.openBlock(),e.createElementBlock("tr",{key:o.id||o.label},[e.createElementVNode("td",xo,[e.createElementVNode("div",_o,[o.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([o.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label)+" ",1),o.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:o.tooltip},t[0]||(t[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,wo)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",uo,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(o)),{item:o},null,8,["item"]))])]))),128))])])])):s.view==="grid"?(e.openBlock(),e.createElementBlock("div",Vo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id||o.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Eo,[o.icon?(e.openBlock(),e.createElementBlock("div",No,[e.createElementVNode("i",{class:e.normalizeClass([o.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Bo,[e.createElementVNode("div",Co,[e.createElementVNode("h4",$o,e.toDisplayString(o.label),1),o.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:o.tooltip},t[1]||(t[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Mo)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(o)),{item:o},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("table",So,[e.createElementVNode("tbody",zo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,o=>(e.openBlock(),e.createElementBlock("tr",{key:o.id||o.label},[e.createElementVNode("td",Lo,[e.createElementVNode("div",To,[o.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([o.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label)+" ",1),o.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:o.tooltip},t[2]||(t[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,jo)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Ho,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(o)),{item:o},null,8,["item"]))])]))),128))])])]))],14,ho))}}),[["__scopeId","data-v-36d43e50"]]),Io={install:r=>{r.component("vs-widget-file",D),r.component("vs-widget-comments",$),r.component("vs-widget-history",M),r.component("vs-widget-gallery",z),r.component("CommentsWidget",$),r.component("HistoryWidget",M),r.component("GalleryWidget",z),r.component("FilesWidget",D),r.component("Card",R),r.component("CardItem",A),r.component("DescriptionListWidget",O),r.component("CopyNotification",S)}};k.Card=R,k.CardItem=A,k.CommentsWidget=$,k.CopyNotification=S,k.DescriptionListWidget=O,k.FilesWidget=D,k.GalleryWidget=z,k.HistoryWidget=M,k.default=Io,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opengis/widgets",
3
3
  "private": false,
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "type": "module",
6
6
  "description": "A collection of independent widgets for comments, history, files, and gallery",
7
7
  "main": "dist/index.js",