@opengis/widgets 0.0.19 → 0.0.20
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.
- package/dist/index.css +1 -1
- package/dist/index.js +3 -3
- package/dist/index.umd.cjs +1 -1
- package/dist/widgets/map/MapWidget.vue.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.image-wrapper{display:grid;grid-template-rows:1fr 1fr;grid-template-columns:1fr 1fr 1fr 1fr;grid-column-gap:5px;grid-row-gap:3px;height:100%}.image0{height:100%;width:100%;grid-row-start:1;grid-column-start:1;grid-row-end:3;grid-column-end:3}.image1{grid-row-start:1;grid-column-start:3;grid-row-end:2;grid-column-end:4}.image2{grid-row-start:1;grid-column-start:4;grid-row-end:2;grid-column-end:5}.image3{grid-row-start:2;grid-column-start:3;grid-row-end:3;grid-column-end:4}.image4{grid-row-start:2;grid-column-start:4;grid-row-end:3;grid-column-end:5}.thumb-cover{position:absolute;inset:0;z-index:5;background-color:#00000080;color:#fff;display:flex;align-items:center;justify-content:center;font-size:36px}.text-value[data-v-c14550b7]{word-break:break-word}.link-value[data-v-e6eb07a6]{word-break:break-all}.date-value[data-v-b9600618],.status-value[data-v-c72e0b01],.custom-value[data-v-11a73810]{word-break:break-word}.description-list-widget[data-v-36d43e50]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.fullscreen[data-v-
|
|
1
|
+
.image-wrapper{display:grid;grid-template-rows:1fr 1fr;grid-template-columns:1fr 1fr 1fr 1fr;grid-column-gap:5px;grid-row-gap:3px;height:100%}.image0{height:100%;width:100%;grid-row-start:1;grid-column-start:1;grid-row-end:3;grid-column-end:3}.image1{grid-row-start:1;grid-column-start:3;grid-row-end:2;grid-column-end:4}.image2{grid-row-start:1;grid-column-start:4;grid-row-end:2;grid-column-end:5}.image3{grid-row-start:2;grid-column-start:3;grid-row-end:3;grid-column-end:4}.image4{grid-row-start:2;grid-column-start:4;grid-row-end:3;grid-column-end:5}.thumb-cover{position:absolute;inset:0;z-index:5;background-color:#00000080;color:#fff;display:flex;align-items:center;justify-content:center;font-size:36px}.text-value[data-v-c14550b7]{word-break:break-word}.link-value[data-v-e6eb07a6]{word-break:break-all}.date-value[data-v-b9600618],.status-value[data-v-c72e0b01],.custom-value[data-v-11a73810]{word-break:break-word}.description-list-widget[data-v-36d43e50]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.fullscreen[data-v-e3aa0e7d]{position:fixed!important;inset:0;width:100vw!important;height:100vh!important;z-index:9999;background:#fff}.notification-enter-active[data-v-55903525],.notification-leave-active[data-v-55903525]{transition:all .3s ease}.notification-enter-from[data-v-55903525],.notification-leave-to[data-v-55903525]{opacity:0;transform:translate(100%)}.notification-move[data-v-55903525]{transition:transform .3s ease}
|
package/dist/index.js
CHANGED
|
@@ -1702,7 +1702,7 @@ const jn = {
|
|
|
1702
1702
|
const E = l?.appContext.config.globalProperties.$settings?.center || [50, 30];
|
|
1703
1703
|
o = L.map(n.value, { zoomControl: !1 }).setView(E, 10), o.on("mousemove", (D) => {
|
|
1704
1704
|
M || (o.invalidateSize(), M = !0);
|
|
1705
|
-
}), L.control.zoom({ position: "bottomright" }).addTo(o), m = L.tileLayer(r[y.value].url, { maxZoom: 19 }).addTo(o),
|
|
1705
|
+
}), L.control.zoom({ position: "bottomright" }).addTo(o), m = L.tileLayer(r[y.value].url, { maxZoom: 19 }).addTo(o), h = new L.FeatureGroup().addTo(o), v.value.length && $(0);
|
|
1706
1706
|
const x = Dn(s.geom);
|
|
1707
1707
|
if (x) {
|
|
1708
1708
|
const D = [];
|
|
@@ -1718,7 +1718,7 @@ const jn = {
|
|
|
1718
1718
|
function u(E) {
|
|
1719
1719
|
m && m.removeFrom(o);
|
|
1720
1720
|
const x = r[E];
|
|
1721
|
-
m = L.tileLayer(x.url, x.options || {}).addTo(o), y.value = E;
|
|
1721
|
+
m = L.tileLayer(x.url, x.options || {}).addTo(o), m.bringToBack(), y.value = E;
|
|
1722
1722
|
}
|
|
1723
1723
|
function c() {
|
|
1724
1724
|
u(y.value);
|
|
@@ -1846,7 +1846,7 @@ const jn = {
|
|
|
1846
1846
|
]), 2)
|
|
1847
1847
|
], 2));
|
|
1848
1848
|
}
|
|
1849
|
-
}), me = /* @__PURE__ */ G(Pn, [["__scopeId", "data-v-
|
|
1849
|
+
}), me = /* @__PURE__ */ G(Pn, [["__scopeId", "data-v-e3aa0e7d"]]), Nn = { class: "flex justify-between items-center mb-[15px]" }, Wn = { class: "font-semibold text-[16px]" }, Rn = { class: "overflow-x-auto" }, Un = { class: "min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600" }, Gn = { class: "text-left font-medium text-gray-700" }, qn = { class: "py-2 min-w-[200px]" }, Zn = {
|
|
1850
1850
|
key: 0,
|
|
1851
1851
|
class: "py-2 min-w-[200px]"
|
|
1852
1852
|
}, Kn = { class: "divide-y divide-gray-200" }, Jn = { class: "bg-white odd:bg-gray-50" }, Xn = { class: "py-2 pr-5" }, Qn = ["href"], Yn = { class: "py-2 pr-5 gap-2 inline-flex" }, eo = ["onClick"], to = ["onClick"], so = /* @__PURE__ */ H({
|
package/dist/index.umd.cjs
CHANGED
|
@@ -128,4 +128,4 @@
|
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const Z=V("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Le={class:"border-t pt-3 mt-4"},De={class:"flex gap-2"},Me={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Se={class:"flex-1 space-y-2"},Te={class:"flex justify-between items-center"},ze={class:"flex gap-2"},Fe=["disabled"],ne=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(r,{emit:l}){const t=e.useModel(r,"isReply"),o=e.ref(""),n=l,g=()=>{o.value.trim()&&(n("sendComment",o.value),o.value="")},a=h=>{(h.ctrlKey||h.metaKey)&&h.key==="Enter"&&(h.preventDefault(),g())};return(h,m)=>(e.openBlock(),e.createElementBlock("div",Le,[e.createElementVNode("div",De,[e.createElementVNode("span",Me,[e.createVNode(e.unref(q),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Se,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[0]||(m[0]=x=>o.value=x),onKeydown:a,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,o.value]]),e.createElementVNode("div",Te,[m[4]||(m[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",ze,[t.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:m[1]||(m[1]=x=>t.value=!1)},[e.createVNode(e.unref(Z),{class:"h-3 w-3"}),m[2]||(m[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:!o.value.trim(),onClick:g},[e.createVNode(e.unref(oe),{class:"h-3 w-3 mr-1"}),m[3]||(m[3]=e.createTextVNode(" Send ",-1))],8,Fe)])])])])]))}}),je={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"},Ie=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(r,{emit:l}){const t=l,o=e.useModel(r,"showMoreOptions"),n=e.ref(),g=e.ref(!0),a=async x=>{o.value&&n.value&&!n.value.contains(x.target)&&!g.value&&(o.value=!1),g.value=!1},h=()=>{o.value=!1,t("edit")},m=()=>{o.value=!1,t("delete")};return e.onMounted(()=>{document.addEventListener("click",a)}),e.onUnmounted(()=>{document.removeEventListener("click",a)}),(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:n},[e.createElementVNode("div",je,[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:h},[e.createVNode(e.unref(Ne),{class:"h-3 w-3 mr-2"}),k[0]||(k[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:m},[e.createVNode(e.unref(G),{class:"h-3 w-3 mr-2"}),k[1]||(k[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),Ae={class:"space-y-2"},He={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Oe={class:"flex-1 min-w-0 space-y-1 relative"},Pe={class:"flex items-center gap-2"},We={class:"font-medium text-xs"},Re={class:"text-xs text-gray-500"},Ue={key:0,class:"text-xs text-gray-700 leading-relaxed"},Ge={class:"flex justify-between text-xs"},qe={class:"flex items-center gap-2"},Ze={key:0,class:"flex gap-2"},Ke=["disabled"],Je={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},Xe=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(r,{emit:l}){const t=l,o=r,n=e.ref(o.comment.text),g=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),a=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"),h=e.ref(!1),m=e.ref(!1),x=e.ref(!1),k=e.ref(!1),d=s=>{const c=new Date,i=Math.floor((c.getTime()-s.getTime())/(1e3*60*60));return i<1?`${Math.floor((c.getTime()-s.getTime())/6e4)}m`:i<24?`${i}h`:`${Math.floor(i/24)}d`},y=()=>{k.value=!k.value,k.value?t("like",o.comment.id,"add"):t("like",o.comment.id,"delete")},$=()=>{t("edit",o.comment.id,n.value),x.value=!1},u=(s,c)=>{t("like",s,c)},w=(s,c)=>{t("edit",s,c)};return(s,c)=>{const i=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",x.value?"bg-gray-50":""])},[e.createElementVNode("span",He,[e.createVNode(e.unref(q),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Oe,[e.createElementVNode("div",Pe,[e.createElementVNode("span",We,e.toDisplayString(s.comment?.author),1),e.createElementVNode("span",Re,e.toDisplayString(d(s.comment?.createdAt)),1)]),x.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":c[0]||(c[0]=p=>n.value=p),class:e.normalizeClass(x.value?a.value:g.value)},null,2)),[[e.vModelText,n.value]]):(e.openBlock(),e.createElementBlock("p",Ue,e.toDisplayString(s.comment?.text),1)),e.createElementVNode("div",Ge,[e.createElementVNode("div",qe,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",k.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:c[1]||(c[1]=p=>y())},[e.createVNode(e.unref(_e),{class:e.normalizeClass(["h-3 w-3",k.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(s.comment?.likes),1)],2),s.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:c[2]||(c[2]=p=>m.value=!0)},[e.createVNode(e.unref(Be),{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:c[3]||(c[3]=p=>h.value=!0)},[e.createVNode(e.unref(be),{class:"h-3 w-3"})])]),x.value?(e.openBlock(),e.createElementBlock("div",Ze,[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:c[4]||(c[4]=p=>x.value=!1)},[e.createVNode(e.unref(Z),{class:"h-3 w-3"}),c[11]||(c[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:!n.value.trim(),onClick:c[5]||(c[5]=p=>$())},[e.createVNode(e.unref(oe),{class:"h-3 w-3 mr-1"}),c[12]||(c[12]=e.createTextVNode(" Send ",-1))],8,Ke)])):e.createCommentVNode("",!0)])]),h.value?(e.openBlock(),e.createBlock(Ie,{key:0,showMoreOptions:h.value,"onUpdate:showMoreOptions":c[6]||(c[6]=p=>h.value=p),onEdit:c[7]||(c[7]=p=>x.value=!0),onDelete:c[8]||(c[8]=p=>s.$emit("delete",s.comment?.id)),comment:s.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),s.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.comment?.replies,p=>(e.openBlock(),e.createBlock(i,{key:p.id,comment:p,isInside:!0,onDelete:_=>s.$emit("delete",p.id),onLike:u,onEdit:w},null,8,["comment","onDelete"]))),128)),m.value&&!s.isInside?(e.openBlock(),e.createBlock(ne,{key:0,onSendComment:c[9]||(c[9]=p=>s.$emit("reply",s.comment?.id,p)),isReply:m.value,"onUpdate:isReply":c[10]||(c[10]=p=>m.value=p)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),Qe=["id"],Ye={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},H=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:l}){const t=r,o=l,n=e.ref(t.comments??[]);async function g(){if(!t.id)return;const d=await fetch(`/api/widget/comment/${t.id}`).then(y=>y.json());n.value=d.rows.map(y=>({id:y.communication_id,author:y.username,text:y.body,createdAt:new Date(y.cdate)}))}n.value.length===0&&g();const a=async d=>{t.onAddComment?t.onAddComment(d):t.id&&(await fetch(`/api/widget/comment/${t.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:d})}),await g()),o("add",d)},h=(d,y)=>{t?.onLike?.(d,y),o("like",d,y)},m=(d,y)=>{t.onReply?.(d,y),o("reply",d,y)},x=async(d,y)=>{t.onEdit?t.onEdit(d,y):t.id&&(await fetch(`/api/widget/comment/${t.id}/${d}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:y})}),await g()),o("edit",d,y)},k=async d=>{t.onDelete?t.onDelete(d):t.id&&(await fetch(`/api/widget/comment/${t.id}/${d}`,{method:"DELETE"}),await g()),o("delete",d)};return(d,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",d.className]),id:d.id,style:e.normalizeStyle(d.style)},[d.title?(e.openBlock(),e.createElementBlock("h3",Ye,e.toDisplayString(d.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([d.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:d.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,$=>(e.openBlock(),e.createBlock(Xe,{key:$.id,comment:$,onReply:m,onLike:h,onDelete:y[0]||(y[0]=u=>k(u)),onEdit:x},null,8,["comment"]))),128))],6),e.createVNode(ne,{onSendComment:y[1]||(y[1]=$=>a($))})],14,Qe))}}),le=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:S}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ve}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:$e}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:we}]]),ve={class:"mx-auto font-sans"},et={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},tt={class:"relative"},ot={class:"space-y-3"},nt={class:"flex-1 min-w-0 pb-2"},lt={class:"flex items-center gap-1.5 mb-1 mt-0.5"},st={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},at={class:"font-medium text-xs"},rt={class:"text-xs text-gray-500"},it={class:"space-y-1"},ct={class:"text-xs text-gray-700"},dt={class:"capitalize mr-1"},mt={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"},pt={key:0,class:"flex items-center gap-1 text-xs"},gt={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},ft={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},O=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(r){const l=r,t=e.ref(Array.isArray(l.data)?l.data:[]);t.value.length===0&&l.id&&o();async function o(){const n=await fetch(`/api/widget/history/${l.id}`);if(!n.ok)return{data:[]};const g=await n.json();g.rows.forEach(a=>{a.timestamp=new Date(a.cdate),a.id=a.entity_id,a.entityType=a.entity_type,a.entityId=a.entity_id,a.action=a.change_type,a.userId=a.change_user_id,a.userName=a.username,a.timestamp=new Date(a.cdate),a.description=a.username,a.status=a.username}),t.value=g.rows}return(n,g)=>(e.openBlock(),e.createElementBlock("div",ve,[n.title?(e.openBlock(),e.createElementBlock("h3",et,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",tt,[g[0]||(g[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,a=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:a?.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(le).get(a?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(le).get(a?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",nt,[e.createElementVNode("div",lt,[e.createElementVNode("span",st,[e.createVNode(e.unref(q),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",at,e.toDisplayString(a?.userName),1),e.createElementVNode("span",rt,e.toDisplayString(a?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",it,[e.createElementVNode("div",ct,[e.createElementVNode("span",dt,e.toDisplayString(a?.action),1),a?.entityId?(e.openBlock(),e.createElementBlock("span",mt,e.toDisplayString(a?.entityId),1)):e.createCommentVNode("",!0)]),a?.changes?.[a?.entityId]?(e.openBlock(),e.createElementBlock("div",pt,[a?.changes?.[a?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",gt,e.toDisplayString(a?.changes?.[a?.entityId]?.old),1)):e.createCommentVNode("",!0),a?.changes?.[a?.entityId]?.old&&a?.changes?.[a?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(ye),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),a?.changes?.[a?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",ft,e.toDisplayString(a?.changes?.[a?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),ht={key:0,class:"text-xl font-semibold"},yt={class:"flex gap-1"},kt={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap 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 rounded-md text-xs h-7 px-2 cursor-pointer"},bt=e.defineComponent({__name:"FileHeader",props:e.mergeModels({title:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(r){const l=e.useModel(r,"modelValue"),t={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",o.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[o.title?(e.openBlock(),e.createElementBlock("h3",ht,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",yt,[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",l.value==="list"?t.active:t.inactive]),onClick:n[0]||(n[0]=g=>l.value="list")},[e.createVNode(e.unref(Ee),{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",l.value==="grid"?t.active:t.inactive]),onClick:n[1]||(n[1]=g=>l.value="grid")},[e.createVNode(e.unref(ue),{class:"h-4 w-4"})],2),e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:n[2]||(n[2]=g=>o.$emit("onAddFile",g))},null,32),e.createElementVNode("div",kt,[e.createVNode(e.unref(te),{class:"h-4 w-4"}),n[3]||(n[3]=e.createTextVNode(" Додати файл ",-1))])])])],2))}}),K={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:S,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:xe,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:S,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:he,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:ee,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:ee,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:S,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:S,label:"PPT"}};function se(r,l="en"){const t={month:"short",day:"numeric"};return new Intl.DateTimeFormat(l,t).format(r)}function ae(r){if(r===0)return"0 B";const l=1024,t=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(r)/Math.log(l));return`${parseFloat((r/Math.pow(l,o)).toFixed(1))} ${t[o]}`}const xt={class:"space-y-0.5"},ut=["onClick"],_t=["onClick"],wt={class:"flex items-center gap-2"},Et={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},Bt={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Vt={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Nt={class:"flex items-center gap-1"},$t=["onClick"],Ct=["onClick"],Lt=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(r){return(l,t)=>(e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.files,o=>(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:o.id,onClick:e.withModifiers(n=>l.$emit("openLightbox",o),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(K)[o?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(K)[o?.ext]?.icon||e.unref(K).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:n=>l.$emit("openLightbox",o)},[e.createElementVNode("div",wt,[e.createElementVNode("span",Et,e.toDisplayString(o?.uploaded_name||o?.name),1)])],8,_t),e.createElementVNode("div",Bt,e.toDisplayString(e.unref(ae)(o.size)),1),e.createElementVNode("div",Vt,e.toDisplayString(e.unref(se)(o.createdAt)),1),e.createElementVNode("div",Nt,[e.createElementVNode("button",{onClick:e.withModifiers(n=>l.$emit("download",o),["stop"]),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(v),{class:"h-3 w-3"})],8,$t),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:e.withModifiers(n=>l.$emit("delete",n,o?.file_id),["stop"])},[e.createVNode(e.unref(G),{class:"h-3 w-3"})],8,Ct)])],8,ut))),128))]))}}),Dt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Mt=["onClick"],St={class:"space-y-2"},Tt={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},zt=["src"],Ft={class:"space-y-1"},jt=["title"],It={class:"text-xs text-gray-500 text-left"},At={class:"absolute top-2 right-1 flex items-center gap-1"},Ht=["onClick"],Ot=["onClick"],Pt=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(r){return(l,t)=>(e.openBlock(),e.createElementBlock("div",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.files,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,onClick:e.withModifiers(n=>l.$emit("openLightbox",o),["stop"]),class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",St,[e.createElementVNode("div",Tt,[o.ext==="png"||o.ext==="jpg"||o.ext==="jpeg"||o.ext==="gif"||o.ext==="svg"||o.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${o?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,zt)):(e.openBlock(),e.createBlock(e.unref(S),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",Ft,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:o.uploaded_name||o.name},e.toDisplayString(o.uploaded_name||o.name),9,jt),e.createElementVNode("p",It,e.toDisplayString(e.unref(se)(o.createdAt))+", "+e.toDisplayString(e.unref(ae)(o.size)),1)])]),e.createElementVNode("div",At,[e.createElementVNode("button",{onClick:e.withModifiers(n=>l.$emit("download",o),["stop"]),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 hover:bg-red-50"},[e.createVNode(e.unref(v),{class:"h-3 w-3"})],8,Ht),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 rounded-md 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:e.withModifiers(n=>l.$emit("delete",n,o?.file_id),["stop"])},[e.createVNode(e.unref(G),{class:"h-3 w-3"})],8,Ot)])],8,Mt))),128))]))}}),Wt={class:"mx-auto font-sans"},Rt={key:1},P=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(r,{emit:l}){const t=r,o=e.ref(!1),n=e.ref(null),g=e.ref(!1),a=e.ref(0),h=e.ref(t.files??[]),m=l;h.value.length===0&&c();const x=(_,f)=>{n.value=f,o.value=!0},k=()=>{n.value&&(u(n.value),n.value=null,o.value=!1)},d=e.computed(()=>Array.isArray(h.value)?h.value.map(_=>_?.file_path):[]),y=_=>{const f=d.value.findIndex(B=>B===_.file_path);f!==-1&&(g.value=!0,a.value=f)},$=_=>{t.onAddFile?t.onAddFile(_):i(_),m("add",_)},u=_=>{t.onDelete?t.onDelete(_):p(_),m("delete",_)},w=_=>{const f=document.createElement("a");f.setAttribute("download",_?.uploaded_name||_?.name),f.href=_?.file_path||_?.path,f.click()},s=e.ref("list");async function c(){if(!t.id)return;const _=await fetch(`/api/widget/file/${t.id}`).then(f=>f.json());_.rows.forEach(f=>{f.timestamp=new Date(f.cdate),f.id=f.entity_id,f.entityType=f.entity_type,f.entityId=f.entity_id,f.entityType=f.entity_type,f.action=f.change_type,f.userId=f.change_user_id,f.userName=f.username,f.timestamp=new Date(f.cdate),f.description=f.username,f.status=f.username}),h.value=_.rows}const i=async _=>{if(!(!_.target||!_.target.files||_.target.files.length===0))try{await Promise.all(Array.from(_.target.files).map(async f=>{const B=new FormData;B.append("file",f);const b=`/api/widget/file/${t.id}`,E=await fetch(b,{method:"POST",body:B});if(!E.ok)throw new Error(`HTTP error! status: ${E.status}`);return f})),await c()}catch(f){console.error("Помилка при завантаженні файлів:",f)}},p=async _=>{try{await fetch(`/api/widget/file/${t.id}/${_}`,{method:"DELETE"}),await c()}catch(f){console.error(f)}};return(_,f)=>{const B=e.resolveComponent("MessageBox"),b=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Wt,[e.createVNode(bt,{modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=E=>s.value=E),title:t.title,onOnAddFile:f[1]||(f[1]=E=>$(E))},null,8,["modelValue","title"]),h.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(_.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:_.maxHeight+"px"})},[s.value==="list"?(e.openBlock(),e.createBlock(Lt,{key:0,onDelete:x,onDownload:w,onOpenLightbox:f[2]||(f[2]=E=>y(E)),files:h.value},null,8,["files"])):e.createCommentVNode("",!0),s.value==="grid"?(e.openBlock(),e.createBlock(Pt,{key:1,onDelete:x,onDownload:w,onOpenLightbox:f[3]||(f[3]=E=>y(E)),files:h.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",Rt,f[6]||(f[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])))]),e.createVNode(B,{modelValue:o.value,"onUpdate:modelValue":f[4]||(f[4]=E=>o.value=E),onConfirm:k,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(b,{modelValue:g.value,"onUpdate:modelValue":f[5]||(f[5]=E=>g.value=E),images:d.value,"start-index":a.value},null,8,["modelValue","images","start-index"])],64)}}}),Ut={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},Gt=["onClick"],qt={key:0,rel:"noreferrer",class:"relative block h-full w-full"},Zt=["src"],Kt={key:0,class:"thumb-cover"},Jt=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(r,{emit:l}){const t=l,o=e.ref(!1),n=e.ref(0),g=r,a=e.computed(()=>Array.isArray(g.items)?g.items.map(m=>m?.file_path):[]),h=m=>{const x=a.value.findIndex(k=>k===m.file_path);x!==-1&&(o.value=!0,n.value=x)};return(m,x)=>{const k=e.resolveComponent("Lightbox");return m.items?.length>=1?(e.openBlock(),e.createElementBlock("div",Ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.items,(d,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+y,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:y,onClick:e.withModifiers($=>h(d),["stop"])},[y<5?(e.openBlock(),e.createElementBlock("div",qt,[e.createElementVNode("img",{src:`/file/resize?filepath=${d?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",y===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,Zt),y===4&&m.items?.length>5?(e.openBlock(),e.createElementBlock("div",Kt," +"+e.toDisplayString(m.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Gt))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-m.items.length),d=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+d,class:e.normalizeClass(["h-full w-full image"+(m.items.length+d-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(k,{modelValue:o.value,"onUpdate:modelValue":x[0]||(x[0]=d=>o.value=d),images:a.value,"start-index":n.value,delete:"true",download:"true",onDelete:x[1]||(x[1]=d=>t("delete",d))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),Xt={key:0,class:"text-xl font-semibold"},Qt={class:"flex gap-1"},Yt={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap 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 rounded-md text-xs h-7 px-2 cursor-pointer"},vt=e.defineComponent({__name:"widgetHeader",props:{title:{}},emits:["onAddImage"],setup(r){return(l,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",l.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[l.title?(e.openBlock(),e.createElementBlock("h3",Xt,e.toDisplayString(l.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Qt,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:t[0]||(t[0]=o=>l.$emit("onAddImage",o))},null,32),e.createElementVNode("div",Yt,[e.createVNode(e.unref(te),{class:"h-4 w-4"}),t[1]||(t[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),eo={class:"w-full mx-auto font-sans",ref:"containerRef"},to={key:1},W=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(r,{emit:l}){const t=r,o=e.ref(t.items??[]),n=l;o.value.length===0&&m();const g=k=>{t.onAddImage?t.onAddImage(k):h(k),n("add",k)},a=k=>{const d=o.value.find(y=>y.file_path===k)?.file_id;d&&(t.onDelete?t.onDelete(d):x(d))},h=async k=>{if(!(!k.target||!k.target.files||k.target.files.length===0))try{await Promise.all(Array.from(k.target.files).map(async d=>{const y=new FormData;y.append("file",d);const $=`/api/widget/file/${t.id}`,u=await fetch($,{method:"POST",body:y});if(!u.ok)throw new Error(`HTTP error! status: ${u.status}`);return d})),await m()}catch(d){console.error("Помилка при завантаженні файлів:",d)}};async function m(){if(!t.id)return;const k=await fetch(`/api/widget/file/${t.id}`).then(d=>d.json());o.value=k.rows}const x=async k=>{try{await fetch(`/api/widget/file/${t.id}/${k}`,{method:"DELETE"}),await m()}catch(d){console.error(d)}};return(k,d)=>(e.openBlock(),e.createElementBlock("div",eo,[e.createVNode(vt,{title:k.title,onOnAddImage:d[0]||(d[0]=y=>g(y))},null,8,["title"]),o.value.length>0?(e.openBlock(),e.createBlock(Jt,{key:0,items:o.value,onDelete:d[1]||(d[1]=y=>a(y))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",to,d[2]||(d[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])))],512))}}),oo={class:"text-value"},no={class:"text-sm text-gray-900"},lo=e.defineComponent({__name:"TextValue",props:{item:{}},setup(r){const l=r,t=e.computed(()=>{const o=l.item.value;return typeof o=="boolean"?o?"Так":"Ні":o==null?"—":String(o)});return(o,n)=>(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("span",no,e.toDisplayString(t.value),1)]))}}),D=(r,l)=>{const t=r.__vccOpts||r;for(const[o,n]of l)t[o]=n;return t},so=D(lo,[["__scopeId","data-v-c14550b7"]]),ao={class:"link-value"},ro=["href"],io=D(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(r){const l=r,t=e.computed(()=>{const o=String(l.item.value);try{const n=new URL(o);return n.hostname+n.pathname}catch{return o}});return(o,n)=>(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("a",{href:String(o.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(t.value)+" ",1),n[0]||(n[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,ro)]))}}),[["__scopeId","data-v-e6eb07a6"]]),co={class:"date-value"},mo={class:"text-sm text-gray-900"},po=D(e.defineComponent({__name:"DateValue",props:{item:{}},setup(r){const l=r,t=e.computed(()=>{const o=l.item.value;if(o instanceof Date)return o.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof o=="string"){const n=new Date(o);if(!isNaN(n.getTime()))return n.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(o)});return(o,n)=>(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("span",mo,e.toDisplayString(t.value),1)]))}}),[["__scopeId","data-v-b9600618"]]),go={class:"status-value"},fo={key:0,class:"mr-1"},ho=D(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(r){const l=r,t=e.computed(()=>{switch(String(l.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"}}),o=e.computed(()=>{switch(String(l.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(n,g)=>(e.openBlock(),e.createElementBlock("div",go,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",t.value])},[o.value?(e.openBlock(),e.createElementBlock("span",fo,[e.createElementVNode("i",{class:e.normalizeClass(o.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(n.item.value)),1)],2)]))}}),[["__scopeId","data-v-c72e0b01"]]),yo={class:"custom-value"},ko={class:"text-sm text-gray-900"},bo=D(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(r){return(l,t)=>(e.openBlock(),e.createElementBlock("div",yo,[e.renderSlot(l.$slots,"default",{item:l.item,value:l.item.value},()=>[e.createElementVNode("span",ko,e.toDisplayString(String(l.item.value)),1)],!0)]))}}),[["__scopeId","data-v-11a73810"]]),xo=["id"],uo={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},_o={key:1,class:"overflow-x-auto"},wo={class:"min-w-full divide-y divide-gray-200"},Eo={class:"bg-white divide-y divide-gray-200"},Bo={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Vo={class:"flex items-center gap-2"},No=["title"],$o={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Co={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Lo={class:"flex items-start gap-3"},Do={key:0,class:"flex-shrink-0"},Mo={class:"flex-1 min-w-0"},So={class:"flex items-center gap-2 mb-2"},To={class:"text-sm font-medium text-gray-900"},zo=["title"],Fo={key:3,class:"overflow-x-auto"},jo={class:"min-w-full divide-y divide-gray-200"},Io={class:"bg-white divide-y divide-gray-200"},Ao={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Ho={class:"flex items-center gap-2"},Oo=["title"],Po={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},J=D(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(r){const l=t=>{switch(t.type){case"link":return io;case"date":return po;case"status":return ho;case"custom":return bo;default:return so}};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",uo,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",_o,[e.createElementVNode("table",wo,[e.createElementVNode("tbody",Eo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,n=>(e.openBlock(),e.createElementBlock("tr",{key:n.id||n.label},[e.createElementVNode("td",Bo,[e.createElementVNode("div",Vo,[n.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([n.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label)+" ",1),n.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:n.tooltip},o[0]||(o[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,No)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",$o,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(n)),{item:n},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",Co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id||n.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Lo,[n.icon?(e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("i",{class:e.normalizeClass([n.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Mo,[e.createElementVNode("div",So,[e.createElementVNode("h4",To,e.toDisplayString(n.label),1),n.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:n.tooltip},o[1]||(o[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,zo)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(n)),{item:n},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("table",jo,[e.createElementVNode("tbody",Io,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,n=>(e.openBlock(),e.createElementBlock("tr",{key:n.id||n.label},[e.createElementVNode("td",Ao,[e.createElementVNode("div",Ho,[n.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([n.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label)+" ",1),n.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:n.tooltip},o[2]||(o[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Oo)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Po,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(n)),{item:n},null,8,["item"]))])]))),128))])])]))],14,xo))}}),[["__scopeId","data-v-36d43e50"]]),Wo={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function Ro(r){return r?r.type==="FeatureCollection"||r.type==="Feature"?r:r.geom?{type:"Feature",geometry:{type:r.geom.type,coordinates:r.geom.coordinates},properties:{}}:r.type&&r.coordinates?{type:"Feature",geometry:r,properties:{}}:null:null}const Uo={key:1,class:"bg-white absolute top-[10px] right-[10px] z-[500] border rounded-lg cursor-pointer"},Go={class:"flex items-center justify-between p-2 border-b"},qo={class:"p-2 border-b"},Zo={class:"flex items-center"},Ko=["value"],Jo={class:"ml-2"},Xo={class:"p-2"},Qo={class:"flex items-center"},Yo={class:"flex items-center"},vo=["onUpdate:modelValue","onChange"],en={class:"ml-2"},R=D(e.defineComponent({__name:"MapWidget",props:{pattern:{},geom:{},id:{},tms:{}},setup(r){const l=e.getCurrentInstance(),t=r,o=e.ref(null);let n,g;const a=f(),h=e.ref(Object.keys(a)[0]);let m;const x=e.ref(!0),k=e.ref(!1),d=e.ref(!1),y=e.ref($());function $(){return t.tms?(Array.isArray(t.tms)?t.tms:t.tms?.split(",")).map((b,E)=>({url:t.pattern?t.pattern.replace("{{id}}",b):b,name:"Шар "+E,visible:!0,i:E})):[]}function u(){return new Promise((B,b)=>{if(window.L&&window.L.Draw)return B(0);const E=M=>{if(Array.from(document.styleSheets).some(F=>F?.href?.includes(M)))return;const T=document.createElement("link");T.rel="stylesheet",T.href=M,document.head.appendChild(T)},C=M=>new Promise((Q,T)=>{const F=Array.from(document.scripts).find(I=>I.src===M);if(F){F.addEventListener("load",()=>Q()),F.addEventListener("error",I=>T(I));return}const j=document.createElement("script");j.src=M,j.async=!0,j.onload=()=>Q(),j.onerror=I=>T(I),document.body.appendChild(j)});E("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),E("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),C("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>C("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(()=>B(0)).catch(b)})}let w=!1;e.onMounted(async()=>{await u(),L.drawLocal=Wo;const B=l?.appContext.config.globalProperties.$settings?.center||[50,30];n=L.map(o.value,{zoomControl:!1}).setView(B,10),n.on("mousemove",E=>{w||(n.invalidateSize(),w=!0)}),L.control.zoom({position:"bottomright"}).addTo(n),m=L.tileLayer(a[h.value].url,{maxZoom:19}).addTo(n),h.value="topo100",g=new L.FeatureGroup().addTo(n),y.value.length&&_(0);const b=Ro(t.geom);if(b){const E=[];L.geoJSON(b).eachLayer(C=>E.push(C)),E.length&&g.addLayer(E[0]),g.toGeoJSON(),s()}});function s(B=30){const b=g.getLayers();if(!b.length)return;const C=L.featureGroup(b).getBounds();C&&C.isValid()&&n.fitBounds(C,{padding:[B,B],maxZoom:16})}function c(B){m&&m.removeFrom(n);const b=a[B];m=L.tileLayer(b.url,b.options||{}).addTo(n),h.value=B}function i(){c(h.value)}function p(){g&&(x.value?g.addTo(n):g.removeFrom(n))}function _(B){const b=y.value[B];b.layer||(b.layer=L.tileLayer(b.url,{maxZoom:19})),b.visible?b.layer.addTo(n):b.layer.removeFrom(n)}function f(){return l?.appContext.config.globalProperties.$settings?.basemaps?l?.appContext.config.globalProperties.$settings?.basemaps.map((B,b)=>Object.assign(B,{key:`b${b}`,preview:B.preview||B.url.replace("{z}/{x}/{y}.png","13/4790/2762.png")})).reduce((B,b)=>({...B,[b.key]:b}),{}):{topo100:{url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}return e.watch(k,()=>{setTimeout(()=>{n.invalidateSize()},50)}),(B,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative min-h-[300px] h-full",k.value?"fullscreen":"pb-[3.25rem]"])},[e.createElementVNode("div",{ref_key:"mapContainer",ref:o,class:"w-full h-full min-h-[300px]"},null,512),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:b[0]||(b[0]=E=>d.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-2 border rounded-lg cursor-pointer"}," Шари ")),d.value?(e.openBlock(),e.createElementBlock("div",Uo,[e.createElementVNode("div",Go,[b[6]||(b[6]=e.createElementVNode("div",null,"Шари",-1)),(e.openBlock(),e.createElementBlock("svg",{onClick:b[1]||(b[1]=E=>d.value=!1),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x w-4 h-4"},b[5]||(b[5]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])))]),e.createElementVNode("div",qo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),(E,C)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("label",Zo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"base-layer",value:C,"onUpdate:modelValue":b[2]||(b[2]=M=>h.value=M),onChange:i},null,40,Ko),[[e.vModelRadio,h.value]]),e.createElementVNode("span",Jo,e.toDisplayString(E.name||C),1)])]))),256))]),e.createElementVNode("div",Xo,[e.createElementVNode("label",Qo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":b[3]||(b[3]=E=>x.value=E),onChange:p},null,544),[[e.vModelCheckbox,x.value]]),b[7]||(b[7]=e.createElementVNode("span",{class:"ml-2"}," Геометрія/Межі ",-1))]),t.tms?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(y.value,E=>(e.openBlock(),e.createElementBlock("label",Yo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":C=>E.visible=C,onChange:C=>_(E.i)},null,40,vo),[[e.vModelCheckbox,E.visible]]),e.createElementVNode("span",en,e.toDisplayString(E.name),1)]))),256)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["absolute z-[500] bg-white p-2 border rounded-lg cursor-pointer",k.value?"bottom-[100px] right-[7px]":"bottom-[150px] right-[7px]"]),onClick:b[4]||(b[4]=E=>k.value=!k.value)},b[8]||(b[8]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)]),2)],2))}}),[["__scopeId","data-v-d9c38ff0"]]),tn={class:"flex justify-between items-center mb-[15px]"},on={class:"font-semibold text-[16px]"},nn={class:"overflow-x-auto"},ln={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},sn={class:"text-left font-medium text-gray-700"},an={class:"py-2 min-w-[200px]"},rn={key:0,class:"py-2 min-w-[200px]"},cn={class:"divide-y divide-gray-200"},dn={class:"bg-white odd:bg-gray-50"},mn={class:"py-2 pr-5"},pn=["href"],gn={class:"py-2 pr-5 gap-2 inline-flex"},fn=["onClick"],hn=["onClick"],re=e.defineComponent({__name:"TableWidget",props:{name:{},label:{},component:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(r){const l=e.getCurrentInstance(),t=e.ref([]),o=e.ref([]),n=r,g=e.ref([]),a=e.ref(""),h=e.ref("");async function m(){const s=await fetch("/api/data/"+n.token).then(c=>c.json());t.value=s.rows,o.value=s.columns,g.value=s.actions,a.value=s.form,h.value=s.addToken}const{$notify:x=console.log,$confirm:k,$form:d}=l?.appContext?.config?.globalProperties||{};async function y(s){await d({token:s.token}),m()}function $(){d({token:h.value})}function u(s){k({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const c=await fetch(`/api/table/${s.token}`,{method:"DELETE"});if(!c.ok){const{error:i,code:p}=await c.json();x({title:"Помилка",type:"warning",message:i});return}x({title:"Видаленно",message:"Успішно видалено"}),await m()}})}e.onMounted(async()=>{await m()});function w(s,c){return c.format?.toLowerCase()==="text"?s[c.name]:s[c.name+"_data"]??s[c.name+"_text"]??"-"}return(s,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",tn,[e.createElementVNode("div",on,e.toDisplayString(s.title),1),g.value.includes("add")&&h.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:$,class:"px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-blue-100 text-blue-500 hover:bg-blue-500 focus:ring-blue-500"},"Додати")):e.createCommentVNode("",!0)]),e.createElementVNode("div",nn,[e.createElementVNode("table",ln,[e.createElementVNode("thead",sn,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,i=>(e.openBlock(),e.createElementBlock("th",an,e.toDisplayString(i.ua),1))),256)),g.value.includes("edit")?(e.openBlock(),e.createElementBlock("th",rn," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,i=>(e.openBlock(),e.createElementBlock("tr",dn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createElementBlock("td",mn,[p.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:p.link.replace("{{id}}",i.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(w(i,p)),9,pn)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(w(i,p)),1)],64))]))),256)),e.createElementVNode("td",gn,[i.token?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:p=>y(i),class:"inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"},c[0]||(c[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M20,16v4a2,2,0,0,1-2,2H4a2,2,0,0,1-2-2V6A2,2,0,0,1,4,4H8",fill:"none",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}),e.createElementVNode("polygon",{fill:"none",points:"12.5 15.8 22 6.2 17.8 2 8.3 11.5 8 16 12.5 15.8",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)]),8,fn)):e.createCommentVNode("",!0),i.token?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:p=>u(i),class:"inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"},c[1]||(c[1]=[e.createStaticVNode('<svg class="flex-shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="12px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>',1)]),8,hn)):e.createCommentVNode("",!0)])]))),256))])])])]))}}),yn={class:"p-[20px]"},kn={class:"flex gap-[6px] mb-5"},bn={class:"vs-form-text relative bg-white rounded-lg flex-grow"},xn={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},un={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},_n={class:"space-y-8"},wn={key:0},En={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Bn=["onClick"],Vn={class:"md:col-span-2"},Nn={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},$n={class:"text-sm text-gray-500 dark:text-neutral-500"},Cn={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Ln=["checked","onChange"],Dn={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Mn={class:"md:col-span-2"},Sn={class:"font-semibold text-gray-800 dark:text-neutral-200"},Tn=["onClick"],zn={class:"md:col-span-2"},Fn={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},jn={class:"text-sm text-gray-500 dark:text-neutral-500"},In={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},An=["checked","onChange"],U=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(r){const l=r,t=e.ref(""),o=["view","add","edit","del"],n=e.ref({});e.onMounted(async()=>{const w=await(await fetch(`/api/access-group/${l.id}?tab=vs-group-interface`)).json();w.routes&&w.routes.forEach(s=>{n.value[s.path]=new Set(s.actions)})});const g=(u,w)=>n.value[u]?.has(w)??!1,a=(u,w)=>{n.value[u]||(n.value[u]=new Set),n.value[u].has(w)?n.value[u].delete(w):n.value[u].add(w)},h=(u,w)=>{u.forEach(s=>{s.path&&(n.value[s.path]||(n.value[s.path]=new Set),n.value[s.path].has(w)?n.value[s.path].delete(w):n.value[s.path].add(w))})},m=e.computed(()=>Object.entries(n.value).map(([u,w])=>({path:u,actions:Array.from(w)})).filter(u=>u.actions.length)),x=async()=>{await fetch(`/api/access-group/${l.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:m.value})}),console.log("Saved",m.value),de.notify({title:"Success!",message:"Permissions saved."})},k=()=>{n.value={}},d=u=>{if(!t.value.trim())return u;const w=t.value.toLowerCase();return u.filter(s=>s.ua.toLowerCase().includes(w)||s.path&&s.path.toLowerCase().includes(w))},y=e.computed(()=>d(l.data.routers.filter(u=>!u.menu))),$=e.computed(()=>l.data.routers.filter(u=>u.menu).map(u=>({...u,menu:d(u.menu||[])})).filter(u=>u.menu&&u.menu.length>0));return(u,w)=>(e.openBlock(),e.createElementBlock("div",yn,[e.createElementVNode("div",kn,[e.createElementVNode("div",bn,[w[1]||(w[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":w[0]||(w[0]=s=>t.value=s),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,512),[[e.vModelText,t.value]])]),e.createElementVNode("button",{onClick:k,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:x,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",xn,[w[2]||(w[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(s,c)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:c},[e.createElementVNode("h3",un,e.toDisplayString(s),1)])),64))]),e.createElementVNode("div",_n,[y.value.length?(e.openBlock(),e.createElementBlock("div",wn,[e.createElementVNode("ul",En,[w[3]||(w[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(s,c)=>e.createElementVNode("li",{key:c,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:i=>h(y.value,o[c])}," Toggle all ",8,Bn)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(s,c)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+c,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Vn,[e.createElementVNode("p",Nn,e.toDisplayString(s.ua),1),e.createElementVNode("p",$n,e.toDisplayString(s.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,p)=>e.createElementVNode("li",{key:p,class:"col-span-1"},[e.createElementVNode("div",Cn,[e.createElementVNode("input",{type:"checkbox",checked:g(s.path,i),onChange:_=>a(s.path,i),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Ln)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(s,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:"space-y-5"},[e.createElementVNode("ul",Dn,[e.createElementVNode("li",Mn,[e.createElementVNode("h3",Sn,e.toDisplayString(s.ua),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,p)=>e.createElementVNode("li",{key:p,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:_=>h(s.menu,o[p])}," Toggle all ",8,Tn)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.menu,(i,p)=>(e.openBlock(),e.createElementBlock("ul",{key:p,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",zn,[e.createElementVNode("p",Fn,e.toDisplayString(i.ua),1),e.createElementVNode("p",jn,e.toDisplayString(i.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(_,f)=>e.createElementVNode("li",{key:f,class:"col-span-1"},[e.createElementVNode("div",In,[e.createElementVNode("input",{type:"checkbox",checked:g(i.path,_),onChange:B=>a(i.path,_),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,An)])])),64))]))),128))]))),128))])]))}}),ie={"vs-widget-map":R,"vs-widget-comments":H,"vs-widget-history":O,"vs-widget-gallery":W,"vs-widget-file":P,"vs-widget-list":J,"vs-widget-table":re,"vs-group-interface":U},Hn={key:0,class:"mb-4 pb-2 border-b border-gray-200"},On={class:"text-lg font-semibold text-gray-900"},Pn=["innerHTML"],Wn={key:0,class:"mb-4 pb-2 border-b border-gray-200"},Rn={class:"text-lg font-semibold text-gray-900"},Un=["innerHTML"],X=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(r){const l=r;console.log(l.data);const t=e.computed(()=>l.col?{[`lg:col-span-${l.col}`]:!0}:{});function o(a){return ie[a]||a}const n=function(a={}){return a.props&&Object.entries(a.props).forEach(([h,m])=>{a[h]=l.data[m]}),a},g=e.computed(()=>{const a={};return l.col&&(a.col=l.col),a});return(a,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full bg-gray-50 rounded-lg p-4 col-span-12",t.value])},[a.title?(e.openBlock(),e.createElementBlock("div",Hn,[e.createElementVNode("h3",On,e.toDisplayString(a.title),1)])):e.createCommentVNode("",!0),a.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:a.html,class:"text-gray-900 leading-relaxed"},null,8,Pn)):a.type?.includes("tabs")?(e.openBlock(),e.createBlock(z,{key:2,view:a.type,panels:a.items,data:a.data},null,8,["view","panels","data"])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(a.items,m=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m.title||m.label?(e.openBlock(),e.createElementBlock("div",Wn,[e.createElementVNode("h3",Rn,e.toDisplayString(m.title||m.label),1)])):e.createCommentVNode("",!0),m.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:m.html,class:"text-gray-900 leading-relaxed"},null,8,Un)):m.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o(m.component)),e.mergeProps({key:2,ref_for:!0},{geom:a.data.geom,id:a.data.id,...g.value,...n(m),data:a.data},{class:"w-full"}),null,16)):e.renderSlot(a.$slots,"default",{key:3})],64))),256))],2))}}),Gn={class:"grid grid-cols-12 gap-[20px]"},qn={key:0,class:"col-span-4"},Zn=["innerHTML"],Kn={key:0,class:"overflow-hidden w-full"},Jn={class:"flex border-b border-gray-200 bg-gray-50 relative"},Xn=["onClick"],Qn={class:"p-1"},Yn=["innerHTML"],vn={key:1,class:"flex w-full"},el={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},tl=["onClick"],ol={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},nl={class:"flex-1 p-4"},ll=["innerHTML"],sl={key:2,class:"p-1 w-full"},al={class:"grid grid-cols-12 gap-4"},z=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},id:{},className:{},style:{}},setup(r){const l=r,t=e.ref(0),o=e.ref([]);function n(s){return ie[s]||s}function g(s){return s.forEach(c=>{c.type&&(c.view=c.type)}),o.value=s.filter(c=>c.type==="pin"),s.filter(c=>c.type!=="pin")}const a=e.computed(()=>l.panels&&l.panels.length>0?l.normalizeTabs?g(l.panels):l.panels:l.data&&Array.isArray(l.data)?l.data.filter(c=>c.type.includes("tabs"))[0]?.items||[]:[]),h=e.computed(()=>l.panels&&l.panels.length>0?l.normalizeTabs?g(l.panels):l.panels:l.data&&Array.isArray(l.data)?l.data:[]),m=e.computed(()=>({[`view-${l.view}`]:!0})),x=s=>{const c={...s};return l.data&&(c.data=l.data),c},k=e.ref([]),d=e.ref([]),y=e.ref([]);function $(s,c){s&&s instanceof HTMLElement&&(k.value[c]=s)}function u(){d.value=k.value.map(s=>s.offsetWidth),y.value=k.value.map(s=>s.offsetLeft)}let w=null;return e.onMounted(()=>{e.nextTick(()=>{u()}),w=new ResizeObserver(()=>u()),w.observe(document.body)}),e.onBeforeUnmount(()=>{w?.disconnect()}),e.watch(t,()=>{e.nextTick(()=>{u()})}),(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.classWrapper||m.value)},[e.createElementVNode("div",Gn,[o.value.length!==0?(e.openBlock(),e.createElementBlock("div",qn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value[0].items,(i,p)=>(e.openBlock(),e.createElementBlock("div",{key:i.name||p,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[i.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:i.html,class:"text-gray-900 leading-relaxed"},null,8,Zn)):i.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(i.component)),e.mergeProps({key:1,ref_for:!0},i.component==="Card"?i:x(i),{id:s.data.id,class:"w-full h-full"}),null,16,["id"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.value.length!==0?"col-span-8":"col-span-12")},[s.view==="tabs"?(e.openBlock(),e.createElementBlock("div",Kn,[e.createElementVNode("div",Jn,[d.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:d.value[t.value]+"px",left:y.value[t.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(i,p)=>(e.openBlock(),e.createElementBlock("button",{key:i.name||p,ref_for:!0,ref:_=>$(_,p),onClick:_=>t.value=p,class:e.normalizeClass(["relative px-4 py-3 text-sm font-medium transition-colors duration-300",t.value===p?"text-blue-600":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(i.title||i.label||i.name||`Tab ${p+1}`),11,Xn))),128))]),e.createElementVNode("div",Qn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(i,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:i.name||p,class:e.normalizeClass(["transition-all duration-300 ease-in-out",t.value===p?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",s.classPanel||"w-full border-gray-100 py-2"])},[i.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:i.html,class:"text-gray-900 leading-relaxed"},null,8,Yn)):s.$slots[`tab-${p}`]?e.renderSlot(s.$slots,`tab-${p}`,{key:1,item:i,data:s.data}):i.component||i.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(i.component||i.name)),e.mergeProps({key:2,ref_for:!0},i.component==="Card"?i:x(i),{id:s.data.id,class:"w-full h-full"}),null,16,["id"])):e.renderSlot(s.$slots,i.slot||`tab-${p}`,{key:3,item:i,data:s.data})],2)),[[e.vShow,t.value===p]])),128))])])):s.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",vn,[e.createElementVNode("div",el,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(i,p)=>(e.openBlock(),e.createElementBlock("button",{key:i.name||p,onClick:_=>t.value=p,class:e.normalizeClass(["relative px-4 py-3 text-sm font-medium text-left transition-colors duration-300",t.value===p?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(i.title||i.label||i.name||`Tab ${p+1}`)+" ",1),t.value===p?(e.openBlock(),e.createElementBlock("span",ol,c[0]||(c[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)]))):e.createCommentVNode("",!0)],10,tl))),128))]),e.createElementVNode("div",nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(i,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:i.name||p,class:e.normalizeClass(["transition-all duration-300 ease-in-out",t.value===p?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",s.classPanel||"w-full border-gray-100 py-2"])},[i.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:i.html,class:"text-gray-900 leading-relaxed"},null,8,ll)):s.$slots[`tab-${p}`]?e.renderSlot(s.$slots,`tab-${p}`,{key:1,item:i,data:s.data}):i.component||i.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(i.component||i.name)),e.mergeProps({key:2,ref_for:!0},i.component==="Card"?i:x(i),{id:s.data.id,class:"w-full h-full"}),null,16,["id"])):e.renderSlot(s.$slots,i.slot||`tab-${p}`,{key:3,item:i,data:s.data})],2)),[[e.vShow,t.value===p]])),128))])])):(e.openBlock(),e.createElementBlock("div",sl,[e.createElementVNode("div",al,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(i,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i.name||p},[s.$slots[`panel-${p}`]?e.renderSlot(s.$slots,`panel-${p}`,{key:0,item:i,data:s.data}):i.items||i.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(X),e.mergeProps({key:1,ref_for:!0},x(i),{items:i.items,class:"w-full h-full"}),null,16,["items"])):i.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(i.component)),e.mergeProps({key:2,ref_for:!0},x(i),{class:"w-full h-full"}),null,16)):e.renderSlot(s.$slots,i.slot||`panel-${p}`,{key:3,item:i,data:s.data})],64))),128))])]))],2)])],2))}}),rl=["onClick"],ce=D(e.defineComponent({__name:"CopyNotification",setup(r,{expose:l}){const t=e.ref([]);let o=1;const n=()=>{if(t.value.length>=10){const h=t.value[0];clearTimeout(h.timer),t.value.shift()}const a={id:o++,timer:setTimeout(()=>{g(a.id)},1500)};t.value.push(a)},g=a=>{const h=t.value.findIndex(m=>m.id===a);if(h!==-1){const m=t.value[h];clearTimeout(m.timer),t.value.splice(h,1)}};return l({addNotification:n}),e.onUnmounted(()=>{t.value.forEach(a=>{clearTimeout(a.timer)})}),(a,h)=>(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(t.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.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(ke),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),h[0]||(h[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:x=>g(m.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(Z),{class:"h-4 w-4"})],8,rl)]))),128))]),_:1})]))}}),[["__scopeId","data-v-55903525"]]);z.install=function(r){r.component("vs-widget-file",P),r.component("vs-widget-comments",H),r.component("vs-widget-history",O),r.component("vs-widget-gallery",W),r.component("vs-widget-map",R),r.component("vs-group-interface",U),r.component("CommentsWidget",H),r.component("HistoryWidget",O),r.component("GalleryWidget",W),r.component("FilesWidget",P),r.component("MapWidget",R),r.component("Card",z),r.component("CardItem",X),r.component("DescriptionListWidget",J),r.component("CopyNotification",ce),r.component("GroupInterfaceWidget",U)},N.Card=z,N.CardItem=X,N.CommentsWidget=H,N.CopyNotification=ce,N.DescriptionListWidget=J,N.FilesWidget=P,N.GalleryWidget=W,N.GroupInterfaceWidget=U,N.HistoryWidget=O,N.MapWidget=R,N.TableWidget=re,N.default=z,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
131
|
+
*/const Z=V("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Le={class:"border-t pt-3 mt-4"},De={class:"flex gap-2"},Me={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Se={class:"flex-1 space-y-2"},Te={class:"flex justify-between items-center"},ze={class:"flex gap-2"},Fe=["disabled"],ne=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(r,{emit:l}){const t=e.useModel(r,"isReply"),o=e.ref(""),n=l,g=()=>{o.value.trim()&&(n("sendComment",o.value),o.value="")},a=h=>{(h.ctrlKey||h.metaKey)&&h.key==="Enter"&&(h.preventDefault(),g())};return(h,m)=>(e.openBlock(),e.createElementBlock("div",Le,[e.createElementVNode("div",De,[e.createElementVNode("span",Me,[e.createVNode(e.unref(q),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Se,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[0]||(m[0]=x=>o.value=x),onKeydown:a,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,o.value]]),e.createElementVNode("div",Te,[m[4]||(m[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",ze,[t.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:m[1]||(m[1]=x=>t.value=!1)},[e.createVNode(e.unref(Z),{class:"h-3 w-3"}),m[2]||(m[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:!o.value.trim(),onClick:g},[e.createVNode(e.unref(oe),{class:"h-3 w-3 mr-1"}),m[3]||(m[3]=e.createTextVNode(" Send ",-1))],8,Fe)])])])])]))}}),je={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"},Ie=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(r,{emit:l}){const t=l,o=e.useModel(r,"showMoreOptions"),n=e.ref(),g=e.ref(!0),a=async x=>{o.value&&n.value&&!n.value.contains(x.target)&&!g.value&&(o.value=!1),g.value=!1},h=()=>{o.value=!1,t("edit")},m=()=>{o.value=!1,t("delete")};return e.onMounted(()=>{document.addEventListener("click",a)}),e.onUnmounted(()=>{document.removeEventListener("click",a)}),(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:n},[e.createElementVNode("div",je,[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:h},[e.createVNode(e.unref(Ne),{class:"h-3 w-3 mr-2"}),k[0]||(k[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:m},[e.createVNode(e.unref(G),{class:"h-3 w-3 mr-2"}),k[1]||(k[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),Ae={class:"space-y-2"},He={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Oe={class:"flex-1 min-w-0 space-y-1 relative"},Pe={class:"flex items-center gap-2"},We={class:"font-medium text-xs"},Re={class:"text-xs text-gray-500"},Ue={key:0,class:"text-xs text-gray-700 leading-relaxed"},Ge={class:"flex justify-between text-xs"},qe={class:"flex items-center gap-2"},Ze={key:0,class:"flex gap-2"},Ke=["disabled"],Je={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},Xe=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(r,{emit:l}){const t=l,o=r,n=e.ref(o.comment.text),g=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),a=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"),h=e.ref(!1),m=e.ref(!1),x=e.ref(!1),k=e.ref(!1),d=s=>{const c=new Date,i=Math.floor((c.getTime()-s.getTime())/(1e3*60*60));return i<1?`${Math.floor((c.getTime()-s.getTime())/6e4)}m`:i<24?`${i}h`:`${Math.floor(i/24)}d`},y=()=>{k.value=!k.value,k.value?t("like",o.comment.id,"add"):t("like",o.comment.id,"delete")},$=()=>{t("edit",o.comment.id,n.value),x.value=!1},u=(s,c)=>{t("like",s,c)},w=(s,c)=>{t("edit",s,c)};return(s,c)=>{const i=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",x.value?"bg-gray-50":""])},[e.createElementVNode("span",He,[e.createVNode(e.unref(q),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Oe,[e.createElementVNode("div",Pe,[e.createElementVNode("span",We,e.toDisplayString(s.comment?.author),1),e.createElementVNode("span",Re,e.toDisplayString(d(s.comment?.createdAt)),1)]),x.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":c[0]||(c[0]=p=>n.value=p),class:e.normalizeClass(x.value?a.value:g.value)},null,2)),[[e.vModelText,n.value]]):(e.openBlock(),e.createElementBlock("p",Ue,e.toDisplayString(s.comment?.text),1)),e.createElementVNode("div",Ge,[e.createElementVNode("div",qe,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",k.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:c[1]||(c[1]=p=>y())},[e.createVNode(e.unref(_e),{class:e.normalizeClass(["h-3 w-3",k.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(s.comment?.likes),1)],2),s.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:c[2]||(c[2]=p=>m.value=!0)},[e.createVNode(e.unref(Be),{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:c[3]||(c[3]=p=>h.value=!0)},[e.createVNode(e.unref(be),{class:"h-3 w-3"})])]),x.value?(e.openBlock(),e.createElementBlock("div",Ze,[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:c[4]||(c[4]=p=>x.value=!1)},[e.createVNode(e.unref(Z),{class:"h-3 w-3"}),c[11]||(c[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:!n.value.trim(),onClick:c[5]||(c[5]=p=>$())},[e.createVNode(e.unref(oe),{class:"h-3 w-3 mr-1"}),c[12]||(c[12]=e.createTextVNode(" Send ",-1))],8,Ke)])):e.createCommentVNode("",!0)])]),h.value?(e.openBlock(),e.createBlock(Ie,{key:0,showMoreOptions:h.value,"onUpdate:showMoreOptions":c[6]||(c[6]=p=>h.value=p),onEdit:c[7]||(c[7]=p=>x.value=!0),onDelete:c[8]||(c[8]=p=>s.$emit("delete",s.comment?.id)),comment:s.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),s.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.comment?.replies,p=>(e.openBlock(),e.createBlock(i,{key:p.id,comment:p,isInside:!0,onDelete:_=>s.$emit("delete",p.id),onLike:u,onEdit:w},null,8,["comment","onDelete"]))),128)),m.value&&!s.isInside?(e.openBlock(),e.createBlock(ne,{key:0,onSendComment:c[9]||(c[9]=p=>s.$emit("reply",s.comment?.id,p)),isReply:m.value,"onUpdate:isReply":c[10]||(c[10]=p=>m.value=p)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),Qe=["id"],Ye={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},H=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:l}){const t=r,o=l,n=e.ref(t.comments??[]);async function g(){if(!t.id)return;const d=await fetch(`/api/widget/comment/${t.id}`).then(y=>y.json());n.value=d.rows.map(y=>({id:y.communication_id,author:y.username,text:y.body,createdAt:new Date(y.cdate)}))}n.value.length===0&&g();const a=async d=>{t.onAddComment?t.onAddComment(d):t.id&&(await fetch(`/api/widget/comment/${t.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:d})}),await g()),o("add",d)},h=(d,y)=>{t?.onLike?.(d,y),o("like",d,y)},m=(d,y)=>{t.onReply?.(d,y),o("reply",d,y)},x=async(d,y)=>{t.onEdit?t.onEdit(d,y):t.id&&(await fetch(`/api/widget/comment/${t.id}/${d}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:y})}),await g()),o("edit",d,y)},k=async d=>{t.onDelete?t.onDelete(d):t.id&&(await fetch(`/api/widget/comment/${t.id}/${d}`,{method:"DELETE"}),await g()),o("delete",d)};return(d,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",d.className]),id:d.id,style:e.normalizeStyle(d.style)},[d.title?(e.openBlock(),e.createElementBlock("h3",Ye,e.toDisplayString(d.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([d.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:d.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,$=>(e.openBlock(),e.createBlock(Xe,{key:$.id,comment:$,onReply:m,onLike:h,onDelete:y[0]||(y[0]=u=>k(u)),onEdit:x},null,8,["comment"]))),128))],6),e.createVNode(ne,{onSendComment:y[1]||(y[1]=$=>a($))})],14,Qe))}}),le=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:S}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ve}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:$e}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:we}]]),ve={class:"mx-auto font-sans"},et={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},tt={class:"relative"},ot={class:"space-y-3"},nt={class:"flex-1 min-w-0 pb-2"},lt={class:"flex items-center gap-1.5 mb-1 mt-0.5"},st={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},at={class:"font-medium text-xs"},rt={class:"text-xs text-gray-500"},it={class:"space-y-1"},ct={class:"text-xs text-gray-700"},dt={class:"capitalize mr-1"},mt={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"},pt={key:0,class:"flex items-center gap-1 text-xs"},gt={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},ft={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},O=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(r){const l=r,t=e.ref(Array.isArray(l.data)?l.data:[]);t.value.length===0&&l.id&&o();async function o(){const n=await fetch(`/api/widget/history/${l.id}`);if(!n.ok)return{data:[]};const g=await n.json();g.rows.forEach(a=>{a.timestamp=new Date(a.cdate),a.id=a.entity_id,a.entityType=a.entity_type,a.entityId=a.entity_id,a.action=a.change_type,a.userId=a.change_user_id,a.userName=a.username,a.timestamp=new Date(a.cdate),a.description=a.username,a.status=a.username}),t.value=g.rows}return(n,g)=>(e.openBlock(),e.createElementBlock("div",ve,[n.title?(e.openBlock(),e.createElementBlock("h3",et,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",tt,[g[0]||(g[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,a=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:a?.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(le).get(a?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(le).get(a?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",nt,[e.createElementVNode("div",lt,[e.createElementVNode("span",st,[e.createVNode(e.unref(q),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",at,e.toDisplayString(a?.userName),1),e.createElementVNode("span",rt,e.toDisplayString(a?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",it,[e.createElementVNode("div",ct,[e.createElementVNode("span",dt,e.toDisplayString(a?.action),1),a?.entityId?(e.openBlock(),e.createElementBlock("span",mt,e.toDisplayString(a?.entityId),1)):e.createCommentVNode("",!0)]),a?.changes?.[a?.entityId]?(e.openBlock(),e.createElementBlock("div",pt,[a?.changes?.[a?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",gt,e.toDisplayString(a?.changes?.[a?.entityId]?.old),1)):e.createCommentVNode("",!0),a?.changes?.[a?.entityId]?.old&&a?.changes?.[a?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(ye),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),a?.changes?.[a?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",ft,e.toDisplayString(a?.changes?.[a?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),ht={key:0,class:"text-xl font-semibold"},yt={class:"flex gap-1"},kt={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap 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 rounded-md text-xs h-7 px-2 cursor-pointer"},bt=e.defineComponent({__name:"FileHeader",props:e.mergeModels({title:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(r){const l=e.useModel(r,"modelValue"),t={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",o.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[o.title?(e.openBlock(),e.createElementBlock("h3",ht,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",yt,[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",l.value==="list"?t.active:t.inactive]),onClick:n[0]||(n[0]=g=>l.value="list")},[e.createVNode(e.unref(Ee),{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",l.value==="grid"?t.active:t.inactive]),onClick:n[1]||(n[1]=g=>l.value="grid")},[e.createVNode(e.unref(ue),{class:"h-4 w-4"})],2),e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:n[2]||(n[2]=g=>o.$emit("onAddFile",g))},null,32),e.createElementVNode("div",kt,[e.createVNode(e.unref(te),{class:"h-4 w-4"}),n[3]||(n[3]=e.createTextVNode(" Додати файл ",-1))])])])],2))}}),K={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:S,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:xe,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:S,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:he,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:ee,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:ee,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:S,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:S,label:"PPT"}};function se(r,l="en"){const t={month:"short",day:"numeric"};return new Intl.DateTimeFormat(l,t).format(r)}function ae(r){if(r===0)return"0 B";const l=1024,t=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(r)/Math.log(l));return`${parseFloat((r/Math.pow(l,o)).toFixed(1))} ${t[o]}`}const xt={class:"space-y-0.5"},ut=["onClick"],_t=["onClick"],wt={class:"flex items-center gap-2"},Et={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},Bt={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Vt={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Nt={class:"flex items-center gap-1"},$t=["onClick"],Ct=["onClick"],Lt=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(r){return(l,t)=>(e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.files,o=>(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:o.id,onClick:e.withModifiers(n=>l.$emit("openLightbox",o),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(K)[o?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(K)[o?.ext]?.icon||e.unref(K).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:n=>l.$emit("openLightbox",o)},[e.createElementVNode("div",wt,[e.createElementVNode("span",Et,e.toDisplayString(o?.uploaded_name||o?.name),1)])],8,_t),e.createElementVNode("div",Bt,e.toDisplayString(e.unref(ae)(o.size)),1),e.createElementVNode("div",Vt,e.toDisplayString(e.unref(se)(o.createdAt)),1),e.createElementVNode("div",Nt,[e.createElementVNode("button",{onClick:e.withModifiers(n=>l.$emit("download",o),["stop"]),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(v),{class:"h-3 w-3"})],8,$t),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:e.withModifiers(n=>l.$emit("delete",n,o?.file_id),["stop"])},[e.createVNode(e.unref(G),{class:"h-3 w-3"})],8,Ct)])],8,ut))),128))]))}}),Dt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Mt=["onClick"],St={class:"space-y-2"},Tt={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},zt=["src"],Ft={class:"space-y-1"},jt=["title"],It={class:"text-xs text-gray-500 text-left"},At={class:"absolute top-2 right-1 flex items-center gap-1"},Ht=["onClick"],Ot=["onClick"],Pt=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(r){return(l,t)=>(e.openBlock(),e.createElementBlock("div",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.files,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,onClick:e.withModifiers(n=>l.$emit("openLightbox",o),["stop"]),class:"group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",St,[e.createElementVNode("div",Tt,[o.ext==="png"||o.ext==="jpg"||o.ext==="jpeg"||o.ext==="gif"||o.ext==="svg"||o.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${o?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,zt)):(e.openBlock(),e.createBlock(e.unref(S),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",Ft,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:o.uploaded_name||o.name},e.toDisplayString(o.uploaded_name||o.name),9,jt),e.createElementVNode("p",It,e.toDisplayString(e.unref(se)(o.createdAt))+", "+e.toDisplayString(e.unref(ae)(o.size)),1)])]),e.createElementVNode("div",At,[e.createElementVNode("button",{onClick:e.withModifiers(n=>l.$emit("download",o),["stop"]),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 hover:bg-red-50"},[e.createVNode(e.unref(v),{class:"h-3 w-3"})],8,Ht),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 rounded-md 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:e.withModifiers(n=>l.$emit("delete",n,o?.file_id),["stop"])},[e.createVNode(e.unref(G),{class:"h-3 w-3"})],8,Ot)])],8,Mt))),128))]))}}),Wt={class:"mx-auto font-sans"},Rt={key:1},P=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(r,{emit:l}){const t=r,o=e.ref(!1),n=e.ref(null),g=e.ref(!1),a=e.ref(0),h=e.ref(t.files??[]),m=l;h.value.length===0&&c();const x=(_,f)=>{n.value=f,o.value=!0},k=()=>{n.value&&(u(n.value),n.value=null,o.value=!1)},d=e.computed(()=>Array.isArray(h.value)?h.value.map(_=>_?.file_path):[]),y=_=>{const f=d.value.findIndex(B=>B===_.file_path);f!==-1&&(g.value=!0,a.value=f)},$=_=>{t.onAddFile?t.onAddFile(_):i(_),m("add",_)},u=_=>{t.onDelete?t.onDelete(_):p(_),m("delete",_)},w=_=>{const f=document.createElement("a");f.setAttribute("download",_?.uploaded_name||_?.name),f.href=_?.file_path||_?.path,f.click()},s=e.ref("list");async function c(){if(!t.id)return;const _=await fetch(`/api/widget/file/${t.id}`).then(f=>f.json());_.rows.forEach(f=>{f.timestamp=new Date(f.cdate),f.id=f.entity_id,f.entityType=f.entity_type,f.entityId=f.entity_id,f.entityType=f.entity_type,f.action=f.change_type,f.userId=f.change_user_id,f.userName=f.username,f.timestamp=new Date(f.cdate),f.description=f.username,f.status=f.username}),h.value=_.rows}const i=async _=>{if(!(!_.target||!_.target.files||_.target.files.length===0))try{await Promise.all(Array.from(_.target.files).map(async f=>{const B=new FormData;B.append("file",f);const b=`/api/widget/file/${t.id}`,E=await fetch(b,{method:"POST",body:B});if(!E.ok)throw new Error(`HTTP error! status: ${E.status}`);return f})),await c()}catch(f){console.error("Помилка при завантаженні файлів:",f)}},p=async _=>{try{await fetch(`/api/widget/file/${t.id}/${_}`,{method:"DELETE"}),await c()}catch(f){console.error(f)}};return(_,f)=>{const B=e.resolveComponent("MessageBox"),b=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Wt,[e.createVNode(bt,{modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=E=>s.value=E),title:t.title,onOnAddFile:f[1]||(f[1]=E=>$(E))},null,8,["modelValue","title"]),h.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(_.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:_.maxHeight+"px"})},[s.value==="list"?(e.openBlock(),e.createBlock(Lt,{key:0,onDelete:x,onDownload:w,onOpenLightbox:f[2]||(f[2]=E=>y(E)),files:h.value},null,8,["files"])):e.createCommentVNode("",!0),s.value==="grid"?(e.openBlock(),e.createBlock(Pt,{key:1,onDelete:x,onDownload:w,onOpenLightbox:f[3]||(f[3]=E=>y(E)),files:h.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",Rt,f[6]||(f[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])))]),e.createVNode(B,{modelValue:o.value,"onUpdate:modelValue":f[4]||(f[4]=E=>o.value=E),onConfirm:k,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(b,{modelValue:g.value,"onUpdate:modelValue":f[5]||(f[5]=E=>g.value=E),images:d.value,"start-index":a.value},null,8,["modelValue","images","start-index"])],64)}}}),Ut={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},Gt=["onClick"],qt={key:0,rel:"noreferrer",class:"relative block h-full w-full"},Zt=["src"],Kt={key:0,class:"thumb-cover"},Jt=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(r,{emit:l}){const t=l,o=e.ref(!1),n=e.ref(0),g=r,a=e.computed(()=>Array.isArray(g.items)?g.items.map(m=>m?.file_path):[]),h=m=>{const x=a.value.findIndex(k=>k===m.file_path);x!==-1&&(o.value=!0,n.value=x)};return(m,x)=>{const k=e.resolveComponent("Lightbox");return m.items?.length>=1?(e.openBlock(),e.createElementBlock("div",Ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.items,(d,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+y,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:y,onClick:e.withModifiers($=>h(d),["stop"])},[y<5?(e.openBlock(),e.createElementBlock("div",qt,[e.createElementVNode("img",{src:`/file/resize?filepath=${d?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",y===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,Zt),y===4&&m.items?.length>5?(e.openBlock(),e.createElementBlock("div",Kt," +"+e.toDisplayString(m.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Gt))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-m.items.length),d=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+d,class:e.normalizeClass(["h-full w-full image"+(m.items.length+d-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(k,{modelValue:o.value,"onUpdate:modelValue":x[0]||(x[0]=d=>o.value=d),images:a.value,"start-index":n.value,delete:"true",download:"true",onDelete:x[1]||(x[1]=d=>t("delete",d))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),Xt={key:0,class:"text-xl font-semibold"},Qt={class:"flex gap-1"},Yt={class:"ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap 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 rounded-md text-xs h-7 px-2 cursor-pointer"},vt=e.defineComponent({__name:"widgetHeader",props:{title:{}},emits:["onAddImage"],setup(r){return(l,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",l.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[l.title?(e.openBlock(),e.createElementBlock("h3",Xt,e.toDisplayString(l.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Qt,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:t[0]||(t[0]=o=>l.$emit("onAddImage",o))},null,32),e.createElementVNode("div",Yt,[e.createVNode(e.unref(te),{class:"h-4 w-4"}),t[1]||(t[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),eo={class:"w-full mx-auto font-sans",ref:"containerRef"},to={key:1},W=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(r,{emit:l}){const t=r,o=e.ref(t.items??[]),n=l;o.value.length===0&&m();const g=k=>{t.onAddImage?t.onAddImage(k):h(k),n("add",k)},a=k=>{const d=o.value.find(y=>y.file_path===k)?.file_id;d&&(t.onDelete?t.onDelete(d):x(d))},h=async k=>{if(!(!k.target||!k.target.files||k.target.files.length===0))try{await Promise.all(Array.from(k.target.files).map(async d=>{const y=new FormData;y.append("file",d);const $=`/api/widget/file/${t.id}`,u=await fetch($,{method:"POST",body:y});if(!u.ok)throw new Error(`HTTP error! status: ${u.status}`);return d})),await m()}catch(d){console.error("Помилка при завантаженні файлів:",d)}};async function m(){if(!t.id)return;const k=await fetch(`/api/widget/file/${t.id}`).then(d=>d.json());o.value=k.rows}const x=async k=>{try{await fetch(`/api/widget/file/${t.id}/${k}`,{method:"DELETE"}),await m()}catch(d){console.error(d)}};return(k,d)=>(e.openBlock(),e.createElementBlock("div",eo,[e.createVNode(vt,{title:k.title,onOnAddImage:d[0]||(d[0]=y=>g(y))},null,8,["title"]),o.value.length>0?(e.openBlock(),e.createBlock(Jt,{key:0,items:o.value,onDelete:d[1]||(d[1]=y=>a(y))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",to,d[2]||(d[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])))],512))}}),oo={class:"text-value"},no={class:"text-sm text-gray-900"},lo=e.defineComponent({__name:"TextValue",props:{item:{}},setup(r){const l=r,t=e.computed(()=>{const o=l.item.value;return typeof o=="boolean"?o?"Так":"Ні":o==null?"—":String(o)});return(o,n)=>(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("span",no,e.toDisplayString(t.value),1)]))}}),D=(r,l)=>{const t=r.__vccOpts||r;for(const[o,n]of l)t[o]=n;return t},so=D(lo,[["__scopeId","data-v-c14550b7"]]),ao={class:"link-value"},ro=["href"],io=D(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(r){const l=r,t=e.computed(()=>{const o=String(l.item.value);try{const n=new URL(o);return n.hostname+n.pathname}catch{return o}});return(o,n)=>(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("a",{href:String(o.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(t.value)+" ",1),n[0]||(n[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,ro)]))}}),[["__scopeId","data-v-e6eb07a6"]]),co={class:"date-value"},mo={class:"text-sm text-gray-900"},po=D(e.defineComponent({__name:"DateValue",props:{item:{}},setup(r){const l=r,t=e.computed(()=>{const o=l.item.value;if(o instanceof Date)return o.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof o=="string"){const n=new Date(o);if(!isNaN(n.getTime()))return n.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(o)});return(o,n)=>(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("span",mo,e.toDisplayString(t.value),1)]))}}),[["__scopeId","data-v-b9600618"]]),go={class:"status-value"},fo={key:0,class:"mr-1"},ho=D(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(r){const l=r,t=e.computed(()=>{switch(String(l.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"}}),o=e.computed(()=>{switch(String(l.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(n,g)=>(e.openBlock(),e.createElementBlock("div",go,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",t.value])},[o.value?(e.openBlock(),e.createElementBlock("span",fo,[e.createElementVNode("i",{class:e.normalizeClass(o.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(n.item.value)),1)],2)]))}}),[["__scopeId","data-v-c72e0b01"]]),yo={class:"custom-value"},ko={class:"text-sm text-gray-900"},bo=D(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(r){return(l,t)=>(e.openBlock(),e.createElementBlock("div",yo,[e.renderSlot(l.$slots,"default",{item:l.item,value:l.item.value},()=>[e.createElementVNode("span",ko,e.toDisplayString(String(l.item.value)),1)],!0)]))}}),[["__scopeId","data-v-11a73810"]]),xo=["id"],uo={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},_o={key:1,class:"overflow-x-auto"},wo={class:"min-w-full divide-y divide-gray-200"},Eo={class:"bg-white divide-y divide-gray-200"},Bo={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Vo={class:"flex items-center gap-2"},No=["title"],$o={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Co={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Lo={class:"flex items-start gap-3"},Do={key:0,class:"flex-shrink-0"},Mo={class:"flex-1 min-w-0"},So={class:"flex items-center gap-2 mb-2"},To={class:"text-sm font-medium text-gray-900"},zo=["title"],Fo={key:3,class:"overflow-x-auto"},jo={class:"min-w-full divide-y divide-gray-200"},Io={class:"bg-white divide-y divide-gray-200"},Ao={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Ho={class:"flex items-center gap-2"},Oo=["title"],Po={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},J=D(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(r){const l=t=>{switch(t.type){case"link":return io;case"date":return po;case"status":return ho;case"custom":return bo;default:return so}};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["description-list-widget",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",uo,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",_o,[e.createElementVNode("table",wo,[e.createElementVNode("tbody",Eo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,n=>(e.openBlock(),e.createElementBlock("tr",{key:n.id||n.label},[e.createElementVNode("td",Bo,[e.createElementVNode("div",Vo,[n.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([n.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label)+" ",1),n.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:n.tooltip},o[0]||(o[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,No)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",$o,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(n)),{item:n},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",Co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id||n.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Lo,[n.icon?(e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("i",{class:e.normalizeClass([n.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Mo,[e.createElementVNode("div",So,[e.createElementVNode("h4",To,e.toDisplayString(n.label),1),n.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:n.tooltip},o[1]||(o[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,zo)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(n)),{item:n},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("table",jo,[e.createElementVNode("tbody",Io,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,n=>(e.openBlock(),e.createElementBlock("tr",{key:n.id||n.label},[e.createElementVNode("td",Ao,[e.createElementVNode("div",Ho,[n.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([n.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label)+" ",1),n.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:n.tooltip},o[2]||(o[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)]),8,Oo)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Po,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(n)),{item:n},null,8,["item"]))])]))),128))])])]))],14,xo))}}),[["__scopeId","data-v-36d43e50"]]),Wo={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function Ro(r){return r?r.type==="FeatureCollection"||r.type==="Feature"?r:r.geom?{type:"Feature",geometry:{type:r.geom.type,coordinates:r.geom.coordinates},properties:{}}:r.type&&r.coordinates?{type:"Feature",geometry:r,properties:{}}:null:null}const Uo={key:1,class:"bg-white absolute top-[10px] right-[10px] z-[500] border rounded-lg cursor-pointer"},Go={class:"flex items-center justify-between p-2 border-b"},qo={class:"p-2 border-b"},Zo={class:"flex items-center"},Ko=["value"],Jo={class:"ml-2"},Xo={class:"p-2"},Qo={class:"flex items-center"},Yo={class:"flex items-center"},vo=["onUpdate:modelValue","onChange"],en={class:"ml-2"},R=D(e.defineComponent({__name:"MapWidget",props:{pattern:{},geom:{},id:{},tms:{}},setup(r){const l=e.getCurrentInstance(),t=r,o=e.ref(null);let n,g;const a=f(),h=e.ref(Object.keys(a)[0]);let m;const x=e.ref(!0),k=e.ref(!1),d=e.ref(!1),y=e.ref($());function $(){return t.tms?(Array.isArray(t.tms)?t.tms:t.tms?.split(",")).map((b,E)=>({url:t.pattern?t.pattern.replace("{{id}}",b):b,name:"Шар "+E,visible:!0,i:E})):[]}function u(){return new Promise((B,b)=>{if(window.L&&window.L.Draw)return B(0);const E=M=>{if(Array.from(document.styleSheets).some(F=>F?.href?.includes(M)))return;const T=document.createElement("link");T.rel="stylesheet",T.href=M,document.head.appendChild(T)},C=M=>new Promise((Q,T)=>{const F=Array.from(document.scripts).find(I=>I.src===M);if(F){F.addEventListener("load",()=>Q()),F.addEventListener("error",I=>T(I));return}const j=document.createElement("script");j.src=M,j.async=!0,j.onload=()=>Q(),j.onerror=I=>T(I),document.body.appendChild(j)});E("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),E("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),C("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>C("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(()=>B(0)).catch(b)})}let w=!1;e.onMounted(async()=>{await u(),L.drawLocal=Wo;const B=l?.appContext.config.globalProperties.$settings?.center||[50,30];n=L.map(o.value,{zoomControl:!1}).setView(B,10),n.on("mousemove",E=>{w||(n.invalidateSize(),w=!0)}),L.control.zoom({position:"bottomright"}).addTo(n),m=L.tileLayer(a[h.value].url,{maxZoom:19}).addTo(n),g=new L.FeatureGroup().addTo(n),y.value.length&&_(0);const b=Ro(t.geom);if(b){const E=[];L.geoJSON(b).eachLayer(C=>E.push(C)),E.length&&g.addLayer(E[0]),g.toGeoJSON(),s()}});function s(B=30){const b=g.getLayers();if(!b.length)return;const C=L.featureGroup(b).getBounds();C&&C.isValid()&&n.fitBounds(C,{padding:[B,B],maxZoom:16})}function c(B){m&&m.removeFrom(n);const b=a[B];m=L.tileLayer(b.url,b.options||{}).addTo(n),m.bringToBack(),h.value=B}function i(){c(h.value)}function p(){g&&(x.value?g.addTo(n):g.removeFrom(n))}function _(B){const b=y.value[B];b.layer||(b.layer=L.tileLayer(b.url,{maxZoom:19})),b.visible?b.layer.addTo(n):b.layer.removeFrom(n)}function f(){return l?.appContext.config.globalProperties.$settings?.basemaps?l?.appContext.config.globalProperties.$settings?.basemaps.map((B,b)=>Object.assign(B,{key:`b${b}`,preview:B.preview||B.url.replace("{z}/{x}/{y}.png","13/4790/2762.png")})).reduce((B,b)=>({...B,[b.key]:b}),{}):{topo100:{url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}return e.watch(k,()=>{setTimeout(()=>{n.invalidateSize()},50)}),(B,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative min-h-[300px] h-full",k.value?"fullscreen":"pb-[3.25rem]"])},[e.createElementVNode("div",{ref_key:"mapContainer",ref:o,class:"w-full h-full min-h-[300px]"},null,512),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:b[0]||(b[0]=E=>d.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-2 border rounded-lg cursor-pointer"}," Шари ")),d.value?(e.openBlock(),e.createElementBlock("div",Uo,[e.createElementVNode("div",Go,[b[6]||(b[6]=e.createElementVNode("div",null,"Шари",-1)),(e.openBlock(),e.createElementBlock("svg",{onClick:b[1]||(b[1]=E=>d.value=!1),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x w-4 h-4"},b[5]||(b[5]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])))]),e.createElementVNode("div",qo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),(E,C)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("label",Zo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"base-layer",value:C,"onUpdate:modelValue":b[2]||(b[2]=M=>h.value=M),onChange:i},null,40,Ko),[[e.vModelRadio,h.value]]),e.createElementVNode("span",Jo,e.toDisplayString(E.name||C),1)])]))),256))]),e.createElementVNode("div",Xo,[e.createElementVNode("label",Qo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":b[3]||(b[3]=E=>x.value=E),onChange:p},null,544),[[e.vModelCheckbox,x.value]]),b[7]||(b[7]=e.createElementVNode("span",{class:"ml-2"}," Геометрія/Межі ",-1))]),t.tms?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(y.value,E=>(e.openBlock(),e.createElementBlock("label",Yo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":C=>E.visible=C,onChange:C=>_(E.i)},null,40,vo),[[e.vModelCheckbox,E.visible]]),e.createElementVNode("span",en,e.toDisplayString(E.name),1)]))),256)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["absolute z-[500] bg-white p-2 border rounded-lg cursor-pointer",k.value?"bottom-[100px] right-[7px]":"bottom-[150px] right-[7px]"]),onClick:b[4]||(b[4]=E=>k.value=!k.value)},b[8]||(b[8]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"})],-1)]),2)],2))}}),[["__scopeId","data-v-e3aa0e7d"]]),tn={class:"flex justify-between items-center mb-[15px]"},on={class:"font-semibold text-[16px]"},nn={class:"overflow-x-auto"},ln={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},sn={class:"text-left font-medium text-gray-700"},an={class:"py-2 min-w-[200px]"},rn={key:0,class:"py-2 min-w-[200px]"},cn={class:"divide-y divide-gray-200"},dn={class:"bg-white odd:bg-gray-50"},mn={class:"py-2 pr-5"},pn=["href"],gn={class:"py-2 pr-5 gap-2 inline-flex"},fn=["onClick"],hn=["onClick"],re=e.defineComponent({__name:"TableWidget",props:{name:{},label:{},component:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(r){const l=e.getCurrentInstance(),t=e.ref([]),o=e.ref([]),n=r,g=e.ref([]),a=e.ref(""),h=e.ref("");async function m(){const s=await fetch("/api/data/"+n.token).then(c=>c.json());t.value=s.rows,o.value=s.columns,g.value=s.actions,a.value=s.form,h.value=s.addToken}const{$notify:x=console.log,$confirm:k,$form:d}=l?.appContext?.config?.globalProperties||{};async function y(s){await d({token:s.token}),m()}function $(){d({token:h.value})}function u(s){k({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const c=await fetch(`/api/table/${s.token}`,{method:"DELETE"});if(!c.ok){const{error:i,code:p}=await c.json();x({title:"Помилка",type:"warning",message:i});return}x({title:"Видаленно",message:"Успішно видалено"}),await m()}})}e.onMounted(async()=>{await m()});function w(s,c){return c.format?.toLowerCase()==="text"?s[c.name]:s[c.name+"_data"]??s[c.name+"_text"]??"-"}return(s,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",tn,[e.createElementVNode("div",on,e.toDisplayString(s.title),1),g.value.includes("add")&&h.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:$,class:"px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-blue-100 text-blue-500 hover:bg-blue-500 focus:ring-blue-500"},"Додати")):e.createCommentVNode("",!0)]),e.createElementVNode("div",nn,[e.createElementVNode("table",ln,[e.createElementVNode("thead",sn,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,i=>(e.openBlock(),e.createElementBlock("th",an,e.toDisplayString(i.ua),1))),256)),g.value.includes("edit")?(e.openBlock(),e.createElementBlock("th",rn," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,i=>(e.openBlock(),e.createElementBlock("tr",dn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createElementBlock("td",mn,[p.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:p.link.replace("{{id}}",i.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(w(i,p)),9,pn)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(w(i,p)),1)],64))]))),256)),e.createElementVNode("td",gn,[i.token?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:p=>y(i),class:"inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"},c[0]||(c[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M20,16v4a2,2,0,0,1-2,2H4a2,2,0,0,1-2-2V6A2,2,0,0,1,4,4H8",fill:"none",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}),e.createElementVNode("polygon",{fill:"none",points:"12.5 15.8 22 6.2 17.8 2 8.3 11.5 8 16 12.5 15.8",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)]),8,fn)):e.createCommentVNode("",!0),i.token?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:p=>u(i),class:"inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"},c[1]||(c[1]=[e.createStaticVNode('<svg class="flex-shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="12px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>',1)]),8,hn)):e.createCommentVNode("",!0)])]))),256))])])])]))}}),yn={class:"p-[20px]"},kn={class:"flex gap-[6px] mb-5"},bn={class:"vs-form-text relative bg-white rounded-lg flex-grow"},xn={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},un={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},_n={class:"space-y-8"},wn={key:0},En={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Bn=["onClick"],Vn={class:"md:col-span-2"},Nn={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},$n={class:"text-sm text-gray-500 dark:text-neutral-500"},Cn={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Ln=["checked","onChange"],Dn={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Mn={class:"md:col-span-2"},Sn={class:"font-semibold text-gray-800 dark:text-neutral-200"},Tn=["onClick"],zn={class:"md:col-span-2"},Fn={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},jn={class:"text-sm text-gray-500 dark:text-neutral-500"},In={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},An=["checked","onChange"],U=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(r){const l=r,t=e.ref(""),o=["view","add","edit","del"],n=e.ref({});e.onMounted(async()=>{const w=await(await fetch(`/api/access-group/${l.id}?tab=vs-group-interface`)).json();w.routes&&w.routes.forEach(s=>{n.value[s.path]=new Set(s.actions)})});const g=(u,w)=>n.value[u]?.has(w)??!1,a=(u,w)=>{n.value[u]||(n.value[u]=new Set),n.value[u].has(w)?n.value[u].delete(w):n.value[u].add(w)},h=(u,w)=>{u.forEach(s=>{s.path&&(n.value[s.path]||(n.value[s.path]=new Set),n.value[s.path].has(w)?n.value[s.path].delete(w):n.value[s.path].add(w))})},m=e.computed(()=>Object.entries(n.value).map(([u,w])=>({path:u,actions:Array.from(w)})).filter(u=>u.actions.length)),x=async()=>{await fetch(`/api/access-group/${l.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:m.value})}),console.log("Saved",m.value),de.notify({title:"Success!",message:"Permissions saved."})},k=()=>{n.value={}},d=u=>{if(!t.value.trim())return u;const w=t.value.toLowerCase();return u.filter(s=>s.ua.toLowerCase().includes(w)||s.path&&s.path.toLowerCase().includes(w))},y=e.computed(()=>d(l.data.routers.filter(u=>!u.menu))),$=e.computed(()=>l.data.routers.filter(u=>u.menu).map(u=>({...u,menu:d(u.menu||[])})).filter(u=>u.menu&&u.menu.length>0));return(u,w)=>(e.openBlock(),e.createElementBlock("div",yn,[e.createElementVNode("div",kn,[e.createElementVNode("div",bn,[w[1]||(w[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":w[0]||(w[0]=s=>t.value=s),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,512),[[e.vModelText,t.value]])]),e.createElementVNode("button",{onClick:k,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:x,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",xn,[w[2]||(w[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(s,c)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:c},[e.createElementVNode("h3",un,e.toDisplayString(s),1)])),64))]),e.createElementVNode("div",_n,[y.value.length?(e.openBlock(),e.createElementBlock("div",wn,[e.createElementVNode("ul",En,[w[3]||(w[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(s,c)=>e.createElementVNode("li",{key:c,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:i=>h(y.value,o[c])}," Toggle all ",8,Bn)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(s,c)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+c,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Vn,[e.createElementVNode("p",Nn,e.toDisplayString(s.ua),1),e.createElementVNode("p",$n,e.toDisplayString(s.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,p)=>e.createElementVNode("li",{key:p,class:"col-span-1"},[e.createElementVNode("div",Cn,[e.createElementVNode("input",{type:"checkbox",checked:g(s.path,i),onChange:_=>a(s.path,i),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Ln)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(s,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:"space-y-5"},[e.createElementVNode("ul",Dn,[e.createElementVNode("li",Mn,[e.createElementVNode("h3",Sn,e.toDisplayString(s.ua),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,p)=>e.createElementVNode("li",{key:p,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:_=>h(s.menu,o[p])}," Toggle all ",8,Tn)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.menu,(i,p)=>(e.openBlock(),e.createElementBlock("ul",{key:p,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",zn,[e.createElementVNode("p",Fn,e.toDisplayString(i.ua),1),e.createElementVNode("p",jn,e.toDisplayString(i.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(_,f)=>e.createElementVNode("li",{key:f,class:"col-span-1"},[e.createElementVNode("div",In,[e.createElementVNode("input",{type:"checkbox",checked:g(i.path,_),onChange:B=>a(i.path,_),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,An)])])),64))]))),128))]))),128))])]))}}),ie={"vs-widget-map":R,"vs-widget-comments":H,"vs-widget-history":O,"vs-widget-gallery":W,"vs-widget-file":P,"vs-widget-list":J,"vs-widget-table":re,"vs-group-interface":U},Hn={key:0,class:"mb-4 pb-2 border-b border-gray-200"},On={class:"text-lg font-semibold text-gray-900"},Pn=["innerHTML"],Wn={key:0,class:"mb-4 pb-2 border-b border-gray-200"},Rn={class:"text-lg font-semibold text-gray-900"},Un=["innerHTML"],X=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(r){const l=r;console.log(l.data);const t=e.computed(()=>l.col?{[`lg:col-span-${l.col}`]:!0}:{});function o(a){return ie[a]||a}const n=function(a={}){return a.props&&Object.entries(a.props).forEach(([h,m])=>{a[h]=l.data[m]}),a},g=e.computed(()=>{const a={};return l.col&&(a.col=l.col),a});return(a,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full bg-gray-50 rounded-lg p-4 col-span-12",t.value])},[a.title?(e.openBlock(),e.createElementBlock("div",Hn,[e.createElementVNode("h3",On,e.toDisplayString(a.title),1)])):e.createCommentVNode("",!0),a.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:a.html,class:"text-gray-900 leading-relaxed"},null,8,Pn)):a.type?.includes("tabs")?(e.openBlock(),e.createBlock(z,{key:2,view:a.type,panels:a.items,data:a.data},null,8,["view","panels","data"])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(a.items,m=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m.title||m.label?(e.openBlock(),e.createElementBlock("div",Wn,[e.createElementVNode("h3",Rn,e.toDisplayString(m.title||m.label),1)])):e.createCommentVNode("",!0),m.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:m.html,class:"text-gray-900 leading-relaxed"},null,8,Un)):m.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o(m.component)),e.mergeProps({key:2,ref_for:!0},{geom:a.data.geom,id:a.data.id,...g.value,...n(m),data:a.data},{class:"w-full"}),null,16)):e.renderSlot(a.$slots,"default",{key:3})],64))),256))],2))}}),Gn={class:"grid grid-cols-12 gap-[20px]"},qn={key:0,class:"col-span-4"},Zn=["innerHTML"],Kn={key:0,class:"overflow-hidden w-full"},Jn={class:"flex border-b border-gray-200 bg-gray-50 relative"},Xn=["onClick"],Qn={class:"p-1"},Yn=["innerHTML"],vn={key:1,class:"flex w-full"},el={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},tl=["onClick"],ol={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},nl={class:"flex-1 p-4"},ll=["innerHTML"],sl={key:2,class:"p-1 w-full"},al={class:"grid grid-cols-12 gap-4"},z=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},id:{},className:{},style:{}},setup(r){const l=r,t=e.ref(0),o=e.ref([]);function n(s){return ie[s]||s}function g(s){return s.forEach(c=>{c.type&&(c.view=c.type)}),o.value=s.filter(c=>c.type==="pin"),s.filter(c=>c.type!=="pin")}const a=e.computed(()=>l.panels&&l.panels.length>0?l.normalizeTabs?g(l.panels):l.panels:l.data&&Array.isArray(l.data)?l.data.filter(c=>c.type.includes("tabs"))[0]?.items||[]:[]),h=e.computed(()=>l.panels&&l.panels.length>0?l.normalizeTabs?g(l.panels):l.panels:l.data&&Array.isArray(l.data)?l.data:[]),m=e.computed(()=>({[`view-${l.view}`]:!0})),x=s=>{const c={...s};return l.data&&(c.data=l.data),c},k=e.ref([]),d=e.ref([]),y=e.ref([]);function $(s,c){s&&s instanceof HTMLElement&&(k.value[c]=s)}function u(){d.value=k.value.map(s=>s.offsetWidth),y.value=k.value.map(s=>s.offsetLeft)}let w=null;return e.onMounted(()=>{e.nextTick(()=>{u()}),w=new ResizeObserver(()=>u()),w.observe(document.body)}),e.onBeforeUnmount(()=>{w?.disconnect()}),e.watch(t,()=>{e.nextTick(()=>{u()})}),(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.classWrapper||m.value)},[e.createElementVNode("div",Gn,[o.value.length!==0?(e.openBlock(),e.createElementBlock("div",qn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value[0].items,(i,p)=>(e.openBlock(),e.createElementBlock("div",{key:i.name||p,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[i.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:i.html,class:"text-gray-900 leading-relaxed"},null,8,Zn)):i.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(i.component)),e.mergeProps({key:1,ref_for:!0},i.component==="Card"?i:x(i),{id:s.data.id,class:"w-full h-full"}),null,16,["id"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.value.length!==0?"col-span-8":"col-span-12")},[s.view==="tabs"?(e.openBlock(),e.createElementBlock("div",Kn,[e.createElementVNode("div",Jn,[d.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:d.value[t.value]+"px",left:y.value[t.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(i,p)=>(e.openBlock(),e.createElementBlock("button",{key:i.name||p,ref_for:!0,ref:_=>$(_,p),onClick:_=>t.value=p,class:e.normalizeClass(["relative px-4 py-3 text-sm font-medium transition-colors duration-300",t.value===p?"text-blue-600":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(i.title||i.label||i.name||`Tab ${p+1}`),11,Xn))),128))]),e.createElementVNode("div",Qn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(i,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:i.name||p,class:e.normalizeClass(["transition-all duration-300 ease-in-out",t.value===p?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",s.classPanel||"w-full border-gray-100 py-2"])},[i.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:i.html,class:"text-gray-900 leading-relaxed"},null,8,Yn)):s.$slots[`tab-${p}`]?e.renderSlot(s.$slots,`tab-${p}`,{key:1,item:i,data:s.data}):i.component||i.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(i.component||i.name)),e.mergeProps({key:2,ref_for:!0},i.component==="Card"?i:x(i),{id:s.data.id,class:"w-full h-full"}),null,16,["id"])):e.renderSlot(s.$slots,i.slot||`tab-${p}`,{key:3,item:i,data:s.data})],2)),[[e.vShow,t.value===p]])),128))])])):s.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",vn,[e.createElementVNode("div",el,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(i,p)=>(e.openBlock(),e.createElementBlock("button",{key:i.name||p,onClick:_=>t.value=p,class:e.normalizeClass(["relative px-4 py-3 text-sm font-medium text-left transition-colors duration-300",t.value===p?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(i.title||i.label||i.name||`Tab ${p+1}`)+" ",1),t.value===p?(e.openBlock(),e.createElementBlock("span",ol,c[0]||(c[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)]))):e.createCommentVNode("",!0)],10,tl))),128))]),e.createElementVNode("div",nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(i,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:i.name||p,class:e.normalizeClass(["transition-all duration-300 ease-in-out",t.value===p?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",s.classPanel||"w-full border-gray-100 py-2"])},[i.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:i.html,class:"text-gray-900 leading-relaxed"},null,8,ll)):s.$slots[`tab-${p}`]?e.renderSlot(s.$slots,`tab-${p}`,{key:1,item:i,data:s.data}):i.component||i.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(i.component||i.name)),e.mergeProps({key:2,ref_for:!0},i.component==="Card"?i:x(i),{id:s.data.id,class:"w-full h-full"}),null,16,["id"])):e.renderSlot(s.$slots,i.slot||`tab-${p}`,{key:3,item:i,data:s.data})],2)),[[e.vShow,t.value===p]])),128))])])):(e.openBlock(),e.createElementBlock("div",sl,[e.createElementVNode("div",al,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(i,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i.name||p},[s.$slots[`panel-${p}`]?e.renderSlot(s.$slots,`panel-${p}`,{key:0,item:i,data:s.data}):i.items||i.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(X),e.mergeProps({key:1,ref_for:!0},x(i),{items:i.items,class:"w-full h-full"}),null,16,["items"])):i.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(i.component)),e.mergeProps({key:2,ref_for:!0},x(i),{class:"w-full h-full"}),null,16)):e.renderSlot(s.$slots,i.slot||`panel-${p}`,{key:3,item:i,data:s.data})],64))),128))])]))],2)])],2))}}),rl=["onClick"],ce=D(e.defineComponent({__name:"CopyNotification",setup(r,{expose:l}){const t=e.ref([]);let o=1;const n=()=>{if(t.value.length>=10){const h=t.value[0];clearTimeout(h.timer),t.value.shift()}const a={id:o++,timer:setTimeout(()=>{g(a.id)},1500)};t.value.push(a)},g=a=>{const h=t.value.findIndex(m=>m.id===a);if(h!==-1){const m=t.value[h];clearTimeout(m.timer),t.value.splice(h,1)}};return l({addNotification:n}),e.onUnmounted(()=>{t.value.forEach(a=>{clearTimeout(a.timer)})}),(a,h)=>(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(t.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.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(ke),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),h[0]||(h[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:x=>g(m.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(Z),{class:"h-4 w-4"})],8,rl)]))),128))]),_:1})]))}}),[["__scopeId","data-v-55903525"]]);z.install=function(r){r.component("vs-widget-file",P),r.component("vs-widget-comments",H),r.component("vs-widget-history",O),r.component("vs-widget-gallery",W),r.component("vs-widget-map",R),r.component("vs-group-interface",U),r.component("CommentsWidget",H),r.component("HistoryWidget",O),r.component("GalleryWidget",W),r.component("FilesWidget",P),r.component("MapWidget",R),r.component("Card",z),r.component("CardItem",X),r.component("DescriptionListWidget",J),r.component("CopyNotification",ce),r.component("GroupInterfaceWidget",U)},N.Card=z,N.CardItem=X,N.CommentsWidget=H,N.CopyNotification=ce,N.DescriptionListWidget=J,N.FilesWidget=P,N.GalleryWidget=W,N.GroupInterfaceWidget=U,N.HistoryWidget=O,N.MapWidget=R,N.TableWidget=re,N.default=z,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapWidget.vue.d.ts","sourceRoot":"","sources":["../../../src/widgets/map/MapWidget.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapWidget.vue.d.ts","sourceRoot":"","sources":["../../../src/widgets/map/MapWidget.vue"],"names":[],"mappings":"AAwRA,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;;AA6YD,wBAMG"}
|
package/package.json
CHANGED