@opengis/widgets 0.0.56 → 0.0.57

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.js CHANGED
@@ -2702,7 +2702,7 @@ const vc = { class: "map-base-layer-menu" }, bc = {
2702
2702
  }), _ = Y(() => {
2703
2703
  const h = t.height;
2704
2704
  return { height: typeof h == "number" ? `${h}px` : String(h) };
2705
- }), H = P(!1), he = P(!1), at = Y(() => H.value ? "fixed inset-0 w-screen h-screen z-[9999] bg-white" : "relative w-full"), Oe = Y(() => {
2705
+ }), H = P(!1), he = P(!1), at = Y(() => H.value ? "!fixed inset-0 w-screen h-screen z-[9999] bg-white" : "relative w-full"), Oe = Y(() => {
2706
2706
  const h = ["w-full", "h-full"];
2707
2707
  return H.value || h.push(`min-h-[${_.value.height}]`), h.join(" ");
2708
2708
  }), Se = Y(() => y.value), Be = () => j?.(), lt = P(k ?? E.value ?? null), ct = P(t.zoom ?? d ?? null), ut = P(E.value);
@@ -1,4 +1,4 @@
1
- (function(ge,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],e):(ge=typeof globalThis<"u"?globalThis:ge||self,e(ge.WidgetLib={},ge.Vue,ge.OpenGISCore))})(this,(function(ge,e,xe){"use strict";function Cr(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Sr=Cr(e);const zo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_r=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Br=t=>{const n=_r(t);return n.charAt(0).toUpperCase()+n.slice(1)},$r=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var on={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Tr=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:l,class:i,...a},{slots:c})=>e.h("svg",{...on,width:t||on.width,height:t||on.height,stroke:s||on.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:$r("lucide",...l?[`lucide-${zo(Br(l))}-icon`,`lucide-${zo(l)}`]:["lucide-icon"]),...a},[...r.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);const ce=(t,n)=>(o,{slots:s})=>e.h(Tr,{...o,iconNode:n,name:t},s);const Lr=ce("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const Ar=ce("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Ir=ce("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const jo=ce("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);const Dr=ce("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const Nt=ce("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Or=ce("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mr=ce("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Rr=ce("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);const Fr=ce("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const Pr=ce("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const Ho=ce("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const zr=ce("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);const jr=ce("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);const Uo=ce("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Hr=ce("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);const qo=ce("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Ur=ce("sheet",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]);const qr=ce("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);const Rn=ce("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Wr=ce("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);const Fn=ce("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const Kr=ce("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);const Pn=ce("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Gr={class:"border-t pt-3 mt-4"},Zr={class:"flex gap-2"},Jr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Yr={class:"flex-1 space-y-2"},Xr={class:"flex justify-between items-center"},Qr={class:"flex gap-2"},Vr=["disabled"],Wo=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(t,{emit:n}){const o=e.useModel(t,"isReply"),s=e.ref(""),r=n,l=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},i=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),l())};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Gr,[e.createElementVNode("div",Zr,[e.createElementVNode("span",Jr,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Yr,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>s.value=d),onKeydown:i,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,s.value]]),e.createElementVNode("div",Xr,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",Qr,[o.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:c[1]||(c[1]=d=>o.value=!1)},[e.createVNode(e.unref(Pn),{class:"h-3 w-3"}),c[2]||(c[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:!s.value.trim(),onClick:l},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,Vr)])])])])]))}}),ei={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"},ti=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(t,{emit:n}){const o=n,s=e.useModel(t,"showMoreOptions"),r=e.ref(),l=e.ref(!0),i=async d=>{s.value&&r.value&&!r.value.contains(d.target)&&!l.value&&(s.value=!1),l.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return e.onMounted(()=>{document.addEventListener("click",i)}),e.onUnmounted(()=>{document.removeEventListener("click",i)}),(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:r},[e.createElementVNode("div",ei,[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:a},[e.createVNode(e.unref(qr),{class:"h-3 w-3 mr-2"}),m[0]||(m[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:c},[e.createVNode(e.unref(Rn),{class:"h-3 w-3 mr-2"}),m[1]||(m[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),ni={class:"space-y-2"},oi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},si={class:"flex-1 min-w-0 space-y-1 relative"},ri={class:"flex items-center gap-2"},ii={class:"font-medium text-xs"},li={class:"text-xs text-gray-500"},ai={key:0,class:"text-xs text-gray-700 leading-relaxed"},ci={class:"flex justify-between text-xs"},di={class:"flex items-center gap-2"},fi={key:0,class:"flex gap-2"},pi=["disabled"],ui={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},mi=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(t,{emit:n}){const o=n,s=t,r=e.ref(s.comment.text),l=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),i=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"),a=e.ref(!1),c=e.ref(!1),d=e.ref(!1),m=e.ref(!1),f=x=>{const E=new Date,j=Math.floor((E.getTime()-x.getTime())/(1e3*60*60));return j<1?`${Math.floor((E.getTime()-x.getTime())/6e4)}m`:j<24?`${j}h`:`${Math.floor(j/24)}d`},g=()=>{m.value=!m.value,m.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},b=()=>{o("edit",s.comment.id,r.value),d.value=!1},k=(x,E)=>{o("like",x,E)},v=(x,E)=>{o("edit",x,E)};return(x,E)=>{const j=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",ni,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",d.value?"bg-gray-50":""])},[e.createElementVNode("span",oi,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",si,[e.createElementVNode("div",ri,[e.createElementVNode("span",ii,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",li,e.toDisplayString(f(t.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":E[0]||(E[0]=S=>r.value=S),class:e.normalizeClass(d.value?i.value:l.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",ai,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",ci,[e.createElementVNode("div",di,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",m.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:E[1]||(E[1]=S=>g())},[e.createVNode(e.unref(Rr),{class:e.normalizeClass(["h-3 w-3",m.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.comment?.likes),1)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:E[2]||(E[2]=S=>c.value=!0)},[e.createVNode(e.unref(Hr),{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:E[3]||(E[3]=S=>a.value=!0)},[e.createVNode(e.unref(Dr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",fi,[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:E[4]||(E[4]=S=>d.value=!1)},[e.createVNode(e.unref(Pn),{class:"h-3 w-3"}),E[11]||(E[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:!r.value.trim(),onClick:E[5]||(E[5]=S=>b())},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),E[12]||(E[12]=e.createTextVNode(" Send ",-1))],8,pi)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(ti,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":E[6]||(E[6]=S=>a.value=S),onEdit:E[7]||(E[7]=S=>d.value=!0),onDelete:E[8]||(E[8]=S=>x.$emit("delete",t.comment?.id)),comment:t.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ui,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,S=>(e.openBlock(),e.createBlock(j,{key:S.id,comment:S,isInside:!0,onDelete:L=>x.$emit("delete",S.id),onLike:k,onEdit:v},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(Wo,{key:0,onSendComment:E[9]||(E[9]=S=>x.$emit("reply",t.comment?.id,S)),isReply:c.value,"onUpdate:isReply":E[10]||(E[10]=S=>c.value=S)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),hi=["id"],gi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},sn=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(t,{emit:n}){const o=t,s=n,r=e.ref(o.comments??[]);async function l(){if(!o.id)return;const f=await fetch(`/api/widget/comment/${o.id}`).then(g=>g.json());r.value=f.rows.map(g=>({id:g.communication_id,author:g.username,text:g.body,createdAt:new Date(g.cdate)}))}r.value.length===0&&l();const i=async f=>{o.onAddComment?o.onAddComment(f):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:f})}),await l()),s("add",f)},a=(f,g)=>{o?.onLike?.(f,g),s("like",f,g)},c=(f,g)=>{o.onReply?.(f,g),s("reply",f,g)},d=async(f,g)=>{o.onEdit?o.onEdit(f,g):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:g})}),await l()),s("edit",f,g)},m=async f=>{o.onDelete?o.onDelete(f):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"DELETE"}),await l()),s("delete",f)};return(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",gi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([t.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,b=>(e.openBlock(),e.createBlock(mi,{key:b.id,comment:b,onReply:c,onLike:a,onDelete:g[0]||(g[0]=k=>m(k)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Wo,{onSendComment:g[1]||(g[1]=b=>i(b))})],14,hi))}}),Ko=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Nt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ur}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Wr}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Fr}]]),yi={class:"mx-auto font-sans"},vi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},bi={class:"relative"},ki={class:"space-y-3"},Ei={class:"flex-1 min-w-0 pb-2"},wi={class:"flex items-center gap-1.5 mb-1 mt-0.5"},xi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Ni={class:"font-medium text-xs"},Ci={class:"text-xs text-gray-500"},Si={class:"space-y-1"},_i={class:"text-xs text-gray-700"},Bi={class:"capitalize mr-1"},$i={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"},Ti={key:0,class:"flex items-center gap-1 text-xs"},Li={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Ai={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},rn=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.ref(Array.isArray(n.data)?n.data:[]);o.value.length===0&&n.id&&s();async function s(){const r=await fetch(`/api/widget/history/${n.id}`);if(!r.ok)return{data:[]};const l=await r.json();l.rows.forEach(i=>{i.timestamp=new Date(i.cdate),i.id=i.entity_id,i.entityType=i.entity_type,i.entityId=i.entity_id,i.action=i.change_type,i.userId=i.change_user_id,i.userName=i.username,i.timestamp=new Date(i.cdate),i.description=i.username,i.status=i.username}),o.value=l.rows}return(r,l)=>(e.openBlock(),e.createElementBlock("div",yi,[t.title?(e.openBlock(),e.createElementBlock("h3",vi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[e.createElementVNode("div",bi,[l[0]||(l[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:i?.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(Ko).get(i?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Ko).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",Ei,[e.createElementVNode("div",wi,[e.createElementVNode("span",xi,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",Ni,e.toDisplayString(i?.userName),1),e.createElementVNode("span",Ci,e.toDisplayString(i?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+e.toDisplayString(i?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",Si,[e.createElementVNode("div",_i,[e.createElementVNode("span",Bi,e.toDisplayString(i?.action),1),i?.entityId?(e.openBlock(),e.createElementBlock("span",$i,e.toDisplayString(i?.entityId),1)):e.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(e.openBlock(),e.createElementBlock("div",Ti,[i?.changes?.[i?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",Li,e.toDisplayString(i?.changes?.[i?.entityId]?.old),1)):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.old&&i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(Ar),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Ai,e.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Ii={key:0,class:"text-xl font-semibold"},Di={class:"flex gap-1"},Oi={key:0},Mi=["accept"],Ri={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"},Fi=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{},accept:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(t){const n=e.useModel(t,"modelValue"),o={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Ii,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?o.active:o.inactive]),onClick:r[0]||(r[0]=l=>n.value="list")},[e.createVNode(e.unref(zr),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?o.active:o.inactive]),onClick:r[1]||(r[1]=l=>n.value="grid")},[e.createVNode(e.unref(Mr),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Oi,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,40,Mi),e.createElementVNode("div",Ri,[e.createVNode(e.unref(Uo),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),zn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Nt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Or,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Kr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Nt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:Lr,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Nt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Nt,label:"PPT"}};function Go(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function Zo(t){if(t===0)return"0 B";const n=1024,o=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,s)).toFixed(1))} ${o[s]}`}const Pi={class:"space-y-0.5"},zi=["onClick"],ji=["onClick"],Hi={class:"flex items-center gap-2"},Ui={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},qi={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Wi={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Ki={class:"flex items-center gap-1"},Gi=["onClick"],Zi=["onClick"],Ji=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,s=>(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:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(zn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(zn)[s?.ext]?.icon||e.unref(zn).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:r=>n.$emit("openLightbox",s)},[e.createElementVNode("div",Hi,[e.createElementVNode("span",Ui,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,ji),e.createElementVNode("div",qi,e.toDisplayString(e.unref(Zo)(s.size)),1),e.createElementVNode("div",Wi,e.toDisplayString(e.unref(Go)(s.createdAt)),1),e.createElementVNode("div",Ki,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["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(jo),{class:"h-3 w-3"})],8,Gi),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(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Rn),{class:"h-3 w-3"})],8,Zi)])],8,zi))),128))]))}}),Yi={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Xi=["onClick"],Qi={class:"space-y-2"},Vi={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},el=["src"],tl={class:"space-y-1"},nl=["title"],ol={class:"text-xs text-gray-500 text-left"},sl={class:"absolute top-2 right-1 flex items-center gap-1"},rl=["onClick"],il=["onClick"],ll=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["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",Qi,[e.createElementVNode("div",Vi,[s.ext==="png"||s.ext==="jpg"||s.ext==="jpeg"||s.ext==="gif"||s.ext==="svg"||s.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${s?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,el)):(e.openBlock(),e.createBlock(e.unref(Nt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",tl,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:s.uploaded_name||s.name},e.toDisplayString(s.uploaded_name||s.name),9,nl),e.createElementVNode("p",ol,e.toDisplayString(e.unref(Go)(s.createdAt))+", "+e.toDisplayString(e.unref(Zo)(s.size)),1)])]),e.createElementVNode("div",sl,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["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(jo),{class:"h-3 w-3"})],8,rl),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(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Rn),{class:"h-3 w-3"})],8,il)])],8,Xi))),128))]))}}),al={class:"mx-auto font-sans"},cl={key:1},ln=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},format:{default:()=>[]},editable:{type:Boolean,default:!0},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=e.ref(!1),r=e.ref(null),l=e.ref(!1),i=e.ref(0),a=e.ref(o.files??[]),c=e.computed(()=>{const h=(o.format??[]).map(F=>typeof F=="string"?F.trim():F==null?"":String(F).trim()).filter(F=>F.length>0),T=[];return h.forEach(F=>{const P=F.toLowerCase(),K=P.indexOf("/"),Z=K>=0;let B,M=!1,w;if(Z){B=P;const ne=P.slice(K+1);M=ne==="*",!M&&ne&&(w=`.${ne.replace(/^\.+/,"")}`)}else w=P.startsWith(".")?P:`.${P.replace(/^\.+/,"")}`;const z=Z?B:w??"";z&&T.push({acceptValue:z,mime:B,wildcard:M,extension:w})}),T.length?T:null}),d=e.computed(()=>{const A=c.value;if(!A)return;const h=A.map(T=>T.acceptValue).filter(Boolean);return h.length?h.join(","):void 0}),m=A=>{if(!c.value)return!0;const h=A.type?.toLowerCase(),T=A.name?.toLowerCase();return c.value.some(F=>{if(F.mime){if(h){if(F.wildcard){const P=F.mime.split("/")[0];if(h.startsWith(`${P}/`))return!0}else if(h===F.mime)return!0}return!!(F.extension&&T?.endsWith(F.extension))}return!!(F.extension&&T?.endsWith(F.extension))})},f=n;a.value.length===0&&L();const g=(A,h)=>{r.value=h,s.value=!0},b=()=>{r.value&&(E(r.value),r.value=null,s.value=!1)},k=e.computed(()=>Array.isArray(a.value)?a.value.map(A=>A?.file_path):[]),v=A=>{const h=k.value.findIndex(T=>T===A.file_path);h!==-1&&(l.value=!0,i.value=h)},x=A=>{o.onAddFile?o.onAddFile(A):R(A),f("add",A)},E=A=>{o.onDelete?o.onDelete(A):I(A),f("delete",A)},j=A=>{const h=document.createElement("a");h.setAttribute("download",A?.uploaded_name||A?.name),h.href=A?.file_path||A?.path,h.click()},S=e.ref("list");async function L(){if(!o.id)return;const A=await fetch(`/api/widget/file/${o.id}`).then(h=>h.json());A.rows.forEach(h=>{h.timestamp=new Date(h.cdate),h.id=h.entity_id,h.entityType=h.entity_type,h.entityId=h.entity_id,h.entityType=h.entity_type,h.action=h.change_type,h.userId=h.change_user_id,h.userName=h.username,h.timestamp=new Date(h.cdate),h.description=h.username,h.status=h.username}),a.value=A.rows}const R=async A=>{const T=A.target?.files;if(!T||T.length===0)return;const F=Array.from(T),P=[],K=[];if(F.forEach(Z=>{m(Z)?P.push(Z):K.push(Z)}),K.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${K.map(Z=>Z.name).join(", ")}`),P.length!==0)try{await Promise.all(P.map(async Z=>{const B=new FormData;B.append("file",Z);const M=`/api/widget/file/${o.id}`,w=await fetch(M,{method:"POST",body:B});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);return Z})),await L()}catch(Z){console.error("Помилка при завантаженні файлів:",Z)}},I=async A=>{try{await fetch(`/api/widget/file/${o.id}/${A}`,{method:"DELETE"}),await L()}catch(h){console.error(h)}};return(A,h)=>{const T=e.resolveComponent("MessageBox"),F=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",al,[e.createVNode(Fi,{modelValue:S.value,"onUpdate:modelValue":h[0]||(h[0]=P=>S.value=P),title:o.title,onOnAddFile:h[1]||(h[1]=P=>x(P)),editable:o.editable,accept:d.value},null,8,["modelValue","title","editable","accept"]),a.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[S.value==="list"?(e.openBlock(),e.createBlock(Ji,{key:0,onDelete:g,onDownload:j,onOpenLightbox:h[2]||(h[2]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),S.value==="grid"?(e.openBlock(),e.createBlock(ll,{key:1,onDelete:g,onDownload:j,onOpenLightbox:h[3]||(h[3]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",cl,[...h[6]||(h[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),e.createVNode(T,{modelValue:s.value,"onUpdate:modelValue":h[4]||(h[4]=P=>s.value=P),onConfirm:b,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(F,{modelValue:l.value,"onUpdate:modelValue":h[5]||(h[5]=P=>l.value=P),images:k.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),dl={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},fl=["onClick"],pl={key:0,rel:"noreferrer",class:"relative block h-full w-full"},ul=["src"],ml={key:0,class:"thumb-cover"},hl=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},format:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(t,{emit:n}){const o=n,s=e.ref(!1),r=e.ref(0),l=t,i=e.computed(()=>Array.isArray(l.items)?l.items.map(c=>c?.file_path):[]),a=c=>{const d=i.value.findIndex(m=>m===c.file_path);d!==-1&&(s.value=!0,r.value=d)};return(c,d)=>{const m=e.resolveComponent("Lightbox");return t.items?.length>=1?(e.openBlock(),e.createElementBlock("div",dl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+g,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:g,onClick:e.withModifiers(b=>a(f),["stop"])},[g<5?(e.openBlock(),e.createElementBlock("div",pl,[e.createElementVNode("img",{src:`/file/resize?filepath=${f?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",g===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,ul),g===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",ml," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,fl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-t.items.length),f=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+f,class:e.normalizeClass(["h-full w-full image"+(t.items.length+f-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),images:i.value,"start-index":r.value,delete:"true",download:"true",onDelete:d[1]||(d[1]=f=>o("delete",f))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),gl={key:0,class:"text-xl font-semibold"},yl={class:"flex gap-1"},vl=["accept"],bl={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"},kl=e.defineComponent({__name:"widgetHeader",props:{title:{},accept:{}},emits:["onAddImage"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",gl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",yl,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",accept:t.accept??"image/*",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s)),multiple:""},null,40,vl),e.createElementVNode("div",bl,[e.createVNode(e.unref(Uo),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),El={class:"w-full mx-auto font-sans",ref:"containerRef"},wl={key:1},an=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},format:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=L=>{if(!L)return[];const R=Array.isArray(L)?L:L.split(",");return Array.from(new Set(R.map(I=>I.trim().replace(/^\./,"").toLowerCase()).filter(Boolean)))},r=["jpg","jpeg","png","gif","webp","bmp","svg","avif","heic","tiff"],l=e.computed(()=>{const L=s(o.format);return L.length>0?L:void 0}),i=e.computed(()=>{const L=l.value;return!L||L.length===0?"image/*":L.map(R=>R.startsWith(".")?R:`.${R}`).join(",")}),a=L=>L?.split(".").pop()?.toLowerCase()??"",c=L=>{const R=L?.toLowerCase();return!!R&&!!l.value&&l.value.includes(R)},d=L=>{const R=L?.toLowerCase();return!!R&&r.includes(R)},m=L=>{const R=L.type?.toLowerCase(),I=L.ext?.toLowerCase();return R?.startsWith("image/")?l.value?c(I):!0:I?l.value?c(I):d(I):!1},f=L=>{if(!L.type?.toLowerCase()?.startsWith("image/"))return!1;if(!l.value)return!0;const I=a(L.name);return c(I)},g=L=>L.filter(m),b=e.ref(g(o.items??[])),k=n;b.value.length===0&&j();const v=L=>{o.onAddImage?o.onAddImage(L):E(L),k("add",L)},x=L=>{const R=b.value.find(I=>I.file_path===L)?.file_id;R&&(o.onDelete?o.onDelete(R):S(R))},E=async L=>{const R=L.target;if(!R?.files||R.files.length===0)return;const I=Array.from(R.files),A=I.filter(T=>f(T)),h=l.value?.join(", ")??"image/*";if(A.length===0){console.warn(`Допустимі формати: ${h}. Завантажте зображення дозволеного типу.`);return}A.length!==I.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${h}.`);try{await Promise.all(A.map(async T=>{const F=new FormData;F.append("file",T);const P=`/api/widget/file/${o.id}`,K=await fetch(P,{method:"POST",body:F});if(!K.ok)throw new Error(`HTTP error! status: ${K.status}`);return T})),await j()}catch(T){console.error("Помилка при завантаженні файлів:",T)}};async function j(){if(!o.id)return;const L=await fetch(`/api/widget/file/${o.id}`).then(R=>R.json());b.value=g(L.rows)}const S=async L=>{try{await fetch(`/api/widget/file/${o.id}/${L}`,{method:"DELETE"}),await j()}catch(R){console.error(R)}};return(L,R)=>(e.openBlock(),e.createElementBlock("div",El,[e.createVNode(kl,{title:t.title,accept:i.value,onOnAddImage:R[0]||(R[0]=I=>v(I))},null,8,["title","accept"]),b.value.length>0?(e.openBlock(),e.createBlock(hl,{key:0,items:b.value,onDelete:R[1]||(R[1]=I=>x(I))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",wl,[...R[2]||(R[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),xl={class:"text-value"},Nl={class:"text-sm text-gray-900"},Cl=e.defineComponent({__name:"TextValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;return typeof s=="boolean"?s?"Так":"Ні":s==null?"—":String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",xl,[e.createElementVNode("span",Nl,e.toDisplayString(o.value),1)]))}}),nt=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},Sl=nt(Cl,[["__scopeId","data-v-34a76c89"]]),_l={class:"link-value"},Bl=["href"],$l=nt(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=String(n.item.value);try{const r=new URL(s);return r.hostname+r.pathname}catch{return s}});return(s,r)=>(e.openBlock(),e.createElementBlock("div",_l,[e.createElementVNode("a",{href:String(t.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(o.value)+" ",1),r[0]||(r[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,Bl)]))}}),[["__scopeId","data-v-932f028c"]]),Tl={class:"date-value"},Ll={class:"text-sm text-gray-900"},Al=nt(e.defineComponent({__name:"DateValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;if(s instanceof Date)return s.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof s=="string"){const r=new Date(s);if(!isNaN(r.getTime()))return r.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",Tl,[e.createElementVNode("span",Ll,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),Il={class:"status-value"},Dl={key:0,class:"mr-1"},Ol=nt(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"bg-green-100 text-green-800";case"inactive":case"неактивний":case"pending":case"очікує":return"bg-yellow-100 text-yellow-800";case"error":case"помилка":case"failed":case"неуспішно":return"bg-red-100 text-red-800";case"draft":case"чернетка":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}}),s=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(r,l)=>(e.openBlock(),e.createElementBlock("div",Il,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",o.value])},[s.value?(e.openBlock(),e.createElementBlock("span",Dl,[e.createElementVNode("i",{class:e.normalizeClass(s.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(t.item.value)),1)],2)]))}}),[["__scopeId","data-v-aea1f529"]]),Ml={class:"custom-value"},Rl={class:"text-sm text-gray-900"},Fl=nt(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ml,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Rl,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),Pl=["id"],zl={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},jl={key:1,class:"overflow-x-auto"},Hl={class:"min-w-full divide-y divide-gray-200"},Ul={class:"bg-white divide-y divide-gray-200"},ql={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Wl={class:"flex items-center gap-2"},Kl=["title"],Gl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Zl={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Jl={class:"flex items-start gap-3"},Yl={key:0,class:"flex-shrink-0"},Xl={class:"flex-1 min-w-0"},Ql={class:"flex items-center gap-2 mb-2"},Vl={class:"text-sm font-medium text-gray-900"},ea=["title"],ta={key:3,class:"overflow-x-auto"},na={class:"min-w-full divide-y divide-gray-200"},oa={class:"bg-white divide-y divide-gray-200"},sa={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},ra={class:"flex items-center gap-2"},ia=["title"],la={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},jn=nt(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return $l;case"date":return Al;case"status":return Ol;case"custom":return Fl;default:return Sl}};return(o,s)=>(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",zl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",jl,[e.createElementVNode("table",Hl,[e.createElementVNode("tbody",Ul,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",ql,[e.createElementVNode("div",Wl,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[0]||(s[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,Kl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Gl,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",Zl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id||r.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Jl,[r.icon?(e.openBlock(),e.createElementBlock("div",Yl,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xl,[e.createElementVNode("div",Ql,[e.createElementVNode("h4",Vl,e.toDisplayString(r.label),1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[1]||(s[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,ea)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",ta,[e.createElementVNode("table",na,[e.createElementVNode("tbody",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",sa,[e.createElementVNode("div",ra,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[2]||(s[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,ia)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",la,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Pl))}}),[["__scopeId","data-v-106790ef"]]);function Jo(t){return new Promise((n,o)=>{if(typeof document>"u"){o(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(l=>l.src===t)){n();return}const r=document.createElement("script");r.src=t,r.async=!0,r.onload=()=>n(),r.onerror=()=>o(new Error(`Failed to load ${t}`)),document.body.appendChild(r)})}function aa(t){if(typeof document>"u"||Array.from(document.styleSheets||[]).some(s=>s.href===t))return;const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}const ca="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Hn=null;function da(){if(typeof window>"u")return;const t=window.IMask;if(typeof t=="function")return t;if(t&&typeof t.default=="function")return t.default}function fa(){return Hn||(Hn=Jo(ca).then(()=>{const t=da();if(!t)throw new Error("IMask is not available after loading the script");return t})),Hn}function pa(){return typeof window>"u"?"":window.location?.origin??""}function Yo(){if(!(typeof window>"u"))return window.maplibregl}const Xo=Symbol("vs-widget-map");function Un(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function ua(t){const n=['<div class="map-popup">'];return n.push('<div class="map-popup__body">'),t.forEach(o=>{n.push(`<div class="flex flex-col"><span class="font-bold text-slate-700">${o.label}: </span><span class="text-slate-700">${o.value}</span></div>`)}),n.push("</div></div>"),n.join("")}function ma(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function qn(t){if(!t)return"";const n=t.trim();if(!n)return"";const s=n.replace(/\\n/g,"").replace(/\\r/g,"").replace(/\\t/g,"").replace(/\s+/g,"");if(!s)return"";if(/^https?:\/\//i.test(s))return s;const r=pa(),l=s.replace(/^\/+/,"");return r?`${r}/${l}`:l?`/${l}`:""}function ha(t){const n=(t?.service??"").toLowerCase();if(n)return n;const o=(t?.url??"").toLowerCase();return/(\.mvt|\.pbf|\.vtile|\.vmt)(\?|$)/.test(o)?"vtile":/(\.png|\.jpg|\.jpeg|\.webp)(\?|$)/.test(o)?"raster":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(o)?"wms":""}function ga(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function cn(t){if(t!=null){if(typeof t=="number")return t;if(typeof t=="string"){const n=t.trim();if(!n)return;const o=Number(n);return Number.isFinite(o)?o:void 0}}}const Qo=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function ya(t){const n=t?.color??Qo[0],o=(t?.colorAttr??"").trim();if(!o)return n;const s=t?.colorSet&&Object.keys(t.colorSet).length>0,r={};if(s&&t?.colorSet?Object.entries(t.colorSet).forEach(([i,a])=>{const c=typeof a=="string"?a.trim():"",d=String(i).trim();c&&d&&(r[d]=c)}):Qo.forEach((i,a)=>{r[String(a+1)]=i}),!Object.keys(r).length)return n;const l=["match",["to-string",["coalesce",["get",o],""]]];return Object.entries(r).forEach(([i,a])=>{l.push(String(i),a)}),l.push(n),l}const zt="map-highlight-source",va="map-highlight-fill",ba="map-highlight-line";function ka(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function Vo(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function Ea(){return aa("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Jo("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),Yo()}function dn(t){const n=e.inject(Xo,void 0);if(!t){if(!n)throw new Error("useMap() must be called inside a map provider");return n}if(n)return n;const o=e.ref(null),s=e.ref(!1),r=e.ref({selectedBasemap:"",geometryVisible:!0,overlays:[]}),l=e.ref([]),i=e.ref([]),a=e.ref(null),c=e.ref(null),d=e.ref(null);let m=t.style??null,f=null;const g=p=>{p&&(o.value?o.value.setStyle(p):m=p)},b=()=>{r.value.overlays=i.value.map(p=>({id:p.id,name:p.config.name,visible:p.visible}))},k=p=>{const C=Array.isArray(p)?p:[];l.value=C,C.some(H=>H.key===r.value.selectedBasemap)||(r.value.selectedBasemap=C[0]?.key??"")},v=p=>{p&&i.value.forEach(C=>{C.layerIds.forEach(D=>{p.getLayer(D)&&p.removeLayer(D)}),p.getSource(C.sourceId)&&p.removeSource(C.sourceId),C.layerIds=[]})},x=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||(i.value.forEach(C=>{E(p,C)}),P())},E=(p,C)=>{const D=ha(C.config);D==="vtile"?S(p,C):D==="raster"&&j(p,C)},j=(p,C)=>{const D=C.config,H=C.sourceId,J=qn(D.url);if(!J)return;p.getSource(H)||p.addSource(H,{type:"raster",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const q=`${C.id}-raster`;p.getLayer(q)||p.addLayer({id:q,type:"raster",source:H,layout:{visibility:C.visible?"visible":"none"}}),C.layerIds=[q],L(p,C)},S=(p,C)=>{const D=C.config,H=C.sourceId,J=qn(D.url);if(!J)return;p.getSource(H)||p.addSource(H,{type:"vector",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const q=D.style??{},le=ya(q),he=[],ie={visibility:C.visible?"visible":"none"},et=ga(D),Me={source:H,layout:ie};if(et&&(Me["source-layer"]=et),(q.type??"polygon").toLowerCase()==="point"){const je=`${C.id}-circle`;p.getLayer(je)||p.addLayer({id:je,type:"circle",...Me,paint:{"circle-color":le,"circle-opacity":q.opacity??1,"circle-radius":q.radius??q.width??3,"circle-stroke-color":q.stroke??q.color??"#ffffff","circle-stroke-width":q.width??1}}),he.push(je);const He=q.text??q.label;if(He){const vt=`${C.id}-symbol`,tn=cn(q.textSize)??10,Mt=q.textHaloColor??q.stroke??"#ffffff",Rt=cn(q.textHaloWidth)??1,bt=cn(q.textZoom??q.pointZoom),Ft={"text-color":q.textColor??"#000000","text-halo-color":Mt,"text-halo-width":Rt},Je={id:vt,type:"symbol",...Me,layout:{"text-field":["coalesce",["get",He],""],"text-size":tn,"text-anchor":"top"},paint:Ft};bt!=null&&(Je.minzoom=bt),p.getLayer(vt)||p.addLayer(Je),he.push(vt)}}else{const je=`${C.id}-fill`;p.getLayer(je)||p.addLayer({id:je,type:"fill",...Me,paint:{"fill-color":le,"fill-opacity":q.opacity??.5,"fill-outline-color":q.stroke??q.color??"#0ea5e9"}}),he.push(je);const He=`${C.id}-line`;p.getLayer(He)||p.addLayer({id:He,type:"line",...Me,paint:{"line-color":q.stroke??q.color??"#0b74c4","line-width":cn(q.width??q.border)??1,"line-opacity":q.opacity??1}}),he.push(He)}C.layerIds=he,L(p,C)},L=(p,C)=>{const D=C.visible?"visible":"none";C.layerIds.forEach(H=>{p.getLayer(H)&&p.setLayoutProperty(H,"visibility",D)})},R=p=>{const C=Array.isArray(p)?p:[];v(o.value??void 0),d.value=null,B();const D=C.map((H,J)=>{if(!H)return null;const q=qn(H.url);if(!q)return null;const le=H.id!=null?String(H.id):`overlay-${J}`;return{id:le,config:{...H,id:le,url:q},visible:!1,sourceId:`${le}-source`,layerIds:[]}}).filter(H=>!!H);i.value=D,b(),x()},I=(p,C)=>{const D=i.value.find(J=>J.id===p);if(!D)return;D.visible=C,b();const H=o.value;if(!(!H||typeof H.isStyleLoaded!="function"||!H.isStyleLoaded())){if(!D.layerIds.length){E(H,D);return}L(H,D)}},A=()=>{a.value&&(a.value.remove(),a.value=null)},h=(p,C={})=>!Array.isArray(p.popup)||!p.popup.length?[]:p.popup.map(D=>({label:D.label??D.field,value:Un(C?.[D.field])})).filter(D=>D.label&&D.value!==void 0),T=p=>{const C=o.value;if(!C||!p?.point)return;const D=C.queryRenderedFeatures(p.point);for(const H of D){const J=H.layer?.id??H.sourceLayer;if(!J)continue;const q=ze(J);if(!q)continue;const le=h(q,H.properties??H.layer?.properties??{});if(!le.length)continue;const he=ua(le),ie=Yo();if(!ie)return;const et=p.lngLat;if(c.value===J&&a.value){a.value.setLngLat(et),a.value.setHTML(he);return}c.value=J,A(),a.value=new ie.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(et).setHTML(he).addTo(C);return}c.value=null,A()},F=()=>{c.value=null,A()},P=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||p.getSource(zt)||(p.addSource(zt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),p.addLayer({id:va,type:"fill",source:zt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),p.addLayer({id:ba,type:"line",source:zt,paint:{"line-color":"#1d4ed8","line-width":2}}))},K=p=>{const C=o.value;if(!C||typeof C.isStyleLoaded!="function"||!C.isStyleLoaded())return;P();const D=C.getSource(zt);if(!(!D||typeof D.setData!="function")){if(!p){D.setData({type:"FeatureCollection",features:[]});return}D.setData({type:"FeatureCollection",features:[p]})}},Z=p=>{const C=ka(p);C&&K(C)},B=()=>{K(null)},M=()=>{d.value=null,B()},w=p=>{if(p)return typeof p=="string"?p:p.field??p.name??p.key??p.label},z=p=>{if(p)return typeof p=="string"?p:p.label??p.title??p.field??p.name},ne=(p,C)=>!p||!p.length?[]:p.map(D=>{const H=w(D);if(!H)return null;const J=z(D),q=Un(C?.[H]);return!J||q===""?null:{label:J,value:q}}).filter(D=>!!D),We=(p,C)=>!Array.isArray(p)||!p.length?[]:p.map(D=>{if(!D?.name)return null;const H=D.title??D.name,J=Un(C?.[D.name]);return!H||J===""?null:{label:H,value:J}}).filter(D=>!!D),we=(p,C)=>!Array.isArray(p)||!p.length?[]:p.map(H=>{const J=Vo(H.url,C),q=H.label??H.url;return J?{label:q,url:J,target:H.target}:null}).filter(H=>!!H),pe=async(p,C)=>{const D=Vo(p,C);if(!D)return null;try{const H=await fetch(D);return H.ok?await H.json():null}catch{return null}},Le=async(p,C)=>{const D=C.properties??C.layer?.properties??{},H=ne(p.card?.rows,D);let J,q;if(p.card?.api){const ie=await pe(p.card.api,D);ie&&(typeof ie.html=="string"&&ie.html.trim()&&(J=ie.html),Array.isArray(ie.columns)&&ie.columns.length&&(q=ie.columns))}let le=H;if(!J&&q){const ie=We(q,D);ie.length&&(le=ie)}if(!le.length&&!J)return null;const he=we(p.card?.actions,D);return{title:D?.name??p.name,rows:le,html:J,actions:he.length?he:void 0}},Ke=async p=>{const C=o.value;if(!C||!p?.point)return;const D=C.queryRenderedFeatures(p.point);for(const H of D){const J=H.layer?.id??H.sourceLayer;if(!J)continue;const q=ze(J);if(!q||!q.card)continue;const le=await Le(q,H);if(le){d.value=le,Z(H);return}}d.value=null,B()},Ge=()=>{const p=o.value;p&&(p.on("mousemove",T),p.on("mouseleave",F),p.on("click",Ke))},Ze=()=>{const p=o.value;p&&(p.off("mousemove",T),p.off("mouseleave",F),p.off("click",Ke),A(),B())},ze=p=>{if(p)return i.value.find(C=>C.layerIds.includes(p))?.config},W=async()=>{const p=await Ea(),C=ma(t.container);if(!p||!C)return;const D={container:C,center:t.center??[30.524,50.45],zoom:t.zoom??10,style:m??t.style??{version:8,sources:{},layers:[]},attributionControl:!1,...t.mapOptions};o.value=new p.Map(D);const H=()=>{x()};f=H,o.value.on("style.load",H),o.value.on("load",()=>{s.value=!0,m&&o.value&&(o.value.setStyle(m),m=null),x(),Ge()})};e.onMounted(W),e.onBeforeUnmount(()=>{Ze(),o.value&&f&&o.value.off("style.load",f),v(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const G={map:o,ready:s,setStyle:g,flyTo:p=>o.value?.flyTo(p),fitBounds:(p,C)=>o.value?.fitBounds(p,C),setCenter:p=>o.value?.setCenter(p),setZoom:p=>o.value?.setZoom(p),addControl:(p,C)=>o.value?.addControl(p,C),removeControl:p=>o.value?.removeControl(p),on:(p,...C)=>o.value?.on(p,...C),off:(p,...C)=>o.value?.off(p,...C),project:p=>o.value?.project(p),unproject:p=>o.value?.unproject(p),state:r,basemapOptions:l,setOverlays:R,toggleOverlay:I,getOverlayConfig:ze,selectedCard:d,setBasemapOptions:k,clearCard:M};return e.provide(Xo,G),G}const wa={class:"map-base-layer-menu"},xa={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Na={class:"flex items-center justify-between p-2 border-b"},Ca={class:"p-2 border-b"},Sa={class:"flex items-center"},_a=["value","checked","onChange"],Ba={class:"ml-2"},$a={class:"p-2"},Ta={class:"flex items-center"},La=["checked"],Aa=["checked","onChange"],Ia={class:"ml-2"},Da=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:l}=dn(),i=e.ref(!1),a=`map-base-basemap-${Math.random().toString(36).slice(2,7)}`,c=e.computed(()=>o.value),d=e.computed(()=>n.value.selectedBasemap??""),m=e.computed(()=>n.value.geometryVisible??!0),f=e.computed(()=>n.value.overlays??[]),g=v=>{s?.(v)},b=()=>{r?.(!m.value)},k=v=>{l?.(v.id,!v.visible)};return(v,x)=>(e.openBlock(),e.createElementBlock("div",wa,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=E=>i.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),i.value?(e.openBlock(),e.createElementBlock("div",xa,[e.createElementVNode("div",Na,[x[3]||(x[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:x[1]||(x[1]=E=>i.value=!1)},[...x[2]||(x[2]=[e.createElementVNode("svg",{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:"w-4 h-4"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M18 6l-12 12"}),e.createElementVNode("path",{d:"M6 6l12 12"})],-1)])])]),e.createElementVNode("div",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.key},[e.createElementVNode("label",Sa,[e.createElementVNode("input",{type:"radio",name:a,value:E.key,checked:d.value===E.key,onChange:j=>g(E.key)},null,40,_a),e.createElementVNode("span",Ba,e.toDisplayString(E.name||E.key),1)])]))),128))]),e.createElementVNode("div",$a,[e.createElementVNode("label",Ta,[e.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:b},null,40,La),x[4]||(x[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,E=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:E.id},[e.createElementVNode("input",{type:"checkbox",checked:E.visible,onChange:j=>k(E)},null,40,Aa),e.createElementVNode("span",Ia,e.toDisplayString(E.name||E.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),Oa={key:0,class:"absolute bottom-[35px] left-[10px] z-[400] bg-white border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},Ma={class:"leading-tight"},Ra=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",Oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,s=>(e.openBlock(),e.createElementBlock("div",{key:s.key,class:"flex items-center gap-2 text-gray-800"},[e.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",Ma,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),Fa={class:"flex items-center gap-2 bg-white border border-gray-200 rounded-lg shadow-[0_10px_22px_rgba(15,23,42,0.16)] px-3 py-2 text-[11px] text-slate-900 max-w-[220px]"},Pa={class:"font-mono"},za=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Fa,[e.createElementVNode("span",Pa,e.toDisplayString(t.coordinates),1)]))}}),ja={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Ha=["title"],Ua={key:0,class:"vs-select__options absolute z-50 mt-1 w-auto min-w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900"},qa=["onClick"],Wa=["placeholder"],Ka={class:"divide-y divide-gray-100"},Ga=["onClick"],Za=600,Ja="0000000000:00:000:0000",Ya=30,Xa=8,Qa="https://data.softpro.ua/api-user/gis-url-proxy",Va="https://geo.rv.ua/api-user/dzk.api",ec="https://nominatim.openstreetmap.org/search",tc=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=dn(),s=e.getCurrentInstance();function r(){return s?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const i=!!r()?["xy","parcel","address"]:["xy","parcel"],a=e.computed(()=>{const W=n.config?.tools?.filter(G=>i.includes(G));return W&&W.length?W:i}),c=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),d=e.ref(a.value[0]);e.watch(a,W=>{W.includes(d.value)||(d.value=W[0])});const m=e.ref(""),f=e.ref(!1),g=e.ref(null),b=e.ref(null),k=e.ref(null),v=e.ref([]),x=e.ref(null),E=e.computed(()=>d.value==="address"&&v.value.length>0);let j=null,S=null,L=null;const R=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function I(){if(!b.value)return;const W=b.value.getBoundingClientRect(),G=W.width+Ya,p=W.left+window.scrollX,C=W.bottom+window.scrollY+Xa;R.left=`${p}px`,R.top=`${C}px`,R.width=`${G}px`,R.display="block"}const A=()=>{E.value&&I()};function h(){j&&(clearTimeout(j),j=null)}function T(){S?.destroy(),S=null}async function F(){if(d.value!=="parcel")return;const W=k.value;if(!W)return;const G=await fa();d.value==="parcel"&&(T(),S=G(W,{mask:Ja,lazy:!1,placeholderChar:"_"}),S.on("accept",()=>{m.value=S?.value??""}))}function P(){return(S?.value??m.value).trim()}function K(){if(!(typeof window>"u"))return window.maplibregl}function Z(W){const G=o.map.value;if(!G)return;const p=K();if(p){if(L){L.setLngLat([W.lat,W.lng]);return}L=new p.Marker({color:"#2563eb"}).setLngLat([W.lat,W.lng]).addTo(G)}}function B(){L&&(L.remove(),L=null)}e.watch(d,W=>{m.value="",f.value=!1,v.value=[],h(),W==="parcel"?e.nextTick(()=>{F().catch(G=>{xe.notify({type:"error",title:"Маска кадастру",message:G?.message||"Не вдалося ініціалізувати маску"})})}):T()}),e.watch(E,W=>{W?e.nextTick(()=>{I()}):R.display="none"}),e.watch(m,W=>{if(d.value!=="address"){v.value=[],h();return}if(!W.trim()){v.value=[],h();return}h(),j=window.setTimeout(()=>{Le(W).catch(G=>{const p=G?.message||"Помилка пошуку адреси";xe.notify({type:"error",title:"Пошук адреси",message:p})})},Za)});function M(W){d.value=W}function w(W){const G=W.target;if(f.value){const p=g.value;p&&!p.contains(G)&&(f.value=!1)}if(E.value){const p=x.value;p&&!p.contains(G)&&(v.value=[])}}e.onMounted(()=>{window.addEventListener("click",w,!0),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),d.value==="parcel"&&e.nextTick(()=>{F().catch(W=>{xe.notify({type:"error",title:"Маска кадастру",message:W?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",w,!0),window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A),h(),T(),B()});function z(W){return W==="xy"?"Координати":W==="parcel"?"Кадастр":"Адреси"}function ne(W){const G=W.replace(/[,]+/g," ").trim();if(!G)return null;const p=G.split(/\s+/).filter(Boolean);if(p.length<2)return null;console.log(p);const C=p.slice(0,2).map(Number);if(console.log(C),!C.every(ie=>Number.isFinite(ie)))return null;let[D,H]=C,J=D,q=H;const le=ie=>Math.abs(ie)<=90,he=ie=>Math.abs(ie)<=180;if(!le(J)||!he(q))if(le(q)&&he(J))J=D,q=H;else return null;return console.log(J,q),{lat:J,lng:q}}function We(W){return(W?.items||[]).map((p,C)=>{const D=Number(p?.position?.lat),H=Number(p?.position?.lng);return!Number.isFinite(D)||!Number.isFinite(H)?null:{id:String(p?.id??C),title:p?.title||p?.address?.label||"Знайдений обʼєкт",lat:D,lng:H}}).filter(p=>!!p)}function we(W){const G=W?.result||W?.data||W;if(!G)return[];const p=G.geom_centroid;if(!p||!Array.isArray(p.coordinates))return[];const[C,D]=p.coordinates;return!Number.isFinite(C)||!Number.isFinite(D)?[]:[{id:"parcel",title:G.cadnum||G.cad_num||"Земельна ділянка",lat:C,lng:D}]}function pe(W){return(Array.isArray(W?.features)?W.features:[]).map((p,C)=>{const D=p?.geometry?.coordinates,H=Number(D?.[0]),J=Number(D?.[1]);if(!Number.isFinite(H)||!Number.isFinite(J))return null;const q=p?.properties||{},le=q?.geocoding?.label||q?.display_name||q?.label||"Адреса";return{id:String(q?.geocoding?.place_id||q?.place_id||C),title:le,lat:H,lng:J}}).filter(p=>!!p)}async function Le(W){v.value=[],h();const G=new URL(ec);G.searchParams.set("format","geojson"),G.searchParams.set("q",W),G.searchParams.set("addressdetails","1"),G.searchParams.set("bounded","1");const p=r();p&&G.searchParams.set("viewbox",p);const C=await fetch(G.toString());if(!C.ok)throw new Error(`HTTP ${C.status}`);const D=await C.json(),H=pe(D);if(!H.length){xe.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}v.value=H}function Ke(W){Ze(W),v.value=[],m.value=""}function Ge(W){const p=W.replace(/\s+/g,"").split(":");if(p.length!==4)return!1;const C=[10,2,3,4];return p.every((D,H)=>D.length===C[H]&&/^\d+$/.test(D))}function Ze(W){const G=n.config?.zoom??17;o.flyTo?.({center:[W.lat,W.lng],zoom:G}),Z(W)}async function ze(){const W=d.value==="parcel"?P():m.value.trim();if(W){if(d.value==="xy"){const G=ne(W);if(console.log(G),!G){xe.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}Ze(G),m.value="";return}if(d.value==="address"){try{await Le(W)}catch(G){const p=G?.message||"Помилка пошуку адреси";xe.notify({type:"error",title:"Пошук адреси",message:p})}return}try{const G=new URL(d.value==="here"?Qa:Va);if(d.value==="here")G.searchParams.set("searchtext",W);else{if(!Ge(W)){xe.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}G.searchParams.set("cad_num",W)}const p=await fetch(G.toString());if(!p.ok)throw new Error(`HTTP ${p.status}`);const C=await p.json(),D=d.value==="here"?We(C):we(C);if(!D.length)xe.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const H=D[0];Ze(H),d.value==="parcel"&&S&&(S.value=""),m.value=""}}catch(G){const p=G?.message||"Помилка пошуку";xe.notify({type:"error",title:"Пошук",message:p})}}}return(W,G)=>(e.openBlock(),e.createElementBlock("div",ja,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(ze,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:g,class:"relative search-type w-[100px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:G[0]||(G[0]=p=>f.value=!f.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:z(d.value)},e.toDisplayString(z(d.value)),9,Ha),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":f.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...G[3]||(G[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))]),f.value?(e.openBlock(),e.createElementBlock("div",Ua,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,p=>(e.openBlock(),e.createElementBlock("li",{key:p,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:C=>M(p)},e.toDisplayString(z(p)),9,qa))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:b,class:"relative flex-1 min-w-[140px] bg-white rounded-md"},[d.value==="parcel"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"parcelInputRef",ref:k,"onUpdate:modelValue":G[1]||(G[1]=p=>m.value=p),placeholder:"0000000000:00:000:0000",inputmode:"numeric",type:"text",class:"vs-input !h-[34px] transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,512)),[[e.vModelText,m.value,void 0,{trim:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":G[2]||(G[2]=p=>m.value=p),placeholder:c.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,Wa)),[[e.vModelText,m.value,void 0,{trim:!0}]]),G[4]||(G[4]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1)),E.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:x,class:"vs-select__options mt-1 bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900 z-50 max-h-60 overflow-auto",style:e.normalizeStyle(R)},[e.createElementVNode("ul",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,p=>(e.openBlock(),e.createElementBlock("li",{key:p.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:C=>Ke(p)},e.toDisplayString(p.title),9,Ga))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),nc={class:"map-center-control"},oc=["aria-label"],sc=e.defineComponent({directives:{tooltip:xe.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=dn(),r=e.ref(null),l=e.ref(null),i=e.ref(null),a=e.ref(null);function c(k){if(Array.isArray(k)&&k.length>=2){const[v,x]=k.slice(0,2).map(E=>Number(E));return Number.isNaN(v)||Number.isNaN(x)?null:[v,x]}if(k&&typeof k=="object"){const v=k,x=v.lng??v.lon??v.long??v.x,E=v.lat??v.y;if(x!=null&&E!=null){const j=Number(x),S=Number(E);if(!Number.isNaN(j)&&!Number.isNaN(S))return[j,S]}}if(typeof k=="string"){const v=k.split(",").map(x=>Number(x.trim()));if(v.length>=2&&v.every(x=>!Number.isNaN(x)))return[v[0],v[1]]}return null}e.watch(()=>n.center,k=>{const v=c(k);v&&(r.value=v)},{immediate:!0}),e.watch(()=>n.zoom,k=>{const v=Number(k);Number.isNaN(v)||(l.value=v)},{immediate:!0}),e.watch(()=>n.targetCenter,k=>{i.value=c(k)},{immediate:!0}),e.watch(()=>n.targetZoom,k=>{const v=Number(k);a.value=Number.isNaN(v)?null:v},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),m=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),f=e.computed(()=>!!i.value);e.onMounted(async()=>{const k=o.value;if(k){if(!r.value){const v=k.getCenter();r.value=[v.lng,v.lat]}l.value==null&&(l.value=k.getZoom())}});function g(){const k=o.value;if(!k)return;const v=r.value||(()=>{const E=k.getCenter();return[E.lng,E.lat]})(),x=l.value??k.getZoom();k.flyTo({center:v,zoom:x})}function b(){const k=o.value;if(!k||!i.value)return;const v=a.value??l.value??k.getZoom();k.flyTo({center:i.value,zoom:v})}return(k,v)=>{const x=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",nc,[f.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,id:"center-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":"Повернути центр",onClick:e.withModifiers(g,["stop"])},[e.createVNode(e.unref(Pr),{class:"w-4 h-4"})])),[[x,"Центр мапи"]]),f.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:1,id:"goto-target-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":m.value,onClick:e.withModifiers(b,["stop"])},[e.createVNode(e.unref(jr),{class:"w-4 h-4"})],8,oc)),[[x,d.value]]):e.createCommentVNode("",!0)])}}}),es=nt(sc,[["__scopeId","data-v-bc627616"]]),rc={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},ic={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},lc=["aria-label"],ac={key:2,class:"absolute top-[10px] right-[10px] z-[600] min-w-[220px] max-w-[320px] bg-white border border-gray-200 rounded-[0.75rem] p-3 shadow-[0_25px_45px_rgba(15,23,42,0.2)]"},cc={class:"text-slate-900 font-semibold mb-1"},dc=["innerHTML"],fc={key:1,class:"space-y-2"},pc={class:"text-gray-500"},uc={class:"font-medium text-slate-900"},mc={key:2,class:"mt-2 flex flex-col gap-2"},hc=["href","target"],fn="map-basemap-source",Wn="map-basemap-layer",gc=20,Ct="map-katottg-geometry-source",pn="map-katottg-geometry-line",ot="map-geometry-source",St="map-geometry-fill",_t="map-geometry-line",Bt="map-geometry-circle",un=e.defineComponent({__name:"MapWidget",props:{height:{default:350},center:{},zoom:{},geom:{},layers:{},legend:{},tools:{},katottg:{}},setup(t){const n=t,o=[{key:"topo100",name:"Topographic 100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",name:"Орто 10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",name:"OSM Bright",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}],l=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{};function i(u){if(u){if(Array.isArray(u)&&u.length>=2){const O=Number(u[0]),U=Number(u[1]);return!Number.isFinite(O)||!Number.isFinite(U)?void 0:[O,U]}if(typeof u=="object"){const O=u,U=O.lng??O.lon??O.long??O.x,Y=O.lat??O.y;if(U!=null&&Y!=null){const Se=Number(U),Ye=Number(Y);if(Number.isFinite(Se)&&Number.isFinite(Ye))return[Se,Ye]}}}}function a(u){if(u==null)return;const O=Number(u);return Number.isFinite(O)?O:void 0}const c=e.computed(()=>n.katottg!=null?n.katottg:l.katottg),d=e.computed(()=>(Array.isArray(l.basemaps)&&l.basemaps.length?l.basemaps:o).map((U,Y)=>{const Se=typeof U.url=="string"?U.url.trim():"";return Se?{key:(U.key??U.name??`base-${Y}`).trim()||`base-${Y}`,url:Se,name:U.name??U.key??`Layer ${Y+1}`}:null}).filter(U=>!!U)),m=i(l.center),f=a(l.zoom),g=Po(n.geom),b=xr(g),k=b?[(b[0]+b[2])/2,(b[1]+b[3])/2]:void 0,v=e.ref(null),x=e.computed(()=>i(n.center)??null),E=e.computed(()=>x.value??m??null),j=dn({container:v,center:k??E.value??void 0,zoom:n.zoom??f}),{map:S,setCenter:L,setZoom:R,state:I,getOverlayConfig:A,selectedCard:h,setBasemapOptions:T,clearCard:F,addControl:P,removeControl:K,ready:Z}=j,B=e.computed({get:()=>I.value.selectedBasemap??"",set:u=>{I.value.selectedBasemap=u}}),M=e.computed({get:()=>I.value.geometryVisible??!0,set:u=>{I.value.geometryVisible=u}}),w=e.computed(()=>{const u=n.height;return{height:typeof u=="number"?`${u}px`:String(u)}}),z=e.ref(!1),ne=e.ref(!1),We=e.computed(()=>z.value?"fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),we=e.computed(()=>{const u=["w-full","h-full"];return z.value||u.push(`min-h-[${w.value.height}]`),u.join(" ")}),pe=e.computed(()=>h.value),Le=()=>F?.(),Ke=e.ref(k??E.value??null),Ge=e.ref(n.zoom??f??null),Ze=e.ref(E.value);e.watch(E,u=>{Ze.value=u},{immediate:!0});const ze=e.computed(()=>Ze.value??null),W=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof Ge.value=="number"?Ge.value:gc),G=["home","fullscreen","scale","position"],p=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?G:n.tools.filter(u=>G.includes(u))),C=u=>p.value.includes(u);e.watch([S,Z],([u,O])=>{if(!(!u||!O)){if(!Ke.value){const U=u.getCenter();Ke.value=[U.lng,U.lat]}Ge.value==null&&(Ge.value=u.getZoom())}},{immediate:!0});const D=e.ref(null),H=e.ref(""),J=e.ref(null),q=u=>u?ne.value?!0:typeof u.isStyleLoaded=="function"&&u.isStyleLoaded()?(ne.value=!0,!0):!1:!1,le=u=>{if(!u)return"";const O=Number(u.lat??u[1]),U=Number(u.lng??u[0]);return!Number.isFinite(O)||!Number.isFinite(U)?"":`${U.toFixed(5)}, ${O.toFixed(5)}`},he=u=>{u?.lngLat&&(H.value=le(u.lngLat))},ie=()=>{H.value=""},et=u=>{u&&(u.on("mousemove",he),u.on("mouseleave",ie),J.value=u)},Me=u=>{u&&(u.off("mousemove",he),u.off("mouseleave",ie),J.value=null)},Mn=e.computed(()=>C("scale"));e.watch([S,Z],([u,O],[U])=>{U&&Me(U),!(!u||!O)&&et(u)},{immediate:!0}),e.watch([S,Z,Mn],([u,O,U])=>{if(D.value&&K&&(K(D.value),D.value=null),!u||!O||!U)return;const Y=window?.maplibregl;Y&&(D.value=new Y.ScaleControl({unit:"metric"}),P?.(D.value,"bottom-left"))},{immediate:!0});const je=e.computed(()=>Array.isArray(n.legend)?n.legend.map((u,O)=>{const U=typeof u?.color=="string"?u.color.trim():"",Y=typeof u?.label=="string"?u.label.trim():"";return!U||!Y?null:{color:U,label:Y,key:`${Y}-${O}`}}).filter(u=>!!u):[]),He=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(l.layers)&&l.layers.length?l.layers:[]);e.watch(d,u=>{if(T?.(u),!u.length){B.value="";return}u.some(O=>O.key===B.value)||(B.value=u[0].key)},{immediate:!0});const vt=()=>typeof window>"u"?"":window.location?.origin??"",tn=u=>{if(!u)return"";const O=u.trim();if(!O)return"";const Y=O.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!Y)return"";if(/^https?:\/\//i.test(Y))return Y;const Se=vt(),Ye=Y.replace(/^\/+/,"");return Se?`${Se}/${Ye}`:Ye?`/${Ye}`:""},Mt=u=>{if(!u?.getStyle)return;const O=u.getStyle()??{},U=Array.isArray(O.layers)?O.layers:[];return U.length?U.find(Se=>Se.type!=="background")?.id??U[0]?.id:void 0},Rt=u=>{u&&(u.getLayer(Wn)&&u.removeLayer(Wn),u.getSource(fn)&&u.removeSource(fn))},bt=(u,O)=>{if(!u)return;const U=Mt(u);u.addSource(fn,{type:"raster",tiles:[O],tileSize:256}),u.addLayer({id:Wn,type:"raster",source:fn,layout:{visibility:"visible"}},U)},Ft=u=>{if(!u)return;const O=tn(u.url);if(!O){Je.value=null;return}Je.value=O,Rt(S.value),kt()},Je=e.ref(null),Mo=u=>{if(!u||u.__pendingBasemapHooked)return;u.__pendingBasemapHooked=!0;const O=()=>{u.__pendingBasemapHooked=!1,kt()};u.once("style.load",O),u.once("styledata",O)},kt=()=>{const u=S.value,O=Je.value;if(!(!O||!u)){if(!q(u)){Mo(u);return}Rt(u),bt(u,O)}},y=()=>{const u=B.value;if(!u)return;const O=d.value.find(U=>U.key===u);O&&Ft(O)};e.watch(B,()=>{y()},{immediate:!0}),e.watch(He,u=>{j.setOverlays?.(u)},{immediate:!0,deep:!0});const $=e.ref(null);let N=0;const _=e.computed(()=>Po($.value)),X={fill:{"fill-color":"#0ea5e9","fill-opacity":.25},line:{"line-color":"#0b74c4","line-width":2},circle:{"circle-color":"#0ea5e9","circle-stroke-color":"#ffffff","circle-stroke-width":2,"circle-radius":7,"circle-opacity":.95}},ae={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},te=e.ref(g),ue=e.ref(b),Re=e.ref(!1),se=e.computed(()=>{if(!ue.value)return null;const[u,O,U,Y]=ue.value;return[(u+U)/2,(O+Y)/2]}),Pt=e.computed(()=>!!ue.value),be=e.ref(!!b);e.ref(!1);const dt=()=>{z.value=!z.value},tt=e.ref(!1),Ue=()=>{const u=S.value;if(!u||!q(u))return;const O=te.value;if(!O){Et(u);return}let U=u.getSource(ot);U?U.setData(O):(u.addSource(ot,{type:"geojson",data:O}),Ro(u),U=u.getSource(ot)),kr(u,M.value?"visible":"none"),hu(),wr(),ue.value&&(!be.value&&(Re.value||!tt.value)?(u.fitBounds(ue.value,{padding:40,maxZoom:16,duration:0}),tt.value=!0,Re.value=!1):be.value&&(be.value=!1,Re.value=!1,tt.value=!0))},Ro=u=>{const O=X;u.getLayer(St)||u.addLayer({id:St,type:"fill",source:ot,paint:O.fill}),u.getLayer(_t)||u.addLayer({id:_t,type:"line",source:ot,paint:O.line}),u.getLayer(Bt)||u.addLayer({id:Bt,type:"circle",source:ot,paint:O.circle,filter:["==","$type","Point"]})},Et=u=>{[Bt,_t,St].forEach(O=>{u.getLayer(O)&&u.removeLayer(O)}),u.getSource(ot)&&u.removeSource(ot)},kr=(u,O)=>{q(u)&&[Bt,_t,St].forEach(U=>{u.getLayer(U)&&u.setLayoutProperty(U,"visibility",O)})},hu=()=>{const u=S.value;if(!u||!q(u))return;const O=X;u.getLayer(St)&&Object.entries(O.fill).forEach(([U,Y])=>{u.setPaintProperty(St,U,Y)}),u.getLayer(_t)&&Object.entries(O.line).forEach(([U,Y])=>{u.setPaintProperty(_t,U,Y)}),u.getLayer(Bt)&&Object.entries(O.circle).forEach(([U,Y])=>{u.setPaintProperty(Bt,U,Y)})},Er=u=>{u.getLayer(pn)||u.addLayer({id:pn,type:"line",source:Ct,layout:{visibility:"visible"},paint:ae})},wr=()=>{const u=S.value;if(!u||!q(u))return;const O=_.value??{type:"FeatureCollection",features:[]};if(!u.getSource(Ct)){u.addSource(Ct,{type:"geojson",data:O}),Er(u);return}const U=u.getSource(Ct);U&&typeof U.setData=="function"&&U.setData(O),Er(u)},gu=u=>{u.getLayer(pn)&&u.removeLayer(pn),u.getSource(Ct)&&u.removeSource(Ct)},yu=async u=>{const O=typeof u=="string"?u.trim():"",U=++N;if(!O){$.value=null;return}try{const Y=await fetch(`https://data.gki.com.ua/api-user/atu/${O}`);if(N!==U)return;if(!Y.ok){$.value=null;return}const Se=await Y.json();if(N!==U)return;$.value=Se}catch{if(N!==U)return;$.value=null}};e.watch(c,u=>{yu(u)},{immediate:!0}),e.watch(_,()=>{wr()},{immediate:!0}),e.watch(()=>n.geom,u=>{te.value=Po(u),ue.value=xr(te.value),se.value&&(Ke.value=se.value),tt.value=!1,Re.value=!0,Ue()},{deep:!0,immediate:!0}),e.watch(M,()=>{const u=S.value;u&&q(u)&&kr(u,M.value?"visible":"none")});const wt=()=>{ne.value=!0,Ue(),kt()},Fo=()=>{Ue()};e.watch(S,(u,O)=>{O&&(O.off("style.load",wt),O.off("load",wt),O.off("idle",Fo)),ne.value=!1,u&&(u.on("load",wt),u.on("style.load",wt),u.on("idle",Fo),typeof u.isStyleLoaded=="function"&&u.isStyleLoaded()&&wt())}),e.watch(x,u=>{!S.value||!u||Pt.value||L(u)}),e.watch(()=>n.zoom,u=>{!S.value||typeof u!="number"||R(u)}),e.onBeforeUnmount(()=>{D.value&&K&&K(D.value),J.value?Me(J.value):S.value&&Me(S.value);const u=S.value;u&&(gu(u),u.off("style.load",wt),u.off("load",wt),u.off("idle",Fo))});function vu(u){u&&(B.value=u)}function bu(u){M.value=u}j.setBasemap=vu,j.toggleGeometry=bu,j.setOverlays?.(He.value);function Po(u){if(!u)return null;if(u.type==="FeatureCollection")return u;if(u.type==="Feature")return{type:"FeatureCollection",features:[u]};const O=u.geometry??u;if(!O?.type)return null;if(O.type==="GeometryCollection"&&Array.isArray(O.geometries)){const U=O.geometries.filter(Y=>Y&&typeof Y.type=="string").map(Y=>({type:"Feature",geometry:Y}));return U.length?{type:"FeatureCollection",features:U}:null}if(O.type==="MultiPoint"&&Array.isArray(O.coordinates)){const U=O.coordinates.filter(Y=>Array.isArray(Y)&&Y.length>=2).map(Y=>({type:"Feature",geometry:{type:"Point",coordinates:Y}}));return U.length?{type:"FeatureCollection",features:U}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:O}]}}function xr(u){if(!u?.features?.length)return null;let O=1/0,U=1/0,Y=-1/0,Se=-1/0;const Ye=nn=>{if(typeof nn[0]=="number"){const[xt,Nr]=nn;O=Math.min(O,xt),U=Math.min(U,Nr),Y=Math.max(Y,xt),Se=Math.max(Se,Nr);return}nn.forEach(xt=>Ye(xt))};return u.features.forEach(nn=>{const xt=nn?.geometry?.coordinates;xt&&Ye(xt)}),O===1/0||U===1/0?null:[O,U,Y,Se]}return(u,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(We.value),style:e.normalizeStyle(z.value?void 0:w.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:v,class:e.normalizeClass(we.value)},null,2),e.createVNode(Ra,{items:je.value},null,8,["items"]),C("search")?(e.openBlock(),e.createBlock(tc,{key:0})):e.createCommentVNode("",!0),C("home")||C("fullscreen")?(e.openBlock(),e.createElementBlock("div",rc,[C("home")?(e.openBlock(),e.createElementBlock("div",ic,[e.createVNode(es,{center:ze.value,zoom:W.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(es,{key:0,"target-center":se.value,"target-zoom":W.value,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C("fullscreen")?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 pointer-events-auto",onClick:dt,"aria-label":z.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...O[0]||(O[0]=[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)])],8,lc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),pe.value?(e.openBlock(),e.createElementBlock("div",ac,[e.createElementVNode("button",{type:"button",class:"absolute top-2 right-2 h-6 w-6 flex items-center justify-center rounded-full text-slate-500 hover:text-slate-900","aria-label":"Закрити",onClick:Le},[...O[1]||(O[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",cc,e.toDisplayString(pe.value.title||"Об'єкт"),1),pe.value.html?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["text-[0.75rem] text-slate-700 leading-relaxed overflow-auto",`max-h-[calc(${w.value.height}-120px)]`]),innerHTML:pe.value.html},null,10,dc)):(e.openBlock(),e.createElementBlock("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.rows,U=>(e.openBlock(),e.createElementBlock("div",{key:U.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",pc,e.toDisplayString(U.label)+":",1),e.createElementVNode("span",uc,e.toDisplayString(U.value),1)]))),128))])),pe.value.actions?.length?(e.openBlock(),e.createElementBlock("div",mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.actions,U=>(e.openBlock(),e.createElementBlock("a",{key:U.url,class:"bg-sky-600 hover:bg-sky-700 transition-colors text-white font-semibold text-center py-[0.55rem] rounded-md w-full",href:U.url,target:U.target??void 0,rel:"noreferrer"},e.toDisplayString(U.label),9,hc))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Da),C("position")&&H.value?(e.openBlock(),e.createBlock(za,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:H.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});function qe(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const yc=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kn=()=>{},mn=()=>!1,Gn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),st=Object.assign,Xe=Array.isArray,ve=t=>typeof t=="string",Zn=t=>typeof t=="symbol",vc=t=>t!==null&&typeof t=="object",ts=qe(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),bc=qe("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Jn=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},kc=/-\w/g,rt=Jn(t=>t.replace(kc,n=>n.slice(1).toUpperCase())),Yn=Jn(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ec=Jn(t=>t?`on${Yn(t)}`:""),jt={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"NEED_HYDRATION",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"CACHED",[-2]:"BAIL"},wc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},xc=/;(?![^(]*\))/g,Nc=/:([^]+)/,Cc=/\/\*[^]*?\*\//g;function Sc(t){const n={};return t.replace(Cc,"").split(xc).forEach(o=>{if(o){const s=o.split(Nc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const _c="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Bc="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",$c="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",Tc="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Lc=qe(_c),Ac=qe(Bc),Ic=qe($c),Dc=qe(Tc);const Ht=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),Ut=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),hn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),ns=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),ft=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),os=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),ss=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),qt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),eo=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),rs=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),to=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),no=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),oo=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),so=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),ro=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),io=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),is=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),ls=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),gn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),yn=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),lo=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),ao=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Wt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Kt=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),co=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),fo=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),Oc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),po=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),vn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Mc=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),Rc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),uo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),Fc=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Pc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),mo=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),as=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),$t={[Ht]:"Fragment",[Ut]:"Teleport",[Xn]:"Suspense",[hn]:"KeepAlive",[ns]:"BaseTransition",[ft]:"openBlock",[os]:"createBlock",[ss]:"createElementBlock",[Qn]:"createVNode",[Vn]:"createElementVNode",[qt]:"createCommentVNode",[eo]:"createTextVNode",[rs]:"createStaticVNode",[to]:"resolveComponent",[no]:"resolveDynamicComponent",[oo]:"resolveDirective",[so]:"resolveFilter",[ro]:"withDirectives",[io]:"renderList",[is]:"renderSlot",[ls]:"createSlots",[gn]:"toDisplayString",[yn]:"mergeProps",[lo]:"normalizeClass",[ao]:"normalizeStyle",[Wt]:"normalizeProps",[Kt]:"guardReactiveProps",[co]:"toHandlers",[fo]:"camelize",[Oc]:"capitalize",[po]:"toHandlerKey",[vn]:"setBlockTracking",[Mc]:"pushScopeId",[Rc]:"popScopeId",[uo]:"withCtx",[Fc]:"unref",[Pc]:"isRef",[mo]:"withMemo",[as]:"isMemoSame"};function zc(t){Object.getOwnPropertySymbols(t).forEach(n=>{$t[n]=t[n]})}const Ae={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function jc(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Ae}}function Gt(t,n,o,s,r,l,i,a=!1,c=!1,d=!1,m=Ae){return t&&(a?(t.helper(ft),t.helper(At(t.inSSR,d))):t.helper(Lt(t.inSSR,d)),i&&t.helper(ro)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:d,loc:m}}function pt(t,n=Ae){return{type:17,loc:n,elements:t}}function Oe(t,n=Ae){return{type:15,loc:n,properties:t}}function me(t,n){return{type:16,loc:Ae,key:ve(t)?Q(t,!0):t,value:n}}function Q(t,n=!1,o=Ae,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function Fe(t,n=Ae){return{type:8,loc:n,children:t}}function ye(t,n=[],o=Ae){return{type:14,loc:o,callee:t,arguments:n}}function Tt(t,n=void 0,o=!1,s=!1,r=Ae){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function ho(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Ae}}function Hc(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Ae}}function Uc(t){return{type:21,body:t,loc:Ae}}function Lt(t,n){return t||n?Qn:Vn}function At(t,n){return t||n?os:ss}function go(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o(Lt(s,t.isComponent)),n(ft),n(At(s,t.isComponent)))}const cs=new Uint8Array([123,123]),ds=new Uint8Array([125,125]);function fs(t){return t>=97&&t<=122||t>=65&&t<=90}function Ie(t){return t===32||t===10||t===9||t===12||t===13}function it(t){return t===47||t===62||Ie(t)}function bn(t){const n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const ke={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class qc{constructor(n,o){this.stack=n,this.cbs=o,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=cs,this.delimiterClose=ds,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return this.mode===2&&this.stack.length===0}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=cs,this.delimiterClose=ds}getPos(n){let o=1,s=n+1;const r=this.newlines.length;let l=-1;if(r>100){let i=-1,a=r;for(;i+1<a;){const c=i+a>>>1;this.newlines[c]<n?i=c:a=c}l=i}else for(let i=r-1;i>=0;i--)if(n>this.newlines[i]){l=i;break}return l>=0&&(o=l+2,s=n-this.newlines[l]),{column:s,line:o,offset:n}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(n){n===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n))}stateInterpolationOpen(n){if(n===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const o=this.index+1-this.delimiterOpen.length;o>this.sectionStart&&this.cbs.ontext(this.sectionStart,o),this.state=3,this.sectionStart=o}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(n)):(this.state=1,this.stateText(n))}stateInterpolation(n){n===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(n))}stateInterpolationClose(n){n===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(n))}stateSpecialStartSequence(n){const o=this.sequenceIndex===this.currentSequence.length;if(!(o?it(n):(n|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!o){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(n)}stateInRCDATA(n){if(this.sequenceIndex===this.currentSequence.length){if(n===62||Ie(n)){const o=this.index-this.currentSequence.length;if(this.sectionStart<o){const s=this.index;this.index=o,this.cbs.ontext(this.sectionStart,o),this.index=s}this.sectionStart=o+2,this.stateInClosingTagName(n),this.inRCDATA=!1;return}this.sequenceIndex=0}(n|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===ke.TitleEnd||this.currentSequence===ke.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(n===60)}stateCDATASequence(n){n===ke.Cdata[this.sequenceIndex]?++this.sequenceIndex===ke.Cdata.length&&(this.state=28,this.currentSequence=ke.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(n))}fastForwardTo(n){for(;++this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);if(o===10&&this.newlines.push(this.index),o===n)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(n){n===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===ke.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):n!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(n,o){this.enterRCDATA(n,o),this.state=31}enterRCDATA(n,o){this.inRCDATA=!0,this.currentSequence=n,this.sequenceIndex=o}stateBeforeTagName(n){n===33?(this.state=22,this.sectionStart=this.index+1):n===63?(this.state=24,this.sectionStart=this.index+1):fs(n)?(this.sectionStart=this.index,this.mode===0?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:n===116?this.state=30:this.state=n===115?29:6):n===47?this.state=8:(this.state=1,this.stateText(n))}stateInTagName(n){it(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(it(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(bn("</"+o),0),this.handleTagName(n)}}handleTagName(n){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)}stateBeforeClosingTagName(n){Ie(n)||(n===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=fs(n)?9:27,this.sectionStart=this.index))}stateInClosingTagName(n){(n===62||Ie(n))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(n))}stateAfterClosingTagName(n){n===62&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(n){n===62?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):n===47?(this.state=7,process.env.NODE_ENV!=="production"&&this.peek()!==62&&this.cbs.onerr(22,this.index)):n===60&&this.peek()===47?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):Ie(n)||(process.env.NODE_ENV!=="production"&&n===61&&this.cbs.onerr(19,this.index),this.handleAttrStart(n))}handleAttrStart(n){n===118&&this.peek()===45?(this.state=13,this.sectionStart=this.index):n===46||n===58||n===64||n===35?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(n){n===62?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):Ie(n)||(this.state=11,this.stateBeforeAttrName(n))}stateInAttrName(n){n===61||it(n)?(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):process.env.NODE_ENV!=="production"&&(n===34||n===39||n===60)&&this.cbs.onerr(17,this.index)}stateInDirName(n){n===61||it(n)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===58?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):n===46&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(n){n===61||it(n)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===91?this.state=15:n===46&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(n){n===93?this.state=14:(n===61||it(n))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(n),process.env.NODE_ENV!=="production"&&this.cbs.onerr(27,this.index))}stateInDirModifier(n){n===61||it(n)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===46&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(n){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(n)}stateAfterAttrName(n){n===61?this.state=18:n===47||n===62?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)):Ie(n)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(n))}stateBeforeAttrValue(n){n===34?(this.state=19,this.sectionStart=this.index+1):n===39?(this.state=20,this.sectionStart=this.index+1):Ie(n)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(n))}handleInAttrValue(n,o){(n===o||this.fastForwardTo(o))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(o===34?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(n){this.handleInAttrValue(n,34)}stateInAttrValueSingleQuotes(n){this.handleInAttrValue(n,39)}stateInAttrValueNoQuotes(n){Ie(n)||n===62?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(n)):(process.env.NODE_ENV!=="production"&&n===34||n===39||n===60||n===61||n===96)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(n){n===91?(this.state=26,this.sequenceIndex=0):this.state=n===45?25:23}stateInDeclaration(n){(n===62||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(n){(n===62||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(n){n===45?(this.state=28,this.currentSequence=ke.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(n){(n===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(n){n===ke.ScriptEnd[3]?this.startSpecial(ke.ScriptEnd,4):n===ke.StyleEnd[3]?this.startSpecial(ke.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===ke.TitleEnd[3]?this.startSpecial(ke.TitleEnd,4):n===ke.TextareaEnd[3]?this.startSpecial(ke.TextareaEnd,4):(this.state=6,this.stateInTagName(n))}startEntity(){}stateInEntity(){}parse(n){for(this.buffer=n;this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);switch(o===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(o);break}case 2:{this.stateInterpolationOpen(o);break}case 3:{this.stateInterpolation(o);break}case 4:{this.stateInterpolationClose(o);break}case 31:{this.stateSpecialStartSequence(o);break}case 32:{this.stateInRCDATA(o);break}case 26:{this.stateCDATASequence(o);break}case 19:{this.stateInAttrValueDoubleQuotes(o);break}case 12:{this.stateInAttrName(o);break}case 13:{this.stateInDirName(o);break}case 14:{this.stateInDirArg(o);break}case 15:{this.stateInDynamicDirArg(o);break}case 16:{this.stateInDirModifier(o);break}case 28:{this.stateInCommentLike(o);break}case 27:{this.stateInSpecialComment(o);break}case 11:{this.stateBeforeAttrName(o);break}case 6:{this.stateInTagName(o);break}case 34:{this.stateInSFCRootTagName(o);break}case 9:{this.stateInClosingTagName(o);break}case 5:{this.stateBeforeTagName(o);break}case 17:{this.stateAfterAttrName(o);break}case 20:{this.stateInAttrValueSingleQuotes(o);break}case 18:{this.stateBeforeAttrValue(o);break}case 8:{this.stateBeforeClosingTagName(o);break}case 10:{this.stateAfterClosingTagName(o);break}case 29:{this.stateBeforeSpecialS(o);break}case 30:{this.stateBeforeSpecialT(o);break}case 21:{this.stateInAttrValueNoQuotes(o);break}case 7:{this.stateInSelfClosingTag(o);break}case 23:{this.stateInDeclaration(o);break}case 22:{this.stateBeforeDeclaration(o);break}case 25:{this.stateBeforeComment(o);break}case 24:{this.stateInProcessingInstruction(o);break}case 33:{this.stateInEntity();break}}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(this.state===1||this.state===32&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===19||this.state===20||this.state===21)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const n=this.buffer.length;this.sectionStart>=n||(this.state===28?this.currentSequence===ke.CdataEnd?this.cbs.oncdata(this.sectionStart,n):this.cbs.oncomment(this.sectionStart,n):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,n))}emitCodePoint(n,o){}}const Wc={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:t=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${t}.sync\` should be changed to \`v-model:${t}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function yo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function lt(t,n){const o=yo("MODE",n),s=yo(t,n);return o===3?s===!0:s!==!1}function It(t,n,o,...s){const r=lt(t,n);return process.env.NODE_ENV!=="production"&&r&&kn(t,n,o,...s),r}function kn(t,n,o,...s){if(yo(t,n)==="suppress-warning")return;const{message:l,link:i}=Wc[t],a=`(deprecation ${t}) ${typeof l=="function"?l(...s):l}${i?`
1
+ (function(ge,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],e):(ge=typeof globalThis<"u"?globalThis:ge||self,e(ge.WidgetLib={},ge.Vue,ge.OpenGISCore))})(this,(function(ge,e,xe){"use strict";function Cr(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Sr=Cr(e);const zo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_r=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Br=t=>{const n=_r(t);return n.charAt(0).toUpperCase()+n.slice(1)},$r=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var on={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Tr=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:l,class:i,...a},{slots:c})=>e.h("svg",{...on,width:t||on.width,height:t||on.height,stroke:s||on.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:$r("lucide",...l?[`lucide-${zo(Br(l))}-icon`,`lucide-${zo(l)}`]:["lucide-icon"]),...a},[...r.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);const ce=(t,n)=>(o,{slots:s})=>e.h(Tr,{...o,iconNode:n,name:t},s);const Lr=ce("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);const Ar=ce("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Ir=ce("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const jo=ce("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);const Dr=ce("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const Nt=ce("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Or=ce("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mr=ce("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Rr=ce("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);const Fr=ce("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const Pr=ce("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const Ho=ce("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const zr=ce("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);const jr=ce("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);const Uo=ce("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Hr=ce("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);const qo=ce("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const Ur=ce("sheet",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]);const qr=ce("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);const Rn=ce("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Wr=ce("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);const Fn=ce("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const Kr=ce("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);const Pn=ce("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Gr={class:"border-t pt-3 mt-4"},Zr={class:"flex gap-2"},Jr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Yr={class:"flex-1 space-y-2"},Xr={class:"flex justify-between items-center"},Qr={class:"flex gap-2"},Vr=["disabled"],Wo=e.defineComponent({__name:"CommentInputZone",props:{isReply:{type:Boolean,required:!1,default:!1},isReplyModifiers:{}},emits:e.mergeModels(["sendComment"],["update:isReply"]),setup(t,{emit:n}){const o=e.useModel(t,"isReply"),s=e.ref(""),r=n,l=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},i=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),l())};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Gr,[e.createElementVNode("div",Zr,[e.createElementVNode("span",Jr,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Yr,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>s.value=d),onKeydown:i,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,s.value]]),e.createElementVNode("div",Xr,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",Qr,[o.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:c[1]||(c[1]=d=>o.value=!1)},[e.createVNode(e.unref(Pn),{class:"h-3 w-3"}),c[2]||(c[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:!s.value.trim(),onClick:l},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,Vr)])])])])]))}}),ei={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"},ti=e.defineComponent({__name:"CommentDetails",props:{showMoreOptions:{type:Boolean,required:!0,default:!1},showMoreOptionsModifiers:{}},emits:e.mergeModels(["edit","delete"],["update:showMoreOptions"]),setup(t,{emit:n}){const o=n,s=e.useModel(t,"showMoreOptions"),r=e.ref(),l=e.ref(!0),i=async d=>{s.value&&r.value&&!r.value.contains(d.target)&&!l.value&&(s.value=!1),l.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return e.onMounted(()=>{document.addEventListener("click",i)}),e.onUnmounted(()=>{document.removeEventListener("click",i)}),(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute bg-white left-0 top-full transform min-w-max z-50",ref_key:"moreOptionsRef",ref:r},[e.createElementVNode("div",ei,[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:a},[e.createVNode(e.unref(qr),{class:"h-3 w-3 mr-2"}),m[0]||(m[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:c},[e.createVNode(e.unref(Rn),{class:"h-3 w-3 mr-2"}),m[1]||(m[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),ni={class:"space-y-2"},oi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},si={class:"flex-1 min-w-0 space-y-1 relative"},ri={class:"flex items-center gap-2"},ii={class:"font-medium text-xs"},li={class:"text-xs text-gray-500"},ai={key:0,class:"text-xs text-gray-700 leading-relaxed"},ci={class:"flex justify-between text-xs"},di={class:"flex items-center gap-2"},fi={key:0,class:"flex gap-2"},pi=["disabled"],ui={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},mi=e.defineComponent({__name:"CommentItem",props:{comment:{},isInside:{type:Boolean}},emits:["like","reply","edit","delete"],setup(t,{emit:n}){const o=n,s=t,r=e.ref(s.comment.text),l=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),i=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"),a=e.ref(!1),c=e.ref(!1),d=e.ref(!1),m=e.ref(!1),f=x=>{const E=new Date,j=Math.floor((E.getTime()-x.getTime())/(1e3*60*60));return j<1?`${Math.floor((E.getTime()-x.getTime())/6e4)}m`:j<24?`${j}h`:`${Math.floor(j/24)}d`},g=()=>{m.value=!m.value,m.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},b=()=>{o("edit",s.comment.id,r.value),d.value=!1},k=(x,E)=>{o("like",x,E)},v=(x,E)=>{o("edit",x,E)};return(x,E)=>{const j=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",ni,[e.createElementVNode("div",{class:e.normalizeClass(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",d.value?"bg-gray-50":""])},[e.createElementVNode("span",oi,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",si,[e.createElementVNode("div",ri,[e.createElementVNode("span",ii,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",li,e.toDisplayString(f(t.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":E[0]||(E[0]=S=>r.value=S),class:e.normalizeClass(d.value?i.value:l.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",ai,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",ci,[e.createElementVNode("div",di,[e.createElementVNode("button",{class:e.normalizeClass(["flex items-center gap-1",m.value?"text-blue-600":"text-gray-500 hover:text-blue-600 transition-colors"]),onClick:E[1]||(E[1]=S=>g())},[e.createVNode(e.unref(Rr),{class:e.normalizeClass(["h-3 w-3",m.value?"fill-blue-600":""])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.comment?.likes),1)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-gray-500 hover:text-blue-600 transition-colors",onClick:E[2]||(E[2]=S=>c.value=!0)},[e.createVNode(e.unref(Hr),{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:E[3]||(E[3]=S=>a.value=!0)},[e.createVNode(e.unref(Dr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",fi,[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:E[4]||(E[4]=S=>d.value=!1)},[e.createVNode(e.unref(Pn),{class:"h-3 w-3"}),E[11]||(E[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:!r.value.trim(),onClick:E[5]||(E[5]=S=>b())},[e.createVNode(e.unref(qo),{class:"h-3 w-3 mr-1"}),E[12]||(E[12]=e.createTextVNode(" Send ",-1))],8,pi)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(ti,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":E[6]||(E[6]=S=>a.value=S),onEdit:E[7]||(E[7]=S=>d.value=!0),onDelete:E[8]||(E[8]=S=>x.$emit("delete",t.comment?.id)),comment:t.comment},null,8,["showMoreOptions","comment"])):e.createCommentVNode("",!0)],2),t.isInside?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ui,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,S=>(e.openBlock(),e.createBlock(j,{key:S.id,comment:S,isInside:!0,onDelete:L=>x.$emit("delete",S.id),onLike:k,onEdit:v},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(Wo,{key:0,onSendComment:E[9]||(E[9]=S=>x.$emit("reply",t.comment?.id,S)),isReply:c.value,"onUpdate:isReply":E[10]||(E[10]=S=>c.value=S)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),hi=["id"],gi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},sn=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(t,{emit:n}){const o=t,s=n,r=e.ref(o.comments??[]);async function l(){if(!o.id)return;const f=await fetch(`/api/widget/comment/${o.id}`).then(g=>g.json());r.value=f.rows.map(g=>({id:g.communication_id,author:g.username,text:g.body,createdAt:new Date(g.cdate)}))}r.value.length===0&&l();const i=async f=>{o.onAddComment?o.onAddComment(f):o.id&&(await fetch(`/api/widget/comment/${o.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:f})}),await l()),s("add",f)},a=(f,g)=>{o?.onLike?.(f,g),s("like",f,g)},c=(f,g)=>{o.onReply?.(f,g),s("reply",f,g)},d=async(f,g)=>{o.onEdit?o.onEdit(f,g):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:g})}),await l()),s("edit",f,g)},m=async f=>{o.onDelete?o.onDelete(f):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"DELETE"}),await l()),s("delete",f)};return(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mx-auto font-sans",t.className]),id:t.id,style:e.normalizeStyle(t.style)},[t.title?(e.openBlock(),e.createElementBlock("h3",gi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([t.maxHeight?"overflow-y-auto":"","space-y-3"]),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,b=>(e.openBlock(),e.createBlock(mi,{key:b.id,comment:b,onReply:c,onLike:a,onDelete:g[0]||(g[0]=k=>m(k)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Wo,{onSendComment:g[1]||(g[1]=b=>i(b))})],14,hi))}}),Ko=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Nt}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ur}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Wr}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:Fr}]]),yi={class:"mx-auto font-sans"},vi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},bi={class:"relative"},ki={class:"space-y-3"},Ei={class:"flex-1 min-w-0 pb-2"},wi={class:"flex items-center gap-1.5 mb-1 mt-0.5"},xi={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Ni={class:"font-medium text-xs"},Ci={class:"text-xs text-gray-500"},Si={class:"space-y-1"},_i={class:"text-xs text-gray-700"},Bi={class:"capitalize mr-1"},$i={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"},Ti={key:0,class:"flex items-center gap-1 text-xs"},Li={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Ai={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},rn=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.ref(Array.isArray(n.data)?n.data:[]);o.value.length===0&&n.id&&s();async function s(){const r=await fetch(`/api/widget/history/${n.id}`);if(!r.ok)return{data:[]};const l=await r.json();l.rows.forEach(i=>{i.timestamp=new Date(i.cdate),i.id=i.entity_id,i.entityType=i.entity_type,i.entityId=i.entity_id,i.action=i.change_type,i.userId=i.change_user_id,i.userName=i.username,i.timestamp=new Date(i.cdate),i.description=i.username,i.status=i.username}),o.value=l.rows}return(r,l)=>(e.openBlock(),e.createElementBlock("div",yi,[t.title?(e.openBlock(),e.createElementBlock("h3",vi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[e.createElementVNode("div",bi,[l[0]||(l[0]=e.createElementVNode("div",{class:"absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),e.createElementVNode("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"relative flex items-start gap-2",key:i?.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(Ko).get(i?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Ko).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",Ei,[e.createElementVNode("div",wi,[e.createElementVNode("span",xi,[e.createVNode(e.unref(Fn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",Ni,e.toDisplayString(i?.userName),1),e.createElementVNode("span",Ci,e.toDisplayString(i?.timestamp.toLocaleDateString("ua-UA",{day:"2-digit",month:"2-digit",year:"numeric"}))+" "+e.toDisplayString(i?.timestamp.toLocaleTimeString("ua-UA",{hour:"2-digit",minute:"2-digit"})),1)]),e.createElementVNode("div",Si,[e.createElementVNode("div",_i,[e.createElementVNode("span",Bi,e.toDisplayString(i?.action),1),i?.entityId?(e.openBlock(),e.createElementBlock("span",$i,e.toDisplayString(i?.entityId),1)):e.createCommentVNode("",!0)]),i?.changes?.[i?.entityId]?(e.openBlock(),e.createElementBlock("div",Ti,[i?.changes?.[i?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",Li,e.toDisplayString(i?.changes?.[i?.entityId]?.old),1)):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.old&&i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createBlock(e.unref(Ar),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Ai,e.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Ii={key:0,class:"text-xl font-semibold"},Di={class:"flex gap-1"},Oi={key:0},Mi=["accept"],Ri={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"},Fi=e.defineComponent({__name:"FileHeader",props:e.mergeModels({editable:{type:Boolean,default:!0},title:{},accept:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["onAddFile"],["update:modelValue"]),setup(t){const n=e.useModel(t,"modelValue"),o={active:"bg-blue-100 text-black hover:bg-blue-100",inactive:"bg-white text-black hover:bg-blue-100"};return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",Ii,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Di,[e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="list"?o.active:o.inactive]),onClick:r[0]||(r[0]=l=>n.value="list")},[e.createVNode(e.unref(zr),{class:"h-4 w-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2",n.value==="grid"?o.active:o.inactive]),onClick:r[1]||(r[1]=l=>n.value="grid")},[e.createVNode(e.unref(Mr),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Oi,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,40,Mi),e.createElementVNode("div",Ri,[e.createVNode(e.unref(Uo),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),zn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Nt,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Or,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Kr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Nt,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:Lr,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Ho,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Nt,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Nt,label:"PPT"}};function Go(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function Zo(t){if(t===0)return"0 B";const n=1024,o=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,s)).toFixed(1))} ${o[s]}`}const Pi={class:"space-y-0.5"},zi=["onClick"],ji=["onClick"],Hi={class:"flex items-center gap-2"},Ui={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},qi={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Wi={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Ki={class:"flex items-center gap-1"},Gi=["onClick"],Zi=["onClick"],Ji=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,s=>(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:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["stop"])},[e.createElementVNode("div",{class:e.normalizeClass(["p-1 rounded",e.unref(zn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(zn)[s?.ext]?.icon||e.unref(zn).pdf.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:r=>n.$emit("openLightbox",s)},[e.createElementVNode("div",Hi,[e.createElementVNode("span",Ui,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,ji),e.createElementVNode("div",qi,e.toDisplayString(e.unref(Zo)(s.size)),1),e.createElementVNode("div",Wi,e.toDisplayString(e.unref(Go)(s.createdAt)),1),e.createElementVNode("div",Ki,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["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(jo),{class:"h-3 w-3"})],8,Gi),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(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Rn),{class:"h-3 w-3"})],8,Zi)])],8,zi))),128))]))}}),Yi={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Xi=["onClick"],Qi={class:"space-y-2"},Vi={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},el=["src"],tl={class:"space-y-1"},nl=["title"],ol={class:"text-xs text-gray-500 text-left"},sl={class:"absolute top-2 right-1 flex items-center gap-1"},rl=["onClick"],il=["onClick"],ll=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.files,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onClick:e.withModifiers(r=>n.$emit("openLightbox",s),["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",Qi,[e.createElementVNode("div",Vi,[s.ext==="png"||s.ext==="jpg"||s.ext==="jpeg"||s.ext==="gif"||s.ext==="svg"||s.ext==="webp"?(e.openBlock(),e.createElementBlock("img",{key:0,src:`/file/resize?filepath=${s?.file_path}&w=500`,alt:"file",class:"w-full h-full object-cover"},null,8,el)):(e.openBlock(),e.createBlock(e.unref(Nt),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",tl,[e.createElementVNode("h3",{class:"font-medium text-xs leading-tight text-left",title:s.uploaded_name||s.name},e.toDisplayString(s.uploaded_name||s.name),9,nl),e.createElementVNode("p",ol,e.toDisplayString(e.unref(Go)(s.createdAt))+", "+e.toDisplayString(e.unref(Zo)(s.size)),1)])]),e.createElementVNode("div",sl,[e.createElementVNode("button",{onClick:e.withModifiers(r=>n.$emit("download",s),["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(jo),{class:"h-3 w-3"})],8,rl),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(r=>n.$emit("delete",r,s?.file_id),["stop"])},[e.createVNode(e.unref(Rn),{class:"h-3 w-3"})],8,il)])],8,Xi))),128))]))}}),al={class:"mx-auto font-sans"},cl={key:1},ln=e.defineComponent({__name:"FilesWidget",props:{title:{},view:{},files:{default:()=>[]},format:{default:()=>[]},editable:{type:Boolean,default:!0},maxHeight:{},onAddFile:{},id:{},className:{},style:{},onDelete:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=e.ref(!1),r=e.ref(null),l=e.ref(!1),i=e.ref(0),a=e.ref(o.files??[]),c=e.computed(()=>{const h=(o.format??[]).map(F=>typeof F=="string"?F.trim():F==null?"":String(F).trim()).filter(F=>F.length>0),T=[];return h.forEach(F=>{const P=F.toLowerCase(),K=P.indexOf("/"),Z=K>=0;let B,M=!1,w;if(Z){B=P;const ne=P.slice(K+1);M=ne==="*",!M&&ne&&(w=`.${ne.replace(/^\.+/,"")}`)}else w=P.startsWith(".")?P:`.${P.replace(/^\.+/,"")}`;const z=Z?B:w??"";z&&T.push({acceptValue:z,mime:B,wildcard:M,extension:w})}),T.length?T:null}),d=e.computed(()=>{const A=c.value;if(!A)return;const h=A.map(T=>T.acceptValue).filter(Boolean);return h.length?h.join(","):void 0}),m=A=>{if(!c.value)return!0;const h=A.type?.toLowerCase(),T=A.name?.toLowerCase();return c.value.some(F=>{if(F.mime){if(h){if(F.wildcard){const P=F.mime.split("/")[0];if(h.startsWith(`${P}/`))return!0}else if(h===F.mime)return!0}return!!(F.extension&&T?.endsWith(F.extension))}return!!(F.extension&&T?.endsWith(F.extension))})},f=n;a.value.length===0&&L();const g=(A,h)=>{r.value=h,s.value=!0},b=()=>{r.value&&(E(r.value),r.value=null,s.value=!1)},k=e.computed(()=>Array.isArray(a.value)?a.value.map(A=>A?.file_path):[]),v=A=>{const h=k.value.findIndex(T=>T===A.file_path);h!==-1&&(l.value=!0,i.value=h)},x=A=>{o.onAddFile?o.onAddFile(A):R(A),f("add",A)},E=A=>{o.onDelete?o.onDelete(A):I(A),f("delete",A)},j=A=>{const h=document.createElement("a");h.setAttribute("download",A?.uploaded_name||A?.name),h.href=A?.file_path||A?.path,h.click()},S=e.ref("list");async function L(){if(!o.id)return;const A=await fetch(`/api/widget/file/${o.id}`).then(h=>h.json());A.rows.forEach(h=>{h.timestamp=new Date(h.cdate),h.id=h.entity_id,h.entityType=h.entity_type,h.entityId=h.entity_id,h.entityType=h.entity_type,h.action=h.change_type,h.userId=h.change_user_id,h.userName=h.username,h.timestamp=new Date(h.cdate),h.description=h.username,h.status=h.username}),a.value=A.rows}const R=async A=>{const T=A.target?.files;if(!T||T.length===0)return;const F=Array.from(T),P=[],K=[];if(F.forEach(Z=>{m(Z)?P.push(Z):K.push(Z)}),K.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${K.map(Z=>Z.name).join(", ")}`),P.length!==0)try{await Promise.all(P.map(async Z=>{const B=new FormData;B.append("file",Z);const M=`/api/widget/file/${o.id}`,w=await fetch(M,{method:"POST",body:B});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);return Z})),await L()}catch(Z){console.error("Помилка при завантаженні файлів:",Z)}},I=async A=>{try{await fetch(`/api/widget/file/${o.id}/${A}`,{method:"DELETE"}),await L()}catch(h){console.error(h)}};return(A,h)=>{const T=e.resolveComponent("MessageBox"),F=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",al,[e.createVNode(Fi,{modelValue:S.value,"onUpdate:modelValue":h[0]||(h[0]=P=>S.value=P),title:o.title,onOnAddFile:h[1]||(h[1]=P=>x(P)),editable:o.editable,accept:d.value},null,8,["modelValue","title","editable","accept"]),a.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[S.value==="list"?(e.openBlock(),e.createBlock(Ji,{key:0,onDelete:g,onDownload:j,onOpenLightbox:h[2]||(h[2]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),S.value==="grid"?(e.openBlock(),e.createBlock(ll,{key:1,onDelete:g,onDownload:j,onOpenLightbox:h[3]||(h[3]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",cl,[...h[6]||(h[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),e.createVNode(T,{modelValue:s.value,"onUpdate:modelValue":h[4]||(h[4]=P=>s.value=P),onConfirm:b,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(F,{modelValue:l.value,"onUpdate:modelValue":h[5]||(h[5]=P=>l.value=P),images:k.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),dl={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},fl=["onClick"],pl={key:0,rel:"noreferrer",class:"relative block h-full w-full"},ul=["src"],ml={key:0,class:"thumb-cover"},hl=e.defineComponent({__name:"GalleryContent",props:{title:{},items:{},columns:{},maxHeight:{},format:{},onAddImage:{type:Function},onDelete:{type:Function},id:{},className:{},style:{}},emits:["delete"],setup(t,{emit:n}){const o=n,s=e.ref(!1),r=e.ref(0),l=t,i=e.computed(()=>Array.isArray(l.items)?l.items.map(c=>c?.file_path):[]),a=c=>{const d=i.value.findIndex(m=>m===c.file_path);d!==-1&&(s.value=!0,r.value=d)};return(c,d)=>{const m=e.resolveComponent("Lightbox");return t.items?.length>=1?(e.openBlock(),e.createElementBlock("div",dl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+g,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:g,onClick:e.withModifiers(b=>a(f),["stop"])},[g<5?(e.openBlock(),e.createElementBlock("div",pl,[e.createElementVNode("img",{src:`/file/resize?filepath=${f?.file_path}&w=500`,alt:"alt",height:"auto",width:"100%",class:e.normalizeClass(["object-cover h-full w-full bg-gray-200 rounded-[3px]",g===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,ul),g===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",ml," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,fl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Math.max(0,5-t.items.length),f=>(e.openBlock(),e.createElementBlock("div",{key:"empty-"+f,class:e.normalizeClass(["h-full w-full image"+(t.items.length+f-1),"bg-gray-300 rounded-[3px]"])},null,2))),128)),e.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),images:i.value,"start-index":r.value,delete:"true",download:"true",onDelete:d[1]||(d[1]=f=>o("delete",f))},null,8,["modelValue","images","start-index"])])):e.createCommentVNode("",!0)}}}),gl={key:0,class:"text-xl font-semibold"},yl={class:"flex gap-1"},vl=["accept"],bl={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"},kl=e.defineComponent({__name:"widgetHeader",props:{title:{},accept:{}},emits:["onAddImage"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col sm:flex-row gap-3 mb-4",t.title?"justify-between sm:items-center":"justify-end sm:items-center"])},[t.title?(e.openBlock(),e.createElementBlock("h3",gl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",yl,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",accept:t.accept??"image/*",class:"hidden",onChange:o[0]||(o[0]=s=>n.$emit("onAddImage",s)),multiple:""},null,40,vl),e.createElementVNode("div",bl,[e.createVNode(e.unref(Uo),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),El={class:"w-full mx-auto font-sans",ref:"containerRef"},wl={key:1},an=e.defineComponent({__name:"GalleryWidget",props:{title:{},items:{default:()=>[]},columns:{},maxHeight:{},format:{},onAddImage:{},onDelete:{},id:{},className:{},style:{}},emits:["delete","add","openLightbox"],setup(t,{emit:n}){const o=t,s=L=>{if(!L)return[];const R=Array.isArray(L)?L:L.split(",");return Array.from(new Set(R.map(I=>I.trim().replace(/^\./,"").toLowerCase()).filter(Boolean)))},r=["jpg","jpeg","png","gif","webp","bmp","svg","avif","heic","tiff"],l=e.computed(()=>{const L=s(o.format);return L.length>0?L:void 0}),i=e.computed(()=>{const L=l.value;return!L||L.length===0?"image/*":L.map(R=>R.startsWith(".")?R:`.${R}`).join(",")}),a=L=>L?.split(".").pop()?.toLowerCase()??"",c=L=>{const R=L?.toLowerCase();return!!R&&!!l.value&&l.value.includes(R)},d=L=>{const R=L?.toLowerCase();return!!R&&r.includes(R)},m=L=>{const R=L.type?.toLowerCase(),I=L.ext?.toLowerCase();return R?.startsWith("image/")?l.value?c(I):!0:I?l.value?c(I):d(I):!1},f=L=>{if(!L.type?.toLowerCase()?.startsWith("image/"))return!1;if(!l.value)return!0;const I=a(L.name);return c(I)},g=L=>L.filter(m),b=e.ref(g(o.items??[])),k=n;b.value.length===0&&j();const v=L=>{o.onAddImage?o.onAddImage(L):E(L),k("add",L)},x=L=>{const R=b.value.find(I=>I.file_path===L)?.file_id;R&&(o.onDelete?o.onDelete(R):S(R))},E=async L=>{const R=L.target;if(!R?.files||R.files.length===0)return;const I=Array.from(R.files),A=I.filter(T=>f(T)),h=l.value?.join(", ")??"image/*";if(A.length===0){console.warn(`Допустимі формати: ${h}. Завантажте зображення дозволеного типу.`);return}A.length!==I.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${h}.`);try{await Promise.all(A.map(async T=>{const F=new FormData;F.append("file",T);const P=`/api/widget/file/${o.id}`,K=await fetch(P,{method:"POST",body:F});if(!K.ok)throw new Error(`HTTP error! status: ${K.status}`);return T})),await j()}catch(T){console.error("Помилка при завантаженні файлів:",T)}};async function j(){if(!o.id)return;const L=await fetch(`/api/widget/file/${o.id}`).then(R=>R.json());b.value=g(L.rows)}const S=async L=>{try{await fetch(`/api/widget/file/${o.id}/${L}`,{method:"DELETE"}),await j()}catch(R){console.error(R)}};return(L,R)=>(e.openBlock(),e.createElementBlock("div",El,[e.createVNode(kl,{title:t.title,accept:i.value,onOnAddImage:R[0]||(R[0]=I=>v(I))},null,8,["title","accept"]),b.value.length>0?(e.openBlock(),e.createBlock(hl,{key:0,items:b.value,onDelete:R[1]||(R[1]=I=>x(I))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",wl,[...R[2]||(R[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),xl={class:"text-value"},Nl={class:"text-sm text-gray-900"},Cl=e.defineComponent({__name:"TextValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;return typeof s=="boolean"?s?"Так":"Ні":s==null?"—":String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",xl,[e.createElementVNode("span",Nl,e.toDisplayString(o.value),1)]))}}),nt=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},Sl=nt(Cl,[["__scopeId","data-v-34a76c89"]]),_l={class:"link-value"},Bl=["href"],$l=nt(e.defineComponent({__name:"LinkValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=String(n.item.value);try{const r=new URL(s);return r.hostname+r.pathname}catch{return s}});return(s,r)=>(e.openBlock(),e.createElementBlock("div",_l,[e.createElementVNode("a",{href:String(t.item.value),target:"_blank",rel:"noopener noreferrer",class:"text-blue-600 hover:text-blue-800 underline text-sm"},[e.createTextVNode(e.toDisplayString(o.value)+" ",1),r[0]||(r[0]=e.createElementVNode("i",{class:"fas fa-external-link-alt ml-1 text-xs"},null,-1))],8,Bl)]))}}),[["__scopeId","data-v-932f028c"]]),Tl={class:"date-value"},Ll={class:"text-sm text-gray-900"},Al=nt(e.defineComponent({__name:"DateValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{const s=n.item.value;if(s instanceof Date)return s.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});if(typeof s=="string"){const r=new Date(s);if(!isNaN(r.getTime()))return r.toLocaleDateString("uk-UA",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}return String(s)});return(s,r)=>(e.openBlock(),e.createElementBlock("div",Tl,[e.createElementVNode("span",Ll,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),Il={class:"status-value"},Dl={key:0,class:"mr-1"},Ol=nt(e.defineComponent({__name:"StatusValue",props:{item:{}},setup(t){const n=t,o=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"bg-green-100 text-green-800";case"inactive":case"неактивний":case"pending":case"очікує":return"bg-yellow-100 text-yellow-800";case"error":case"помилка":case"failed":case"неуспішно":return"bg-red-100 text-red-800";case"draft":case"чернетка":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}}),s=e.computed(()=>{switch(String(n.item.value).toLowerCase()){case"active":case"активний":case"успішно":case"success":return"fas fa-check-circle";case"inactive":case"неактивний":case"pending":case"очікує":return"fas fa-clock";case"error":case"помилка":case"failed":case"неуспішно":return"fas fa-exclamation-circle";case"draft":case"чернетка":return"fas fa-edit";default:return"fas fa-info-circle"}});return(r,l)=>(e.openBlock(),e.createElementBlock("div",Il,[e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",o.value])},[s.value?(e.openBlock(),e.createElementBlock("span",Dl,[e.createElementVNode("i",{class:e.normalizeClass(s.value)},null,2)])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(String(t.item.value)),1)],2)]))}}),[["__scopeId","data-v-aea1f529"]]),Ml={class:"custom-value"},Rl={class:"text-sm text-gray-900"},Fl=nt(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ml,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Rl,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),Pl=["id"],zl={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},jl={key:1,class:"overflow-x-auto"},Hl={class:"min-w-full divide-y divide-gray-200"},Ul={class:"bg-white divide-y divide-gray-200"},ql={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Wl={class:"flex items-center gap-2"},Kl=["title"],Gl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Zl={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Jl={class:"flex items-start gap-3"},Yl={key:0,class:"flex-shrink-0"},Xl={class:"flex-1 min-w-0"},Ql={class:"flex items-center gap-2 mb-2"},Vl={class:"text-sm font-medium text-gray-900"},ea=["title"],ta={key:3,class:"overflow-x-auto"},na={class:"min-w-full divide-y divide-gray-200"},oa={class:"bg-white divide-y divide-gray-200"},sa={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},ra={class:"flex items-center gap-2"},ia=["title"],la={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},jn=nt(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return $l;case"date":return Al;case"status":return Ol;case"custom":return Fl;default:return Sl}};return(o,s)=>(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",zl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",jl,[e.createElementVNode("table",Hl,[e.createElementVNode("tbody",Ul,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",ql,[e.createElementVNode("div",Wl,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[0]||(s[0]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,Kl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Gl,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",Zl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id||r.label,class:"description-item-card bg-white border border-gray-200 rounded-lg p-4"},[e.createElementVNode("div",Jl,[r.icon?(e.openBlock(),e.createElementBlock("div",Yl,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xl,[e.createElementVNode("div",Ql,[e.createElementVNode("h4",Vl,e.toDisplayString(r.label),1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[1]||(s[1]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,ea)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",ta,[e.createElementVNode("table",na,[e.createElementVNode("tbody",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createElementBlock("tr",{key:r.id||r.label},[e.createElementVNode("td",sa,[e.createElementVNode("div",ra,[r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([r.icon,"text-gray-500"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.label)+" ",1),r.tooltip?(e.openBlock(),e.createElementBlock("span",{key:1,class:"text-gray-400 cursor-help",title:r.tooltip},[...s[2]||(s[2]=[e.createElementVNode("i",{class:"fas fa-info-circle text-xs"},null,-1)])],8,ia)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",la,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Pl))}}),[["__scopeId","data-v-106790ef"]]);function Jo(t){return new Promise((n,o)=>{if(typeof document>"u"){o(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(l=>l.src===t)){n();return}const r=document.createElement("script");r.src=t,r.async=!0,r.onload=()=>n(),r.onerror=()=>o(new Error(`Failed to load ${t}`)),document.body.appendChild(r)})}function aa(t){if(typeof document>"u"||Array.from(document.styleSheets||[]).some(s=>s.href===t))return;const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}const ca="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Hn=null;function da(){if(typeof window>"u")return;const t=window.IMask;if(typeof t=="function")return t;if(t&&typeof t.default=="function")return t.default}function fa(){return Hn||(Hn=Jo(ca).then(()=>{const t=da();if(!t)throw new Error("IMask is not available after loading the script");return t})),Hn}function pa(){return typeof window>"u"?"":window.location?.origin??""}function Yo(){if(!(typeof window>"u"))return window.maplibregl}const Xo=Symbol("vs-widget-map");function Un(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function ua(t){const n=['<div class="map-popup">'];return n.push('<div class="map-popup__body">'),t.forEach(o=>{n.push(`<div class="flex flex-col"><span class="font-bold text-slate-700">${o.label}: </span><span class="text-slate-700">${o.value}</span></div>`)}),n.push("</div></div>"),n.join("")}function ma(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function qn(t){if(!t)return"";const n=t.trim();if(!n)return"";const s=n.replace(/\\n/g,"").replace(/\\r/g,"").replace(/\\t/g,"").replace(/\s+/g,"");if(!s)return"";if(/^https?:\/\//i.test(s))return s;const r=pa(),l=s.replace(/^\/+/,"");return r?`${r}/${l}`:l?`/${l}`:""}function ha(t){const n=(t?.service??"").toLowerCase();if(n)return n;const o=(t?.url??"").toLowerCase();return/(\.mvt|\.pbf|\.vtile|\.vmt)(\?|$)/.test(o)?"vtile":/(\.png|\.jpg|\.jpeg|\.webp)(\?|$)/.test(o)?"raster":/service=wms|request=getmap|\/(wms|ows)(\?|$)/.test(o)?"wms":""}function ga(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function cn(t){if(t!=null){if(typeof t=="number")return t;if(typeof t=="string"){const n=t.trim();if(!n)return;const o=Number(n);return Number.isFinite(o)?o:void 0}}}const Qo=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function ya(t){const n=t?.color??Qo[0],o=(t?.colorAttr??"").trim();if(!o)return n;const s=t?.colorSet&&Object.keys(t.colorSet).length>0,r={};if(s&&t?.colorSet?Object.entries(t.colorSet).forEach(([i,a])=>{const c=typeof a=="string"?a.trim():"",d=String(i).trim();c&&d&&(r[d]=c)}):Qo.forEach((i,a)=>{r[String(a+1)]=i}),!Object.keys(r).length)return n;const l=["match",["to-string",["coalesce",["get",o],""]]];return Object.entries(r).forEach(([i,a])=>{l.push(String(i),a)}),l.push(n),l}const zt="map-highlight-source",va="map-highlight-fill",ba="map-highlight-line";function ka(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function Vo(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function Ea(){return aa("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Jo("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),Yo()}function dn(t){const n=e.inject(Xo,void 0);if(!t){if(!n)throw new Error("useMap() must be called inside a map provider");return n}if(n)return n;const o=e.ref(null),s=e.ref(!1),r=e.ref({selectedBasemap:"",geometryVisible:!0,overlays:[]}),l=e.ref([]),i=e.ref([]),a=e.ref(null),c=e.ref(null),d=e.ref(null);let m=t.style??null,f=null;const g=p=>{p&&(o.value?o.value.setStyle(p):m=p)},b=()=>{r.value.overlays=i.value.map(p=>({id:p.id,name:p.config.name,visible:p.visible}))},k=p=>{const C=Array.isArray(p)?p:[];l.value=C,C.some(H=>H.key===r.value.selectedBasemap)||(r.value.selectedBasemap=C[0]?.key??"")},v=p=>{p&&i.value.forEach(C=>{C.layerIds.forEach(D=>{p.getLayer(D)&&p.removeLayer(D)}),p.getSource(C.sourceId)&&p.removeSource(C.sourceId),C.layerIds=[]})},x=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||(i.value.forEach(C=>{E(p,C)}),P())},E=(p,C)=>{const D=ha(C.config);D==="vtile"?S(p,C):D==="raster"&&j(p,C)},j=(p,C)=>{const D=C.config,H=C.sourceId,J=qn(D.url);if(!J)return;p.getSource(H)||p.addSource(H,{type:"raster",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const q=`${C.id}-raster`;p.getLayer(q)||p.addLayer({id:q,type:"raster",source:H,layout:{visibility:C.visible?"visible":"none"}}),C.layerIds=[q],L(p,C)},S=(p,C)=>{const D=C.config,H=C.sourceId,J=qn(D.url);if(!J)return;p.getSource(H)||p.addSource(H,{type:"vector",tiles:[J],minzoom:D.minzoom??0,maxzoom:D.maxzoom??24});const q=D.style??{},le=ya(q),he=[],ie={visibility:C.visible?"visible":"none"},et=ga(D),Me={source:H,layout:ie};if(et&&(Me["source-layer"]=et),(q.type??"polygon").toLowerCase()==="point"){const je=`${C.id}-circle`;p.getLayer(je)||p.addLayer({id:je,type:"circle",...Me,paint:{"circle-color":le,"circle-opacity":q.opacity??1,"circle-radius":q.radius??q.width??3,"circle-stroke-color":q.stroke??q.color??"#ffffff","circle-stroke-width":q.width??1}}),he.push(je);const He=q.text??q.label;if(He){const vt=`${C.id}-symbol`,tn=cn(q.textSize)??10,Mt=q.textHaloColor??q.stroke??"#ffffff",Rt=cn(q.textHaloWidth)??1,bt=cn(q.textZoom??q.pointZoom),Ft={"text-color":q.textColor??"#000000","text-halo-color":Mt,"text-halo-width":Rt},Je={id:vt,type:"symbol",...Me,layout:{"text-field":["coalesce",["get",He],""],"text-size":tn,"text-anchor":"top"},paint:Ft};bt!=null&&(Je.minzoom=bt),p.getLayer(vt)||p.addLayer(Je),he.push(vt)}}else{const je=`${C.id}-fill`;p.getLayer(je)||p.addLayer({id:je,type:"fill",...Me,paint:{"fill-color":le,"fill-opacity":q.opacity??.5,"fill-outline-color":q.stroke??q.color??"#0ea5e9"}}),he.push(je);const He=`${C.id}-line`;p.getLayer(He)||p.addLayer({id:He,type:"line",...Me,paint:{"line-color":q.stroke??q.color??"#0b74c4","line-width":cn(q.width??q.border)??1,"line-opacity":q.opacity??1}}),he.push(He)}C.layerIds=he,L(p,C)},L=(p,C)=>{const D=C.visible?"visible":"none";C.layerIds.forEach(H=>{p.getLayer(H)&&p.setLayoutProperty(H,"visibility",D)})},R=p=>{const C=Array.isArray(p)?p:[];v(o.value??void 0),d.value=null,B();const D=C.map((H,J)=>{if(!H)return null;const q=qn(H.url);if(!q)return null;const le=H.id!=null?String(H.id):`overlay-${J}`;return{id:le,config:{...H,id:le,url:q},visible:!1,sourceId:`${le}-source`,layerIds:[]}}).filter(H=>!!H);i.value=D,b(),x()},I=(p,C)=>{const D=i.value.find(J=>J.id===p);if(!D)return;D.visible=C,b();const H=o.value;if(!(!H||typeof H.isStyleLoaded!="function"||!H.isStyleLoaded())){if(!D.layerIds.length){E(H,D);return}L(H,D)}},A=()=>{a.value&&(a.value.remove(),a.value=null)},h=(p,C={})=>!Array.isArray(p.popup)||!p.popup.length?[]:p.popup.map(D=>({label:D.label??D.field,value:Un(C?.[D.field])})).filter(D=>D.label&&D.value!==void 0),T=p=>{const C=o.value;if(!C||!p?.point)return;const D=C.queryRenderedFeatures(p.point);for(const H of D){const J=H.layer?.id??H.sourceLayer;if(!J)continue;const q=ze(J);if(!q)continue;const le=h(q,H.properties??H.layer?.properties??{});if(!le.length)continue;const he=ua(le),ie=Yo();if(!ie)return;const et=p.lngLat;if(c.value===J&&a.value){a.value.setLngLat(et),a.value.setHTML(he);return}c.value=J,A(),a.value=new ie.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(et).setHTML(he).addTo(C);return}c.value=null,A()},F=()=>{c.value=null,A()},P=()=>{const p=o.value;!p||typeof p.isStyleLoaded!="function"||!p.isStyleLoaded()||p.getSource(zt)||(p.addSource(zt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),p.addLayer({id:va,type:"fill",source:zt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),p.addLayer({id:ba,type:"line",source:zt,paint:{"line-color":"#1d4ed8","line-width":2}}))},K=p=>{const C=o.value;if(!C||typeof C.isStyleLoaded!="function"||!C.isStyleLoaded())return;P();const D=C.getSource(zt);if(!(!D||typeof D.setData!="function")){if(!p){D.setData({type:"FeatureCollection",features:[]});return}D.setData({type:"FeatureCollection",features:[p]})}},Z=p=>{const C=ka(p);C&&K(C)},B=()=>{K(null)},M=()=>{d.value=null,B()},w=p=>{if(p)return typeof p=="string"?p:p.field??p.name??p.key??p.label},z=p=>{if(p)return typeof p=="string"?p:p.label??p.title??p.field??p.name},ne=(p,C)=>!p||!p.length?[]:p.map(D=>{const H=w(D);if(!H)return null;const J=z(D),q=Un(C?.[H]);return!J||q===""?null:{label:J,value:q}}).filter(D=>!!D),We=(p,C)=>!Array.isArray(p)||!p.length?[]:p.map(D=>{if(!D?.name)return null;const H=D.title??D.name,J=Un(C?.[D.name]);return!H||J===""?null:{label:H,value:J}}).filter(D=>!!D),we=(p,C)=>!Array.isArray(p)||!p.length?[]:p.map(H=>{const J=Vo(H.url,C),q=H.label??H.url;return J?{label:q,url:J,target:H.target}:null}).filter(H=>!!H),pe=async(p,C)=>{const D=Vo(p,C);if(!D)return null;try{const H=await fetch(D);return H.ok?await H.json():null}catch{return null}},Le=async(p,C)=>{const D=C.properties??C.layer?.properties??{},H=ne(p.card?.rows,D);let J,q;if(p.card?.api){const ie=await pe(p.card.api,D);ie&&(typeof ie.html=="string"&&ie.html.trim()&&(J=ie.html),Array.isArray(ie.columns)&&ie.columns.length&&(q=ie.columns))}let le=H;if(!J&&q){const ie=We(q,D);ie.length&&(le=ie)}if(!le.length&&!J)return null;const he=we(p.card?.actions,D);return{title:D?.name??p.name,rows:le,html:J,actions:he.length?he:void 0}},Ke=async p=>{const C=o.value;if(!C||!p?.point)return;const D=C.queryRenderedFeatures(p.point);for(const H of D){const J=H.layer?.id??H.sourceLayer;if(!J)continue;const q=ze(J);if(!q||!q.card)continue;const le=await Le(q,H);if(le){d.value=le,Z(H);return}}d.value=null,B()},Ge=()=>{const p=o.value;p&&(p.on("mousemove",T),p.on("mouseleave",F),p.on("click",Ke))},Ze=()=>{const p=o.value;p&&(p.off("mousemove",T),p.off("mouseleave",F),p.off("click",Ke),A(),B())},ze=p=>{if(p)return i.value.find(C=>C.layerIds.includes(p))?.config},W=async()=>{const p=await Ea(),C=ma(t.container);if(!p||!C)return;const D={container:C,center:t.center??[30.524,50.45],zoom:t.zoom??10,style:m??t.style??{version:8,sources:{},layers:[]},attributionControl:!1,...t.mapOptions};o.value=new p.Map(D);const H=()=>{x()};f=H,o.value.on("style.load",H),o.value.on("load",()=>{s.value=!0,m&&o.value&&(o.value.setStyle(m),m=null),x(),Ge()})};e.onMounted(W),e.onBeforeUnmount(()=>{Ze(),o.value&&f&&o.value.off("style.load",f),v(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const G={map:o,ready:s,setStyle:g,flyTo:p=>o.value?.flyTo(p),fitBounds:(p,C)=>o.value?.fitBounds(p,C),setCenter:p=>o.value?.setCenter(p),setZoom:p=>o.value?.setZoom(p),addControl:(p,C)=>o.value?.addControl(p,C),removeControl:p=>o.value?.removeControl(p),on:(p,...C)=>o.value?.on(p,...C),off:(p,...C)=>o.value?.off(p,...C),project:p=>o.value?.project(p),unproject:p=>o.value?.unproject(p),state:r,basemapOptions:l,setOverlays:R,toggleOverlay:I,getOverlayConfig:ze,selectedCard:d,setBasemapOptions:k,clearCard:M};return e.provide(Xo,G),G}const wa={class:"map-base-layer-menu"},xa={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Na={class:"flex items-center justify-between p-2 border-b"},Ca={class:"p-2 border-b"},Sa={class:"flex items-center"},_a=["value","checked","onChange"],Ba={class:"ml-2"},$a={class:"p-2"},Ta={class:"flex items-center"},La=["checked"],Aa=["checked","onChange"],Ia={class:"ml-2"},Da=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:l}=dn(),i=e.ref(!1),a=`map-base-basemap-${Math.random().toString(36).slice(2,7)}`,c=e.computed(()=>o.value),d=e.computed(()=>n.value.selectedBasemap??""),m=e.computed(()=>n.value.geometryVisible??!0),f=e.computed(()=>n.value.overlays??[]),g=v=>{s?.(v)},b=()=>{r?.(!m.value)},k=v=>{l?.(v.id,!v.visible)};return(v,x)=>(e.openBlock(),e.createElementBlock("div",wa,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=E=>i.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),i.value?(e.openBlock(),e.createElementBlock("div",xa,[e.createElementVNode("div",Na,[x[3]||(x[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:x[1]||(x[1]=E=>i.value=!1)},[...x[2]||(x[2]=[e.createElementVNode("svg",{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:"w-4 h-4"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M18 6l-12 12"}),e.createElementVNode("path",{d:"M6 6l12 12"})],-1)])])]),e.createElementVNode("div",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.key},[e.createElementVNode("label",Sa,[e.createElementVNode("input",{type:"radio",name:a,value:E.key,checked:d.value===E.key,onChange:j=>g(E.key)},null,40,_a),e.createElementVNode("span",Ba,e.toDisplayString(E.name||E.key),1)])]))),128))]),e.createElementVNode("div",$a,[e.createElementVNode("label",Ta,[e.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:b},null,40,La),x[4]||(x[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,E=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:E.id},[e.createElementVNode("input",{type:"checkbox",checked:E.visible,onChange:j=>k(E)},null,40,Aa),e.createElementVNode("span",Ia,e.toDisplayString(E.name||E.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),Oa={key:0,class:"absolute bottom-[35px] left-[10px] z-[400] bg-white border border-gray-200 rounded-md shadow px-3 py-2 text-[11px] sm:text-xs space-y-1 max-w-[220px]"},Ma={class:"leading-tight"},Ra=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",Oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,s=>(e.openBlock(),e.createElementBlock("div",{key:s.key,class:"flex items-center gap-2 text-gray-800"},[e.createElementVNode("span",{class:"w-3.5 h-3.5 rounded-[2px] border border-black/10 shrink-0",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",Ma,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),Fa={class:"flex items-center gap-2 bg-white border border-gray-200 rounded-lg shadow-[0_10px_22px_rgba(15,23,42,0.16)] px-3 py-2 text-[11px] text-slate-900 max-w-[220px]"},Pa={class:"font-mono"},za=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Fa,[e.createElementVNode("span",Pa,e.toDisplayString(t.coordinates),1)]))}}),ja={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Ha=["title"],Ua={key:0,class:"vs-select__options absolute z-50 mt-1 w-auto min-w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900"},qa=["onClick"],Wa=["placeholder"],Ka={class:"divide-y divide-gray-100"},Ga=["onClick"],Za=600,Ja="0000000000:00:000:0000",Ya=30,Xa=8,Qa="https://data.softpro.ua/api-user/gis-url-proxy",Va="https://geo.rv.ua/api-user/dzk.api",ec="https://nominatim.openstreetmap.org/search",tc=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=dn(),s=e.getCurrentInstance();function r(){return s?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const i=!!r()?["xy","parcel","address"]:["xy","parcel"],a=e.computed(()=>{const W=n.config?.tools?.filter(G=>i.includes(G));return W&&W.length?W:i}),c=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),d=e.ref(a.value[0]);e.watch(a,W=>{W.includes(d.value)||(d.value=W[0])});const m=e.ref(""),f=e.ref(!1),g=e.ref(null),b=e.ref(null),k=e.ref(null),v=e.ref([]),x=e.ref(null),E=e.computed(()=>d.value==="address"&&v.value.length>0);let j=null,S=null,L=null;const R=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function I(){if(!b.value)return;const W=b.value.getBoundingClientRect(),G=W.width+Ya,p=W.left+window.scrollX,C=W.bottom+window.scrollY+Xa;R.left=`${p}px`,R.top=`${C}px`,R.width=`${G}px`,R.display="block"}const A=()=>{E.value&&I()};function h(){j&&(clearTimeout(j),j=null)}function T(){S?.destroy(),S=null}async function F(){if(d.value!=="parcel")return;const W=k.value;if(!W)return;const G=await fa();d.value==="parcel"&&(T(),S=G(W,{mask:Ja,lazy:!1,placeholderChar:"_"}),S.on("accept",()=>{m.value=S?.value??""}))}function P(){return(S?.value??m.value).trim()}function K(){if(!(typeof window>"u"))return window.maplibregl}function Z(W){const G=o.map.value;if(!G)return;const p=K();if(p){if(L){L.setLngLat([W.lat,W.lng]);return}L=new p.Marker({color:"#2563eb"}).setLngLat([W.lat,W.lng]).addTo(G)}}function B(){L&&(L.remove(),L=null)}e.watch(d,W=>{m.value="",f.value=!1,v.value=[],h(),W==="parcel"?e.nextTick(()=>{F().catch(G=>{xe.notify({type:"error",title:"Маска кадастру",message:G?.message||"Не вдалося ініціалізувати маску"})})}):T()}),e.watch(E,W=>{W?e.nextTick(()=>{I()}):R.display="none"}),e.watch(m,W=>{if(d.value!=="address"){v.value=[],h();return}if(!W.trim()){v.value=[],h();return}h(),j=window.setTimeout(()=>{Le(W).catch(G=>{const p=G?.message||"Помилка пошуку адреси";xe.notify({type:"error",title:"Пошук адреси",message:p})})},Za)});function M(W){d.value=W}function w(W){const G=W.target;if(f.value){const p=g.value;p&&!p.contains(G)&&(f.value=!1)}if(E.value){const p=x.value;p&&!p.contains(G)&&(v.value=[])}}e.onMounted(()=>{window.addEventListener("click",w,!0),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),d.value==="parcel"&&e.nextTick(()=>{F().catch(W=>{xe.notify({type:"error",title:"Маска кадастру",message:W?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",w,!0),window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A),h(),T(),B()});function z(W){return W==="xy"?"Координати":W==="parcel"?"Кадастр":"Адреси"}function ne(W){const G=W.replace(/[,]+/g," ").trim();if(!G)return null;const p=G.split(/\s+/).filter(Boolean);if(p.length<2)return null;console.log(p);const C=p.slice(0,2).map(Number);if(console.log(C),!C.every(ie=>Number.isFinite(ie)))return null;let[D,H]=C,J=D,q=H;const le=ie=>Math.abs(ie)<=90,he=ie=>Math.abs(ie)<=180;if(!le(J)||!he(q))if(le(q)&&he(J))J=D,q=H;else return null;return console.log(J,q),{lat:J,lng:q}}function We(W){return(W?.items||[]).map((p,C)=>{const D=Number(p?.position?.lat),H=Number(p?.position?.lng);return!Number.isFinite(D)||!Number.isFinite(H)?null:{id:String(p?.id??C),title:p?.title||p?.address?.label||"Знайдений обʼєкт",lat:D,lng:H}}).filter(p=>!!p)}function we(W){const G=W?.result||W?.data||W;if(!G)return[];const p=G.geom_centroid;if(!p||!Array.isArray(p.coordinates))return[];const[C,D]=p.coordinates;return!Number.isFinite(C)||!Number.isFinite(D)?[]:[{id:"parcel",title:G.cadnum||G.cad_num||"Земельна ділянка",lat:C,lng:D}]}function pe(W){return(Array.isArray(W?.features)?W.features:[]).map((p,C)=>{const D=p?.geometry?.coordinates,H=Number(D?.[0]),J=Number(D?.[1]);if(!Number.isFinite(H)||!Number.isFinite(J))return null;const q=p?.properties||{},le=q?.geocoding?.label||q?.display_name||q?.label||"Адреса";return{id:String(q?.geocoding?.place_id||q?.place_id||C),title:le,lat:H,lng:J}}).filter(p=>!!p)}async function Le(W){v.value=[],h();const G=new URL(ec);G.searchParams.set("format","geojson"),G.searchParams.set("q",W),G.searchParams.set("addressdetails","1"),G.searchParams.set("bounded","1");const p=r();p&&G.searchParams.set("viewbox",p);const C=await fetch(G.toString());if(!C.ok)throw new Error(`HTTP ${C.status}`);const D=await C.json(),H=pe(D);if(!H.length){xe.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}v.value=H}function Ke(W){Ze(W),v.value=[],m.value=""}function Ge(W){const p=W.replace(/\s+/g,"").split(":");if(p.length!==4)return!1;const C=[10,2,3,4];return p.every((D,H)=>D.length===C[H]&&/^\d+$/.test(D))}function Ze(W){const G=n.config?.zoom??17;o.flyTo?.({center:[W.lat,W.lng],zoom:G}),Z(W)}async function ze(){const W=d.value==="parcel"?P():m.value.trim();if(W){if(d.value==="xy"){const G=ne(W);if(console.log(G),!G){xe.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}Ze(G),m.value="";return}if(d.value==="address"){try{await Le(W)}catch(G){const p=G?.message||"Помилка пошуку адреси";xe.notify({type:"error",title:"Пошук адреси",message:p})}return}try{const G=new URL(d.value==="here"?Qa:Va);if(d.value==="here")G.searchParams.set("searchtext",W);else{if(!Ge(W)){xe.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}G.searchParams.set("cad_num",W)}const p=await fetch(G.toString());if(!p.ok)throw new Error(`HTTP ${p.status}`);const C=await p.json(),D=d.value==="here"?We(C):we(C);if(!D.length)xe.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const H=D[0];Ze(H),d.value==="parcel"&&S&&(S.value=""),m.value=""}}catch(G){const p=G?.message||"Помилка пошуку";xe.notify({type:"error",title:"Пошук",message:p})}}}return(W,G)=>(e.openBlock(),e.createElementBlock("div",ja,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(ze,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:g,class:"relative search-type w-[100px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:G[0]||(G[0]=p=>f.value=!f.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:z(d.value)},e.toDisplayString(z(d.value)),9,Ha),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":f.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...G[3]||(G[3]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))]),f.value?(e.openBlock(),e.createElementBlock("div",Ua,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,p=>(e.openBlock(),e.createElementBlock("li",{key:p,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:C=>M(p)},e.toDisplayString(z(p)),9,qa))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:b,class:"relative flex-1 min-w-[140px] bg-white rounded-md"},[d.value==="parcel"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"parcelInputRef",ref:k,"onUpdate:modelValue":G[1]||(G[1]=p=>m.value=p),placeholder:"0000000000:00:000:0000",inputmode:"numeric",type:"text",class:"vs-input !h-[34px] transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,512)),[[e.vModelText,m.value,void 0,{trim:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":G[2]||(G[2]=p=>m.value=p),placeholder:c.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,Wa)),[[e.vModelText,m.value,void 0,{trim:!0}]]),G[4]||(G[4]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1)),E.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:x,class:"vs-select__options mt-1 bg-white border border-gray-300 shadow-lg rounded-lg text-sm text-gray-900 z-50 max-h-60 overflow-auto",style:e.normalizeStyle(R)},[e.createElementVNode("ul",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,p=>(e.openBlock(),e.createElementBlock("li",{key:p.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:C=>Ke(p)},e.toDisplayString(p.title),9,Ga))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),nc={class:"map-center-control"},oc=["aria-label"],sc=e.defineComponent({directives:{tooltip:xe.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=dn(),r=e.ref(null),l=e.ref(null),i=e.ref(null),a=e.ref(null);function c(k){if(Array.isArray(k)&&k.length>=2){const[v,x]=k.slice(0,2).map(E=>Number(E));return Number.isNaN(v)||Number.isNaN(x)?null:[v,x]}if(k&&typeof k=="object"){const v=k,x=v.lng??v.lon??v.long??v.x,E=v.lat??v.y;if(x!=null&&E!=null){const j=Number(x),S=Number(E);if(!Number.isNaN(j)&&!Number.isNaN(S))return[j,S]}}if(typeof k=="string"){const v=k.split(",").map(x=>Number(x.trim()));if(v.length>=2&&v.every(x=>!Number.isNaN(x)))return[v[0],v[1]]}return null}e.watch(()=>n.center,k=>{const v=c(k);v&&(r.value=v)},{immediate:!0}),e.watch(()=>n.zoom,k=>{const v=Number(k);Number.isNaN(v)||(l.value=v)},{immediate:!0}),e.watch(()=>n.targetCenter,k=>{i.value=c(k)},{immediate:!0}),e.watch(()=>n.targetZoom,k=>{const v=Number(k);a.value=Number.isNaN(v)?null:v},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),m=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),f=e.computed(()=>!!i.value);e.onMounted(async()=>{const k=o.value;if(k){if(!r.value){const v=k.getCenter();r.value=[v.lng,v.lat]}l.value==null&&(l.value=k.getZoom())}});function g(){const k=o.value;if(!k)return;const v=r.value||(()=>{const E=k.getCenter();return[E.lng,E.lat]})(),x=l.value??k.getZoom();k.flyTo({center:v,zoom:x})}function b(){const k=o.value;if(!k||!i.value)return;const v=a.value??l.value??k.getZoom();k.flyTo({center:i.value,zoom:v})}return(k,v)=>{const x=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",nc,[f.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,id:"center-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":"Повернути центр",onClick:e.withModifiers(g,["stop"])},[e.createVNode(e.unref(Pr),{class:"w-4 h-4"})])),[[x,"Центр мапи"]]),f.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:1,id:"goto-target-btn",type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2","aria-label":m.value,onClick:e.withModifiers(b,["stop"])},[e.createVNode(e.unref(jr),{class:"w-4 h-4"})],8,oc)),[[x,d.value]]):e.createCommentVNode("",!0)])}}}),es=nt(sc,[["__scopeId","data-v-bc627616"]]),rc={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},ic={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},lc=["aria-label"],ac={key:2,class:"absolute top-[10px] right-[10px] z-[600] min-w-[220px] max-w-[320px] bg-white border border-gray-200 rounded-[0.75rem] p-3 shadow-[0_25px_45px_rgba(15,23,42,0.2)]"},cc={class:"text-slate-900 font-semibold mb-1"},dc=["innerHTML"],fc={key:1,class:"space-y-2"},pc={class:"text-gray-500"},uc={class:"font-medium text-slate-900"},mc={key:2,class:"mt-2 flex flex-col gap-2"},hc=["href","target"],fn="map-basemap-source",Wn="map-basemap-layer",gc=20,Ct="map-katottg-geometry-source",pn="map-katottg-geometry-line",ot="map-geometry-source",St="map-geometry-fill",_t="map-geometry-line",Bt="map-geometry-circle",un=e.defineComponent({__name:"MapWidget",props:{height:{default:350},center:{},zoom:{},geom:{},layers:{},legend:{},tools:{},katottg:{}},setup(t){const n=t,o=[{key:"topo100",name:"Topographic 100",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"},{key:"orto10",name:"Орто 10",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"},{key:"osmb",name:"OSM Bright",url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"}],l=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{};function i(u){if(u){if(Array.isArray(u)&&u.length>=2){const O=Number(u[0]),U=Number(u[1]);return!Number.isFinite(O)||!Number.isFinite(U)?void 0:[O,U]}if(typeof u=="object"){const O=u,U=O.lng??O.lon??O.long??O.x,Y=O.lat??O.y;if(U!=null&&Y!=null){const Se=Number(U),Ye=Number(Y);if(Number.isFinite(Se)&&Number.isFinite(Ye))return[Se,Ye]}}}}function a(u){if(u==null)return;const O=Number(u);return Number.isFinite(O)?O:void 0}const c=e.computed(()=>n.katottg!=null?n.katottg:l.katottg),d=e.computed(()=>(Array.isArray(l.basemaps)&&l.basemaps.length?l.basemaps:o).map((U,Y)=>{const Se=typeof U.url=="string"?U.url.trim():"";return Se?{key:(U.key??U.name??`base-${Y}`).trim()||`base-${Y}`,url:Se,name:U.name??U.key??`Layer ${Y+1}`}:null}).filter(U=>!!U)),m=i(l.center),f=a(l.zoom),g=Po(n.geom),b=xr(g),k=b?[(b[0]+b[2])/2,(b[1]+b[3])/2]:void 0,v=e.ref(null),x=e.computed(()=>i(n.center)??null),E=e.computed(()=>x.value??m??null),j=dn({container:v,center:k??E.value??void 0,zoom:n.zoom??f}),{map:S,setCenter:L,setZoom:R,state:I,getOverlayConfig:A,selectedCard:h,setBasemapOptions:T,clearCard:F,addControl:P,removeControl:K,ready:Z}=j,B=e.computed({get:()=>I.value.selectedBasemap??"",set:u=>{I.value.selectedBasemap=u}}),M=e.computed({get:()=>I.value.geometryVisible??!0,set:u=>{I.value.geometryVisible=u}}),w=e.computed(()=>{const u=n.height;return{height:typeof u=="number"?`${u}px`:String(u)}}),z=e.ref(!1),ne=e.ref(!1),We=e.computed(()=>z.value?"!fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),we=e.computed(()=>{const u=["w-full","h-full"];return z.value||u.push(`min-h-[${w.value.height}]`),u.join(" ")}),pe=e.computed(()=>h.value),Le=()=>F?.(),Ke=e.ref(k??E.value??null),Ge=e.ref(n.zoom??f??null),Ze=e.ref(E.value);e.watch(E,u=>{Ze.value=u},{immediate:!0});const ze=e.computed(()=>Ze.value??null),W=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof Ge.value=="number"?Ge.value:gc),G=["home","fullscreen","scale","position"],p=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?G:n.tools.filter(u=>G.includes(u))),C=u=>p.value.includes(u);e.watch([S,Z],([u,O])=>{if(!(!u||!O)){if(!Ke.value){const U=u.getCenter();Ke.value=[U.lng,U.lat]}Ge.value==null&&(Ge.value=u.getZoom())}},{immediate:!0});const D=e.ref(null),H=e.ref(""),J=e.ref(null),q=u=>u?ne.value?!0:typeof u.isStyleLoaded=="function"&&u.isStyleLoaded()?(ne.value=!0,!0):!1:!1,le=u=>{if(!u)return"";const O=Number(u.lat??u[1]),U=Number(u.lng??u[0]);return!Number.isFinite(O)||!Number.isFinite(U)?"":`${U.toFixed(5)}, ${O.toFixed(5)}`},he=u=>{u?.lngLat&&(H.value=le(u.lngLat))},ie=()=>{H.value=""},et=u=>{u&&(u.on("mousemove",he),u.on("mouseleave",ie),J.value=u)},Me=u=>{u&&(u.off("mousemove",he),u.off("mouseleave",ie),J.value=null)},Mn=e.computed(()=>C("scale"));e.watch([S,Z],([u,O],[U])=>{U&&Me(U),!(!u||!O)&&et(u)},{immediate:!0}),e.watch([S,Z,Mn],([u,O,U])=>{if(D.value&&K&&(K(D.value),D.value=null),!u||!O||!U)return;const Y=window?.maplibregl;Y&&(D.value=new Y.ScaleControl({unit:"metric"}),P?.(D.value,"bottom-left"))},{immediate:!0});const je=e.computed(()=>Array.isArray(n.legend)?n.legend.map((u,O)=>{const U=typeof u?.color=="string"?u.color.trim():"",Y=typeof u?.label=="string"?u.label.trim():"";return!U||!Y?null:{color:U,label:Y,key:`${Y}-${O}`}}).filter(u=>!!u):[]),He=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(l.layers)&&l.layers.length?l.layers:[]);e.watch(d,u=>{if(T?.(u),!u.length){B.value="";return}u.some(O=>O.key===B.value)||(B.value=u[0].key)},{immediate:!0});const vt=()=>typeof window>"u"?"":window.location?.origin??"",tn=u=>{if(!u)return"";const O=u.trim();if(!O)return"";const Y=O.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!Y)return"";if(/^https?:\/\//i.test(Y))return Y;const Se=vt(),Ye=Y.replace(/^\/+/,"");return Se?`${Se}/${Ye}`:Ye?`/${Ye}`:""},Mt=u=>{if(!u?.getStyle)return;const O=u.getStyle()??{},U=Array.isArray(O.layers)?O.layers:[];return U.length?U.find(Se=>Se.type!=="background")?.id??U[0]?.id:void 0},Rt=u=>{u&&(u.getLayer(Wn)&&u.removeLayer(Wn),u.getSource(fn)&&u.removeSource(fn))},bt=(u,O)=>{if(!u)return;const U=Mt(u);u.addSource(fn,{type:"raster",tiles:[O],tileSize:256}),u.addLayer({id:Wn,type:"raster",source:fn,layout:{visibility:"visible"}},U)},Ft=u=>{if(!u)return;const O=tn(u.url);if(!O){Je.value=null;return}Je.value=O,Rt(S.value),kt()},Je=e.ref(null),Mo=u=>{if(!u||u.__pendingBasemapHooked)return;u.__pendingBasemapHooked=!0;const O=()=>{u.__pendingBasemapHooked=!1,kt()};u.once("style.load",O),u.once("styledata",O)},kt=()=>{const u=S.value,O=Je.value;if(!(!O||!u)){if(!q(u)){Mo(u);return}Rt(u),bt(u,O)}},y=()=>{const u=B.value;if(!u)return;const O=d.value.find(U=>U.key===u);O&&Ft(O)};e.watch(B,()=>{y()},{immediate:!0}),e.watch(He,u=>{j.setOverlays?.(u)},{immediate:!0,deep:!0});const $=e.ref(null);let N=0;const _=e.computed(()=>Po($.value)),X={fill:{"fill-color":"#0ea5e9","fill-opacity":.25},line:{"line-color":"#0b74c4","line-width":2},circle:{"circle-color":"#0ea5e9","circle-stroke-color":"#ffffff","circle-stroke-width":2,"circle-radius":7,"circle-opacity":.95}},ae={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},te=e.ref(g),ue=e.ref(b),Re=e.ref(!1),se=e.computed(()=>{if(!ue.value)return null;const[u,O,U,Y]=ue.value;return[(u+U)/2,(O+Y)/2]}),Pt=e.computed(()=>!!ue.value),be=e.ref(!!b);e.ref(!1);const dt=()=>{z.value=!z.value},tt=e.ref(!1),Ue=()=>{const u=S.value;if(!u||!q(u))return;const O=te.value;if(!O){Et(u);return}let U=u.getSource(ot);U?U.setData(O):(u.addSource(ot,{type:"geojson",data:O}),Ro(u),U=u.getSource(ot)),kr(u,M.value?"visible":"none"),hu(),wr(),ue.value&&(!be.value&&(Re.value||!tt.value)?(u.fitBounds(ue.value,{padding:40,maxZoom:16,duration:0}),tt.value=!0,Re.value=!1):be.value&&(be.value=!1,Re.value=!1,tt.value=!0))},Ro=u=>{const O=X;u.getLayer(St)||u.addLayer({id:St,type:"fill",source:ot,paint:O.fill}),u.getLayer(_t)||u.addLayer({id:_t,type:"line",source:ot,paint:O.line}),u.getLayer(Bt)||u.addLayer({id:Bt,type:"circle",source:ot,paint:O.circle,filter:["==","$type","Point"]})},Et=u=>{[Bt,_t,St].forEach(O=>{u.getLayer(O)&&u.removeLayer(O)}),u.getSource(ot)&&u.removeSource(ot)},kr=(u,O)=>{q(u)&&[Bt,_t,St].forEach(U=>{u.getLayer(U)&&u.setLayoutProperty(U,"visibility",O)})},hu=()=>{const u=S.value;if(!u||!q(u))return;const O=X;u.getLayer(St)&&Object.entries(O.fill).forEach(([U,Y])=>{u.setPaintProperty(St,U,Y)}),u.getLayer(_t)&&Object.entries(O.line).forEach(([U,Y])=>{u.setPaintProperty(_t,U,Y)}),u.getLayer(Bt)&&Object.entries(O.circle).forEach(([U,Y])=>{u.setPaintProperty(Bt,U,Y)})},Er=u=>{u.getLayer(pn)||u.addLayer({id:pn,type:"line",source:Ct,layout:{visibility:"visible"},paint:ae})},wr=()=>{const u=S.value;if(!u||!q(u))return;const O=_.value??{type:"FeatureCollection",features:[]};if(!u.getSource(Ct)){u.addSource(Ct,{type:"geojson",data:O}),Er(u);return}const U=u.getSource(Ct);U&&typeof U.setData=="function"&&U.setData(O),Er(u)},gu=u=>{u.getLayer(pn)&&u.removeLayer(pn),u.getSource(Ct)&&u.removeSource(Ct)},yu=async u=>{const O=typeof u=="string"?u.trim():"",U=++N;if(!O){$.value=null;return}try{const Y=await fetch(`https://data.gki.com.ua/api-user/atu/${O}`);if(N!==U)return;if(!Y.ok){$.value=null;return}const Se=await Y.json();if(N!==U)return;$.value=Se}catch{if(N!==U)return;$.value=null}};e.watch(c,u=>{yu(u)},{immediate:!0}),e.watch(_,()=>{wr()},{immediate:!0}),e.watch(()=>n.geom,u=>{te.value=Po(u),ue.value=xr(te.value),se.value&&(Ke.value=se.value),tt.value=!1,Re.value=!0,Ue()},{deep:!0,immediate:!0}),e.watch(M,()=>{const u=S.value;u&&q(u)&&kr(u,M.value?"visible":"none")});const wt=()=>{ne.value=!0,Ue(),kt()},Fo=()=>{Ue()};e.watch(S,(u,O)=>{O&&(O.off("style.load",wt),O.off("load",wt),O.off("idle",Fo)),ne.value=!1,u&&(u.on("load",wt),u.on("style.load",wt),u.on("idle",Fo),typeof u.isStyleLoaded=="function"&&u.isStyleLoaded()&&wt())}),e.watch(x,u=>{!S.value||!u||Pt.value||L(u)}),e.watch(()=>n.zoom,u=>{!S.value||typeof u!="number"||R(u)}),e.onBeforeUnmount(()=>{D.value&&K&&K(D.value),J.value?Me(J.value):S.value&&Me(S.value);const u=S.value;u&&(gu(u),u.off("style.load",wt),u.off("load",wt),u.off("idle",Fo))});function vu(u){u&&(B.value=u)}function bu(u){M.value=u}j.setBasemap=vu,j.toggleGeometry=bu,j.setOverlays?.(He.value);function Po(u){if(!u)return null;if(u.type==="FeatureCollection")return u;if(u.type==="Feature")return{type:"FeatureCollection",features:[u]};const O=u.geometry??u;if(!O?.type)return null;if(O.type==="GeometryCollection"&&Array.isArray(O.geometries)){const U=O.geometries.filter(Y=>Y&&typeof Y.type=="string").map(Y=>({type:"Feature",geometry:Y}));return U.length?{type:"FeatureCollection",features:U}:null}if(O.type==="MultiPoint"&&Array.isArray(O.coordinates)){const U=O.coordinates.filter(Y=>Array.isArray(Y)&&Y.length>=2).map(Y=>({type:"Feature",geometry:{type:"Point",coordinates:Y}}));return U.length?{type:"FeatureCollection",features:U}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:O}]}}function xr(u){if(!u?.features?.length)return null;let O=1/0,U=1/0,Y=-1/0,Se=-1/0;const Ye=nn=>{if(typeof nn[0]=="number"){const[xt,Nr]=nn;O=Math.min(O,xt),U=Math.min(U,Nr),Y=Math.max(Y,xt),Se=Math.max(Se,Nr);return}nn.forEach(xt=>Ye(xt))};return u.features.forEach(nn=>{const xt=nn?.geometry?.coordinates;xt&&Ye(xt)}),O===1/0||U===1/0?null:[O,U,Y,Se]}return(u,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(We.value),style:e.normalizeStyle(z.value?void 0:w.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:v,class:e.normalizeClass(we.value)},null,2),e.createVNode(Ra,{items:je.value},null,8,["items"]),C("search")?(e.openBlock(),e.createBlock(tc,{key:0})):e.createCommentVNode("",!0),C("home")||C("fullscreen")?(e.openBlock(),e.createElementBlock("div",rc,[C("home")?(e.openBlock(),e.createElementBlock("div",ic,[e.createVNode(es,{center:ze.value,zoom:W.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(es,{key:0,"target-center":se.value,"target-zoom":W.value,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C("fullscreen")?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform duration-200 bg-white text-gray-700 hover:bg-gray-50 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 pointer-events-auto",onClick:dt,"aria-label":z.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...O[0]||(O[0]=[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)])],8,lc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),pe.value?(e.openBlock(),e.createElementBlock("div",ac,[e.createElementVNode("button",{type:"button",class:"absolute top-2 right-2 h-6 w-6 flex items-center justify-center rounded-full text-slate-500 hover:text-slate-900","aria-label":"Закрити",onClick:Le},[...O[1]||(O[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",cc,e.toDisplayString(pe.value.title||"Об'єкт"),1),pe.value.html?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["text-[0.75rem] text-slate-700 leading-relaxed overflow-auto",`max-h-[calc(${w.value.height}-120px)]`]),innerHTML:pe.value.html},null,10,dc)):(e.openBlock(),e.createElementBlock("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.rows,U=>(e.openBlock(),e.createElementBlock("div",{key:U.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",pc,e.toDisplayString(U.label)+":",1),e.createElementVNode("span",uc,e.toDisplayString(U.value),1)]))),128))])),pe.value.actions?.length?(e.openBlock(),e.createElementBlock("div",mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.actions,U=>(e.openBlock(),e.createElementBlock("a",{key:U.url,class:"bg-sky-600 hover:bg-sky-700 transition-colors text-white font-semibold text-center py-[0.55rem] rounded-md w-full",href:U.url,target:U.target??void 0,rel:"noreferrer"},e.toDisplayString(U.label),9,hc))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Da),C("position")&&H.value?(e.openBlock(),e.createBlock(za,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:H.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});function qe(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const yc=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kn=()=>{},mn=()=>!1,Gn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),st=Object.assign,Xe=Array.isArray,ve=t=>typeof t=="string",Zn=t=>typeof t=="symbol",vc=t=>t!==null&&typeof t=="object",ts=qe(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),bc=qe("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Jn=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},kc=/-\w/g,rt=Jn(t=>t.replace(kc,n=>n.slice(1).toUpperCase())),Yn=Jn(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ec=Jn(t=>t?`on${Yn(t)}`:""),jt={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"NEED_HYDRATION",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"CACHED",[-2]:"BAIL"},wc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},xc=/;(?![^(]*\))/g,Nc=/:([^]+)/,Cc=/\/\*[^]*?\*\//g;function Sc(t){const n={};return t.replace(Cc,"").split(xc).forEach(o=>{if(o){const s=o.split(Nc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const _c="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Bc="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",$c="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",Tc="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Lc=qe(_c),Ac=qe(Bc),Ic=qe($c),Dc=qe(Tc);const Ht=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),Ut=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),hn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),ns=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),ft=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),os=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),ss=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),qt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),eo=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),rs=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),to=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),no=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),oo=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),so=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),ro=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),io=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),is=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),ls=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),gn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),yn=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),lo=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),ao=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Wt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Kt=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),co=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),fo=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),Oc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),po=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),vn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Mc=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),Rc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),uo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),Fc=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Pc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),mo=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),as=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),$t={[Ht]:"Fragment",[Ut]:"Teleport",[Xn]:"Suspense",[hn]:"KeepAlive",[ns]:"BaseTransition",[ft]:"openBlock",[os]:"createBlock",[ss]:"createElementBlock",[Qn]:"createVNode",[Vn]:"createElementVNode",[qt]:"createCommentVNode",[eo]:"createTextVNode",[rs]:"createStaticVNode",[to]:"resolveComponent",[no]:"resolveDynamicComponent",[oo]:"resolveDirective",[so]:"resolveFilter",[ro]:"withDirectives",[io]:"renderList",[is]:"renderSlot",[ls]:"createSlots",[gn]:"toDisplayString",[yn]:"mergeProps",[lo]:"normalizeClass",[ao]:"normalizeStyle",[Wt]:"normalizeProps",[Kt]:"guardReactiveProps",[co]:"toHandlers",[fo]:"camelize",[Oc]:"capitalize",[po]:"toHandlerKey",[vn]:"setBlockTracking",[Mc]:"pushScopeId",[Rc]:"popScopeId",[uo]:"withCtx",[Fc]:"unref",[Pc]:"isRef",[mo]:"withMemo",[as]:"isMemoSame"};function zc(t){Object.getOwnPropertySymbols(t).forEach(n=>{$t[n]=t[n]})}const Ae={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function jc(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Ae}}function Gt(t,n,o,s,r,l,i,a=!1,c=!1,d=!1,m=Ae){return t&&(a?(t.helper(ft),t.helper(At(t.inSSR,d))):t.helper(Lt(t.inSSR,d)),i&&t.helper(ro)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:d,loc:m}}function pt(t,n=Ae){return{type:17,loc:n,elements:t}}function Oe(t,n=Ae){return{type:15,loc:n,properties:t}}function me(t,n){return{type:16,loc:Ae,key:ve(t)?Q(t,!0):t,value:n}}function Q(t,n=!1,o=Ae,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function Fe(t,n=Ae){return{type:8,loc:n,children:t}}function ye(t,n=[],o=Ae){return{type:14,loc:o,callee:t,arguments:n}}function Tt(t,n=void 0,o=!1,s=!1,r=Ae){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function ho(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Ae}}function Hc(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Ae}}function Uc(t){return{type:21,body:t,loc:Ae}}function Lt(t,n){return t||n?Qn:Vn}function At(t,n){return t||n?os:ss}function go(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o(Lt(s,t.isComponent)),n(ft),n(At(s,t.isComponent)))}const cs=new Uint8Array([123,123]),ds=new Uint8Array([125,125]);function fs(t){return t>=97&&t<=122||t>=65&&t<=90}function Ie(t){return t===32||t===10||t===9||t===12||t===13}function it(t){return t===47||t===62||Ie(t)}function bn(t){const n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const ke={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class qc{constructor(n,o){this.stack=n,this.cbs=o,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=cs,this.delimiterClose=ds,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return this.mode===2&&this.stack.length===0}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=cs,this.delimiterClose=ds}getPos(n){let o=1,s=n+1;const r=this.newlines.length;let l=-1;if(r>100){let i=-1,a=r;for(;i+1<a;){const c=i+a>>>1;this.newlines[c]<n?i=c:a=c}l=i}else for(let i=r-1;i>=0;i--)if(n>this.newlines[i]){l=i;break}return l>=0&&(o=l+2,s=n-this.newlines[l]),{column:s,line:o,offset:n}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(n){n===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n))}stateInterpolationOpen(n){if(n===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const o=this.index+1-this.delimiterOpen.length;o>this.sectionStart&&this.cbs.ontext(this.sectionStart,o),this.state=3,this.sectionStart=o}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(n)):(this.state=1,this.stateText(n))}stateInterpolation(n){n===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(n))}stateInterpolationClose(n){n===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(n))}stateSpecialStartSequence(n){const o=this.sequenceIndex===this.currentSequence.length;if(!(o?it(n):(n|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!o){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(n)}stateInRCDATA(n){if(this.sequenceIndex===this.currentSequence.length){if(n===62||Ie(n)){const o=this.index-this.currentSequence.length;if(this.sectionStart<o){const s=this.index;this.index=o,this.cbs.ontext(this.sectionStart,o),this.index=s}this.sectionStart=o+2,this.stateInClosingTagName(n),this.inRCDATA=!1;return}this.sequenceIndex=0}(n|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===ke.TitleEnd||this.currentSequence===ke.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&n===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(n)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(n===60)}stateCDATASequence(n){n===ke.Cdata[this.sequenceIndex]?++this.sequenceIndex===ke.Cdata.length&&(this.state=28,this.currentSequence=ke.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(n))}fastForwardTo(n){for(;++this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);if(o===10&&this.newlines.push(this.index),o===n)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(n){n===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===ke.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):n!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(n,o){this.enterRCDATA(n,o),this.state=31}enterRCDATA(n,o){this.inRCDATA=!0,this.currentSequence=n,this.sequenceIndex=o}stateBeforeTagName(n){n===33?(this.state=22,this.sectionStart=this.index+1):n===63?(this.state=24,this.sectionStart=this.index+1):fs(n)?(this.sectionStart=this.index,this.mode===0?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:n===116?this.state=30:this.state=n===115?29:6):n===47?this.state=8:(this.state=1,this.stateText(n))}stateInTagName(n){it(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(it(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(bn("</"+o),0),this.handleTagName(n)}}handleTagName(n){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)}stateBeforeClosingTagName(n){Ie(n)||(n===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=fs(n)?9:27,this.sectionStart=this.index))}stateInClosingTagName(n){(n===62||Ie(n))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(n))}stateAfterClosingTagName(n){n===62&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(n){n===62?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):n===47?(this.state=7,process.env.NODE_ENV!=="production"&&this.peek()!==62&&this.cbs.onerr(22,this.index)):n===60&&this.peek()===47?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):Ie(n)||(process.env.NODE_ENV!=="production"&&n===61&&this.cbs.onerr(19,this.index),this.handleAttrStart(n))}handleAttrStart(n){n===118&&this.peek()===45?(this.state=13,this.sectionStart=this.index):n===46||n===58||n===64||n===35?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(n){n===62?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):Ie(n)||(this.state=11,this.stateBeforeAttrName(n))}stateInAttrName(n){n===61||it(n)?(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):process.env.NODE_ENV!=="production"&&(n===34||n===39||n===60)&&this.cbs.onerr(17,this.index)}stateInDirName(n){n===61||it(n)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===58?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):n===46&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(n){n===61||it(n)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===91?this.state=15:n===46&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(n){n===93?this.state=14:(n===61||it(n))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(n),process.env.NODE_ENV!=="production"&&this.cbs.onerr(27,this.index))}stateInDirModifier(n){n===61||it(n)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(n)):n===46&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(n){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(n)}stateAfterAttrName(n){n===61?this.state=18:n===47||n===62?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(n)):Ie(n)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(n))}stateBeforeAttrValue(n){n===34?(this.state=19,this.sectionStart=this.index+1):n===39?(this.state=20,this.sectionStart=this.index+1):Ie(n)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(n))}handleInAttrValue(n,o){(n===o||this.fastForwardTo(o))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(o===34?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(n){this.handleInAttrValue(n,34)}stateInAttrValueSingleQuotes(n){this.handleInAttrValue(n,39)}stateInAttrValueNoQuotes(n){Ie(n)||n===62?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(n)):(process.env.NODE_ENV!=="production"&&n===34||n===39||n===60||n===61||n===96)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(n){n===91?(this.state=26,this.sequenceIndex=0):this.state=n===45?25:23}stateInDeclaration(n){(n===62||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(n){(n===62||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(n){n===45?(this.state=28,this.currentSequence=ke.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(n){(n===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(n){n===ke.ScriptEnd[3]?this.startSpecial(ke.ScriptEnd,4):n===ke.StyleEnd[3]?this.startSpecial(ke.StyleEnd,4):(this.state=6,this.stateInTagName(n))}stateBeforeSpecialT(n){n===ke.TitleEnd[3]?this.startSpecial(ke.TitleEnd,4):n===ke.TextareaEnd[3]?this.startSpecial(ke.TextareaEnd,4):(this.state=6,this.stateInTagName(n))}startEntity(){}stateInEntity(){}parse(n){for(this.buffer=n;this.index<this.buffer.length;){const o=this.buffer.charCodeAt(this.index);switch(o===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(o);break}case 2:{this.stateInterpolationOpen(o);break}case 3:{this.stateInterpolation(o);break}case 4:{this.stateInterpolationClose(o);break}case 31:{this.stateSpecialStartSequence(o);break}case 32:{this.stateInRCDATA(o);break}case 26:{this.stateCDATASequence(o);break}case 19:{this.stateInAttrValueDoubleQuotes(o);break}case 12:{this.stateInAttrName(o);break}case 13:{this.stateInDirName(o);break}case 14:{this.stateInDirArg(o);break}case 15:{this.stateInDynamicDirArg(o);break}case 16:{this.stateInDirModifier(o);break}case 28:{this.stateInCommentLike(o);break}case 27:{this.stateInSpecialComment(o);break}case 11:{this.stateBeforeAttrName(o);break}case 6:{this.stateInTagName(o);break}case 34:{this.stateInSFCRootTagName(o);break}case 9:{this.stateInClosingTagName(o);break}case 5:{this.stateBeforeTagName(o);break}case 17:{this.stateAfterAttrName(o);break}case 20:{this.stateInAttrValueSingleQuotes(o);break}case 18:{this.stateBeforeAttrValue(o);break}case 8:{this.stateBeforeClosingTagName(o);break}case 10:{this.stateAfterClosingTagName(o);break}case 29:{this.stateBeforeSpecialS(o);break}case 30:{this.stateBeforeSpecialT(o);break}case 21:{this.stateInAttrValueNoQuotes(o);break}case 7:{this.stateInSelfClosingTag(o);break}case 23:{this.stateInDeclaration(o);break}case 22:{this.stateBeforeDeclaration(o);break}case 25:{this.stateBeforeComment(o);break}case 24:{this.stateInProcessingInstruction(o);break}case 33:{this.stateInEntity();break}}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(this.state===1||this.state===32&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===19||this.state===20||this.state===21)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const n=this.buffer.length;this.sectionStart>=n||(this.state===28?this.currentSequence===ke.CdataEnd?this.cbs.oncdata(this.sectionStart,n):this.cbs.oncomment(this.sectionStart,n):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,n))}emitCodePoint(n,o){}}const Wc={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:t=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${t}.sync\` should be changed to \`v-model:${t}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function yo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function lt(t,n){const o=yo("MODE",n),s=yo(t,n);return o===3?s===!0:s!==!1}function It(t,n,o,...s){const r=lt(t,n);return process.env.NODE_ENV!=="production"&&r&&kn(t,n,o,...s),r}function kn(t,n,o,...s){if(yo(t,n)==="suppress-warning")return;const{message:l,link:i}=Wc[t],a=`(deprecation ${t}) ${typeof l=="function"?l(...s):l}${i?`
2
2
  Details: ${i}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function vo(t){throw t}function ps(t){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${t.message}`)}function oe(t,n,o,s){const r=process.env.NODE_ENV!=="production"?(o||Kc)[t]+(s||""):`https://vuejs.org/error-reference/#compiler-${t}`,l=new SyntaxError(String(r));return l.code=t,l.loc=n,l}const Kc={0:"Illegal comment.",1:"CDATA section is allowed only in XML context.",2:"Duplicate attribute.",3:"End tag cannot have attributes.",4:"Illegal '/' in tags.",5:"Unexpected EOF in tag.",6:"Unexpected EOF in CDATA section.",7:"Unexpected EOF in comment.",8:"Unexpected EOF in script.",9:"Unexpected EOF in tag.",10:"Incorrectly closed comment.",11:"Incorrectly opened comment.",12:"Illegal tag name. Use '&lt;' to print '<'.",13:"Attribute value was expected.",14:"End tag name was expected.",15:"Whitespace was expected.",16:"Unexpected '<!--' in comment.",17:`Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,18:"Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",19:"Attribute name cannot start with '='.",21:"'<?' is allowed only in XML context.",20:"Unexpected null character.",22:"Illegal '/' in tags.",23:"Invalid end tag.",24:"Element is missing end tag.",25:"Interpolation end sign was not found.",27:"End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",26:"Legal directive name was expected.",28:"v-if/v-else-if is missing expression.",29:"v-if/else branches must use unique keys.",30:"v-else/v-else-if has no adjacent v-if or v-else-if.",31:"v-for is missing expression.",32:"v-for has invalid expression.",33:"<template v-for> key should be placed on the <template> tag.",34:"v-bind is missing expression.",53:"v-bind with same-name shorthand only allows static argument.",35:"v-on is missing expression.",36:"Unexpected custom directive on <slot> outlet.",37:"Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.",38:"Duplicate slot names found. ",39:"Extraneous children found when component already has explicitly named default slot. These children will be ignored.",40:"v-slot can only be used on components or <template> tags.",41:"v-model is missing expression.",42:"v-model value must be a valid JavaScript member expression.",43:"v-model cannot be used on v-for or v-slot scope variables because they are not writable.",44:`v-model cannot be used on a prop, because local prop bindings are not writable.
3
3
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"v-model cannot be used on a const binding because it is not writable.",46:"Error parsing JavaScript expression: ",47:"<KeepAlive> expects exactly one child component.",52:"@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",48:'"prefixIdentifiers" option is not supported in this build of compiler.',49:"ES module mode is not supported in this build of compiler.",50:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',51:'"scopeId" option is only supported in module mode.',54:""},_e=t=>t.type===4&&t.isStatic;function us(t){switch(t){case"Teleport":case"teleport":return Ut;case"Suspense":case"suspense":return Xn;case"KeepAlive":case"keep-alive":return hn;case"BaseTransition":case"base-transition":return ns}}const Gc=/^$|^\d|[^\$\w\xA0-\uFFFF]/,bo=t=>!Gc.test(t),ms=/[A-Za-z_$\xA0-\uFFFF]/,Zc=/[\.\?\w$\xA0-\uFFFF]/,Jc=/\s+[.[]\s*|\s*[.[]\s+/g,hs=t=>t.type===4?t.content:t.loc.source,gs=t=>{const n=hs(t).trim().replace(Jc,a=>a.trim());let o=0,s=[],r=0,l=0,i=null;for(let a=0;a<n.length;a++){const c=n.charAt(a);switch(o){case 0:if(c==="[")s.push(o),o=1,r++;else if(c==="(")s.push(o),o=2,l++;else if(!(a===0?ms:Zc).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(s.push(o),o=3,i=c):c==="["?r++:c==="]"&&(--r||(o=s.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")s.push(o),o=3,i=c;else if(c==="(")l++;else if(c===")"){if(a===n.length-1)return!1;--l||(o=s.pop())}break;case 3:c===i&&(o=s.pop(),i=null);break}}return!r&&!l},Yc=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,Xc=t=>Yc.test(hs(t));function ys(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function Be(t,n,o=!1){for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&(o||r.exp)&&(ve(n)?r.name===n:n.test(r.name)))return r}}function Zt(t,n,o=!1,s=!1){for(let r=0;r<t.props.length;r++){const l=t.props[r];if(l.type===6){if(o)continue;if(l.name===n&&(l.value||s))return l}else if(l.name==="bind"&&(l.exp||s)&&at(l.arg,n))return l}}function at(t,n){return!!(t&&_e(t)&&t.content===n)}function Qc(t){return t.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function ko(t){return t.type===5||t.type===2}function vs(t){return t.type===7&&t.name==="pre"}function Vc(t){return t.type===7&&t.name==="slot"}function En(t){return t.type===1&&t.tagType===3}function wn(t){return t.type===1&&t.tagType===2}const ed=new Set([Wt,Kt]);function bs(t,n=[]){if(t&&!ve(t)&&t.type===14){const o=t.callee;if(!ve(o)&&ed.has(o))return bs(t.arguments[0],n.concat(t))}return[t,n]}function xn(t,n,o){let s,r=t.type===13?t.props:t.arguments[2],l=[],i;if(r&&!ve(r)&&r.type===14){const a=bs(r);r=a[0],l=a[1],i=l[l.length-1]}if(r==null||ve(r))s=Oe([n]);else if(r.type===14){const a=r.arguments[0];!ve(a)&&a.type===15?ks(n,a)||a.properties.unshift(n):r.callee===co?s=ye(o.helper(yn),[Oe([n]),r]):r.arguments.unshift(Oe([n])),!s&&(s=r)}else r.type===15?(ks(n,r)||r.properties.unshift(n),s=r):(s=ye(o.helper(yn),[Oe([n]),r]),i&&i.callee===Kt&&(i=l[l.length-2]));t.type===13?i?i.arguments[0]=s:t.props=s:i?i.arguments[0]=s:t.arguments[2]=s}function ks(t,n){let o=!1;if(t.key.type===4){const s=t.key.content;o=n.properties.some(r=>r.key.type===4&&r.key.content===s)}return o}function Jt(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function td(t){return t.type===14&&t.callee===mo?t.arguments[1].returns:t}const nd=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function Es(t){for(let n=0;n<t.length;n++)if(!Ie(t.charCodeAt(n)))return!1;return!0}function Eo(t){return t.type===2&&Es(t.content)||t.type===12&&Eo(t.content)}function wo(t){return t.type===3||Eo(t)}const ws={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:mn,isPreTag:mn,isIgnoreNewlineTag:mn,isCustomElement:mn,onError:vo,onWarn:ps,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let ee=ws,Yt=null,Qe="",Ne=null,V=null,$e="",Ve=-1,ut=-1,xo=0,ct=!1,No=null;const de=[],re=new qc(de,{onerr:Te,ontext(t,n){Nn(Ee(t,n),t,n)},ontextentity(t,n,o){Nn(t,n,o)},oninterpolation(t,n){if(ct)return Nn(Ee(t,n),t,n);let o=t+re.delimiterOpen.length,s=n-re.delimiterClose.length;for(;Ie(Qe.charCodeAt(o));)o++;for(;Ie(Qe.charCodeAt(s-1));)s--;let r=Ee(o,s);r.includes("&")&&(r=ee.decodeEntities(r,!1)),Co({type:5,content:Sn(r,!1,fe(o,s)),loc:fe(t,n)})},onopentagname(t,n){const o=Ee(t,n);Ne={type:1,tag:o,ns:ee.getNamespace(o,de[0],ee.ns),tagType:0,props:[],children:[],loc:fe(t-1,n),codegenNode:void 0}},onopentagend(t){Ns(t)},onclosetag(t,n){const o=Ee(t,n);if(!ee.isVoidTag(o)){let s=!1;for(let r=0;r<de.length;r++)if(de[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&Te(24,de[0].loc.start.offset);for(let i=0;i<=r;i++){const a=de.shift();Cn(a,n,i<r)}break}s||Te(23,Cs(t,60))}},onselfclosingtag(t){const n=Ne.tag;Ne.isSelfClosing=!0,Ns(t),de[0]&&de[0].tag===n&&Cn(de.shift(),t)},onattribname(t,n){V={type:6,name:Ee(t,n),nameLoc:fe(t,n),value:void 0,loc:fe(t)}},ondirname(t,n){const o=Ee(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!ct&&s===""&&Te(26,t),ct||s==="")V={type:6,name:o,nameLoc:fe(t,n),value:void 0,loc:fe(t)};else if(V={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[Q("prop")]:[],loc:fe(t)},s==="pre"){ct=re.inVPre=!0,No=Ne;const r=Ne.props;for(let l=0;l<r.length;l++)r[l].type===7&&(r[l]=pd(r[l]))}},ondirarg(t,n){if(t===n)return;const o=Ee(t,n);if(ct&&!vs(V))V.name+=o,mt(V.nameLoc,n);else{const s=o[0]!=="[";V.arg=Sn(s?o:o.slice(1,-1),s,fe(t,n),s?3:0)}},ondirmodifier(t,n){const o=Ee(t,n);if(ct&&!vs(V))V.name+="."+o,mt(V.nameLoc,n);else if(V.name==="slot"){const s=V.arg;s&&(s.content+="."+o,mt(s.loc,n))}else{const s=Q(o,!0,fe(t,n));V.modifiers.push(s)}},onattribdata(t,n){$e+=Ee(t,n),Ve<0&&(Ve=t),ut=n},onattribentity(t,n,o){$e+=t,Ve<0&&(Ve=n),ut=o},onattribnameend(t){const n=V.loc.start.offset,o=Ee(n,t);V.type===7&&(V.rawName=o),Ne.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&Te(2,n)},onattribend(t,n){if(Ne&&V){if(mt(V.loc,n),t!==0)if($e.includes("&")&&($e=ee.decodeEntities($e,!0)),V.type===6)V.name==="class"&&($e=Bs($e).trim()),t===1&&!$e&&Te(13,n),V.value={type:2,content:$e,loc:t===1?fe(Ve,ut):fe(Ve-1,ut+1)},re.inSFCRoot&&Ne.tag==="template"&&V.name==="lang"&&$e&&$e!=="html"&&re.enterRCDATA(bn("</template"),0);else{let o=0;V.exp=Sn($e,!1,fe(Ve,ut),0,o),V.name==="for"&&(V.forParseResult=sd(V.exp));let s=-1;V.name==="bind"&&(s=V.modifiers.findIndex(r=>r.content==="sync"))>-1&&It("COMPILER_V_BIND_SYNC",ee,V.loc,V.arg.loc.source)&&(V.name="model",V.modifiers.splice(s,1))}(V.type!==7||V.name!=="pre")&&Ne.props.push(V)}$e="",Ve=ut=-1},oncomment(t,n){ee.comments&&Co({type:3,content:Ee(t,n),loc:fe(t-4,n+3)})},onend(){const t=Qe.length;if(process.env.NODE_ENV!=="production"&&re.state!==1)switch(re.state){case 5:case 8:Te(5,t);break;case 3:case 4:Te(25,re.sectionStart);break;case 28:re.currentSequence===ke.CdataEnd?Te(6,t):Te(7,t);break;case 6:case 7:case 9:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:Te(9,t);break}for(let n=0;n<de.length;n++)Cn(de[n],t-1),Te(24,de[n].loc.start.offset)},oncdata(t,n){de[0].ns!==0?Nn(Ee(t,n),t,n):Te(1,t-9)},onprocessinginstruction(t){(de[0]?de[0].ns:ee.ns)===0&&Te(21,t-1)}}),xs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,od=/^\(|\)$/g;function sd(t){const n=t.loc,o=t.content,s=o.match(nd);if(!s)return;const[,r,l]=s,i=(f,g,b=!1)=>{const k=n.start.offset+g,v=k+f.length;return Sn(f,!1,fe(k,v),0,b?1:0)},a={source:i(l.trim(),o.indexOf(l,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=r.trim().replace(od,"").trim();const d=r.indexOf(c),m=c.match(xs);if(m){c=c.replace(xs,"").trim();const f=m[1].trim();let g;if(f&&(g=o.indexOf(f,d+c.length),a.key=i(f,g,!0)),m[2]){const b=m[2].trim();b&&(a.index=i(b,o.indexOf(b,a.key?g+f.length:d+c.length),!0))}}return c&&(a.value=i(c,d,!0)),a}function Ee(t,n){return Qe.slice(t,n)}function Ns(t){re.inSFCRoot&&(Ne.innerLoc=fe(t+1,t+1)),Co(Ne);const{tag:n,ns:o}=Ne;o===0&&ee.isPreTag(n)&&xo++,ee.isVoidTag(n)?Cn(Ne,t):(de.unshift(Ne),(o===1||o===2)&&(re.inXML=!0)),Ne=null}function Nn(t,n,o){{const l=de[0]&&de[0].tag;l!=="script"&&l!=="style"&&t.includes("&")&&(t=ee.decodeEntities(t,!1))}const s=de[0]||Yt,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=t,mt(r.loc,o)):s.children.push({type:2,content:t,loc:fe(n,o)})}function Cn(t,n,o=!1){o?mt(t.loc,Cs(n,60)):mt(t.loc,rd(n,62)+1),re.inSFCRoot&&(t.children.length?t.innerLoc.end=st({},t.children[t.children.length-1].loc.end):t.innerLoc.end=st({},t.innerLoc.start),t.innerLoc.source=Ee(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:s,ns:r,children:l}=t;if(ct||(s==="slot"?t.tagType=2:Ss(t)?t.tagType=3:ld(t)&&(t.tagType=1)),re.inRCDATA||(t.children=_s(l)),r===0&&ee.isIgnoreNewlineTag(s)){const i=l[0];i&&i.type===2&&(i.content=i.content.replace(/^\r?\n/,""))}r===0&&ee.isPreTag(s)&&xo--,No===t&&(ct=re.inVPre=!1,No=null),re.inXML&&(de[0]?de[0].ns:ee.ns)===0&&(re.inXML=!1);{const i=t.props;if(process.env.NODE_ENV!=="production"&&lt("COMPILER_V_IF_V_FOR_PRECEDENCE",ee)){let c=!1,d=!1;for(let m=0;m<i.length;m++){const f=i[m];if(f.type===7&&(f.name==="if"?c=!0:f.name==="for"&&(d=!0)),c&&d){kn("COMPILER_V_IF_V_FOR_PRECEDENCE",ee,t.loc);break}}}if(!re.inSFCRoot&&lt("COMPILER_NATIVE_TEMPLATE",ee)&&t.tag==="template"&&!Ss(t)){process.env.NODE_ENV!=="production"&&kn("COMPILER_NATIVE_TEMPLATE",ee,t.loc);const c=de[0]||Yt,d=c.children.indexOf(t);c.children.splice(d,1,...t.children)}const a=i.find(c=>c.type===6&&c.name==="inline-template");a&&It("COMPILER_INLINE_TEMPLATE",ee,a.loc)&&t.children.length&&(a.value={type:2,content:Ee(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:a.loc})}}function rd(t,n){let o=t;for(;Qe.charCodeAt(o)!==n&&o<Qe.length-1;)o++;return o}function Cs(t,n){let o=t;for(;Qe.charCodeAt(o)!==n&&o>=0;)o--;return o}const id=new Set(["if","else","else-if","for","slot"]);function Ss({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&id.has(n[o].name))return!0}return!1}function ld({tag:t,props:n}){if(ee.isCustomElement(t))return!1;if(t==="component"||ad(t.charCodeAt(0))||us(t)||ee.isBuiltInComponent&&ee.isBuiltInComponent(t)||ee.isNativeTag&&!ee.isNativeTag(t))return!0;for(let o=0;o<n.length;o++){const s=n[o];if(s.type===6){if(s.name==="is"&&s.value){if(s.value.content.startsWith("vue:"))return!0;if(It("COMPILER_IS_ON_ELEMENT",ee,s.loc))return!0}}else if(s.name==="bind"&&at(s.arg,"is")&&It("COMPILER_IS_ON_ELEMENT",ee,s.loc))return!0}return!1}function ad(t){return t>64&&t<91}const cd=/\r\n/g;function _s(t){const n=ee.whitespace!=="preserve";let o=!1;for(let s=0;s<t.length;s++){const r=t[s];if(r.type===2)if(xo)r.content=r.content.replace(cd,`
4
4
  `);else if(Es(r.content)){const l=t[s-1]&&t[s-1].type,i=t[s+1]&&t[s+1].type;!l||!i||n&&(l===3&&(i===3||i===1)||l===1&&(i===3||i===1&&dd(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=Bs(r.content))}return o?t.filter(Boolean):t}function dd(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function Bs(t){let n="",o=!1;for(let s=0;s<t.length;s++)Ie(t.charCodeAt(s))?o||(n+=" ",o=!0):(n+=t[s],o=!1);return n}function Co(t){(de[0]||Yt).children.push(t)}function fe(t,n){return{start:re.getPos(t),end:n==null?n:re.getPos(n),source:n==null?n:Ee(t,n)}}function fd(t){return fe(t.start.offset,t.end.offset)}function mt(t,n){t.end=re.getPos(n),t.source=Ee(t.start.offset,n)}function pd(t){const n={type:6,name:t.rawName,nameLoc:fe(t.loc.start.offset,t.loc.start.offset+t.rawName.length),value:void 0,loc:t.loc};if(t.exp){const o=t.exp.loc;o.end.offset<t.loc.end.offset&&(o.start.offset--,o.start.column--,o.end.offset++,o.end.column++),n.value={type:2,content:t.exp.content,loc:o}}return n}function Sn(t,n=!1,o,s=0,r=0){return Q(t,n,o,s)}function Te(t,n,o){ee.onError(oe(t,fe(n,n),void 0,o))}function ud(){re.reset(),Ne=null,V=null,$e="",Ve=-1,ut=-1,de.length=0}function md(t,n){if(ud(),Qe=t,ee=st({},ws),n){let r;for(r in n)n[r]!=null&&(ee[r]=n[r])}if(process.env.NODE_ENV!=="production"&&!ee.decodeEntities)throw new Error("[@vue/compiler-core] decodeEntities option is required in browser builds.");re.mode=ee.parseMode==="html"?1:ee.parseMode==="sfc"?2:0,re.inXML=ee.ns===1||ee.ns===2;const o=n&&n.delimiters;o&&(re.delimiterOpen=bn(o[0]),re.delimiterClose=bn(o[1]));const s=Yt=jc([],t);return re.parse(Qe),s.loc=fe(0,t.length),s.children=_s(s.children),Yt=null,s}function hd(t,n){_n(t,void 0,n,!!$s(t))}function $s(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!wn(n[0])?n[0]:null}function _n(t,n,o,s=!1,r=!1){const{children:l}=t,i=[];for(let m=0;m<l.length;m++){const f=l[m];if(f.type===1&&f.tagType===0){const g=s?0:De(f,o);if(g>0){if(g>=2){f.codegenNode.patchFlag=-1,i.push(f);continue}}else{const b=f.codegenNode;if(b.type===13){const k=b.patchFlag;if((k===void 0||k===512||k===1)&&Ls(f,o)>=2){const v=As(f);v&&(b.props=o.hoist(v))}b.dynamicProps&&(b.dynamicProps=o.hoist(b.dynamicProps))}}}else if(f.type===12&&(s?0:De(f,o))>=2){f.codegenNode.type===14&&f.codegenNode.arguments.length>0&&f.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${jt[-1]} */`:"")),i.push(f);continue}if(f.type===1){const g=f.tagType===1;g&&o.scopes.vSlot++,_n(f,t,o,!1,r),g&&o.scopes.vSlot--}else if(f.type===11)_n(f,t,o,f.children.length===1,!0);else if(f.type===9)for(let g=0;g<f.branches.length;g++)_n(f.branches[g],t,o,f.branches[g].children.length===1,r)}let a=!1;if(i.length===l.length&&t.type===1){if(t.tagType===0&&t.codegenNode&&t.codegenNode.type===13&&Xe(t.codegenNode.children))t.codegenNode.children=c(pt(t.codegenNode.children)),a=!0;else if(t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Xe(t.codegenNode.children)&&t.codegenNode.children.type===15){const m=d(t.codegenNode,"default");m&&(m.returns=c(pt(m.returns)),a=!0)}else if(t.tagType===3&&n&&n.type===1&&n.tagType===1&&n.codegenNode&&n.codegenNode.type===13&&n.codegenNode.children&&!Xe(n.codegenNode.children)&&n.codegenNode.children.type===15){const m=Be(t,"slot",!0),f=m&&m.arg&&d(n.codegenNode,m.arg);f&&(f.returns=c(pt(f.returns)),a=!0)}}if(!a)for(const m of i)m.codegenNode=o.cache(m.codegenNode);function c(m){const f=o.cache(m);return f.needArraySpread=!0,f}function d(m,f){if(m.children&&!Xe(m.children)&&m.children.type===15){const g=m.children.properties.find(b=>b.key===f||b.key.content===f);return g&&g.value}}i.length&&o.transformHoist&&o.transformHoist(l,o,t)}function De(t,n){const{constantCache:o}=n;switch(t.type){case 1:if(t.tagType!==0)return 0;const s=o.get(t);if(s!==void 0)return s;const r=t.codegenNode;if(r.type!==13||r.isBlock&&t.tag!=="svg"&&t.tag!=="foreignObject"&&t.tag!=="math")return 0;if(r.patchFlag===void 0){let i=3;const a=Ls(t,n);if(a===0)return o.set(t,0),0;a<i&&(i=a);for(let c=0;c<t.children.length;c++){const d=De(t.children[c],n);if(d===0)return o.set(t,0),0;d<i&&(i=d)}if(i>1)for(let c=0;c<t.props.length;c++){const d=t.props[c];if(d.type===7&&d.name==="bind"&&d.exp){const m=De(d.exp,n);if(m===0)return o.set(t,0),0;m<i&&(i=m)}}if(r.isBlock){for(let c=0;c<t.props.length;c++)if(t.props[c].type===7)return o.set(t,0),0;n.removeHelper(ft),n.removeHelper(At(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper(Lt(n.inSSR,r.isComponent))}return o.set(t,i),i}else return o.set(t,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return De(t.content,n);case 4:return t.constType;case 8:let l=3;for(let i=0;i<t.children.length;i++){const a=t.children[i];if(ve(a)||Zn(a))continue;const c=De(a,n);if(c===0)return 0;c<l&&(l=c)}return l;case 20:return 2;default:return process.env.NODE_ENV,0}}const gd=new Set([lo,ao,Wt,Kt]);function Ts(t,n){if(t.type===14&&!ve(t.callee)&&gd.has(t.callee)){const o=t.arguments[0];if(o.type===4)return De(o,n);if(o.type===14)return Ts(o,n)}return 0}function Ls(t,n){let o=3;const s=As(t);if(s&&s.type===15){const{properties:r}=s;for(let l=0;l<r.length;l++){const{key:i,value:a}=r[l],c=De(i,n);if(c===0)return c;c<o&&(o=c);let d;if(a.type===4?d=De(a,n):a.type===14?d=Ts(a,n):d=0,d===0)return d;d<o&&(o=d)}}return o}function As(t){const n=t.codegenNode;if(n.type===13)return n.props}function yd(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:l=!1,nodeTransforms:i=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:d=Kn,isCustomElement:m=Kn,expressionPlugins:f=[],scopeId:g=null,slotted:b=!0,ssr:k=!1,inSSR:v=!1,ssrCssVars:x="",bindingMetadata:E=yc,inline:j=!1,isTS:S=!1,onError:L=vo,onWarn:R=ps,compatConfig:I}){const A=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),h={filename:n,selfName:A&&Yn(rt(A[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:l,nodeTransforms:i,directiveTransforms:a,transformHoist:c,isBuiltInComponent:d,isCustomElement:m,expressionPlugins:f,scopeId:g,slotted:b,ssr:k,inSSR:v,ssrCssVars:x,bindingMetadata:E,inline:j,isTS:S,onError:L,onWarn:R,compatConfig:I,root:t,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:t,childIndex:0,inVOnce:!1,helper(T){const F=h.helpers.get(T)||0;return h.helpers.set(T,F+1),T},removeHelper(T){const F=h.helpers.get(T);if(F){const P=F-1;P?h.helpers.set(T,P):h.helpers.delete(T)}},helperString(T){return`_${$t[h.helper(T)]}`},replaceNode(T){if(process.env.NODE_ENV!=="production"){if(!h.currentNode)throw new Error("Node being replaced is already removed.");if(!h.parent)throw new Error("Cannot replace root node.")}h.parent.children[h.childIndex]=h.currentNode=T},removeNode(T){if(process.env.NODE_ENV!=="production"&&!h.parent)throw new Error("Cannot remove root node.");const F=h.parent.children,P=T?F.indexOf(T):h.currentNode?h.childIndex:-1;if(process.env.NODE_ENV!=="production"&&P<0)throw new Error("node being removed is not a child of current parent");!T||T===h.currentNode?(h.currentNode=null,h.onNodeRemoved()):h.childIndex>P&&(h.childIndex--,h.onNodeRemoved()),h.parent.children.splice(P,1)},onNodeRemoved:Kn,addIdentifiers(T){},removeIdentifiers(T){},hoist(T){ve(T)&&(T=Q(T)),h.hoists.push(T);const F=Q(`_hoisted_${h.hoists.length}`,!1,T.loc,2);return F.hoisted=T,F},cache(T,F=!1,P=!1){const K=Hc(h.cached.length,T,F,P);return h.cached.push(K),K}};return h.filters=new Set,h}function vd(t,n){const o=yd(t,n);Bn(t,o),n.hoistStatic&&hd(t,o),n.ssr||bd(t,o),t.helpers=new Set([...o.helpers.keys()]),t.components=[...o.components],t.directives=[...o.directives],t.imports=o.imports,t.hoists=o.hoists,t.temps=o.temps,t.cached=o.cached,t.transformed=!0,t.filters=[...o.filters]}function bd(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=$s(t);if(r&&r.codegenNode){const l=r.codegenNode;l.type===13&&go(l,n),t.codegenNode=l}else t.codegenNode=s[0]}else if(s.length>1){let r=64;process.env.NODE_ENV!=="production"&&s.filter(l=>l.type!==3).length===1&&(r|=2048),t.codegenNode=Gt(n,o(Ht),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function kd(t,n){let o=0;const s=()=>{o--};for(;o<t.children.length;o++){const r=t.children[o];ve(r)||(n.grandParent=n.parent,n.parent=t,n.childIndex=o,n.onNodeRemoved=s,Bn(r,n))}}function Bn(t,n){n.currentNode=t;const{nodeTransforms:o}=n,s=[];for(let l=0;l<o.length;l++){const i=o[l](t,n);if(i&&(Xe(i)?s.push(...i):s.push(i)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(qt);break;case 5:n.ssr||n.helper(gn);break;case 9:for(let l=0;l<t.branches.length;l++)Bn(t.branches[l],n);break;case 10:case 11:case 1:case 0:kd(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function Is(t,n){const o=ve(t)?s=>s===t:s=>t.test(s);return(s,r)=>{if(s.type===1){const{props:l}=s;if(s.tagType===3&&l.some(Vc))return;const i=[];for(let a=0;a<l.length;a++){const c=l[a];if(c.type===7&&o(c.name)){l.splice(a,1),a--;const d=n(s,c,r);d&&i.push(d)}}return i}}}const $n="/*@__PURE__*/",Ds=t=>`${$t[t]}: _${$t[t]}`;function Ed(t,{mode:n="function",prefixIdentifiers:o=n==="module",sourceMap:s=!1,filename:r="template.vue.html",scopeId:l=null,optimizeImports:i=!1,runtimeGlobalName:a="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:d="vue/server-renderer",ssr:m=!1,isTS:f=!1,inSSR:g=!1}){const b={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:l,optimizeImports:i,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:m,isTS:f,inSSR:g,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(v){return`_${$t[v]}`},push(v,x=-2,E){b.code+=v},indent(){k(++b.indentLevel)},deindent(v=!1){v?--b.indentLevel:k(--b.indentLevel)},newline(){k(b.indentLevel)}};function k(v){b.push(`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opengis/widgets",
3
3
  "private": false,
4
- "version": "0.0.56",
4
+ "version": "0.0.57",
5
5
  "type": "module",
6
6
  "description": "A collection of independent widgets for comments, history, files, and gallery",
7
7
  "types": "./dist/index.d.ts",