@opengis/widgets 0.0.60 → 0.0.61

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.
@@ -1,9 +1,9 @@
1
- (function(he,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):(he=typeof globalThis<"u"?globalThis:he||self,e(he.WidgetLib={},he.Vue,he.OpenGISCore))})(this,(function(he,e,we){"use strict";function _r(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 Br=_r(e);const Uo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tr=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),$r=t=>{const n=Tr(t);return n.charAt(0).toUpperCase()+n.slice(1)},Lr=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var dn={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 Ar=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:l,class:i,...a},{slots:c})=>e.h("svg",{...dn,width:t||dn.width,height:t||dn.height,stroke:s||dn.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:Lr("lucide",...l?[`lucide-${Uo($r(l))}-icon`,`lucide-${Uo(l)}`]:["lucide-icon"]),...a},[...r.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);const de=(t,n)=>(o,{slots:s})=>e.h(Ar,{...o,iconNode:n,name:t},s);const Ir=de("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 Dr=de("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Or=de("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 qo=de("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 Mr=de("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 Ct=de("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 Rr=de("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 Fr=de("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 Pr=de("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 zr=de("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 jr=de("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 Wo=de("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 Hr=de("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 Ur=de("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 Ko=de("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const qr=de("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 Go=de("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 Wr=de("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 Kr=de("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 Un=de("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 Gr=de("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 qn=de("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 Zr=de("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 Wn=de("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Jr={class:"border-t pt-3 mt-4"},Yr={class:"flex gap-2"},Xr={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Qr={class:"flex-1 space-y-2"},Vr={class:"flex justify-between items-center"},ei={class:"flex gap-2"},ti=["disabled"],Zo=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",Jr,[e.createElementVNode("div",Yr,[e.createElementVNode("span",Xr,[e.createVNode(e.unref(qn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",Qr,[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",Vr,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",ei,[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(Wn),{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(Go),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,ti)])])])])]))}}),ni={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"},oi=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",ni,[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(Kr),{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(Un),{class:"h-3 w-3 mr-2"}),m[1]||(m[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),si={class:"space-y-2"},ri={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ii={class:"flex-1 min-w-0 space-y-1 relative"},li={class:"flex items-center gap-2"},ai={class:"font-medium text-xs"},ci={class:"text-xs text-gray-500"},di={key:0,class:"text-xs text-gray-700 leading-relaxed"},fi={class:"flex justify-between text-xs"},pi={class:"flex items-center gap-2"},ui={key:0,class:"flex gap-2"},mi=["disabled"],hi={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},gi=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=N=>{const w=new Date,H=Math.floor((w.getTime()-N.getTime())/(1e3*60*60));return H<1?`${Math.floor((w.getTime()-N.getTime())/6e4)}m`:H<24?`${H}h`:`${Math.floor(H/24)}d`},g=()=>{m.value=!m.value,m.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},E=()=>{o("edit",s.comment.id,r.value),d.value=!1},b=(N,w)=>{o("like",N,w)},v=(N,w)=>{o("edit",N,w)};return(N,w)=>{const H=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",si,[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",ri,[e.createVNode(e.unref(qn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",ii,[e.createElementVNode("div",li,[e.createElementVNode("span",ai,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",ci,e.toDisplayString(f(t.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":w[0]||(w[0]=A=>r.value=A),class:e.normalizeClass(d.value?i.value:l.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",di,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",fi,[e.createElementVNode("div",pi,[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:w[1]||(w[1]=A=>g())},[e.createVNode(e.unref(Pr),{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:w[2]||(w[2]=A=>c.value=!0)},[e.createVNode(e.unref(qr),{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:w[3]||(w[3]=A=>a.value=!0)},[e.createVNode(e.unref(Mr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",ui,[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:w[4]||(w[4]=A=>d.value=!1)},[e.createVNode(e.unref(Wn),{class:"h-3 w-3"}),w[11]||(w[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:w[5]||(w[5]=A=>E())},[e.createVNode(e.unref(Go),{class:"h-3 w-3 mr-1"}),w[12]||(w[12]=e.createTextVNode(" Send ",-1))],8,mi)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(oi,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":w[6]||(w[6]=A=>a.value=A),onEdit:w[7]||(w[7]=A=>d.value=!0),onDelete:w[8]||(w[8]=A=>N.$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",hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,A=>(e.openBlock(),e.createBlock(H,{key:A.id,comment:A,isInside:!0,onDelete:T=>N.$emit("delete",A.id),onLike:b,onEdit:v},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(Zo,{key:0,onSendComment:w[9]||(w[9]=A=>N.$emit("reply",t.comment?.id,A)),isReply:c.value,"onUpdate:isReply":w[10]||(w[10]=A=>c.value=A)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),yi=["id"],vi={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},fn=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",vi,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,E=>(e.openBlock(),e.createBlock(gi,{key:E.id,comment:E,onReply:c,onLike:a,onDelete:g[0]||(g[0]=b=>m(b)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Zo,{onSendComment:g[1]||(g[1]=E=>i(E))})],14,yi))}}),Jo=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:Ct}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Wr}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Gr}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:zr}]]),bi={class:"mx-auto font-sans"},ki={class:"relative"},Ei={class:"space-y-3"},wi={class:"flex-1 min-w-0 pb-2"},xi={class:"flex items-center gap-1.5 mb-1 mt-0.5"},Ni={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},Ci={class:"font-medium text-xs"},Si={class:"text-xs text-gray-500"},_i={class:"space-y-1"},Bi={class:"text-xs text-gray-700"},Ti={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"},Li={key:0,class:"flex items-center gap-1 text-xs"},Ai={key:0,class:"bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"},Ii={key:2,class:"bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"},pn=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",bi,[e.createElementVNode("div",{class:e.normalizeClass(t.maxHeight?"overflow-y-auto":""),style:e.normalizeStyle({maxHeight:t.maxHeight+"px"})},[e.createElementVNode("div",ki,[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",Ei,[(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(Jo).get(i?.entityType)?.color}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Jo).get(i?.entityType)?.icon),{class:"h-3 w-3"}))],2),e.createElementVNode("div",wi,[e.createElementVNode("div",xi,[e.createElementVNode("span",Ni,[e.createVNode(e.unref(qn),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("span",Ci,e.toDisplayString(i?.userName),1),e.createElementVNode("span",Si,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",_i,[e.createElementVNode("div",Bi,[e.createElementVNode("span",Ti,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",Li,[i?.changes?.[i?.entityId]?.old?(e.openBlock(),e.createElementBlock("span",Ai,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(Dr),{key:1,class:"h-2 w-2 text-gray-400"})):e.createCommentVNode("",!0),i?.changes?.[i?.entityId]?.new?(e.openBlock(),e.createElementBlock("span",Ii,e.toDisplayString(i?.changes?.[i?.entityId]?.new),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]))),128))])])],6)]))}}),Di={key:0,class:"text-xl font-semibold"},Oi={class:"flex gap-1"},Mi={key:0},Ri=["accept"],Fi={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"},Pi=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",Di,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Oi,[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(Hr),{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(Fr),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Mi,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=l=>s.$emit("onAddFile",l))},null,40,Ri),e.createElementVNode("div",Fi,[e.createVNode(e.unref(Ko),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),Kn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:Ct,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:Rr,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Zr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:Ct,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:Ir,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Wo,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Wo,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:Ct,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:Ct,label:"PPT"}};function Yo(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function Xo(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 zi={class:"space-y-0.5"},ji=["onClick"],Hi=["onClick"],Ui={class:"flex items-center gap-2"},qi={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},Wi={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},Ki={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},Gi={class:"flex items-center gap-1"},Zi=["onClick"],Ji=["onClick"],Yi=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",zi,[(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(Kn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Kn)[s?.ext]?.icon||e.unref(Kn).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",Ui,[e.createElementVNode("span",qi,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,Hi),e.createElementVNode("div",Wi,e.toDisplayString(e.unref(Xo)(s.size)),1),e.createElementVNode("div",Ki,e.toDisplayString(e.unref(Yo)(s.createdAt)),1),e.createElementVNode("div",Gi,[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(qo),{class:"h-3 w-3"})],8,Zi),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(Un),{class:"h-3 w-3"})],8,Ji)])],8,ji))),128))]))}}),Xi={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},Qi=["onClick"],Vi={class:"space-y-2"},el={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},tl=["src"],nl={class:"space-y-1"},ol=["title"],sl={class:"text-xs text-gray-500 text-left"},rl={class:"absolute top-2 right-1 flex items-center gap-1"},il=["onClick"],ll=["onClick"],al=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Xi,[(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",Vi,[e.createElementVNode("div",el,[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,tl)):(e.openBlock(),e.createBlock(e.unref(Ct),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",nl,[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,ol),e.createElementVNode("p",sl,e.toDisplayString(e.unref(Yo)(s.createdAt))+", "+e.toDisplayString(e.unref(Xo)(s.size)),1)])]),e.createElementVNode("div",rl,[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(qo),{class:"h-3 w-3"})],8,il),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(Un),{class:"h-3 w-3"})],8,ll)])],8,Qi))),128))]))}}),cl={class:"mx-auto font-sans"},dl={key:1},un=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),B=[];return h.forEach(F=>{const P=F.toLowerCase(),G=P.indexOf("/"),Z=G>=0;let L,M=!1,k;if(Z){L=P;const te=P.slice(G+1);M=te==="*",!M&&te&&(k=`.${te.replace(/^\.+/,"")}`)}else k=P.startsWith(".")?P:`.${P.replace(/^\.+/,"")}`;const z=Z?L:k??"";z&&B.push({acceptValue:z,mime:L,wildcard:M,extension:k})}),B.length?B:null}),d=e.computed(()=>{const x=c.value;if(!x)return;const h=x.map(B=>B.acceptValue).filter(Boolean);return h.length?h.join(","):void 0}),m=x=>{if(!c.value)return!0;const h=x.type?.toLowerCase(),B=x.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&&B?.endsWith(F.extension))}return!!(F.extension&&B?.endsWith(F.extension))})},f=n;a.value.length===0&&T();const g=(x,h)=>{r.value=h,s.value=!0},E=()=>{r.value&&(w(r.value),r.value=null,s.value=!1)},b=e.computed(()=>Array.isArray(a.value)?a.value.map(x=>x?.file_path):[]),v=x=>{const h=b.value.findIndex(B=>B===x.file_path);h!==-1&&(l.value=!0,i.value=h)},N=x=>{o.onAddFile?o.onAddFile(x):R(x),f("add",x)},w=x=>{o.onDelete?o.onDelete(x):I(x),f("delete",x)},H=x=>{const h=document.createElement("a");h.setAttribute("download",x?.uploaded_name||x?.name),h.href=x?.file_path||x?.path,h.click()},A=e.ref(o.view==="grid"?"grid":"list");async function T(){if(!o.id)return;const x=await fetch(`/api/widget/file/${o.id}`).then(h=>h.json());x.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=x.rows}const R=async x=>{const B=x.target?.files;if(!B||B.length===0)return;const F=Array.from(B),P=[],G=[];if(F.forEach(Z=>{m(Z)?P.push(Z):G.push(Z)}),G.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${G.map(Z=>Z.name).join(", ")}`),P.length!==0)try{await Promise.all(P.map(async Z=>{const L=new FormData;L.append("file",Z);const M=`/api/widget/file/${o.id}`,k=await fetch(M,{method:"POST",body:L});if(!k.ok)throw new Error(`HTTP error! status: ${k.status}`);return Z})),await T()}catch(Z){console.error("Помилка при завантаженні файлів:",Z)}},I=async x=>{try{await fetch(`/api/widget/file/${o.id}/${x}`,{method:"DELETE"}),await T()}catch(h){console.error(h)}};return(x,h)=>{const B=e.resolveComponent("MessageBox"),F=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",cl,[e.createVNode(Pi,{modelValue:A.value,"onUpdate:modelValue":h[0]||(h[0]=P=>A.value=P),title:o.title,onOnAddFile:h[1]||(h[1]=P=>N(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"})},[A.value==="list"?(e.openBlock(),e.createBlock(Yi,{key:0,onDelete:g,onDownload:H,onOpenLightbox:h[2]||(h[2]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),A.value==="grid"?(e.openBlock(),e.createBlock(al,{key:1,onDelete:g,onDownload:H,onOpenLightbox:h[3]||(h[3]=P=>v(P)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",dl,[...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(B,{modelValue:s.value,"onUpdate:modelValue":h[4]||(h[4]=P=>s.value=P),onConfirm:E,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(F,{modelValue:l.value,"onUpdate:modelValue":h[5]||(h[5]=P=>l.value=P),images:b.value,"start-index":i.value},null,8,["modelValue","images","start-index"])],64)}}}),fl={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},pl=["onClick"],ul={key:0,rel:"noreferrer",class:"relative block h-full w-full"},ml=["src"],hl={key:0,class:"thumb-cover"},gl=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",fl,[(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(E=>a(f),["stop"])},[g<5?(e.openBlock(),e.createElementBlock("div",ul,[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,ml),g===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",hl," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,pl))),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)}}}),yl={key:0,class:"text-xl font-semibold"},vl={class:"flex gap-1"},bl=["accept"],kl={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"},El=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",yl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",vl,[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,bl),e.createElementVNode("div",kl,[e.createVNode(e.unref(Ko),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),wl={class:"w-full mx-auto font-sans",ref:"containerRef"},xl={key:1},mn=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=T=>{if(!T)return[];const R=Array.isArray(T)?T:T.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 T=s(o.format);return T.length>0?T:void 0}),i=e.computed(()=>{const T=l.value;return!T||T.length===0?"image/*":T.map(R=>R.startsWith(".")?R:`.${R}`).join(",")}),a=T=>T?.split(".").pop()?.toLowerCase()??"",c=T=>{const R=T?.toLowerCase();return!!R&&!!l.value&&l.value.includes(R)},d=T=>{const R=T?.toLowerCase();return!!R&&r.includes(R)},m=T=>{const R=T.type?.toLowerCase(),I=T.ext?.toLowerCase();return R?.startsWith("image/")?l.value?c(I):!0:I?l.value?c(I):d(I):!1},f=T=>{if(!T.type?.toLowerCase()?.startsWith("image/"))return!1;if(!l.value)return!0;const I=a(T.name);return c(I)},g=T=>T.filter(m),E=e.ref(g(o.items??[])),b=n;E.value.length===0&&H();const v=T=>{o.onAddImage?o.onAddImage(T):w(T),b("add",T)},N=T=>{const R=E.value.find(I=>I.file_path===T)?.file_id;R&&(o.onDelete?o.onDelete(R):A(R))},w=async T=>{const R=T.target;if(!R?.files||R.files.length===0)return;const I=Array.from(R.files),x=I.filter(B=>f(B)),h=l.value?.join(", ")??"image/*";if(x.length===0){console.warn(`Допустимі формати: ${h}. Завантажте зображення дозволеного типу.`);return}x.length!==I.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${h}.`);try{await Promise.all(x.map(async B=>{const F=new FormData;F.append("file",B);const P=`/api/widget/file/${o.id}`,G=await fetch(P,{method:"POST",body:F});if(!G.ok)throw new Error(`HTTP error! status: ${G.status}`);return B})),await H()}catch(B){console.error("Помилка при завантаженні файлів:",B)}};async function H(){if(!o.id)return;const T=await fetch(`/api/widget/file/${o.id}`).then(R=>R.json());E.value=g(T.rows)}const A=async T=>{try{await fetch(`/api/widget/file/${o.id}/${T}`,{method:"DELETE"}),await H()}catch(R){console.error(R)}};return(T,R)=>(e.openBlock(),e.createElementBlock("div",wl,[e.createVNode(El,{title:t.title,accept:i.value,onOnAddImage:R[0]||(R[0]=I=>v(I))},null,8,["title","accept"]),E.value.length>0?(e.openBlock(),e.createBlock(gl,{key:0,items:E.value,onDelete:R[1]||(R[1]=I=>N(I))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",xl,[...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))}}),Nl={class:"text-value"},Cl={class:"text-sm text-gray-900"},Sl=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",Nl,[e.createElementVNode("span",Cl,e.toDisplayString(o.value),1)]))}}),nt=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},_l=nt(Sl,[["__scopeId","data-v-34a76c89"]]),Bl={class:"link-value"},Tl=["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",Bl,[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,Tl)]))}}),[["__scopeId","data-v-932f028c"]]),Ll={class:"date-value"},Al={class:"text-sm text-gray-900"},Il=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",Ll,[e.createElementVNode("span",Al,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-cd4df08e"]]),Dl={class:"status-value"},Ol={key:0,class:"mr-1"},Ml=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",Dl,[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",Ol,[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"]]),Rl={class:"custom-value"},Fl={class:"text-sm text-gray-900"},Pl=nt(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Rl,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Fl,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-12c8b3f3"]]),zl=["id"],jl={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},Hl={key:1,class:"overflow-x-auto"},Ul={class:"min-w-full divide-y divide-gray-200"},ql={class:"bg-white divide-y divide-gray-200"},Wl={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},Kl={class:"flex items-center gap-2"},Gl=["title"],Zl={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Jl={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},Yl={class:"flex items-start gap-3"},Xl={key:0,class:"flex-shrink-0"},Ql={class:"flex-1 min-w-0"},Vl={class:"flex items-center gap-2 mb-2"},ea={class:"text-sm font-medium text-gray-900"},ta=["title"],na={key:3,class:"overflow-x-auto"},oa={class:"min-w-full divide-y divide-gray-200"},sa={class:"bg-white divide-y divide-gray-200"},ra={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},ia={class:"flex items-center gap-2"},la=["title"],aa={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Gn=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 Il;case"status":return Ml;case"custom":return Pl;default:return _l}};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",jl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(e.openBlock(),e.createElementBlock("div",Hl,[e.createElementVNode("table",Ul,[e.createElementVNode("tbody",ql,[(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",Wl,[e.createElementVNode("div",Kl,[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,Gl)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Zl,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",Jl,[(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",Yl,[r.icon?(e.openBlock(),e.createElementBlock("div",Xl,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ql,[e.createElementVNode("div",Vl,[e.createElementVNode("h4",ea,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,ta)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",na,[e.createElementVNode("table",oa,[e.createElementVNode("tbody",sa,[(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",ra,[e.createElementVNode("div",ia,[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,la)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",aa,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,zl))}}),[["__scopeId","data-v-106790ef"]]);function Qo(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 ca(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 da="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Zn=null;function fa(){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 pa(){return Zn||(Zn=Qo(da).then(()=>{const t=fa();if(!t)throw new Error("IMask is not available after loading the script");return t})),Zn}function ua(){return typeof window>"u"?"":window.location?.origin??""}function Vo(){if(!(typeof window>"u"))return window.maplibregl}const es=Symbol("vs-widget-map");function Jn(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function ma(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 ha(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function Yn(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=ua(),l=s.replace(/^\/+/,"");return r?`${r}/${l}`:l?`/${l}`:""}function ga(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 ya(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function hn(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 ts=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function va(t){const n=t?.color??ts[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)}):ts.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",ba="map-highlight-fill",ka="map-highlight-line";function Ea(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function ns(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function wa(){return ca("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Qo("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),Vo()}function gn(t){const n=e.inject(es,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=u=>{u&&(o.value?o.value.setStyle(u):m=u)},E=()=>{r.value.overlays=i.value.map(u=>({id:u.id,name:u.config.name,visible:u.visible}))},b=u=>{const S=Array.isArray(u)?u:[];l.value=S,S.some(U=>U.key===r.value.selectedBasemap)||(r.value.selectedBasemap=S[0]?.key??"")},v=u=>{u&&i.value.forEach(S=>{S.layerIds.forEach(O=>{u.getLayer(O)&&u.removeLayer(O)}),u.getSource(S.sourceId)&&u.removeSource(S.sourceId),S.layerIds=[]})},N=()=>{const u=o.value;!u||typeof u.isStyleLoaded!="function"||!u.isStyleLoaded()||(i.value.forEach(S=>{w(u,S)}),P())},w=(u,S)=>{const O=ga(S.config);O==="vtile"?A(u,S):O==="raster"&&H(u,S)},H=(u,S)=>{const O=S.config,U=S.sourceId,Y=Yn(O.url);if(!Y)return;u.getSource(U)||u.addSource(U,{type:"raster",tiles:[Y],minzoom:O.minzoom??0,maxzoom:O.maxzoom??24});const K=`${S.id}-raster`;u.getLayer(K)||u.addLayer({id:K,type:"raster",source:U,layout:{visibility:S.visible?"visible":"none"}}),S.layerIds=[K],T(u,S)},A=(u,S)=>{const O=S.config,U=S.sourceId,Y=Yn(O.url);if(!Y)return;u.getSource(U)||u.addSource(U,{type:"vector",tiles:[Y],minzoom:O.minzoom??0,maxzoom:O.maxzoom??24});const K=O.style??{},oe=va(K),le=[],ie={visibility:S.visible?"visible":"none"},Ie=ya(O),Ve={source:U,layout:ie};if(Ie&&(Ve["source-layer"]=Ie),(K.type??"polygon").toLowerCase()==="point"){const Pe=`${S.id}-circle`;u.getLayer(Pe)||u.addLayer({id:Pe,type:"circle",...Ve,paint:{"circle-color":oe,"circle-opacity":K.opacity??1,"circle-radius":K.radius??K.width??3,"circle-stroke-color":K.stroke??K.color??"#ffffff","circle-stroke-width":K.width??1}}),le.push(Pe);const We=K.text??K.label;if(We){const et=`${S.id}-symbol`,on=hn(K.textSize)??10,sn=K.textHaloColor??K.stroke??"#ffffff",Rt=hn(K.textHaloWidth)??1,kt=hn(K.textZoom??K.pointZoom),Ft={"text-color":K.textColor??"#000000","text-halo-color":sn,"text-halo-width":Rt},Et={id:et,type:"symbol",...Ve,layout:{"text-field":["coalesce",["get",We],""],"text-size":on,"text-anchor":"top"},paint:Ft};kt!=null&&(Et.minzoom=kt),u.getLayer(et)||u.addLayer(Et),le.push(et)}}else{const Pe=`${S.id}-fill`;u.getLayer(Pe)||u.addLayer({id:Pe,type:"fill",...Ve,paint:{"fill-color":oe,"fill-opacity":K.opacity??.5,"fill-outline-color":K.stroke??K.color??"#0ea5e9"}}),le.push(Pe);const We=`${S.id}-line`;u.getLayer(We)||u.addLayer({id:We,type:"line",...Ve,paint:{"line-color":K.stroke??K.color??"#0b74c4","line-width":hn(K.width??K.border)??1,"line-opacity":K.opacity??1}}),le.push(We)}S.layerIds=le,T(u,S)},T=(u,S)=>{const O=S.visible?"visible":"none";S.layerIds.forEach(U=>{u.getLayer(U)&&u.setLayoutProperty(U,"visibility",O)})},R=u=>{const S=Array.isArray(u)?u:[];v(o.value??void 0),d.value=null,L();const O=S.map((U,Y)=>{if(!U)return null;const K=Yn(U.url);if(!K)return null;const oe=U.id!=null?String(U.id):`overlay-${Y}`;return{id:oe,config:{...U,id:oe,url:K},visible:!1,sourceId:`${oe}-source`,layerIds:[]}}).filter(U=>!!U);i.value=O,E(),N()},I=(u,S)=>{const O=i.value.find(Y=>Y.id===u);if(!O)return;O.visible=S,E();const U=o.value;if(!(!U||typeof U.isStyleLoaded!="function"||!U.isStyleLoaded())){if(!O.layerIds.length){w(U,O);return}T(U,O)}},x=()=>{a.value&&(a.value.remove(),a.value=null)},h=(u,S={})=>!Array.isArray(u.popup)||!u.popup.length?[]:u.popup.map(O=>({label:O.label??O.field,value:Jn(S?.[O.field])})).filter(O=>O.label&&O.value!==void 0),B=u=>{const S=o.value;if(!S||!u?.point)return;const O=S.queryRenderedFeatures(u.point);for(const U of O){const Y=U.layer?.id??U.sourceLayer;if(!Y)continue;const K=Qe(Y);if(!K)continue;const oe=h(K,U.properties??U.layer?.properties??{});if(!oe.length)continue;const le=ma(oe),ie=Vo();if(!ie)return;const Ie=u.lngLat;if(c.value===Y&&a.value){a.value.setLngLat(Ie),a.value.setHTML(le);return}c.value=Y,x(),a.value=new ie.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(Ie).setHTML(le).addTo(S);return}c.value=null,x()},F=()=>{c.value=null,x()},P=()=>{const u=o.value;!u||typeof u.isStyleLoaded!="function"||!u.isStyleLoaded()||u.getSource(zt)||(u.addSource(zt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),u.addLayer({id:ba,type:"fill",source:zt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),u.addLayer({id:ka,type:"line",source:zt,paint:{"line-color":"#1d4ed8","line-width":2}}))},G=u=>{const S=o.value;if(!S||typeof S.isStyleLoaded!="function"||!S.isStyleLoaded())return;P();const O=S.getSource(zt);if(!(!O||typeof O.setData!="function")){if(!u){O.setData({type:"FeatureCollection",features:[]});return}O.setData({type:"FeatureCollection",features:[u]})}},Z=u=>{const S=Ea(u);S&&G(S)},L=()=>{G(null)},M=()=>{d.value=null,L()},k=u=>{if(u)return typeof u=="string"?u:u.field??u.name??u.key??u.label},z=u=>{if(u)return typeof u=="string"?u:u.label??u.title??u.field??u.name},te=(u,S)=>!u||!u.length?[]:u.map(O=>{const U=k(O);if(!U)return null;const Y=z(O),K=Jn(S?.[U]);return!Y||K===""?null:{label:Y,value:K}}).filter(O=>!!O),Fe=(u,S)=>!Array.isArray(u)||!u.length?[]:u.map(O=>{if(!O?.name)return null;const U=O.title??O.name,Y=Jn(S?.[O.name]);return!U||Y===""?null:{label:U,value:Y}}).filter(O=>!!O),Ce=(u,S)=>!Array.isArray(u)||!u.length?[]:u.map(U=>{const Y=ns(U.url,S),K=U.label??U.url;return Y?{label:K,url:Y,target:U.target}:null}).filter(U=>!!U),ye=async(u,S)=>{const O=ns(u,S);if(!O)return null;try{const U=await fetch(O);return U.ok?await U.json():null}catch{return null}},me=async(u,S)=>{const O=S.properties??S.layer?.properties??{},U=te(u.card?.rows,O);let Y,K;if(u.card?.api){const ie=await ye(u.card.api,O);ie&&(typeof ie.html=="string"&&ie.html.trim()&&(Y=ie.html),Array.isArray(ie.columns)&&ie.columns.length&&(K=ie.columns))}let oe=U;if(!Y&&K){const ie=Fe(K,O);ie.length&&(oe=ie)}if(!oe.length&&!Y)return null;const le=Ce(u.card?.actions,O);return{title:O?.name??u.name,rows:oe,html:Y,actions:le.length?le:void 0}},Xe=async u=>{const S=o.value;if(!S||!u?.point)return;const O=S.queryRenderedFeatures(u.point);for(const U of O){const Y=U.layer?.id??U.sourceLayer;if(!Y)continue;const K=Qe(Y);if(!K||!K.card)continue;const oe=await me(K,U);if(oe){d.value=oe,Z(U);return}}d.value=null,L()},bt=()=>{const u=o.value;u&&(u.on("mousemove",B),u.on("mouseleave",F),u.on("click",Xe))},Be=()=>{const u=o.value;u&&(u.off("mousemove",B),u.off("mouseleave",F),u.off("click",Xe),x(),L())},Qe=u=>{if(u)return i.value.find(S=>S.layerIds.includes(u))?.config},q=async()=>{const u=await wa(),S=ha(t.container);if(!u||!S)return;const O={container:S,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 u.Map(O);const U=()=>{N()};f=U,o.value.on("style.load",U),o.value.on("load",()=>{s.value=!0,m&&o.value&&(o.value.setStyle(m),m=null),N(),bt()})};e.onMounted(q),e.onBeforeUnmount(()=>{Be(),o.value&&f&&o.value.off("style.load",f),v(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const W={map:o,ready:s,setStyle:g,flyTo:u=>o.value?.flyTo(u),fitBounds:(u,S)=>o.value?.fitBounds(u,S),setCenter:u=>o.value?.setCenter(u),setZoom:u=>o.value?.setZoom(u),addControl:(u,S)=>o.value?.addControl(u,S),removeControl:u=>o.value?.removeControl(u),on:(u,...S)=>o.value?.on(u,...S),off:(u,...S)=>o.value?.off(u,...S),project:u=>o.value?.project(u),unproject:u=>o.value?.unproject(u),state:r,basemapOptions:l,setOverlays:R,toggleOverlay:I,getOverlayConfig:Qe,selectedCard:d,setBasemapOptions:b,clearCard:M};return e.provide(es,W),W}const xa={class:"map-base-layer-menu"},Na={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Ca={class:"flex items-center justify-between p-2 border-b"},Sa={class:"p-2 border-b"},_a={class:"flex items-center"},Ba=["value","checked","onChange"],Ta={class:"ml-2"},$a={class:"p-2"},La={class:"flex items-center"},Aa=["checked"],Ia=["checked","onChange"],Da={class:"ml-2"},Oa=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:l}=gn(),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)},E=()=>{r?.(!m.value)},b=v=>{l?.(v.id,!v.visible)};return(v,N)=>(e.openBlock(),e.createElementBlock("div",xa,[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:N[0]||(N[0]=w=>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",Na,[e.createElementVNode("div",Ca,[N[3]||(N[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:N[1]||(N[1]=w=>i.value=!1)},[...N[2]||(N[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",Sa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w.key},[e.createElementVNode("label",_a,[e.createElementVNode("input",{type:"radio",name:a,value:w.key,checked:d.value===w.key,onChange:H=>g(w.key)},null,40,Ba),e.createElementVNode("span",Ta,e.toDisplayString(w.name||w.key),1)])]))),128))]),e.createElementVNode("div",$a,[e.createElementVNode("label",La,[e.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:E},null,40,Aa),N[4]||(N[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,w=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:w.id},[e.createElementVNode("input",{type:"checkbox",checked:w.visible,onChange:H=>b(w)},null,40,Ia),e.createElementVNode("span",Da,e.toDisplayString(w.name||w.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),Ma={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]"},Ra={class:"leading-tight"},Fa=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",Ma,[(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",Ra,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),Pa={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]"},za={class:"font-mono"},ja=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Pa,[e.createElementVNode("span",za,e.toDisplayString(t.coordinates),1)]))}}),Ha={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Ua=["title"],qa={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"},Wa=["onClick"],Ka=["placeholder"],Ga={class:"divide-y divide-gray-100"},Za=["onClick"],Ja=600,Ya="0000000000:00:000:0000",Xa=30,Qa=8,Va="https://data.softpro.ua/api-user/gis-url-proxy",ec="https://geo.rv.ua/api-user/dzk.api",tc="https://nominatim.openstreetmap.org/search",nc=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=gn(),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 q=n.config?.tools?.filter(W=>i.includes(W));return q&&q.length?q:i}),c=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),d=e.ref(a.value[0]);e.watch(a,q=>{q.includes(d.value)||(d.value=q[0])});const m=e.ref(""),f=e.ref(!1),g=e.ref(null),E=e.ref(null),b=e.ref(null),v=e.ref([]),N=e.ref(null),w=e.computed(()=>d.value==="address"&&v.value.length>0);let H=null,A=null,T=null;const R=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function I(){if(!E.value)return;const q=E.value.getBoundingClientRect(),W=q.width+Xa,u=q.left+window.scrollX,S=q.bottom+window.scrollY+Qa;R.left=`${u}px`,R.top=`${S}px`,R.width=`${W}px`,R.display="block"}const x=()=>{w.value&&I()};function h(){H&&(clearTimeout(H),H=null)}function B(){A?.destroy(),A=null}async function F(){if(d.value!=="parcel")return;const q=b.value;if(!q)return;const W=await pa();d.value==="parcel"&&(B(),A=W(q,{mask:Ya,lazy:!1,placeholderChar:"_"}),A.on("accept",()=>{m.value=A?.value??""}))}function P(){return(A?.value??m.value).trim()}function G(){if(!(typeof window>"u"))return window.maplibregl}function Z(q){const W=o.map.value;if(!W)return;const u=G();if(u){if(T){T.setLngLat([q.lat,q.lng]);return}T=new u.Marker({color:"#2563eb"}).setLngLat([q.lat,q.lng]).addTo(W)}}function L(){T&&(T.remove(),T=null)}e.watch(d,q=>{m.value="",f.value=!1,v.value=[],h(),q==="parcel"?e.nextTick(()=>{F().catch(W=>{we.notify({type:"error",title:"Маска кадастру",message:W?.message||"Не вдалося ініціалізувати маску"})})}):B()}),e.watch(w,q=>{q?e.nextTick(()=>{I()}):R.display="none"}),e.watch(m,q=>{if(d.value!=="address"){v.value=[],h();return}if(!q.trim()){v.value=[],h();return}h(),H=window.setTimeout(()=>{me(q).catch(W=>{const u=W?.message||"Помилка пошуку адреси";we.notify({type:"error",title:"Пошук адреси",message:u})})},Ja)});function M(q){d.value=q}function k(q){const W=q.target;if(f.value){const u=g.value;u&&!u.contains(W)&&(f.value=!1)}if(w.value){const u=N.value;u&&!u.contains(W)&&(v.value=[])}}e.onMounted(()=>{window.addEventListener("click",k,!0),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),d.value==="parcel"&&e.nextTick(()=>{F().catch(q=>{we.notify({type:"error",title:"Маска кадастру",message:q?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",k,!0),window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x),h(),B(),L()});function z(q){return q==="xy"?"Координати":q==="parcel"?"Кадастр":"Адреси"}function te(q){const W=q.replace(/[,]+/g," ").trim();if(!W)return null;const u=W.split(/\s+/).filter(Boolean);if(u.length<2)return null;console.log(u);const S=u.slice(0,2).map(Number);if(console.log(S),!S.every(ie=>Number.isFinite(ie)))return null;let[O,U]=S,Y=O,K=U;const oe=ie=>Math.abs(ie)<=90,le=ie=>Math.abs(ie)<=180;if(!oe(Y)||!le(K))if(oe(K)&&le(Y))Y=O,K=U;else return null;return console.log(Y,K),{lat:Y,lng:K}}function Fe(q){return(q?.items||[]).map((u,S)=>{const O=Number(u?.position?.lat),U=Number(u?.position?.lng);return!Number.isFinite(O)||!Number.isFinite(U)?null:{id:String(u?.id??S),title:u?.title||u?.address?.label||"Знайдений обʼєкт",lat:O,lng:U}}).filter(u=>!!u)}function Ce(q){const W=q?.result||q?.data||q;if(!W)return[];const u=W.geom_centroid;if(!u||!Array.isArray(u.coordinates))return[];const[S,O]=u.coordinates;return!Number.isFinite(S)||!Number.isFinite(O)?[]:[{id:"parcel",title:W.cadnum||W.cad_num||"Земельна ділянка",lat:S,lng:O}]}function ye(q){return(Array.isArray(q?.features)?q.features:[]).map((u,S)=>{const O=u?.geometry?.coordinates,U=Number(O?.[0]),Y=Number(O?.[1]);if(!Number.isFinite(U)||!Number.isFinite(Y))return null;const K=u?.properties||{},oe=K?.geocoding?.label||K?.display_name||K?.label||"Адреса";return{id:String(K?.geocoding?.place_id||K?.place_id||S),title:oe,lat:U,lng:Y}}).filter(u=>!!u)}async function me(q){v.value=[],h();const W=new URL(tc);W.searchParams.set("format","geojson"),W.searchParams.set("q",q),W.searchParams.set("addressdetails","1"),W.searchParams.set("bounded","1");const u=r();u&&W.searchParams.set("viewbox",u);const S=await fetch(W.toString());if(!S.ok)throw new Error(`HTTP ${S.status}`);const O=await S.json(),U=ye(O);if(!U.length){we.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}v.value=U}function Xe(q){Be(q),v.value=[],m.value=""}function bt(q){const u=q.replace(/\s+/g,"").split(":");if(u.length!==4)return!1;const S=[10,2,3,4];return u.every((O,U)=>O.length===S[U]&&/^\d+$/.test(O))}function Be(q){const W=n.config?.zoom??17;o.flyTo?.({center:[q.lat,q.lng],zoom:W}),Z(q)}async function Qe(){const q=d.value==="parcel"?P():m.value.trim();if(q){if(d.value==="xy"){const W=te(q);if(console.log(W),!W){we.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}Be(W),m.value="";return}if(d.value==="address"){try{await me(q)}catch(W){const u=W?.message||"Помилка пошуку адреси";we.notify({type:"error",title:"Пошук адреси",message:u})}return}try{const W=new URL(d.value==="here"?Va:ec);if(d.value==="here")W.searchParams.set("searchtext",q);else{if(!bt(q)){we.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}W.searchParams.set("cad_num",q)}const u=await fetch(W.toString());if(!u.ok)throw new Error(`HTTP ${u.status}`);const S=await u.json(),O=d.value==="here"?Fe(S):Ce(S);if(!O.length)we.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const U=O[0];Be(U),d.value==="parcel"&&A&&(A.value=""),m.value=""}}catch(W){const u=W?.message||"Помилка пошуку";we.notify({type:"error",title:"Пошук",message:u})}}}return(q,W)=>(e.openBlock(),e.createElementBlock("div",Ha,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(Qe,["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:W[0]||(W[0]=u=>f.value=!f.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:z(d.value)},e.toDisplayString(z(d.value)),9,Ua),(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"},[...W[3]||(W[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",qa,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,u=>(e.openBlock(),e.createElementBlock("li",{key:u,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:S=>M(u)},e.toDisplayString(z(u)),9,Wa))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:E,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:b,"onUpdate:modelValue":W[1]||(W[1]=u=>m.value=u),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":W[2]||(W[2]=u=>m.value=u),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,Ka)),[[e.vModelText,m.value,void 0,{trim:!0}]]),W[4]||(W[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)),w.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:N,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",Ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,u=>(e.openBlock(),e.createElementBlock("li",{key:u.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:S=>Xe(u)},e.toDisplayString(u.title),9,Za))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),oc={class:"map-center-control"},sc=["aria-label"],rc=e.defineComponent({directives:{tooltip:we.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=gn(),r=e.ref(null),l=e.ref(null),i=e.ref(null),a=e.ref(null);function c(b){if(Array.isArray(b)&&b.length>=2){const[v,N]=b.slice(0,2).map(w=>Number(w));return Number.isNaN(v)||Number.isNaN(N)?null:[v,N]}if(b&&typeof b=="object"){const v=b,N=v.lng??v.lon??v.long??v.x,w=v.lat??v.y;if(N!=null&&w!=null){const H=Number(N),A=Number(w);if(!Number.isNaN(H)&&!Number.isNaN(A))return[H,A]}}if(typeof b=="string"){const v=b.split(",").map(N=>Number(N.trim()));if(v.length>=2&&v.every(N=>!Number.isNaN(N)))return[v[0],v[1]]}return null}e.watch(()=>n.center,b=>{const v=c(b);v&&(r.value=v)},{immediate:!0}),e.watch(()=>n.zoom,b=>{const v=Number(b);Number.isNaN(v)||(l.value=v)},{immediate:!0}),e.watch(()=>n.targetCenter,b=>{i.value=c(b)},{immediate:!0}),e.watch(()=>n.targetZoom,b=>{const v=Number(b);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 b=o.value;if(b){if(!r.value){const v=b.getCenter();r.value=[v.lng,v.lat]}l.value==null&&(l.value=b.getZoom())}});function g(){const b=o.value;if(!b)return;const v=r.value||(()=>{const w=b.getCenter();return[w.lng,w.lat]})(),N=l.value??b.getZoom();b.flyTo({center:v,zoom:N})}function E(){const b=o.value;if(!b||!i.value)return;const v=a.value??l.value??b.getZoom();b.flyTo({center:i.value,zoom:v})}return(b,v)=>{const N=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",oc,[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(jr),{class:"w-4 h-4"})])),[[N,"Центр мапи"]]),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(E,["stop"])},[e.createVNode(e.unref(Ur),{class:"w-4 h-4"})],8,sc)),[[N,d.value]]):e.createCommentVNode("",!0)])}}}),os=nt(rc,[["__scopeId","data-v-bc627616"]]),ic={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},lc={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},ac=["aria-label"],cc={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)]"},dc={class:"text-slate-900 font-semibold mb-1"},fc=["innerHTML"],pc={key:1,class:"space-y-2"},uc={class:"text-gray-500"},mc={class:"font-medium text-slate-900"},hc={key:2,class:"mt-2 flex flex-col gap-2"},gc=["href","target"],ft="map-basemap-source",jt="map-basemap-layer",yc=20,St="map-katottg-geometry-source",yn="map-katottg-geometry-line",ot="map-geometry-source",_t="map-geometry-fill",Bt="map-geometry-line",Tt="map-geometry-circle",vn=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(p){if(p){if(Array.isArray(p)&&p.length>=2){const D=Number(p[0]),j=Number(p[1]);return!Number.isFinite(D)||!Number.isFinite(j)?void 0:[D,j]}if(typeof p=="object"){const D=p,j=D.lng??D.lon??D.long??D.x,X=D.lat??D.y;if(j!=null&&X!=null){const _e=Number(j),Ge=Number(X);if(Number.isFinite(_e)&&Number.isFinite(Ge))return[_e,Ge]}}}}function a(p){if(p==null)return;const D=Number(p);return Number.isFinite(D)?D:void 0}const c=()=>typeof window>"u"?"":window.location?.origin??"",d=p=>{if(!p)return"";const D=p.trim();if(!D)return"";const X=D.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!X)return"";if(/^https?:\/\//i.test(X))return X;const _e=c(),Ge=X.replace(/^\/+/,"");return _e?`${_e}/${Ge}`:Ge?`/${Ge}`:""},m=e.computed(()=>n.katottg!=null?n.katottg:l.katottg),f=e.computed(()=>(Array.isArray(l.basemaps)&&l.basemaps.length?l.basemaps:o).map((j,X)=>{const _e=typeof j.url=="string"?j.url.trim():"";return _e?{key:(j.key??j.name??`base-${X}`).trim()||`base-${X}`,url:_e,name:j.name??j.key??`Layer ${X+1}`}:null}).filter(j=>!!j)),g=i(l.center),E=a(l.zoom),b=Ho(n.geom),v=Cr(b),N=v?[(v[0]+v[2])/2,(v[1]+v[3])/2]:void 0,w=e.ref(null),H=e.computed(()=>i(n.center)??null),A=e.computed(()=>H.value??g??null),T=p=>p?{version:8,sources:{[ft]:{type:"raster",tiles:[p],tileSize:256}},layers:[{id:jt,type:"raster",source:ft,layout:{visibility:"visible"}}]}:{version:8,sources:{},layers:[]},R=d(f.value[0]?.url),I=gn({container:w,center:N??A.value??void 0,zoom:n.zoom??E,style:T(R)}),{map:x,setCenter:h,setZoom:B,state:F,getOverlayConfig:P,selectedCard:G,setBasemapOptions:Z,clearCard:L,addControl:M,removeControl:k,ready:z}=I,te=e.computed({get:()=>F.value.selectedBasemap??"",set:p=>{F.value.selectedBasemap=p}}),Fe=e.computed({get:()=>F.value.geometryVisible??!0,set:p=>{F.value.geometryVisible=p}}),Ce=e.computed(()=>{const p=n.height;return{height:typeof p=="number"?`${p}px`:String(p)}}),ye=e.ref(!1),me=e.ref(!1),Xe=e.computed(()=>ye.value?"!fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),bt=e.computed(()=>{const p=["w-full","h-full"];return ye.value||p.push(`min-h-[${Ce.value.height}]`),p.join(" ")}),Be=e.computed(()=>G.value),Qe=()=>L?.(),q=e.ref(N??A.value??null),W=e.ref(n.zoom??E??null),u=e.ref(A.value);e.watch(A,p=>{u.value=p},{immediate:!0});const S=e.computed(()=>u.value??null),O=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof W.value=="number"?W.value:yc),U=["home","fullscreen","scale","position"],Y=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?U:n.tools.filter(p=>U.includes(p))),K=p=>Y.value.includes(p);e.watch([x,z],([p,D])=>{if(!(!p||!D)){if(!q.value){const j=p.getCenter();q.value=[j.lng,j.lat]}W.value==null&&(W.value=p.getZoom())}},{immediate:!0});const oe=e.ref(null),le=e.ref(""),ie=e.ref(null),Ie=p=>p?me.value?!0:typeof p.isStyleLoaded=="function"&&p.isStyleLoaded()?(me.value=!0,!0):!1:!1,Ve=p=>{if(!p)return"";const D=Number(p.lat??p[1]),j=Number(p.lng??p[0]);return!Number.isFinite(D)||!Number.isFinite(j)?"":`${j.toFixed(5)}, ${D.toFixed(5)}`},nn=p=>{p?.lngLat&&(le.value=Ve(p.lngLat))},Pe=()=>{le.value=""},We=p=>{p&&(p.on("mousemove",nn),p.on("mouseleave",Pe),ie.value=p)},et=p=>{p&&(p.off("mousemove",nn),p.off("mouseleave",Pe),ie.value=null)},on=e.computed(()=>K("scale"));e.watch([x,z],([p,D],[j])=>{j&&et(j),!(!p||!D)&&We(p)},{immediate:!0}),e.watch([x,z,on],([p,D,j])=>{if(oe.value&&k&&(k(oe.value),oe.value=null),!p||!D||!j)return;const X=window?.maplibregl;X&&(oe.value=new X.ScaleControl({unit:"metric"}),M?.(oe.value,"bottom-left"))},{immediate:!0});const sn=e.computed(()=>Array.isArray(n.legend)?n.legend.map((p,D)=>{const j=typeof p?.color=="string"?p.color.trim():"",X=typeof p?.label=="string"?p.label.trim():"";return!j||!X?null:{color:j,label:X,key:`${X}-${D}`}}).filter(p=>!!p):[]),Rt=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(l.layers)&&l.layers.length?l.layers:[]);e.watch(f,p=>{if(Z?.(p),!p.length){te.value="";return}p.some(D=>D.key===te.value)||(te.value=p[0].key)},{immediate:!0});const kt=p=>{if(!p?.getStyle)return;const D=p.getStyle()??{},j=Array.isArray(D.layers)?D.layers:[];return j.length?j.find(_e=>_e.type!=="background")?.id??j[0]?.id:void 0},Ft=p=>{p&&(p.getLayer(jt)&&p.removeLayer(jt),p.getSource(ft)&&p.removeSource(ft))},Et=(p,D)=>{if(!p)return;const j=kt(p);p.addSource(ft,{type:"raster",tiles:[D],tileSize:256}),p.addLayer({id:jt,type:"raster",source:ft,layout:{visibility:"visible"}},j)},jn=p=>{if(!p)return;const D=d(p.url);if(!D){tt.value=null;return}tt.value=D,Ft(x.value),y()},tt=e.ref(null),Hn=e.ref(R||null),rn=p=>{if(!p||p.__pendingBasemapHooked)return;p.__pendingBasemapHooked=!0;const D=()=>{p.__pendingBasemapHooked=!1,y()};p.once("style.load",D),p.once("styledata",D)},y=()=>{const p=x.value,D=tt.value;if(!(!D||!p)){if(!Ie(p)){rn(p);return}if(Hn.value===D&&p.getSource(ft)&&p.getLayer(jt)){tt.value=null;return}Ft(p),Et(p,D),Hn.value=D,tt.value=null}},$=()=>{const p=te.value;if(!p)return;const D=f.value.find(j=>j.key===p);D&&jn(D)};e.watch(te,()=>{$()},{immediate:!0}),e.watch(Rt,p=>{I.setOverlays?.(p)},{immediate:!0,deep:!0});const C=e.ref(null);let _=0;const J=e.computed(()=>Ho(C.value)),ce={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}},ne={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},be=e.ref(b),De=e.ref(v),se=e.ref(!1),dt=e.computed(()=>{if(!De.value)return null;const[p,D,j,X]=De.value;return[(p+j)/2,(D+X)/2]}),Se=e.computed(()=>!!De.value),Ke=e.ref(!!v);e.ref(!1);const Pt=()=>{ye.value=!ye.value},je=e.ref(!1),ln=()=>{const p=x.value;if(!p||!Ie(p))return;const D=be.value;if(!D){gu(p),an();return}let j=p.getSource(ot);j?j.setData(D):(p.addSource(ot,{type:"geojson",data:D}),wt(p),j=p.getSource(ot)),xr(p,Fe.value?"visible":"none"),yu(),an(),De.value&&(!Ke.value&&(se.value||!je.value)?(p.fitBounds(De.value,{padding:40,maxZoom:16,duration:0}),je.value=!0,se.value=!1):Ke.value&&(Ke.value=!1,se.value=!1,je.value=!0))},wt=p=>{const D=ce;p.getLayer(_t)||p.addLayer({id:_t,type:"fill",source:ot,paint:D.fill}),p.getLayer(Bt)||p.addLayer({id:Bt,type:"line",source:ot,paint:D.line}),p.getLayer(Tt)||p.addLayer({id:Tt,type:"circle",source:ot,paint:D.circle,filter:["==","$type","Point"]})},gu=p=>{[Tt,Bt,_t].forEach(D=>{p.getLayer(D)&&p.removeLayer(D)}),p.getSource(ot)&&p.removeSource(ot)},xr=(p,D)=>{Ie(p)&&[Tt,Bt,_t].forEach(j=>{p.getLayer(j)&&p.setLayoutProperty(j,"visibility",D)})},yu=()=>{const p=x.value;if(!p||!Ie(p))return;const D=ce;p.getLayer(_t)&&Object.entries(D.fill).forEach(([j,X])=>{p.setPaintProperty(_t,j,X)}),p.getLayer(Bt)&&Object.entries(D.line).forEach(([j,X])=>{p.setPaintProperty(Bt,j,X)}),p.getLayer(Tt)&&Object.entries(D.circle).forEach(([j,X])=>{p.setPaintProperty(Tt,j,X)})},Nr=p=>{p.getLayer(yn)||p.addLayer({id:yn,type:"line",source:St,layout:{visibility:"visible"},paint:ne})},an=()=>{const p=x.value;if(!p||!Ie(p))return;const D=J.value??{type:"FeatureCollection",features:[]};if(!p.getSource(St)){p.addSource(St,{type:"geojson",data:D}),Nr(p);return}const j=p.getSource(St);j&&typeof j.setData=="function"&&j.setData(D),Nr(p)},vu=p=>{p.getLayer(yn)&&p.removeLayer(yn),p.getSource(St)&&p.removeSource(St)},bu=async p=>{const D=typeof p=="string"?p.trim():"",j=++_;if(!D){C.value=null;return}try{const X=await fetch(`https://data.gki.com.ua/api-user/atu/${D}`);if(_!==j)return;if(!X.ok){C.value=null;return}const _e=await X.json();if(_!==j)return;C.value=_e}catch{if(_!==j)return;C.value=null}};e.watch(m,p=>{bu(p)},{immediate:!0}),e.watch(J,()=>{an()},{immediate:!0}),e.watch(()=>n.geom,p=>{be.value=Ho(p),De.value=Cr(be.value),dt.value&&(q.value=dt.value),je.value=!1,se.value=!0,ln()},{deep:!0,immediate:!0}),e.watch(Fe,()=>{const p=x.value;p&&Ie(p)&&xr(p,Fe.value?"visible":"none")});const xt=()=>{me.value=!0,ln(),an(),y()},jo=()=>{ln(),an()};e.watch(x,(p,D)=>{D&&(D.off("style.load",xt),D.off("load",xt),D.off("idle",jo)),me.value=!1,p&&(p.on("load",xt),p.on("style.load",xt),p.on("idle",jo),typeof p.isStyleLoaded=="function"&&p.isStyleLoaded()&&xt())}),e.watch(H,p=>{!x.value||!p||Se.value||h(p)}),e.watch(()=>n.zoom,p=>{!x.value||typeof p!="number"||B(p)}),e.onBeforeUnmount(()=>{oe.value&&k&&k(oe.value),ie.value?et(ie.value):x.value&&et(x.value);const p=x.value;p&&(vu(p),p.off("style.load",xt),p.off("load",xt),p.off("idle",jo))});function ku(p){p&&(te.value=p)}function Eu(p){Fe.value=p}I.setBasemap=ku,I.toggleGeometry=Eu,I.setOverlays?.(Rt.value);function Ho(p){if(!p)return null;if(p.type==="FeatureCollection")return p;if(p.type==="Feature")return{type:"FeatureCollection",features:[p]};const D=p.geometry??p;if(!D?.type)return null;if(D.type==="GeometryCollection"&&Array.isArray(D.geometries)){const j=D.geometries.filter(X=>X&&typeof X.type=="string").map(X=>({type:"Feature",geometry:X}));return j.length?{type:"FeatureCollection",features:j}:null}if(D.type==="MultiPoint"&&Array.isArray(D.coordinates)){const j=D.coordinates.filter(X=>Array.isArray(X)&&X.length>=2).map(X=>({type:"Feature",geometry:{type:"Point",coordinates:X}}));return j.length?{type:"FeatureCollection",features:j}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:D}]}}function Cr(p){if(!p?.features?.length)return null;let D=1/0,j=1/0,X=-1/0,_e=-1/0;const Ge=cn=>{if(typeof cn[0]=="number"){const[Nt,Sr]=cn;D=Math.min(D,Nt),j=Math.min(j,Sr),X=Math.max(X,Nt),_e=Math.max(_e,Sr);return}cn.forEach(Nt=>Ge(Nt))};return p.features.forEach(cn=>{const Nt=cn?.geometry?.coordinates;Nt&&Ge(Nt)}),D===1/0||j===1/0?null:[D,j,X,_e]}return(p,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Xe.value),style:e.normalizeStyle(ye.value?void 0:Ce.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:w,class:e.normalizeClass(bt.value)},null,2),e.createVNode(Fa,{items:sn.value},null,8,["items"]),K("search")?(e.openBlock(),e.createBlock(nc,{key:0})):e.createCommentVNode("",!0),K("home")||K("fullscreen")?(e.openBlock(),e.createElementBlock("div",ic,[K("home")?(e.openBlock(),e.createElementBlock("div",lc,[e.createVNode(os,{center:S.value,zoom:O.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(os,{key:0,"target-center":dt.value,"target-zoom":O.value,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),K("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:Pt,"aria-label":ye.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...D[0]||(D[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,ac)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("div",cc,[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:Qe},[...D[1]||(D[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",dc,e.toDisplayString(Be.value.title||"Об'єкт"),1),Be.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(${Ce.value.height}-120px)]`]),innerHTML:Be.value.html},null,10,fc)):(e.openBlock(),e.createElementBlock("div",pc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value.rows,j=>(e.openBlock(),e.createElementBlock("div",{key:j.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",uc,e.toDisplayString(j.label)+":",1),e.createElementVNode("span",mc,e.toDisplayString(j.value),1)]))),128))])),Be.value.actions?.length?(e.openBlock(),e.createElementBlock("div",hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value.actions,j=>(e.openBlock(),e.createElementBlock("a",{key:j.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:j.url,target:j.target??void 0,rel:"noreferrer"},e.toDisplayString(j.label),9,gc))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Oa),K("position")&&le.value?(e.openBlock(),e.createBlock(ja,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:le.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 vc=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Xn=()=>{},bn=()=>!1,Qn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),st=Object.assign,Ze=Array.isArray,ve=t=>typeof t=="string",Vn=t=>typeof t=="symbol",bc=t=>t!==null&&typeof t=="object",ss=qe(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),kc=qe("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),eo=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},Ec=/-\w/g,rt=eo(t=>t.replace(Ec,n=>n.slice(1).toUpperCase())),to=eo(t=>t.charAt(0).toUpperCase()+t.slice(1)),wc=eo(t=>t?`on${to(t)}`:""),Ht={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"},xc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},Nc=/;(?![^(]*\))/g,Cc=/:([^]+)/,Sc=/\/\*[^]*?\*\//g;function _c(t){const n={};return t.replace(Sc,"").split(Nc).forEach(o=>{if(o){const s=o.split(Cc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const Bc="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",Tc="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",Lc="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Ac=qe(Bc),Ic=qe(Tc),Dc=qe($c),Oc=qe(Lc);const Ut=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),qt=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),no=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),kn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),rs=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),pt=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),is=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),ls=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),oo=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),so=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),Wt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),ro=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),as=Symbol(process.env.NODE_ENV!=="production"?"createStaticVNode":""),io=Symbol(process.env.NODE_ENV!=="production"?"resolveComponent":""),lo=Symbol(process.env.NODE_ENV!=="production"?"resolveDynamicComponent":""),ao=Symbol(process.env.NODE_ENV!=="production"?"resolveDirective":""),co=Symbol(process.env.NODE_ENV!=="production"?"resolveFilter":""),fo=Symbol(process.env.NODE_ENV!=="production"?"withDirectives":""),po=Symbol(process.env.NODE_ENV!=="production"?"renderList":""),cs=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),ds=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),En=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),wn=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),uo=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),mo=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Kt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Gt=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),ho=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),go=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),Mc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),yo=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),xn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Rc=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),Fc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),vo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),Pc=Symbol(process.env.NODE_ENV!=="production"?"unref":""),zc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),bo=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),fs=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),$t={[Ut]:"Fragment",[qt]:"Teleport",[no]:"Suspense",[kn]:"KeepAlive",[rs]:"BaseTransition",[pt]:"openBlock",[is]:"createBlock",[ls]:"createElementBlock",[oo]:"createVNode",[so]:"createElementVNode",[Wt]:"createCommentVNode",[ro]:"createTextVNode",[as]:"createStaticVNode",[io]:"resolveComponent",[lo]:"resolveDynamicComponent",[ao]:"resolveDirective",[co]:"resolveFilter",[fo]:"withDirectives",[po]:"renderList",[cs]:"renderSlot",[ds]:"createSlots",[En]:"toDisplayString",[wn]:"mergeProps",[uo]:"normalizeClass",[mo]:"normalizeStyle",[Kt]:"normalizeProps",[Gt]:"guardReactiveProps",[ho]:"toHandlers",[go]:"camelize",[Mc]:"capitalize",[yo]:"toHandlerKey",[xn]:"setBlockTracking",[Rc]:"pushScopeId",[Fc]:"popScopeId",[vo]:"withCtx",[Pc]:"unref",[zc]:"isRef",[bo]:"withMemo",[fs]:"isMemoSame"};function jc(t){Object.getOwnPropertySymbols(t).forEach(n=>{$t[n]=t[n]})}const Oe={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function Hc(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Oe}}function Zt(t,n,o,s,r,l,i,a=!1,c=!1,d=!1,m=Oe){return t&&(a?(t.helper(pt),t.helper(It(t.inSSR,d))):t.helper(At(t.inSSR,d)),i&&t.helper(fo)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:l,directives:i,isBlock:a,disableTracking:c,isComponent:d,loc:m}}function ut(t,n=Oe){return{type:17,loc:n,elements:t}}function ze(t,n=Oe){return{type:15,loc:n,properties:t}}function ue(t,n){return{type:16,loc:Oe,key:ve(t)?Q(t,!0):t,value:n}}function Q(t,n=!1,o=Oe,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function He(t,n=Oe){return{type:8,loc:n,children:t}}function ge(t,n=[],o=Oe){return{type:14,loc:o,callee:t,arguments:n}}function Lt(t,n=void 0,o=!1,s=!1,r=Oe){return{type:18,params:t,returns:n,newline:o,isSlot:s,loc:r}}function ko(t,n,o,s=!0){return{type:19,test:t,consequent:n,alternate:o,newline:s,loc:Oe}}function Uc(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Oe}}function qc(t){return{type:21,body:t,loc:Oe}}function At(t,n){return t||n?oo:so}function It(t,n){return t||n?is:ls}function Eo(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o(At(s,t.isComponent)),n(pt),n(It(s,t.isComponent)))}const ps=new Uint8Array([123,123]),us=new Uint8Array([125,125]);function ms(t){return t>=97&&t<=122||t>=65&&t<=90}function Me(t){return t===32||t===10||t===9||t===12||t===13}function it(t){return t===47||t===62||Me(t)}function Nn(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 Wc{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=ps,this.delimiterClose=us,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=ps,this.delimiterClose=us}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||Me(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):ms(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(Nn("</"+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){Me(n)||(n===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=ms(n)?9:27,this.sectionStart=this.index))}stateInClosingTagName(n){(n===62||Me(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):Me(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):Me(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)):Me(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):Me(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){Me(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 Kc={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 wo(t,{compatConfig:n}){const o=n&&n[t];return t==="MODE"?o||3:o}function lt(t,n){const o=wo("MODE",n),s=wo(t,n);return o===3?s===!0:s!==!1}function Dt(t,n,o,...s){const r=lt(t,n);return process.env.NODE_ENV!=="production"&&r&&Cn(t,n,o,...s),r}function Cn(t,n,o,...s){if(wo(t,n)==="suppress-warning")return;const{message:l,link:i}=Kc[t],a=`(deprecation ${t}) ${typeof l=="function"?l(...s):l}${i?`
2
- Details: ${i}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function xo(t){throw t}function hs(t){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${t.message}`)}function re(t,n,o,s){const r=process.env.NODE_ENV!=="production"?(o||Gc)[t]+(s||""):`https://vuejs.org/error-reference/#compiler-${t}`,l=new SyntaxError(String(r));return l.code=t,l.loc=n,l}const Gc={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
- 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:""},Te=t=>t.type===4&&t.isStatic;function gs(t){switch(t){case"Teleport":case"teleport":return qt;case"Suspense":case"suspense":return no;case"KeepAlive":case"keep-alive":return kn;case"BaseTransition":case"base-transition":return rs}}const Zc=/^$|^\d|[^\$\w\xA0-\uFFFF]/,No=t=>!Zc.test(t),ys=/[A-Za-z_$\xA0-\uFFFF]/,Jc=/[\.\?\w$\xA0-\uFFFF]/,Yc=/\s+[.[]\s*|\s*[.[]\s+/g,vs=t=>t.type===4?t.content:t.loc.source,bs=t=>{const n=vs(t).trim().replace(Yc,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?ys:Jc).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},Xc=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,Qc=t=>Xc.test(vs(t));function ks(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function $e(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 Jt(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&&Te(t)&&t.content===n)}function Vc(t){return t.props.some(n=>n.type===7&&n.name==="bind"&&(!n.arg||n.arg.type!==4||!n.arg.isStatic))}function Co(t){return t.type===5||t.type===2}function Es(t){return t.type===7&&t.name==="pre"}function ed(t){return t.type===7&&t.name==="slot"}function Sn(t){return t.type===1&&t.tagType===3}function _n(t){return t.type===1&&t.tagType===2}const td=new Set([Kt,Gt]);function ws(t,n=[]){if(t&&!ve(t)&&t.type===14){const o=t.callee;if(!ve(o)&&td.has(o))return ws(t.arguments[0],n.concat(t))}return[t,n]}function Bn(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=ws(r);r=a[0],l=a[1],i=l[l.length-1]}if(r==null||ve(r))s=ze([n]);else if(r.type===14){const a=r.arguments[0];!ve(a)&&a.type===15?xs(n,a)||a.properties.unshift(n):r.callee===ho?s=ge(o.helper(wn),[ze([n]),r]):r.arguments.unshift(ze([n])),!s&&(s=r)}else r.type===15?(xs(n,r)||r.properties.unshift(n),s=r):(s=ge(o.helper(wn),[ze([n]),r]),i&&i.callee===Gt&&(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 xs(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 Yt(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function nd(t){return t.type===14&&t.callee===bo?t.arguments[1].returns:t}const od=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function Ns(t){for(let n=0;n<t.length;n++)if(!Me(t.charCodeAt(n)))return!1;return!0}function So(t){return t.type===2&&Ns(t.content)||t.type===12&&So(t.content)}function _o(t){return t.type===3||So(t)}const Cs={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:bn,isPreTag:bn,isIgnoreNewlineTag:bn,isCustomElement:bn,onError:xo,onWarn:hs,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let ee=Cs,Xt=null,Je="",xe=null,V=null,Le="",Ye=-1,mt=-1,Bo=0,ct=!1,To=null;const fe=[],ae=new Wc(fe,{onerr:Ae,ontext(t,n){Tn(Ee(t,n),t,n)},ontextentity(t,n,o){Tn(t,n,o)},oninterpolation(t,n){if(ct)return Tn(Ee(t,n),t,n);let o=t+ae.delimiterOpen.length,s=n-ae.delimiterClose.length;for(;Me(Je.charCodeAt(o));)o++;for(;Me(Je.charCodeAt(s-1));)s--;let r=Ee(o,s);r.includes("&")&&(r=ee.decodeEntities(r,!1)),$o({type:5,content:Ln(r,!1,pe(o,s)),loc:pe(t,n)})},onopentagname(t,n){const o=Ee(t,n);xe={type:1,tag:o,ns:ee.getNamespace(o,fe[0],ee.ns),tagType:0,props:[],children:[],loc:pe(t-1,n),codegenNode:void 0}},onopentagend(t){_s(t)},onclosetag(t,n){const o=Ee(t,n);if(!ee.isVoidTag(o)){let s=!1;for(let r=0;r<fe.length;r++)if(fe[r].tag.toLowerCase()===o.toLowerCase()){s=!0,r>0&&Ae(24,fe[0].loc.start.offset);for(let i=0;i<=r;i++){const a=fe.shift();$n(a,n,i<r)}break}s||Ae(23,Bs(t,60))}},onselfclosingtag(t){const n=xe.tag;xe.isSelfClosing=!0,_s(t),fe[0]&&fe[0].tag===n&&$n(fe.shift(),t)},onattribname(t,n){V={type:6,name:Ee(t,n),nameLoc:pe(t,n),value:void 0,loc:pe(t)}},ondirname(t,n){const o=Ee(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!ct&&s===""&&Ae(26,t),ct||s==="")V={type:6,name:o,nameLoc:pe(t,n),value:void 0,loc:pe(t)};else if(V={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[Q("prop")]:[],loc:pe(t)},s==="pre"){ct=ae.inVPre=!0,To=xe;const r=xe.props;for(let l=0;l<r.length;l++)r[l].type===7&&(r[l]=ud(r[l]))}},ondirarg(t,n){if(t===n)return;const o=Ee(t,n);if(ct&&!Es(V))V.name+=o,ht(V.nameLoc,n);else{const s=o[0]!=="[";V.arg=Ln(s?o:o.slice(1,-1),s,pe(t,n),s?3:0)}},ondirmodifier(t,n){const o=Ee(t,n);if(ct&&!Es(V))V.name+="."+o,ht(V.nameLoc,n);else if(V.name==="slot"){const s=V.arg;s&&(s.content+="."+o,ht(s.loc,n))}else{const s=Q(o,!0,pe(t,n));V.modifiers.push(s)}},onattribdata(t,n){Le+=Ee(t,n),Ye<0&&(Ye=t),mt=n},onattribentity(t,n,o){Le+=t,Ye<0&&(Ye=n),mt=o},onattribnameend(t){const n=V.loc.start.offset,o=Ee(n,t);V.type===7&&(V.rawName=o),xe.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&Ae(2,n)},onattribend(t,n){if(xe&&V){if(ht(V.loc,n),t!==0)if(Le.includes("&")&&(Le=ee.decodeEntities(Le,!0)),V.type===6)V.name==="class"&&(Le=Ls(Le).trim()),t===1&&!Le&&Ae(13,n),V.value={type:2,content:Le,loc:t===1?pe(Ye,mt):pe(Ye-1,mt+1)},ae.inSFCRoot&&xe.tag==="template"&&V.name==="lang"&&Le&&Le!=="html"&&ae.enterRCDATA(Nn("</template"),0);else{let o=0;V.exp=Ln(Le,!1,pe(Ye,mt),0,o),V.name==="for"&&(V.forParseResult=rd(V.exp));let s=-1;V.name==="bind"&&(s=V.modifiers.findIndex(r=>r.content==="sync"))>-1&&Dt("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")&&xe.props.push(V)}Le="",Ye=mt=-1},oncomment(t,n){ee.comments&&$o({type:3,content:Ee(t,n),loc:pe(t-4,n+3)})},onend(){const t=Je.length;if(process.env.NODE_ENV!=="production"&&ae.state!==1)switch(ae.state){case 5:case 8:Ae(5,t);break;case 3:case 4:Ae(25,ae.sectionStart);break;case 28:ae.currentSequence===ke.CdataEnd?Ae(6,t):Ae(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:Ae(9,t);break}for(let n=0;n<fe.length;n++)$n(fe[n],t-1),Ae(24,fe[n].loc.start.offset)},oncdata(t,n){fe[0].ns!==0?Tn(Ee(t,n),t,n):Ae(1,t-9)},onprocessinginstruction(t){(fe[0]?fe[0].ns:ee.ns)===0&&Ae(21,t-1)}}),Ss=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,sd=/^\(|\)$/g;function rd(t){const n=t.loc,o=t.content,s=o.match(od);if(!s)return;const[,r,l]=s,i=(f,g,E=!1)=>{const b=n.start.offset+g,v=b+f.length;return Ln(f,!1,pe(b,v),0,E?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(sd,"").trim();const d=r.indexOf(c),m=c.match(Ss);if(m){c=c.replace(Ss,"").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 E=m[2].trim();E&&(a.index=i(E,o.indexOf(E,a.key?g+f.length:d+c.length),!0))}}return c&&(a.value=i(c,d,!0)),a}function Ee(t,n){return Je.slice(t,n)}function _s(t){ae.inSFCRoot&&(xe.innerLoc=pe(t+1,t+1)),$o(xe);const{tag:n,ns:o}=xe;o===0&&ee.isPreTag(n)&&Bo++,ee.isVoidTag(n)?$n(xe,t):(fe.unshift(xe),(o===1||o===2)&&(ae.inXML=!0)),xe=null}function Tn(t,n,o){{const l=fe[0]&&fe[0].tag;l!=="script"&&l!=="style"&&t.includes("&")&&(t=ee.decodeEntities(t,!1))}const s=fe[0]||Xt,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=t,ht(r.loc,o)):s.children.push({type:2,content:t,loc:pe(n,o)})}function $n(t,n,o=!1){o?ht(t.loc,Bs(n,60)):ht(t.loc,id(n,62)+1),ae.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:Ts(t)?t.tagType=3:ad(t)&&(t.tagType=1)),ae.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)&&Bo--,To===t&&(ct=ae.inVPre=!1,To=null),ae.inXML&&(fe[0]?fe[0].ns:ee.ns)===0&&(ae.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){Cn("COMPILER_V_IF_V_FOR_PRECEDENCE",ee,t.loc);break}}}if(!ae.inSFCRoot&&lt("COMPILER_NATIVE_TEMPLATE",ee)&&t.tag==="template"&&!Ts(t)){process.env.NODE_ENV!=="production"&&Cn("COMPILER_NATIVE_TEMPLATE",ee,t.loc);const c=fe[0]||Xt,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&&Dt("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 id(t,n){let o=t;for(;Je.charCodeAt(o)!==n&&o<Je.length-1;)o++;return o}function Bs(t,n){let o=t;for(;Je.charCodeAt(o)!==n&&o>=0;)o--;return o}const ld=new Set(["if","else","else-if","for","slot"]);function Ts({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&ld.has(n[o].name))return!0}return!1}function ad({tag:t,props:n}){if(ee.isCustomElement(t))return!1;if(t==="component"||cd(t.charCodeAt(0))||gs(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(Dt("COMPILER_IS_ON_ELEMENT",ee,s.loc))return!0}}else if(s.name==="bind"&&at(s.arg,"is")&&Dt("COMPILER_IS_ON_ELEMENT",ee,s.loc))return!0}return!1}function cd(t){return t>64&&t<91}const dd=/\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(Bo)r.content=r.content.replace(dd,`
4
- `);else if(Ns(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&&fd(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=Ls(r.content))}return o?t.filter(Boolean):t}function fd(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function Ls(t){let n="",o=!1;for(let s=0;s<t.length;s++)Me(t.charCodeAt(s))?o||(n+=" ",o=!0):(n+=t[s],o=!1);return n}function $o(t){(fe[0]||Xt).children.push(t)}function pe(t,n){return{start:ae.getPos(t),end:n==null?n:ae.getPos(n),source:n==null?n:Ee(t,n)}}function pd(t){return pe(t.start.offset,t.end.offset)}function ht(t,n){t.end=ae.getPos(n),t.source=Ee(t.start.offset,n)}function ud(t){const n={type:6,name:t.rawName,nameLoc:pe(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 Ln(t,n=!1,o,s=0,r=0){return Q(t,n,o,s)}function Ae(t,n,o){ee.onError(re(t,pe(n,n),void 0,o))}function md(){ae.reset(),xe=null,V=null,Le="",Ye=-1,mt=-1,fe.length=0}function hd(t,n){if(md(),Je=t,ee=st({},Cs),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.");ae.mode=ee.parseMode==="html"?1:ee.parseMode==="sfc"?2:0,ae.inXML=ee.ns===1||ee.ns===2;const o=n&&n.delimiters;o&&(ae.delimiterOpen=Nn(o[0]),ae.delimiterClose=Nn(o[1]));const s=Xt=Hc([],t);return ae.parse(Je),s.loc=pe(0,t.length),s.children=$s(s.children),Xt=null,s}function gd(t,n){An(t,void 0,n,!!As(t))}function As(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!_n(n[0])?n[0]:null}function An(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:Re(f,o);if(g>0){if(g>=2){f.codegenNode.patchFlag=-1,i.push(f);continue}}else{const E=f.codegenNode;if(E.type===13){const b=E.patchFlag;if((b===void 0||b===512||b===1)&&Ds(f,o)>=2){const v=Os(f);v&&(E.props=o.hoist(v))}E.dynamicProps&&(E.dynamicProps=o.hoist(E.dynamicProps))}}}else if(f.type===12&&(s?0:Re(f,o))>=2){f.codegenNode.type===14&&f.codegenNode.arguments.length>0&&f.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${Ht[-1]} */`:"")),i.push(f);continue}if(f.type===1){const g=f.tagType===1;g&&o.scopes.vSlot++,An(f,t,o,!1,r),g&&o.scopes.vSlot--}else if(f.type===11)An(f,t,o,f.children.length===1,!0);else if(f.type===9)for(let g=0;g<f.branches.length;g++)An(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&&Ze(t.codegenNode.children))t.codegenNode.children=c(ut(t.codegenNode.children)),a=!0;else if(t.tagType===1&&t.codegenNode&&t.codegenNode.type===13&&t.codegenNode.children&&!Ze(t.codegenNode.children)&&t.codegenNode.children.type===15){const m=d(t.codegenNode,"default");m&&(m.returns=c(ut(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&&!Ze(n.codegenNode.children)&&n.codegenNode.children.type===15){const m=$e(t,"slot",!0),f=m&&m.arg&&d(n.codegenNode,m.arg);f&&(f.returns=c(ut(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&&!Ze(m.children)&&m.children.type===15){const g=m.children.properties.find(E=>E.key===f||E.key.content===f);return g&&g.value}}i.length&&o.transformHoist&&o.transformHoist(l,o,t)}function Re(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=Ds(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=Re(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=Re(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(pt),n.removeHelper(It(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper(At(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 Re(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)||Vn(a))continue;const c=Re(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 yd=new Set([uo,mo,Kt,Gt]);function Is(t,n){if(t.type===14&&!ve(t.callee)&&yd.has(t.callee)){const o=t.arguments[0];if(o.type===4)return Re(o,n);if(o.type===14)return Is(o,n)}return 0}function Ds(t,n){let o=3;const s=Os(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=Re(i,n);if(c===0)return c;c<o&&(o=c);let d;if(a.type===4?d=Re(a,n):a.type===14?d=Is(a,n):d=0,d===0)return d;d<o&&(o=d)}}return o}function Os(t){const n=t.codegenNode;if(n.type===13)return n.props}function vd(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:l=!1,nodeTransforms:i=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:d=Xn,isCustomElement:m=Xn,expressionPlugins:f=[],scopeId:g=null,slotted:E=!0,ssr:b=!1,inSSR:v=!1,ssrCssVars:N="",bindingMetadata:w=vc,inline:H=!1,isTS:A=!1,onError:T=xo,onWarn:R=hs,compatConfig:I}){const x=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),h={filename:n,selfName:x&&to(rt(x[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:l,nodeTransforms:i,directiveTransforms:a,transformHoist:c,isBuiltInComponent:d,isCustomElement:m,expressionPlugins:f,scopeId:g,slotted:E,ssr:b,inSSR:v,ssrCssVars:N,bindingMetadata:w,inline:H,isTS:A,onError:T,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(B){const F=h.helpers.get(B)||0;return h.helpers.set(B,F+1),B},removeHelper(B){const F=h.helpers.get(B);if(F){const P=F-1;P?h.helpers.set(B,P):h.helpers.delete(B)}},helperString(B){return`_${$t[h.helper(B)]}`},replaceNode(B){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=B},removeNode(B){if(process.env.NODE_ENV!=="production"&&!h.parent)throw new Error("Cannot remove root node.");const F=h.parent.children,P=B?F.indexOf(B):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");!B||B===h.currentNode?(h.currentNode=null,h.onNodeRemoved()):h.childIndex>P&&(h.childIndex--,h.onNodeRemoved()),h.parent.children.splice(P,1)},onNodeRemoved:Xn,addIdentifiers(B){},removeIdentifiers(B){},hoist(B){ve(B)&&(B=Q(B)),h.hoists.push(B);const F=Q(`_hoisted_${h.hoists.length}`,!1,B.loc,2);return F.hoisted=B,F},cache(B,F=!1,P=!1){const G=Uc(h.cached.length,B,F,P);return h.cached.push(G),G}};return h.filters=new Set,h}function bd(t,n){const o=vd(t,n);In(t,o),n.hoistStatic&&gd(t,o),n.ssr||kd(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 kd(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=As(t);if(r&&r.codegenNode){const l=r.codegenNode;l.type===13&&Eo(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=Zt(n,o(Ut),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function Ed(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,In(r,n))}}function In(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&&(Ze(i)?s.push(...i):s.push(i)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(Wt);break;case 5:n.ssr||n.helper(En);break;case 9:for(let l=0;l<t.branches.length;l++)In(t.branches[l],n);break;case 10:case 11:case 1:case 0:Ed(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function Ms(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(ed))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 Dn="/*@__PURE__*/",Rs=t=>`${$t[t]}: _${$t[t]}`;function wd(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 E={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,N=-2,w){E.code+=v},indent(){b(++E.indentLevel)},deindent(v=!1){v?--E.indentLevel:b(--E.indentLevel)},newline(){b(E.indentLevel)}};function b(v){E.push(`
5
- `+" ".repeat(v),0)}return E}function xd(t,n={}){const o=wd(t,n);n.onContextCreated&&n.onContextCreated(o);const{mode:s,push:r,prefixIdentifiers:l,indent:i,deindent:a,newline:c,scopeId:d,ssr:m}=o,f=Array.from(t.helpers),g=f.length>0,E=!l&&s!=="module";Nd(t,o);const v=m?"ssrRender":"render",w=(m?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(r(`function ${v}(${w}) {`),i(),E&&(r("with (_ctx) {"),i(),g&&(r(`const { ${f.map(Rs).join(", ")} } = _Vue
6
- `,-1),c())),t.components.length&&(Lo(t.components,"component",o),(t.directives.length||t.temps>0)&&c()),t.directives.length&&(Lo(t.directives,"directive",o),t.temps>0&&c()),t.filters&&t.filters.length&&(c(),Lo(t.filters,"filter",o),c()),t.temps>0){r("let ");for(let H=0;H<t.temps;H++)r(`${H>0?", ":""}_temp${H}`)}return(t.components.length||t.directives.length||t.temps)&&(r(`
7
- `,0),c()),m||r("return "),t.codegenNode?Ne(t.codegenNode,o):r("null"),E&&(a(),r("}")),a(),r("}"),{ast:t,code:o.code,preamble:"",map:o.map?o.map.toJSON():void 0}}function Nd(t,n){const{ssr:o,prefixIdentifiers:s,push:r,newline:l,runtimeModuleName:i,runtimeGlobalName:a,ssrRuntimeModuleName:c}=n,d=a,m=Array.from(t.helpers);if(m.length>0&&(r(`const _Vue = ${d}
8
- `,-1),t.hoists.length)){const f=[oo,so,Wt,ro,as].filter(g=>m.includes(g)).map(Rs).join(", ");r(`const { ${f} } = _Vue
9
- `,-1)}Cd(t.hoists,n),l(),r("return ")}function Lo(t,n,{helper:o,push:s,newline:r,isTS:l}){const i=o(n==="filter"?co:n==="component"?io:ao);for(let a=0;a<t.length;a++){let c=t[a];const d=c.endsWith("__self");d&&(c=c.slice(0,-6)),s(`const ${Yt(c,n)} = ${i}(${JSON.stringify(c)}${d?", true":""})${l?"!":""}`),a<t.length-1&&r()}}function Cd(t,n){if(!t.length)return;n.pure=!0;const{push:o,newline:s}=n;s();for(let r=0;r<t.length;r++){const l=t[r];l&&(o(`const _hoisted_${r+1} = `),Ne(l,n),s())}n.pure=!1}function Sd(t){return ve(t)||t.type===4||t.type===2||t.type===5||t.type===8}function Ao(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Ze(s)||!Sd(s));n.push("["),o&&n.indent(),Qt(t,n,o),o&&n.deindent(),n.push("]")}function Qt(t,n,o=!1,s=!0){const{push:r,newline:l}=n;for(let i=0;i<t.length;i++){const a=t[i];ve(a)?r(a,-3):Ze(a)?Ao(a,n):Ne(a,n),i<t.length-1&&(o?(s&&r(","),l()):s&&r(", "))}}function Ne(t,n){if(ve(t)){n.push(t,-3);return}if(Vn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&ks(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Ne(t.codegenNode,n);break;case 2:_d(t,n);break;case 4:Fs(t,n);break;case 5:Bd(t,n);break;case 12:Ne(t.codegenNode,n);break;case 8:Ps(t,n);break;case 3:$d(t,n);break;case 13:Ld(t,n);break;case 14:Id(t,n);break;case 15:Dd(t,n);break;case 17:Od(t,n);break;case 18:Md(t,n);break;case 19:Rd(t,n);break;case 20:Fd(t,n);break;case 21:Qt(t.body,n,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return ks(!1,`unhandled codegen node type: ${t.type}`),t}}function _d(t,n){n.push(JSON.stringify(t.content),-3,t)}function Fs(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function Bd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Dn),o(`${s(En)}(`),Ne(t.content,n),o(")")}function Ps(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];ve(s)?n.push(s,-3):Ne(s,n)}}function Td(t,n){const{push:o}=n;if(t.type===8)o("["),Ps(t,n),o("]");else if(t.isStatic){const s=No(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function $d(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Dn),o(`${s(Wt)}(${JSON.stringify(t.content)})`,-3,t)}function Ld(t,n){const{push:o,helper:s,pure:r}=n,{tag:l,props:i,children:a,patchFlag:c,dynamicProps:d,directives:m,isBlock:f,disableTracking:g,isComponent:E}=t;let b;if(c)if(process.env.NODE_ENV!=="production")if(c<0)b=c+` /* ${Ht[c]} */`;else{const N=Object.keys(Ht).map(Number).filter(w=>w>0&&c&w).map(w=>Ht[w]).join(", ");b=c+` /* ${N} */`}else b=String(c);m&&o(s(fo)+"("),f&&o(`(${s(pt)}(${g?"true":""}), `),r&&o(Dn);const v=f?It(n.inSSR,E):At(n.inSSR,E);o(s(v)+"(",-2,t),Qt(Ad([l,i,a,b,d]),n),o(")"),f&&o(")"),m&&(o(", "),Ne(m,n),o(")"))}function Ad(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function Id(t,n){const{push:o,helper:s,pure:r}=n,l=ve(t.callee)?t.callee:s(t.callee);r&&o(Dn),o(l+"(",-2,t),Qt(t.arguments,n),o(")")}function Dd(t,n){const{push:o,indent:s,deindent:r,newline:l}=n,{properties:i}=t;if(!i.length){o("{}",-2,t);return}const a=i.length>1||process.env.NODE_ENV!=="production"&&i.some(c=>c.value.type!==4);o(a?"{":"{ "),a&&s();for(let c=0;c<i.length;c++){const{key:d,value:m}=i[c];Td(d,n),o(": "),Ne(m,n),c<i.length-1&&(o(","),l())}a&&r(),o(a?"}":" }")}function Od(t,n){Ao(t.elements,n)}function Md(t,n){const{push:o,indent:s,deindent:r}=n,{params:l,returns:i,body:a,newline:c,isSlot:d}=t;d&&o(`_${$t[vo]}(`),o("(",-2,t),Ze(l)?Qt(l,n):l&&Ne(l,n),o(") => "),(c||a)&&(o("{"),s()),i?(c&&o("return "),Ze(i)?Ao(i,n):Ne(i,n)):a&&Ne(a,n),(c||a)&&(r(),o("}")),d&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function Rd(t,n){const{test:o,consequent:s,alternate:r,newline:l}=t,{push:i,indent:a,deindent:c,newline:d}=n;if(o.type===4){const f=!No(o.content);f&&i("("),Fs(o,n),f&&i(")")}else i("("),Ne(o,n),i(")");l&&a(),n.indentLevel++,l||i(" "),i("? "),Ne(s,n),n.indentLevel--,l&&d(),l||i(" "),i(": ");const m=r.type===19;m||n.indentLevel++,Ne(r,n),m||n.indentLevel--,l&&c(!0)}function Fd(t,n){const{push:o,helper:s,indent:r,deindent:l,newline:i}=n,{needPauseTracking:a,needArraySpread:c}=t;c&&o("[...("),o(`_cache[${t.index}] || (`),a&&(r(),o(`${s(xn)}(-1`),t.inVOnce&&o(", true"),o("),"),i(),o("(")),o(`_cache[${t.index}] = `),Ne(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),i(),o(`${s(xn)}(1),`),i(),o(`_cache[${t.index}]`),l()),o(")"),c&&o(")]")}const Pd=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),zd=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function gt(t,n,o=!1,s=!1){const r=t.content;if(r.trim())try{new Function(s?` ${r} `:`return ${o?`(${r}) => {}`:`(${r})`}`)}catch(l){let i=l.message;const a=r.replace(zd,"").match(Pd);a&&(i=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(re(46,t.loc,void 0,i))}}const jd=(t,n)=>{if(t.type===5)t.content=Io(t.content,n);else if(t.type===1){const o=$e(t,"memo");for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&r.name!=="for"){const l=r.exp,i=r.arg;l&&l.type===4&&!(r.name==="on"&&i)&&!(o&&i&&i.type===4&&i.content==="key")&&(r.exp=Io(l,n,r.name==="slot")),i&&i.type===4&&!i.isStatic&&(r.arg=Io(i,n))}}}};function Io(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&gt(t,n,o,s),t}const Hd=Ms(/^(?:if|else|else-if)$/,(t,n,o)=>Ud(t,n,o,(s,r,l)=>{const i=o.parent.children;let a=i.indexOf(s),c=0;for(;a-->=0;){const d=i[a];d&&d.type===9&&(c+=d.branches.length)}return()=>{if(l)s.codegenNode=js(r,c,o);else{const d=Wd(s.codegenNode);d.alternate=js(r,c+s.branches.length-1,o)}}}));function Ud(t,n,o,s){if(n.name!=="else"&&(!n.exp||!n.exp.content.trim())){const r=n.exp?n.exp.loc:t.loc;o.onError(re(28,n.loc)),n.exp=Q("true",!1,r)}if(process.env.NODE_ENV!=="production"&&n.exp&&gt(n.exp,o),n.name==="if"){const r=zs(t,n),l={type:9,loc:pd(t.loc),branches:[r]};if(o.replaceNode(l),s)return s(l,r,!0)}else{const r=o.parent.children,l=[];let i=r.indexOf(t);for(;i-->=-1;){const a=r[i];if(a&&_o(a)){o.removeNode(a),process.env.NODE_ENV!=="production"&&a.type===3&&l.unshift(a);continue}if(a&&a.type===9){(n.name==="else-if"||n.name==="else")&&a.branches[a.branches.length-1].condition===void 0&&o.onError(re(30,t.loc)),o.removeNode();const c=zs(t,n);if(process.env.NODE_ENV!=="production"&&l.length&&!(o.parent&&o.parent.type===1&&(o.parent.tag==="transition"||o.parent.tag==="Transition"))&&(c.children=[...l,...c.children]),process.env.NODE_ENV!=="production"){const m=c.userKey;m&&a.branches.forEach(({userKey:f})=>{qd(f,m)&&o.onError(re(29,c.userKey.loc))})}a.branches.push(c);const d=s&&s(a,c,!1);In(c,o),d&&d(),o.currentNode=null}else o.onError(re(30,t.loc));break}}}function zs(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!$e(t,"for")?t.children:[t],userKey:Jt(t,"key"),isTemplateIf:o}}function js(t,n,o){return t.condition?ko(t.condition,Hs(t,n,o),ge(o.helper(Wt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):Hs(t,n,o)}function Hs(t,n,o){const{helper:s}=o,r=ue("key",Q(`${n}`,!1,Oe,2)),{children:l}=t,i=l[0];if(l.length!==1||i.type!==1)if(l.length===1&&i.type===11){const c=i.codegenNode;return Bn(c,r,o),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!t.isTemplateIf&&l.filter(d=>d.type!==3).length===1&&(c|=2048),Zt(o,s(Ut),ze([r]),l,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=i.codegenNode,d=nd(c);return d.type===13&&Eo(d,o),Bn(d,r,o),c}}function qd(t,n){if(!t||t.type!==n.type)return!1;if(t.type===6){if(t.value.content!==n.value.content)return!1}else{const o=t.exp,s=n.exp;if(o.type!==s.type||o.type!==4||o.isStatic!==s.isStatic||o.content!==s.content)return!1}return!0}function Wd(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const Kd=Ms("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return Gd(t,n,o,l=>{const i=ge(s(po),[l.source]),a=Sn(t),c=$e(t,"memo"),d=Jt(t,"key",!1,!0);d&&d.type;let m=d&&(d.type===6?d.value?Q(d.value.content,!0):void 0:d.exp);const f=d&&m?ue("key",m):null,g=l.source.type===4&&l.source.constType>0,E=g?64:d?128:256;return l.codegenNode=Zt(o,s(Ut),void 0,i,E,void 0,void 0,!0,!g,!1,t.loc),()=>{let b;const{children:v}=l;process.env.NODE_ENV!=="production"&&a&&t.children.some(H=>{if(H.type===1){const A=Jt(H,"key");if(A)return o.onError(re(33,A.loc)),!0}});const N=v.length!==1||v[0].type!==1,w=_n(t)?t:a&&t.children.length===1&&_n(t.children[0])?t.children[0]:null;if(w?(b=w.codegenNode,a&&f&&Bn(b,f,o)):N?b=Zt(o,s(Ut),f?ze([f]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(b=v[0].codegenNode,a&&f&&Bn(b,f,o),b.isBlock!==!g&&(b.isBlock?(r(pt),r(It(o.inSSR,b.isComponent))):r(At(o.inSSR,b.isComponent))),b.isBlock=!g,b.isBlock?(s(pt),s(It(o.inSSR,b.isComponent))):s(At(o.inSSR,b.isComponent))),c){const H=Lt(Do(l.parseResult,[Q("_cached")]));H.body=qc([He(["const _memo = (",c.exp,")"]),He(["if (_cached",...m?[" && _cached.key === ",m]:[],` && ${o.helperString(fs)}(_cached, _memo)) return _cached`]),He(["const _item = ",b]),Q("_item.memo = _memo"),Q("return _item")]),i.arguments.push(H,Q("_cache"),Q(String(o.cached.length))),o.cached.push(null)}else i.arguments.push(Lt(Do(l.parseResult),b,!0))}})});function Gd(t,n,o,s){if(!n.exp){o.onError(re(31,n.loc));return}const r=n.forParseResult;if(!r){o.onError(re(32,n.loc));return}Us(r,o);const{addIdentifiers:l,removeIdentifiers:i,scopes:a}=o,{source:c,value:d,key:m,index:f}=r,g={type:11,loc:n.loc,source:c,valueAlias:d,keyAlias:m,objectIndexAlias:f,parseResult:r,children:Sn(t)?t.children:[t]};o.replaceNode(g),a.vFor++;const E=s&&s(g);return()=>{a.vFor--,E&&E()}}function Us(t,n){t.finalized||(process.env.NODE_ENV!=="production"&&(gt(t.source,n),t.key&&gt(t.key,n,!0),t.index&&gt(t.index,n,!0),t.value&&gt(t.value,n,!0)),t.finalized=!0)}function Do({value:t,key:n,index:o},s=[]){return Zd([t,n,o,...s])}function Zd(t){let n=t.length;for(;n--&&!t[n];);return t.slice(0,n+1).map((o,s)=>o||Q("_".repeat(s+1),!1))}const qs=Q("undefined",!1),Jd=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=$e(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},Yd=(t,n,o,s)=>Lt(t,o,!1,!0,o.length?o[0].loc:s);function Xd(t,n,o=Yd){n.helper(vo);const{children:s,loc:r}=t,l=[],i=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=$e(t,"slot",!0);if(c){const{arg:N,exp:w}=c;N&&!Te(N)&&(a=!0),l.push(ue(N||Q("default",!0),o(w,void 0,s,r)))}let d=!1,m=!1;const f=[],g=new Set;let E=0;for(let N=0;N<s.length;N++){const w=s[N];let H;if(!Sn(w)||!(H=$e(w,"slot",!0))){w.type!==3&&f.push(w);continue}if(c){n.onError(re(37,H.loc));break}d=!0;const{children:A,loc:T}=w,{arg:R=Q("default",!0),exp:I,loc:x}=H;let h;Te(R)?h=R?R.content:"default":a=!0;const B=$e(w,"for"),F=o(I,B,A,T);let P,G;if(P=$e(w,"if"))a=!0,i.push(ko(P.exp,On(R,F,E++),qs));else if(G=$e(w,/^else(?:-if)?$/,!0)){let Z=N,L;for(;Z--&&(L=s[Z],!!_o(L)););if(L&&Sn(L)&&$e(L,/^(?:else-)?if$/)){let M=i[i.length-1];for(;M.alternate.type===19;)M=M.alternate;M.alternate=G.exp?ko(G.exp,On(R,F,E++),qs):On(R,F,E++)}else n.onError(re(30,G.loc))}else if(B){a=!0;const Z=B.forParseResult;Z?(Us(Z,n),i.push(ge(n.helper(po),[Z.source,Lt(Do(Z),On(R,F),!0)]))):n.onError(re(32,B.loc))}else{if(h){if(g.has(h)){n.onError(re(38,x));continue}g.add(h),h==="default"&&(m=!0)}l.push(ue(R,F))}}if(!c){const N=(w,H)=>{const A=o(w,void 0,H,r);return n.compatConfig&&(A.isNonScopedSlot=!0),ue("default",A)};d?f.length&&!f.every(So)&&(m?n.onError(re(39,f[0].loc)):l.push(N(void 0,f))):l.push(N(void 0,s))}const b=a?2:Mn(t.children)?3:1;let v=ze(l.concat(ue("_",Q(b+(process.env.NODE_ENV!=="production"?` /* ${xc[b]} */`:""),!1))),r);return i.length&&(v=ge(n.helper(ds),[v,ut(i)])),{slots:v,hasDynamicSlots:a}}function On(t,n,o){const s=[ue("name",t),ue("fn",n)];return o!=null&&s.push(ue("key",Q(String(o),!0))),ze(s)}function Mn(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||Mn(o.children))return!0;break;case 9:if(Mn(o.branches))return!0;break;case 10:case 11:if(Mn(o.children))return!0;break}}return!1}const Ws=new WeakMap,Qd=(t,n)=>function(){if(t=n.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:s,props:r}=t,l=t.tagType===1;let i=l?Vd(t,n):`"${s}"`;const a=bc(i)&&i.callee===lo;let c,d,m=0,f,g,E,b=a||i===qt||i===no||!l&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const v=Ks(t,n,void 0,l,a);c=v.props,m=v.patchFlag,g=v.dynamicPropNames;const N=v.directives;E=N&&N.length?ut(N.map(w=>tf(w,n))):void 0,v.shouldUseBlock&&(b=!0)}if(t.children.length>0)if(i===kn&&(b=!0,m|=1024,process.env.NODE_ENV!=="production"&&t.children.length>1&&n.onError(re(47,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}))),l&&i!==qt&&i!==kn){const{slots:N,hasDynamicSlots:w}=Xd(t,n);d=N,w&&(m|=1024)}else if(t.children.length===1&&i!==qt){const N=t.children[0],w=N.type,H=w===5||w===8;H&&Re(N,n)===0&&(m|=1),H||w===2?d=N:d=t.children}else d=t.children;g&&g.length&&(f=nf(g)),t.codegenNode=Zt(n,i,c,d,m===0?void 0:m,f,E,!!b,!1,l,t.loc)};function Vd(t,n,o=!1){let{tag:s}=t;const r=Oo(s),l=Jt(t,"is",!1,!0);if(l)if(r||lt("COMPILER_IS_ON_ELEMENT",n)){let a;if(l.type===6?a=l.value&&Q(l.value.content,!0):(a=l.exp,a||(a=Q("is",!1,l.arg.loc))),a)return ge(n.helper(lo),[a])}else l.type===6&&l.value.content.startsWith("vue:")&&(s=l.value.content.slice(4));const i=gs(s)||n.isBuiltInComponent(s);return i?(o||n.helper(i),i):(n.helper(io),n.components.add(s),Yt(s,"component"))}function Ks(t,n,o=t.props,s,r,l=!1){const{tag:i,loc:a,children:c}=t;let d=[];const m=[],f=[],g=c.length>0;let E=!1,b=0,v=!1,N=!1,w=!1,H=!1,A=!1,T=!1;const R=[],I=F=>{d.length&&(m.push(ze(Gs(d),a)),d=[]),F&&m.push(F)},x=()=>{n.scopes.vFor>0&&d.push(ue(Q("ref_for",!0),Q("true")))},h=({key:F,value:P})=>{if(Te(F)){const G=F.content,Z=Qn(G);if(Z&&(!s||r)&&G.toLowerCase()!=="onclick"&&G!=="onUpdate:modelValue"&&!ss(G)&&(H=!0),Z&&ss(G)&&(T=!0),Z&&P.type===14&&(P=P.arguments[0]),P.type===20||(P.type===4||P.type===8)&&Re(P,n)>0)return;G==="ref"?v=!0:G==="class"?N=!0:G==="style"?w=!0:G!=="key"&&!R.includes(G)&&R.push(G),s&&(G==="class"||G==="style")&&!R.includes(G)&&R.push(G)}else A=!0};for(let F=0;F<o.length;F++){const P=o[F];if(P.type===6){const{loc:G,name:Z,nameLoc:L,value:M}=P;let k=!0;if(Z==="ref"&&(v=!0,x()),Z==="is"&&(Oo(i)||M&&M.content.startsWith("vue:")||lt("COMPILER_IS_ON_ELEMENT",n)))continue;d.push(ue(Q(Z,!0,L),Q(M?M.content:"",k,M?M.loc:G)))}else{const{name:G,arg:Z,exp:L,loc:M,modifiers:k}=P,z=G==="bind",te=G==="on";if(G==="slot"){s||n.onError(re(40,M));continue}if(G==="once"||G==="memo"||G==="is"||z&&at(Z,"is")&&(Oo(i)||lt("COMPILER_IS_ON_ELEMENT",n))||te&&l)continue;if((z&&at(Z,"key")||te&&g&&at(Z,"vue:before-update"))&&(E=!0),z&&at(Z,"ref")&&x(),!Z&&(z||te)){if(A=!0,L)if(z){if(I(),process.env.NODE_ENV!=="production"&&m.some(ye=>ye.type===15?ye.properties.some(({key:me})=>me.type!==4||!me.isStatic?!0:me.content!=="class"&&me.content!=="style"&&!Qn(me.content)):!0)&&Dt("COMPILER_V_BIND_OBJECT_ORDER",n,M),lt("COMPILER_V_BIND_OBJECT_ORDER",n)){m.unshift(L);continue}x(),I(),m.push(L)}else I({type:14,loc:M,callee:n.helper(ho),arguments:s?[L]:[L,"true"]});else n.onError(re(z?34:35,M));continue}z&&k.some(Ce=>Ce.content==="prop")&&(b|=32);const Fe=n.directiveTransforms[G];if(Fe){const{props:Ce,needRuntime:ye}=Fe(P,t,n);!l&&Ce.forEach(h),te&&Z&&!Te(Z)?I(ze(Ce,a)):d.push(...Ce),ye&&(f.push(P),Vn(ye)&&Ws.set(P,ye))}else kc(G)||(f.push(P),g&&(E=!0))}}let B;if(m.length?(I(),m.length>1?B=ge(n.helper(wn),m,a):B=m[0]):d.length&&(B=ze(Gs(d),a)),A?b|=16:(N&&!s&&(b|=2),w&&!s&&(b|=4),R.length&&(b|=8),H&&(b|=32)),!E&&(b===0||b===32)&&(v||T||f.length>0)&&(b|=512),!n.inSSR&&B)switch(B.type){case 15:let F=-1,P=-1,G=!1;for(let M=0;M<B.properties.length;M++){const k=B.properties[M].key;Te(k)?k.content==="class"?F=M:k.content==="style"&&(P=M):k.isHandlerKey||(G=!0)}const Z=B.properties[F],L=B.properties[P];G?B=ge(n.helper(Kt),[B]):(Z&&!Te(Z.value)&&(Z.value=ge(n.helper(uo),[Z.value])),L&&(w||L.value.type===4&&L.value.content.trim()[0]==="["||L.value.type===17)&&(L.value=ge(n.helper(mo),[L.value])));break;case 14:break;default:B=ge(n.helper(Kt),[ge(n.helper(Gt),[B])]);break}return{props:B,directives:f,patchFlag:b,dynamicPropNames:R,shouldUseBlock:E}}function Gs(t){const n=new Map,o=[];for(let s=0;s<t.length;s++){const r=t[s];if(r.key.type===8||!r.key.isStatic){o.push(r);continue}const l=r.key.content,i=n.get(l);i?(l==="style"||l==="class"||Qn(l))&&ef(i,r):(n.set(l,r),o.push(r))}return o}function ef(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=ut([t.value,n.value],t.loc)}function tf(t,n){const o=[],s=Ws.get(t);s?o.push(n.helperString(s)):(n.helper(ao),n.directives.add(t.name),o.push(Yt(t.name,"directive")));const{loc:r}=t;if(t.exp&&o.push(t.exp),t.arg&&(t.exp||o.push("void 0"),o.push(t.arg)),Object.keys(t.modifiers).length){t.arg||(t.exp||o.push("void 0"),o.push("void 0"));const l=Q("true",!1,r);o.push(ze(t.modifiers.map(i=>ue(i,l)),r))}return ut(o,t.loc)}function nf(t){let n="[";for(let o=0,s=t.length;o<s;o++)n+=JSON.stringify(t[o]),o<s-1&&(n+=", ");return n+"]"}function Oo(t){return t==="component"||t==="Component"}const of=(t,n)=>{if(_n(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:l}=sf(t,n),i=[n.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;l&&(i[2]=l,a=3),o.length&&(i[3]=Lt([],o,!1,!1,s),a=4),n.scopeId&&!n.slotted&&(a=5),i.splice(a),t.codegenNode=ge(n.helper(cs),i,s)}};function sf(t,n){let o='"default"',s;const r=[];for(let l=0;l<t.props.length;l++){const i=t.props[l];if(i.type===6)i.value&&(i.name==="name"?o=JSON.stringify(i.value.content):(i.name=rt(i.name),r.push(i)));else if(i.name==="bind"&&at(i.arg,"name")){if(i.exp)o=i.exp;else if(i.arg&&i.arg.type===4){const a=rt(i.arg.content);o=i.exp=Q(a,!1,i.arg.loc)}}else i.name==="bind"&&i.arg&&Te(i.arg)&&(i.arg.content=rt(i.arg.content)),r.push(i)}if(r.length>0){const{props:l,directives:i}=Ks(t,n,r,!1,!1);s=l,i.length&&n.onError(re(36,i[0].loc))}return{slotName:o,slotProps:s}}const Zs=(t,n,o,s)=>{const{loc:r,modifiers:l,arg:i}=t;!t.exp&&!l.length&&o.onError(re(35,r));let a;if(i.type===4)if(i.isStatic){let f=i.content;process.env.NODE_ENV!=="production"&&f.startsWith("vnode")&&o.onError(re(52,i.loc)),f.startsWith("vue:")&&(f=`vnode-${f.slice(4)}`);const g=n.tagType!==0||f.startsWith("vnode")||!/[A-Z]/.test(f)?wc(rt(f)):`on:${f}`;a=Q(g,!0,i.loc)}else a=He([`${o.helperString(yo)}(`,i,")"]);else a=i,a.children.unshift(`${o.helperString(yo)}(`),a.children.push(")");let c=t.exp;c&&!c.content.trim()&&(c=void 0);let d=o.cacheHandlers&&!c&&!o.inVOnce;if(c){const f=bs(c),g=!(f||Qc(c)),E=c.content.includes(";");process.env.NODE_ENV!=="production"&&gt(c,o,!1,E),(g||d&&f)&&(c=He([`${g?"$event":"(...args)"} => ${E?"{":"("}`,c,E?"}":")"]))}let m={props:[ue(a,c||Q("() => {}",!1,r))]};return s&&(m=s(m)),d&&(m.props[0].value=o.cache(m.props[0].value)),m.props.forEach(f=>f.key.isHandlerKey=!0),m},rf=(t,n,o)=>{const{modifiers:s,loc:r}=t,l=t.arg;let{exp:i}=t;return i&&i.type===4&&!i.content.trim()&&(i=void 0),l.type!==4?(l.children.unshift("("),l.children.push(') || ""')):l.isStatic||(l.content=l.content?`${l.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(l.type===4?l.isStatic?l.content=rt(l.content):l.content=`${o.helperString(go)}(${l.content})`:(l.children.unshift(`${o.helperString(go)}(`),l.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&Js(l,"."),s.some(a=>a.content==="attr")&&Js(l,"^")),{props:[ue(l,i)]}},Js=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},lf=(t,n)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const o=t.children;let s,r=!1;for(let l=0;l<o.length;l++){const i=o[l];if(Co(i)){r=!0;for(let a=l+1;a<o.length;a++){const c=o[a];if(Co(c))s||(s=o[l]=He([i],i.loc)),s.children.push(" + ",c),o.splice(a,1),a--;else{s=void 0;break}}}}if(!(!r||o.length===1&&(t.type===0||t.type===1&&t.tagType===0&&!t.props.find(l=>l.type===7&&!n.directiveTransforms[l.name])&&t.tag!=="template")))for(let l=0;l<o.length;l++){const i=o[l];if(Co(i)||i.type===8){const a=[];(i.type!==2||i.content!==" ")&&a.push(i),!n.ssr&&Re(i,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Ht[1]} */`:"")),o[l]={type:12,content:i,loc:i.loc,codegenNode:ge(n.helper(ro),a)}}}}},Ys=new WeakSet,af=(t,n)=>{if(t.type===1&&$e(t,"once",!0))return Ys.has(t)||n.inVOnce||n.inSSR?void 0:(Ys.add(t),n.inVOnce=!0,n.helper(xn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},Xs=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(re(41,t.loc)),Vt();const l=s.loc.source.trim(),i=s.type===4?s.content:l,a=o.bindingMetadata[l];if(a==="props"||a==="props-aliased")return o.onError(re(44,s.loc)),Vt();if(a==="literal-const"||a==="setup-const")return o.onError(re(45,s.loc)),Vt();if(!i.trim()||!bs(s))return o.onError(re(42,s.loc)),Vt();const c=r||Q("modelValue",!0),d=r?Te(r)?`onUpdate:${rt(r.content)}`:He(['"onUpdate:" + ',r]):"onUpdate:modelValue";let m;const f=o.isTS?"($event: any)":"$event";m=He([`${f} => ((`,s,") = $event)"]);const g=[ue(c,t.exp),ue(d,m)];if(t.modifiers.length&&n.tagType===1){const E=t.modifiers.map(v=>v.content).map(v=>(No(v)?v:JSON.stringify(v))+": true").join(", "),b=r?Te(r)?`${r.content}Modifiers`:He([r,' + "Modifiers"']):"modelModifiers";g.push(ue(b,Q(`{ ${E} }`,!1,t.loc,2)))}return Vt(g)};function Vt(t=[]){return{props:t}}const cf=/[\w).+\-_$\]]/,df=(t,n)=>{lt("COMPILER_FILTERS",n)&&(t.type===5?Rn(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&Rn(o.exp,n)}))};function Rn(t,n){if(t.type===4)Qs(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?Qs(s,n):s.type===8?Rn(t,n):s.type===5&&Rn(s.content,n))}}function Qs(t,n){const o=t.content;let s=!1,r=!1,l=!1,i=!1,a=0,c=0,d=0,m=0,f,g,E,b,v=[];for(E=0;E<o.length;E++)if(g=f,f=o.charCodeAt(E),s)f===39&&g!==92&&(s=!1);else if(r)f===34&&g!==92&&(r=!1);else if(l)f===96&&g!==92&&(l=!1);else if(i)f===47&&g!==92&&(i=!1);else if(f===124&&o.charCodeAt(E+1)!==124&&o.charCodeAt(E-1)!==124&&!a&&!c&&!d)b===void 0?(m=E+1,b=o.slice(0,E).trim()):N();else{switch(f){case 34:r=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:d++;break;case 41:d--;break;case 91:c++;break;case 93:c--;break;case 123:a++;break;case 125:a--;break}if(f===47){let w=E-1,H;for(;w>=0&&(H=o.charAt(w),H===" ");w--);(!H||!cf.test(H))&&(i=!0)}}b===void 0?b=o.slice(0,E).trim():m!==0&&N();function N(){v.push(o.slice(m,E).trim()),m=E+1}if(v.length){for(process.env.NODE_ENV!=="production"&&Cn("COMPILER_FILTERS",n,t.loc),E=0;E<v.length;E++)b=ff(b,v[E],n);t.content=b,t.ast=void 0}}function ff(t,n,o){o.helper(co);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${Yt(n,"filter")}(${t})`;{const r=n.slice(0,s),l=n.slice(s+1);return o.filters.add(r),`${Yt(r,"filter")}(${t}${l!==")"?","+l:l}`}}const Vs=new WeakSet,pf=(t,n)=>{if(t.type===1){const o=$e(t,"memo");return!o||Vs.has(t)||n.inSSR?void 0:(Vs.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&Eo(s,n),t.codegenNode=ge(n.helper(bo),[o.exp,Lt(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}},uf=(t,n)=>{if(t.type===1){for(const o of t.props)if(o.type===7&&o.name==="bind"&&(!o.exp||o.exp.type===4&&!o.exp.content.trim())&&o.arg){const s=o.arg;if(s.type!==4||!s.isStatic)n.onError(re(53,s.loc)),o.exp=Q("",!0,s.loc);else{const r=rt(s.content);(ys.test(r[0])||r[0]==="-")&&(o.exp=Q(r,!1,s.loc))}}}};function mf(t){return[[uf,af,Hd,pf,Kd,df,...process.env.NODE_ENV!=="production"?[jd]:[],of,Qd,Jd,lf],{on:Zs,bind:rf,model:Xs}]}function hf(t,n={}){const o=n.onError||xo,s=n.mode==="module";n.prefixIdentifiers===!0?o(re(48)):s&&o(re(49));const r=!1;n.cacheHandlers&&o(re(50)),n.scopeId&&!s&&o(re(51));const l=st({},n,{prefixIdentifiers:r}),i=ve(t)?hd(t,l):t,[a,c]=mf();return bd(i,st({},l,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:st({},c,n.directiveTransforms||{})})),xd(i,l)}const gf=()=>({props:[]});const er=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),tr=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),nr=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),or=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Mo=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),sr=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),rr=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),ir=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),Ro=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),lr=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");jc({[er]:"vModelRadio",[tr]:"vModelCheckbox",[nr]:"vModelText",[or]:"vModelSelect",[Mo]:"vModelDynamic",[sr]:"withModifiers",[rr]:"withKeys",[ir]:"vShow",[Ro]:"Transition",[lr]:"TransitionGroup"});let Ot;function yf(t,n=!1){return Ot||(Ot=document.createElement("div")),n?(Ot.innerHTML=`<div foo="${t.replace(/"/g,"&quot;")}">`,Ot.children[0].getAttribute("foo")):(Ot.innerHTML=t,Ot.textContent)}const vf={parseMode:"html",isVoidTag:Oc,isNativeTag:t=>Ac(t)||Ic(t)||Dc(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:yf,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return Ro;if(t==="TransitionGroup"||t==="transition-group")return lr},getNamespace(t,n,o){let s=n?n.ns:o;if(n&&s===2)if(n.tag==="annotation-xml"){if(t==="svg")return 1;n.props.some(r=>r.type===6&&r.name==="encoding"&&r.value!=null&&(r.value.content==="text/html"||r.value.content==="application/xhtml+xml"))&&(s=0)}else/^m(?:[ions]|text)$/.test(n.tag)&&t!=="mglyph"&&t!=="malignmark"&&(s=0);else n&&s===1&&(n.tag==="foreignObject"||n.tag==="desc"||n.tag==="title")&&(s=0);if(s===0){if(t==="svg")return 1;if(t==="math")return 2}return s}},bf=t=>{t.type===1&&t.props.forEach((n,o)=>{n.type===6&&n.name==="style"&&n.value&&(t.props[o]={type:7,name:"bind",arg:Q("style",!0,n.loc),exp:kf(n.value.content,n.loc),modifiers:[],loc:n.loc})})},kf=(t,n)=>{const o=_c(t);return Q(JSON.stringify(o),!1,n,3)};function Ue(t,n){return re(t,n,process.env.NODE_ENV!=="production"?Ef:void 0)}const Ef={54:"v-html is missing expression.",55:"v-html will override element children.",56:"v-text is missing expression.",57:"v-text will override element children.",58:"v-model can only be used on <input>, <textarea> and <select> elements.",59:"v-model argument is not supported on plain elements.",60:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",61:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",62:"v-show is missing expression.",63:"<Transition> expects exactly one child element or component.",64:"Tags with side effect (<script> and <style>) are ignored in client component templates."},wf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(54,r)),n.children.length&&(o.onError(Ue(55,r)),n.children.length=0),{props:[ue(Q("innerHTML",!0,r),s||Q("",!0))]}},xf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(56,r)),n.children.length&&(o.onError(Ue(57,r)),n.children.length=0),{props:[ue(Q("textContent",!0),s?Re(s,o)>0?s:ge(o.helperString(En),[s],r):Q("",!0))]}},Nf=(t,n,o)=>{const s=Xs(t,n,o);if(!s.props.length||n.tagType===1)return s;t.arg&&o.onError(Ue(59,t.arg.loc));function r(){const a=$e(n,"bind");a&&at(a.arg,"value")&&o.onError(Ue(61,a.loc))}const{tag:l}=n,i=o.isCustomElement(l);if(l==="input"||l==="textarea"||l==="select"||i){let a=nr,c=!1;if(l==="input"||i){const d=Jt(n,"type");if(d){if(d.type===7)a=Mo;else if(d.value)switch(d.value.content){case"radio":a=er;break;case"checkbox":a=tr;break;case"file":c=!0,o.onError(Ue(60,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else Vc(n)?a=Mo:process.env.NODE_ENV!=="production"&&r()}else l==="select"?a=or:process.env.NODE_ENV!=="production"&&r();c||(s.needRuntime=o.helper(a))}else o.onError(Ue(58,t.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},Cf=qe("passive,once,capture"),Sf=qe("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),_f=qe("left,right"),ar=qe("onkeyup,onkeydown,onkeypress"),Bf=(t,n,o,s)=>{const r=[],l=[],i=[];for(let a=0;a<n.length;a++){const c=n[a].content;c==="native"&&Dt("COMPILER_V_ON_NATIVE",o,s)||Cf(c)?i.push(c):_f(c)?Te(t)?ar(t.content.toLowerCase())?r.push(c):l.push(c):(r.push(c),l.push(c)):Sf(c)?l.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:l,eventOptionModifiers:i}},cr=(t,n)=>Te(t)&&t.content.toLowerCase()==="onclick"?Q(n,!0):t.type!==4?He(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,Tf=(t,n,o)=>Zs(t,n,o,s=>{const{modifiers:r}=t;if(!r.length)return s;let{key:l,value:i}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:d}=Bf(l,r,o,t.loc);if(c.includes("right")&&(l=cr(l,"onContextmenu")),c.includes("middle")&&(l=cr(l,"onMouseup")),c.length&&(i=ge(o.helper(sr),[i,JSON.stringify(c)])),a.length&&(!Te(l)||ar(l.content.toLowerCase()))&&(i=ge(o.helper(rr),[i,JSON.stringify(a)])),d.length){const m=d.map(to).join("");l=Te(l)?Q(`${l.content}${m}`,!0):He(["(",l,`) + "${m}"`])}return{props:[ue(l,i)]}}),$f=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(Ue(62,r)),{props:[],needRuntime:o.helper(ir)}},Lf=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===Ro)return()=>{if(!t.children.length)return;dr(t)&&n.onError(Ue(63,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}));const s=t.children[0];if(s.type===1)for(const r of s.props)r.type===7&&r.name==="show"&&t.props.push({type:6,name:"persisted",nameLoc:t.loc,value:void 0,loc:t.loc})}};function dr(t){const n=t.children=t.children.filter(s=>!_o(s)),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(dr)}const Af=(t,n)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(process.env.NODE_ENV!=="production"&&n.onError(Ue(64,t.loc)),n.removeNode())};function If(t,n){return t==="template"?!0:t in fr?fr[t].has(n):n in pr?pr[n].has(t):!(t in ur&&ur[t].has(n)||n in mr&&mr[n].has(t))}const Mt=new Set(["h1","h2","h3","h4","h5","h6"]),yt=new Set([]),fr={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:yt,iframe:yt,option:yt,textarea:yt,style:yt,title:yt},pr={html:yt,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},ur={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},mr={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:Mt,h2:Mt,h3:Mt,h4:Mt,h5:Mt,h6:Mt},Df=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!If(n.parent.tag,t.tag)){const o=new SyntaxError(`<${t.tag}> cannot be child of <${n.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);o.loc=t.loc,n.onWarn(o)}},Of=[bf,...process.env.NODE_ENV!=="production"?[Lf,Df]:[]],Mf={cloak:gf,html:wf,text:xf,model:Nf,on:Tf,show:$f};function Rf(t,n={}){return hf(t,st({},vf,n,{nodeTransforms:[Af,...Of,...n.nodeTransforms||[]],directiveTransforms:st({},Mf,n.directiveTransforms||{}),transformHoist:null}))}function Ff(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=Rf(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)(Br);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const Fo={};function Pf(t){return Fo[t]||(Fo[t]=Ff(t,{props:{row:{type:Object,default:void 0},value:{type:null,default:void 0},data:{type:Object,default:void 0},column:{type:Object,default:void 0}}})),Fo[t]}const zf={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},jf={class:"flex items-center gap-2"},Hf=["disabled"],Uf={class:"text-sm"},qf=["disabled"],Wf=e.defineComponent({__name:"TablePagination",props:{currentPage:{},totalPages:{},label:{}},setup(t){const n=t,o=e.computed(()=>n.currentPage<=1),s=e.computed(()=>n.currentPage>=n.totalPages);return(r,l)=>(e.openBlock(),e.createElementBlock("div",zf,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",jf,[e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:o.value,onClick:l[0]||(l[0]=i=>r.$emit("previous"))}," Назад ",8,Hf),e.createElementVNode("span",Uf,"Сторінка "+e.toDisplayString(t.currentPage)+" з "+e.toDisplayString(t.totalPages),1),e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:s.value,onClick:l[1]||(l[1]=i=>r.$emit("next"))}," Далі ",8,qf)])]))}}),Kf={class:"relative inline-flex"},Gf=["aria-label"],Zf={class:"px-3 pb-2"},Jf={class:"px-3 pb-3 max-h-64 overflow-y-auto"},Yf=["onClick"],Xf={class:"truncate"},Qf={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Vf="inline-flex items-center justify-center size-8 rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",ep=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(t,{emit:n}){const o=t,s=n,r=e.useAttrs(),l=e.ref(!1),i=e.ref(""),a=e.ref([...o.columns]),c=e.ref(null),d=e.ref(null),m=e.ref(null),f=e.ref({top:0,left:0}),g=e.computed(()=>{if(!i.value)return a.value;const A=i.value.toLowerCase();return a.value.filter(T=>E(T).toLowerCase().includes(A))});e.watch(()=>o.columns,A=>{if(!A){a.value=[];return}const T=JSON.stringify(A),R=JSON.stringify(a.value);T!==R&&(a.value=[...A])},{deep:!0}),e.watch(a,A=>{s("update:columns",A)},{deep:!0});function E(A){return A.ua||A.label||A.name||"Колонка"}function b(A){const T=!A.hidden;T&&a.value.filter(R=>!R.hidden).length<=1||(A.hidden=T)}function v(){l.value=!l.value,l.value&&e.nextTick(()=>{m.value?.focus(),N()})}function N(){if(!c.value)return;const A=c.value.getBoundingClientRect();f.value={top:A.bottom+window.scrollY+6,left:A.left+window.scrollX-200}}function w(A){if(!l.value)return;const T=A.target;T&&(d.value?.contains(T)||c.value?.contains(T)||(l.value=!1))}function H(A){A.key==="Escape"&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",w,!0),document.addEventListener("keydown",H)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",w,!0),document.removeEventListener("keydown",H)}),(A,T)=>(e.openBlock(),e.createElementBlock("div",Kf,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:v,class:e.normalizeClass([Vf,e.unref(r).class]),"aria-label":e.unref(r)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},[...T[2]||(T[2]=[e.createStaticVNode('<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="icon icon-tabler icons-tabler-outline icon-tabler-columns" height="18" width="18" aria-hidden="true"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6h5.5"></path><path d="M4 10h5.5"></path><path d="M4 14h5.5"></path><path d="M4 18h5.5"></path><path d="M14.5 6h5.5"></path><path d="M14.5 10h5.5"></path><path d="M14.5 14h5.5"></path><path d="M14.5 18h5.5"></path></svg>',1)])],10,Gf),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"modalRef",ref:d,class:"fixed z-50 w-64 bg-white rounded-xl shadow-lg border border-gray-200 dark:bg-neutral-900 dark:border-neutral-700",style:e.normalizeStyle({top:`${f.value.top}px`,left:`${f.value.left}px`})},[T[5]||(T[5]=e.createElementVNode("div",{class:"flex items-center justify-between h-12 px-4 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Налаштування колонок ",-1)),e.createElementVNode("div",Zf,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,"onUpdate:modelValue":T[0]||(T[0]=R=>i.value=R),type:"text",class:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200",placeholder:"Пошук колонок"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Jf,[T[4]||(T[4]=e.createElementVNode("p",{class:"px-1 pb-2 text-xs text-gray-500 uppercase tracking-wide"},"Виберіть колонки",-1)),e.createElementVNode("ul",{class:"space-y-1",onClick:T[1]||(T[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,R=>(e.openBlock(),e.createElementBlock("li",{key:R.name,class:"flex items-center justify-between rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 cursor-pointer",onClick:I=>b(R)},[e.createElementVNode("span",Xf,e.toDisplayString(E(R)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",R.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[R.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",Qf,[...T[3]||(T[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])]))],2)],8,Yf))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),tp=["data-action-key"],np=["onClick"],op={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},sp={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},rp={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ip={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},lp=e.defineComponent({__name:"RowActionsButton",props:{row:{},actions:{},isOpen:{type:Boolean},actionKey:{}},emits:["toggle"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(null),l=e.computed(()=>!!o.actions?.length),i=e.ref({scrollX:0,scrollY:0,width:0,height:0}),a=e.ref(!1);function c(){s("toggle")}function d(b){b.handler?.(o.row)}const m=e.computed(()=>{if(!o.isOpen)return{};const b=r.value;if(!b)return{};const v=b.getBoundingClientRect(),N=8,w=160,T=(o.actions?.length??0)*36+N*2,R=i.value.height||(typeof window<"u"?window.innerHeight:0),I=i.value.width||(typeof window<"u"?window.innerWidth:0),x=i.value.scrollX||(typeof window<"u"?window.scrollX:0),h=i.value.scrollY||(typeof window<"u"?window.scrollY:0);let B=v.bottom+h+N,F=v.right+x-w;const P=x+I-w-N;return F>P&&(F=P),F<x+N&&(F=x+N),B+T>h+R-N&&(B=v.top+h-T-N),B<h+N&&(B=h+N),{top:`${B}px`,left:`${F}px`,width:"auto"}});function f(){typeof window>"u"||(i.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function g(){typeof window>"u"||a.value||(a.value=!0,f(),window.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",f))}function E(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",f),window.removeEventListener("resize",f))}return e.watch(()=>o.isOpen,b=>{b?g():E()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&g()}),e.onBeforeUnmount(()=>{E()}),(b,v)=>l.value&&t.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":t.actionKey,ref_key:"anchorRef",ref:r},[e.createElementVNode("button",{type:"button",class:"inline-flex size-7 items-center justify-center rounded-md border border-gray-200 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:e.withModifiers(c,["stop"])},[...v[1]||(v[1]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"19",r:"1"})],-1)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-50 w-40 overflow-hidden rounded-lg border border-gray-200 bg-white py-1 shadow-lg",style:e.normalizeStyle(m.value),onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,N=>(e.openBlock(),e.createElementBlock("button",{key:N.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",N.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:w=>d(N)},[e.renderSlot(b.$slots,"icon",{action:N},()=>[N.type==="view"?(e.openBlock(),e.createElementBlock("svg",op,[...v[2]||(v[2]=[e.createElementVNode("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):N.type==="edit"?(e.openBlock(),e.createElementBlock("svg",sp,[...v[3]||(v[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)])])):N.type==="delete"?(e.openBlock(),e.createElementBlock("svg",rp,[...v[4]||(v[4]=[e.createElementVNode("path",{d:"M3 6h18"},null,-1),e.createElementVNode("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},null,-1),e.createElementVNode("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},null,-1),e.createElementVNode("line",{x1:"10",x2:"10",y1:"11",y2:"17"},null,-1),e.createElementVNode("line",{x1:"14",x2:"14",y1:"11",y2:"17"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",ip,[...v[5]||(v[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])]))]),e.createTextVNode(" "+e.toDisplayString(N.label),1)],10,np))),128))],4)):e.createCommentVNode("",!0)]))],8,tp)):e.createCommentVNode("",!0)}}),hr=typeof window<"u",gr=typeof document<"u";function ap(t){if(!gr)throw new Error("Tooltip requires document to be defined");const n=document.createElement("div");return n.className="fixed z-[9999] p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-150",n.style.opacity="0",n.style.visibility="hidden",n.style.maxWidth="240px",n.style.whiteSpace="normal",n.style.wordBreak="break-word",document.body.appendChild(n),n}function yr(t){if(!t)return null;if(typeof t=="string"){const o=t.trim();return o?{text:o,wrap:!0}:null}const n=typeof t.text=="string"&&t.text.trim()?t.text.trim():void 0;return n?{text:n,wrap:t.wrap!==!1}:null}function Po(t,n){if(!gr||!hr)return;const o=ap(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!hr)return;o.textContent=s.options.text;const i=(r.currentTarget??t).getBoundingClientRect(),a=o.getBoundingClientRect(),c=window.innerWidth-a.width-12,d=Math.max(12,Math.min(i.left,c));o.style.left=`${d}px`,o.style.top=`${i.bottom+4}px`,o.style.opacity="1",o.style.visibility="visible"},hide:()=>{o.style.opacity="0",o.style.visibility="hidden"}};t.addEventListener("mouseenter",s.show),t.addEventListener("mouseleave",s.hide),t.addEventListener("focus",s.show),t.addEventListener("blur",s.hide),t.__tooltipState__=s}function zo(t){const n=t.__tooltipState__;n&&(t.removeEventListener("mouseenter",n.show),t.removeEventListener("mouseleave",n.hide),t.removeEventListener("focus",n.show),t.removeEventListener("blur",n.hide),n.tooltipEl.remove(),delete t.__tooltipState__)}const cp={mounted(t,n){const o=yr(n.value);o&&Po(t,o)},updated(t,n){const o=yr(n.value),s=t;if(!o){zo(s);return}const r=s.__tooltipState__;if(!r){Po(s,o);return}if(r.options.wrap!==o.wrap){zo(s),Po(s,o);return}r.options=o},unmounted(t){zo(t)}},dp={class:"flex flex-col gap-4 mb-[15px]"},fp={class:"flex flex-wrap items-center gap-4"},pp={key:0,class:"relative"},up={class:"ml-auto flex items-center gap-2"},mp={class:"overflow-x-auto"},hp={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},gp={class:"text-left font-medium text-gray-700"},yp={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},vp={class:"divide-y divide-gray-200"},bp=["href"],kp={key:2},Ep={key:3},wp={key:0,class:"py-2 pr-4 text-right"},xp={key:0},Np={key:0},Cp=["colspan"],vr=e.defineComponent({__name:"TableWidget",props:{addButton:{type:Boolean,default:!0},actions:{},columns:{},name:{},label:{},component:{},path:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(t){const n=e.getCurrentInstance(),o=e.ref([]),s=e.ref([]),r=cp,l=t,i=e.ref([]),a=e.ref(""),c=e.ref(""),d=e.ref(""),m=e.ref(1),f=e.ref(10),g=e.ref(0),E=e.ref(0),b=e.ref("id"),v=e.ref("");let N=null,w=0;const H=e.ref(null);async function A(){const y=m.value,$=++w,C=l.columns!==void 0,_=C?Array.isArray(l.columns)?l.columns:[]:void 0;C&&(s.value=G(_??[]));const J=l.actions!==void 0,ce=J?Array.isArray(l.actions)?l.actions:[]:void 0;J&&(i.value=ce??[]);const ne=new URLSearchParams,be=d.value.trim();be&&ne.set("search",be),ne.set("page",String(y)),ne.set("limit",String(f.value));const De=`/api/data/${l.token}${ne.toString()?`?${ne.toString()}`:""}`;let se;try{const wt=await fetch(De);if(!wt.ok)throw new Error(`Request failed with status ${wt.status}`);se=await wt.json()}catch(wt){$===w&&(o.value=[],E.value=0,g.value=0),console.error("Failed to load table data",wt);return}if($!==w)return;o.value=Array.isArray(se?.rows)?se.rows:[];const dt=Array.isArray(se?.columns)?se.columns:[];s.value=G(_??dt),i.value=ce!==void 0?Array.isArray(ce)?ce:[]:Array.isArray(se?.actions)?se.actions:[],a.value=se?.form,c.value=se?.addToken,b.value=typeof se?.pk=="string"&&se.pk?se.pk:b.value,typeof se?.form=="string"&&se.form&&(v.value=se.form.replace(/\.form$/,".table")),le();const Se=Number(se?.total??se?.count??se?.totalCount),Ke=Number(se?.filtered??se?.filteredCount);g.value=Number.isFinite(Se)&&Se>0?Se:o.value.length,E.value=Number.isFinite(Ke)&&Ke>0?Ke:Math.max(o.value.length,g.value);const Pt=Math.max(1,Math.ceil((E.value||o.value.length||1)/f.value));let je=y;typeof se?.page=="number"&&se.page>0&&(je=se.page),je>Pt&&(je=Pt),je<1&&(je=1);const ln=je!==y;if(m.value=je,ln&&E.value>0)return A()}const{$notify:T,$confirm:R,$form:I}=n?.appContext?.config?.globalProperties||{};function x(){if(we.emitter?.emit){we.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}A()}async function h(y){typeof I=="function"&&(await I({token:y.token}),x())}async function B(){typeof I=="function"&&(await I({token:c.value}),x())}function F(y){R({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const $=await fetch(`/api/table/${y.token}`,{method:"DELETE"});if(!$.ok){const{error:C}=await $.json();T({title:"Помилка",type:"warning",message:C});return}T({title:"Видаленно",message:"Успішно видалено"}),await A()}})}e.onMounted(async()=>{await A(),we.emitter?.on?.("updateCard",A)}),e.onBeforeUnmount(()=>{we.emitter?.off?.("updateCard",A)});function P(y){return typeof y?.format=="string"?y.format.toLowerCase():""}function G(y){const $=new Map;s.value.forEach(_=>{_?.name&&$.set(_.name,!!_.hidden)});const C=y.map(_=>{const J=$.has(_.name)?$.get(_.name):!!_.hidden;return{..._,hidden:J}});return C.length&&!C.some(_=>!_.hidden)&&(C[0].hidden=!1),C}const Z=e.computed(()=>{const y=s.value.filter($=>!$.hidden);return y.length?y:s.value}),L=e.computed(()=>{const y=[],$=new Set;for(const C of i.value){if(typeof C=="string"){const _=C.trim().toLowerCase();if(_==="edit"){const J="row:edit";$.has(J)||(y.push({key:J,type:"edit",label:"Редагувати",scope:"row",handler:Ie}),$.add(J));continue}if(_==="delete"||_==="del"){const J="row:delete";$.has(J)||(y.push({key:J,type:"delete",label:"Видалити",scope:"row",handler:Ve,variant:"danger"}),$.add(J));continue}if(_==="add"){const J="toolbar:add";$.has(J)||(y.push({key:J,type:"add",label:"Додати",scope:"toolbar"}),$.add(J));continue}if(_==="search"){const J="toolbar:search";$.has(J)||(y.push({key:J,type:"search",label:"Пошук",scope:"toolbar"}),$.add(J))}continue}if(C&&typeof C=="object"){const _=String(C.name??C.type??"action"),J=String(C.label??C.title??_),ce=C.scope==="toolbar"?"toolbar":"row",ne=`${ce}:${_}`;if($.has(ne))continue;$.add(ne),y.push({key:ne,type:_,label:J,scope:ce,handler:ce==="row"?be=>nn(C,be):void 0,variant:C.variant==="danger"?"danger":"default",original:C})}}return y}),M=e.computed(()=>L.value.filter(y=>y.scope==="row"&&typeof y.handler=="function")),k=e.computed(()=>L.value.filter(y=>y.scope==="toolbar")),z=e.computed(()=>M.value.length>0),te=e.computed(()=>k.value.some(y=>y.type==="add")),Fe=e.computed(()=>k.value.some(y=>y.type==="search")),Ce=e.computed(()=>l.actions!==void 0?Fe.value:!0),ye=e.computed(()=>{const y=!!c.value;return l.addButton!==void 0?l.addButton&&y:te.value&&y}),me=e.computed(()=>o.value),Xe=e.computed(()=>{const y=E.value||me.value.length,$=Math.ceil(y/f.value);return $>0?$:1}),bt=e.computed(()=>{const y=me.value.length,$=E.value||y,C=g.value||$;return`Показано ${y} з ${$} (усього ${C})`});function Be(){m.value<Xe.value&&(m.value+=1,A())}function Qe(){m.value>1&&(m.value-=1,A())}e.watch(s,y=>{y?.length&&(y.some($=>!$.hidden)||(y[0].hidden=!1))},{deep:!0}),e.watch(()=>l.columns,y=>{if(y===void 0){A();return}const $=Array.isArray(y)?y:[];s.value=G($)},{deep:!0}),e.watch(()=>l.actions,y=>{if(y===void 0){A();return}i.value=Array.isArray(y)?y:[]},{deep:!0});function q(){N&&clearTimeout(N),le(),N=setTimeout(()=>{m.value=1,A()},300)}function W(y){const $=b.value||"id",C=y?.token??y?.[$]??y?.id;return C?String(C):""}function u(y){const $=Z.value[y],C=["py-2",...U($)];y===0&&C.push("pl-4");const _=y===Z.value.length-1&&!z.value;return C.push(_?"pr-4":"pr-5"),C.join(" ")}function S(y,$){const C=["py-2",...U($)];P($)==="badge"&&C.push("center"),O($)==="wrap"?C.push("whitespace-normal","break-words"):C.push("truncate"),y===0&&C.push("pl-4");const _=y===Z.value.length-1&&!z.value;return C.push(_?"pr-4":"pr-5"),C.join(" ")}function O(y){return(typeof y?.overflow=="string"?y.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function U(y){const $=[],C=ne=>{if(ne==null||ne==="")return;const be=Number(ne);return Number.isFinite(be)&&be>0?`${be}px`:String(ne).replace(/\s+/g,"")},_=C(y?.width),J=C(y?.minWidth),ce=C(y?.maxWidth);return _?($.push(`min-w-[${_}]`,`max-w-[${_}]`),$):($.push(`min-w-[${J??"100px"}]`),$.push(`max-w-[${ce??"350px"}]`),$)}function Y(y){if(!M.value.length)return!1;const $=b.value||"id";return!!(y?.token||y?.[$]||y?.id)}function K(y){return H.value===W(y)}function oe(y){const $=W(y);$&&(H.value=H.value===$?null:$)}function le(){H.value=null}function ie(y,$){const C=$?.tooltip;if(!C)return;const _=rn(y,$);let J,ce=$?.tooltipWrap!==!1;if(typeof C=="string"){const ne=C.trim();if(!ne)return;const be=ne.toLowerCase();if(["true","1","yes"].includes(be))J=typeof _=="string"?_:String(_??"");else{if(["false","0","no"].includes(be))return;J=ne}}else C===!0?J=_:typeof C=="object"&&(typeof C.text=="string"&&(J=C.text.trim()),typeof C.wrap=="boolean"&&(ce=C.wrap!==!1));if(!J){if(_==null||_==="")return;J=String(_)}if(J.trim())return ce?{text:J,wrap:!0}:J}function Ie(y){le(),h(y)}function Ve(y){le(),F(y)}async function nn(y,$){le();const C=b.value||"id",_=y.isId?$?.[C]??$?.id:$?.token??$?.[C]??$?.id;if(!_){console.warn("Cannot execute action without identifier",y);return}if(y.form&&typeof y.api=="string"&&y.api&&typeof I=="function"){await sn(y,$,_);return}if(y.form&&typeof I=="function"){const J=await We(y.form,_),ce={form:y.form,token:J?.token??$?.token??_,schema:J?.schema,mode:J?.mode??"edit"};J?.data!==void 0&&(ce.defaultValue=J.data);try{await I(ce),x()}catch(ne){console.error("Failed to execute form action",ne)}return}if(typeof y.api=="string"&&y.api){const J=Pe(y.api,_);window.location.href=J;return}$?.token&&typeof I=="function"&&(await I({token:$.token}),x())}function Pe(y,$){return`${y.endsWith("/")?y:`${y}/`}${$}`}async function We(y,$){const C=`/api/form/${y}/${$}`;try{const _=await fetch(C);if(!_.ok)throw new Error(`Request failed with status ${_.status}`);return await _.json()}catch(_){console.error("Failed to load form config",_),T({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function et(y){const $=`/api/template/form/${y}`;try{const C=await fetch($);if(!C.ok)throw new Error(`Request failed with status ${C.status}`);return(await C.json())?.schema}catch(C){console.error("Failed to load form template",C);return}}function on(y){if(y!=null){if(y?.data!==void 0)return y.data;if(y?.defaultValue!==void 0)return y.defaultValue;if(y?.values!==void 0)return y.values;if(typeof y=="object"&&!Array.isArray(y)){const{schema:$,token:C,mode:_,message:J,successMessage:ce,...ne}=y;if(Object.keys(ne).length)return ne}}}async function sn(y,$,C){const _=Pe(y.api,C),J=(typeof y.method=="string"?y.method:"PUT").toUpperCase();let ce;try{const Se=await fetch(_);if(!Se.ok)throw new Error(`Request failed with status ${Se.status}`);ce=await Se.json()}catch(Se){console.error("Failed to load action data",Se),kt("Не вдалося отримати дані форми.");return}const ne=typeof y.form=="string"?y.form.replace(/\.table$/,".form"):void 0,be=ce?.schema??(ne?await et(ne):void 0),De={mode:ce?.mode??"edit"};ne&&(De.form=ne),be&&(De.schema=be);const se=on(ce);se!==void 0&&(De.defaultValue=se);const dt=await I(De);if(dt)try{const Se=await fetch(_,{method:J,headers:{"Content-Type":"application/json"},body:JSON.stringify(dt)});if(!Se.ok){const Ke=await Rt(Se),Pt=Ke?.error??Ke?.message??"Не вдалося зберегти дані.";throw new Error(Pt)}Ft(`Дані успішно ${De.value==="add"?"збережено":"оновлено"}`),x()}catch(Se){console.error("Failed to submit action data",Se),kt("Не вдалося зберегти дані.")}}async function Rt(y){try{return await y.json()}catch{return}}function kt(y){T({title:"Помилка",type:"error",message:y})}function Ft(y){T({title:"Успіх",type:"success",message:y})}function Et(y){if(!H.value)return;const $=y.target;if(!$)return;const C=$.closest("[data-action-key]");C&&C.getAttribute("data-action-key")===H.value||le()}e.onMounted(()=>{document.addEventListener("click",Et,!0)}),e.onBeforeUnmount(()=>{N&&clearTimeout(N),document.removeEventListener("click",Et,!0),we.emitter?.off?.("updateCard",A)});function jn(y,$){const _=y?.[`${$.name}_text`];if(Array.isArray(_))return _.length?_.join(", "):"-";if(_!=null&&_!=="")return _;const J=y?.[$.name];return Array.isArray(J)?J.length?J.join(", "):"-":J??"-"}function tt(y,$){const _=y?.[`${$.name}_data`];if(_&&typeof _=="object")return{text:_.text??_.label??_.name??_.title??"-",color:_.color,textColor:_.textColor};const J=y?.[`${$.name}_text`]??y?.[$.name];return{text:(Array.isArray(J)?J.join(", "):J)??"-"}}function Hn(y,$){const C=tt(y,$);return C.color?{backgroundColor:C.color,color:C.textColor??"#ffffff"}:{}}function rn(y,$){const C=P($);if(C==="badge")return tt(y,$).text;if(C==="select")return jn(y,$);if(C==="slot")return"-";if(C==="text")return y?.[$.name]??"-";const _=y?.[`${$.name}_data`];return _!=null&&typeof _!="object"?_:y?.[`${$.name}_text`]??y?.[$.name]??"-"}return(y,$)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",dp,[e.createElementVNode("div",fp,[Ce.value?(e.openBlock(),e.createElementBlock("div",pp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":$[0]||($[0]=C=>d.value=C),type:"text",class:"w-52 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",onInput:q},null,544),[[e.vModelText,d.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",up,[e.createVNode(ep,{columns:s.value,"onUpdate:columns":$[1]||($[1]=C=>s.value=C)},null,8,["columns"]),ye.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:B,class:"inline-flex size-8 items-center justify-center rounded-lg bg-blue-500 text-white shadow-sm transition-colors hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",title:"Додати запис","aria-label":"Додати запис"},[...$[2]||($[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)])])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",mp,[e.createElementVNode("table",hp,[e.createElementVNode("thead",gp,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(C,_)=>(e.openBlock(),e.createElementBlock("th",{key:C.name,class:e.normalizeClass(u(_))},e.toDisplayString(C.ua),3))),128)),z.value?(e.openBlock(),e.createElementBlock("th",yp," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,C=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:C.id??JSON.stringify(C)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(_,J)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:_.name,class:e.normalizeClass(S(J,_))},[_.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:_.link.replace("{{id}}",C.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(rn(C,_)),9,bp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[P(_)==="slot"&&(_.slot?.content||_.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Pf)(_.slot.content||_.slot)),{key:0,data:C,row:C,column:_,value:C?.[_.name]},null,8,["data","row","column","value"])):P(_)==="badge"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"items-center px-2 py-1 rounded-full text-xs font-semibold text-center justify-center flex",style:e.normalizeStyle(Hn(C,_))},e.toDisplayString(tt(C,_).text),5)):P(_)==="select"?(e.openBlock(),e.createElementBlock("span",kp,e.toDisplayString(jn(C,_)),1)):(e.openBlock(),e.createElementBlock("span",Ep,e.toDisplayString(rn(C,_)),1))],64))],2)),[[e.unref(r),ie(C,_)]])),128)),z.value?(e.openBlock(),e.createElementBlock("td",wp,[Y(C)?(e.openBlock(),e.createElementBlock("div",xp,[e.createVNode(lp,{row:C,actions:M.value,"is-open":K(C),"action-key":W(C),onToggle:_=>oe(C)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),me.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",Np,[e.createElementVNode("td",{colspan:Z.value.length+(z.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,Cp)]))])])]),e.createVNode(Wf,{"current-page":m.value,"total-pages":Xe.value,label:bt.value,onPrevious:Qe,onNext:Be},null,8,["current-page","total-pages","label"])]))}}),Sp={class:"p-[20px]"},_p={class:"flex gap-[6px] mb-5"},Bp={class:"vs-form-text relative bg-white rounded-lg flex-grow"},Tp={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},$p={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},Lp={class:"space-y-8"},Ap={key:0},Ip={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Dp=["onClick"],Op={class:"md:col-span-2"},Mp={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Rp={class:"text-sm text-gray-500 dark:text-neutral-500"},Fp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Pp=["checked","onChange"],zp={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},jp={class:"md:col-span-2"},Hp={class:"font-semibold text-gray-800 dark:text-neutral-200"},Up=["onClick"],qp={class:"md:col-span-2"},Wp={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Kp={class:"text-sm text-gray-500 dark:text-neutral-500"},Gp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Zp=["checked","onChange"],Fn="uk",Pn=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return Fn;const I=localStorage.language,x=typeof navigator<"u"?navigator.language:Fn;return(I||x||Fn).split(/[-_]/)[0].toLowerCase()||Fn},s=t,r=e.ref(""),l=["view","add","edit","del"],i=e.ref({}),a=e.ref(o()),c={view:"Перегляд",add:"Додавання",edit:"Редагування",del:"Видалення"},d=I=>c[I]??I,m=()=>{a.value=o()},f=()=>{const I=[];return a.value&&I.push(a.value),n.forEach(x=>{x&&!I.includes(x)&&I.push(x)}),I.includes("path")||I.push("path"),I},g=I=>{const x=f();for(const h of x){const B=I[h];if(typeof B=="string"&&B.trim())return B}return""};e.onMounted(async()=>{m();const x=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();x.routes&&x.routes.forEach(h=>{i.value[h.path]=new Set(h.actions)})});const E=(I,x)=>i.value[I]?.has(x)??!1,b=(I,x)=>{i.value[I]||(i.value[I]=new Set),i.value[I].has(x)?i.value[I].delete(x):i.value[I].add(x)},v=(I,x)=>{I.forEach(h=>{h.path&&(i.value[h.path]||(i.value[h.path]=new Set),i.value[h.path].has(x)?i.value[h.path].delete(x):i.value[h.path].add(x))})},N=e.computed(()=>Object.entries(i.value).map(([I,x])=>({path:I,actions:Array.from(x)})).filter(I=>I.actions.length)),w=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:N.value})}),we.notify({title:"Success!",message:"Permissions saved."})},H=()=>{i.value={}},A=I=>{if(!r.value.trim())return I;const x=r.value.toLowerCase();return I.filter(h=>g(h).toLowerCase().includes(x)||(h.path?.toLowerCase().includes(x)??!1))},T=e.computed(()=>A(s.data.routers.filter(I=>!I.menu))),R=e.computed(()=>s.data.routers.filter(I=>I.menu).map(I=>({...I,menu:A(I.menu||[])})).filter(I=>I.menu&&I.menu.length>0));return(I,x)=>(e.openBlock(),e.createElementBlock("div",Sp,[e.createElementVNode("div",_p,[e.createElementVNode("div",Bp,[x[1]||(x[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":x[0]||(x[0]=h=>r.value=h),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("button",{onClick:H,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:w,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",Tp,[x[2]||(x[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(h,B)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:B},[e.createElementVNode("h3",$p,e.toDisplayString(d(h)),1)])),64))]),e.createElementVNode("div",Lp,[T.value.length?(e.openBlock(),e.createElementBlock("div",Ap,[e.createElementVNode("ul",Ip,[x[3]||(x[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(h,B)=>e.createElementVNode("li",{key:B,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:F=>v(T.value,l[B])}," Перемкнути всі ",8,Dp)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(h,B)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+B,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Op,[e.createElementVNode("p",Mp,e.toDisplayString(g(h)),1),e.createElementVNode("p",Rp,e.toDisplayString(h.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(F,P)=>e.createElementVNode("li",{key:P,class:"col-span-1"},[e.createElementVNode("div",Fp,[e.createElementVNode("input",{type:"checkbox",checked:E(h.path,F),onChange:G=>b(h.path,F),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Pp)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(h,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"space-y-5"},[e.createElementVNode("ul",zp,[e.createElementVNode("li",jp,[e.createElementVNode("h3",Hp,e.toDisplayString(g(h)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(F,P)=>e.createElementVNode("li",{key:P,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:G=>v(h.menu,l[P])}," Перемкнути всі ",8,Up)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.menu,(F,P)=>(e.openBlock(),e.createElementBlock("ul",{key:P,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",qp,[e.createElementVNode("p",Wp,e.toDisplayString(g(F)),1),e.createElementVNode("p",Kp,e.toDisplayString(F.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,(G,Z)=>e.createElementVNode("li",{key:Z,class:"col-span-1"},[e.createElementVNode("div",Gp,[e.createElementVNode("input",{type:"checkbox",checked:E(F.path,G),onChange:L=>b(F.path,G),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Zp)])])),64))]))),128))]))),128))])]))}}),vt={"vs-widget-comments":fn,"vs-widget-history":pn,"vs-widget-gallery":mn,"vs-widget-file":un,"vs-widget-list":Gn,"vs-widget-map":vn,"vs-widget-table":vr,"vs-group-interface":Pn};function br(t){if(t==null)return null;const n=Number(t);return Number.isFinite(n)?Math.max(1,Math.min(12,Math.floor(n))):null}function kr(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>kr(o))),n}function Jp(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const d=br(c.col);d?(c.col=d,o.push({item:c,span:d})):s.push(c)}),!o.length&&s.length){s.forEach(c=>{c.col=12});return}const r=o.reduce((c,d)=>c+d.span,0);let l=n-r;if(s.length===0)return;l<=0&&(l=n);const i=Math.max(1,Math.floor(l/s.length));let a=Math.max(0,l-i*s.length);s.forEach(c=>{let d=i;a>0&&(d+=1,a-=1),c.col=Math.max(1,Math.min(12,d))})}function zn(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>kr(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=zn(s.items,12))}),Jp(o,n),o}function Er(t){const n=br(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const Yp={class:"text-lg font-semibold text-gray-900"},Xp=["innerHTML"],Qp={key:0,class:"grid grid-cols-12 gap-4"},Vp={key:0,class:"mb-4 pb-2 border-b border-gray-200"},eu={class:"text-lg font-semibold text-gray-900"},tu=["innerHTML"],en=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},hideTitle:{type:Boolean},styling:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.computed(()=>{if(!n.col)return{};const d=Math.max(1,Math.min(12,Number(n.col)));return{[`md:col-span-${d}`]:!0,[`lg:col-span-${d}`]:!0}}),s=e.computed(()=>zn(n.items));function r(d){const m=["col-span-12"],f=Er(d.col);return f.length&&m.push(...f),m}function l(d){return vt[d]||d}function i(d,m){if(!d||typeof m!="string"||!m)return{found:!1,value:void 0};const f=m.split(".");let g=d;for(const E of f){if(g==null||typeof g!="object"&&!Array.isArray(g))return{found:!1,value:void 0};if(!(E in g))return{found:!1,value:void 0};g=g[E]}return{found:!0,value:g}}const a=function(d={}){const m={...d};return Object.entries(m).forEach(([f,g])=>{if(f!=="props"&&typeof g=="string"){const E=i(n.data,g);E.found&&(m[f]=E.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([f,g])=>{if(typeof g=="string"){const E=i(n.data,g);m[f]=E.found?E.value:g}else m[f]=g}),delete m.props,m},c=e.computed(()=>{const d={};return n.col&&(d.col=n.col),d});return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[o.value,t.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!t.hideTitle&&t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",t.styling?.classItemTitle])},[e.createElementVNode("h3",Yp,e.toDisplayString(t.title),1)],2)):e.createCommentVNode("",!0),t.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:t.html,class:"text-gray-900 leading-relaxed"},null,8,Xp)):t.type?.includes("tabs")?(e.openBlock(),e.createBlock(tn,{key:2,view:t.type,panels:t.items,data:t.data,styling:t.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[s.value.length?(e.openBlock(),e.createElementBlock("div",Qp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:f.name||f.component||g,class:e.normalizeClass(r(f))},[f.title||f.label?(e.openBlock(),e.createElementBlock("div",Vp,[e.createElementVNode("h3",eu,e.toDisplayString(f.title||f.label),1)])):e.createCommentVNode("",!0),f.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:f.html,class:"text-gray-900 leading-relaxed"},null,8,tu)):f.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l(f.component)),e.mergeProps({key:2,ref_for:!0},{geom:t.data.geom,id:t.data.id,...c.value,...a(f),data:t.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),nu={class:"grid grid-cols-12 gap-[20px]"},ou={key:0,class:"col-span-4"},su=["innerHTML"],ru=["onClick"],iu=["innerHTML"],lu={key:1,class:"flex w-full"},au={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},cu=["onClick"],du={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},fu={class:"flex-1 p-4"},pu=["innerHTML"],uu={class:"grid grid-cols-12 gap-4"},mu={key:3,class:"w-full h-full"},tn=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},styling:{},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},backgroundClass:{},tabContentWrapperClass:{},tabPanelClass:{},id:{},className:{},style:{}},setup(t){const n=t;function o(){const L=typeof window<"u"?window:globalThis,M="__vsCardAnonymousCounter__",k=L[M]??0;return L[M]=k+1,k===0?"tab":`tab${k}`}const s=e.ref(0),r=e.ref([]);let l=!1,i=!1;const a=e.ref(n.id??o());e.watch(()=>n.id,L=>{L&&(a.value=L)});const c=new Map,d=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function m(L,M){const k=M?.path;return k?(c.has(k)||c.set(k,e.defineAsyncComponent(()=>import(k))),c.get(k)):typeof L=="string"&&vt[L]?vt[L]:M?.component&&vt[M.component]?vt[M.component]:M?.name&&vt[M.name]?vt[M.name]:L}function f(L){return L.forEach(M=>{M.type&&(M.view=M.type)}),r.value=L.filter(M=>M.type==="pin"),L.filter(M=>M.type!=="pin")}const g=e.computed(()=>{let L;return n.panels&&n.panels.length>0?L=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(L=n.data.filter(k=>k.type.includes("tabs"))[0]?.items),zn(L,12)}),E=e.computed(()=>a.value);function b(){i||(i=!0)}const v=e.computed(()=>{let L;return n.panels&&n.panels.length>0?L=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(L=n.data),zn(L,12)}),N=e.computed(()=>({[`view-${n.view}`]:!0}));function w(L,M){if(!L||typeof M!="string"||!M)return{found:!1,value:void 0};const k=M.split(".");let z=L;for(const te of k){if(z==null||typeof z!="object"&&!Array.isArray(z))return{found:!1,value:void 0};if(!(te in z))return{found:!1,value:void 0};z=z[te]}return{found:!0,value:z}}const H=L=>{const M={...L};return Object.entries(M).forEach(([k,z])=>{if(k!=="props"&&typeof z=="string"){const te=w(n.data,z);te.found&&(M[k]=te.value)}}),L.props&&typeof L.props=="object"&&Object.entries(L.props).forEach(([k,z])=>{if(typeof z=="string"){const te=w(n.data,z);M[k]=te.found?te.value:z}else M[k]=z}),delete M.props,n.data&&(M.data=n.data),M};function A(L){const M=["col-span-12"],k=Er(L.col);return k.length&&M.push(...k),M}const T=e.ref([]),R=e.ref([]),I=e.ref([]);function x(L,M){L&&L instanceof HTMLElement&&(T.value[M]=L)}function h(){R.value=T.value.map(L=>L.offsetWidth),I.value=T.value.map(L=>L.offsetLeft)}function B(){if(typeof window>"u")return null;const L=E.value;if(!L)return null;const k=new URL(window.location.href).searchParams.get(L);if(k===null)return null;const z=Number.parseInt(k,10);return Number.isNaN(z)?null:z}function F(L){if(typeof window>"u")return;const M=E.value;if(!M||!i)return;const k=new URL(window.location.href);L<=0?k.searchParams.delete(M):k.searchParams.set(M,String(L));const z=window.history.state??{};window.history.replaceState(z,document.title,k)}function P(){if(l||!g.value.length)return;b();const L=B();if(L===null)return;const M=Math.min(Math.max(L,0),g.value.length-1);M!==L&&F(M),M!==s.value&&(s.value=M),l=!0}function G(){l=!1,P()}let Z=null;return e.onMounted(()=>{e.nextTick(()=>{P(),h()}),typeof window<"u"&&window.addEventListener("popstate",G),Z=new ResizeObserver(()=>h()),Z.observe(document.body)}),e.onBeforeUnmount(()=>{Z?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",G)}),e.watch(s,L=>{e.nextTick(()=>{h()}),F(L)}),e.watch(g,()=>{l=!1,P()}),(L,M)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.classWrapper||N.value)},[e.createElementVNode("div",nu,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",ou,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(k,z)=>(e.openBlock(),e.createElementBlock("div",{key:k.name||z,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[k.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:k.html,class:"text-gray-900 leading-relaxed"},null,8,su)):k.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(k.component,k)),e.mergeProps({key:1,ref_for:!0},k.component==="Card"?k:H(k),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(r.value.length!==0?"col-span-8":"col-span-12")},[t.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",t.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",t.styling?.classTabHeader])},[R.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:R.value[s.value]+"px",left:I.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(k,z)=>(e.openBlock(),e.createElementBlock("button",{key:k.name||z,ref_for:!0,ref:te=>x(te,z),onClick:te=>s.value=z,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===z?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(k.title||k.label||k.name||`Tab ${z+1}`),11,ru))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([t.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(k,z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:k.name||z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100"])},[k.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:k.html,class:"text-gray-900 leading-relaxed"},null,8,iu)):L.$slots[`tab-${z}`]?e.renderSlot(L.$slots,`tab-${z}`,{key:1,item:k,data:t.data}):k.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(en),e.mergeProps({key:2,ref_for:!0},H(k),{items:k.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):k.component||k.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(k.component||k.name,k)),e.mergeProps({key:3,ref_for:!0},k.component==="Card"?k:H(k),{styling:t.styling,id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(L.$slots,k.slot||`tab-${z}`,{key:4,item:k,data:t.data})],2)),[[e.vShow,s.value===z]])),128))],2)],2)):t.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",lu,[e.createElementVNode("div",au,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(k,z)=>(e.openBlock(),e.createElementBlock("button",{key:k.name||z,onClick:te=>s.value=z,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===z?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(k.title||k.label||k.name||`Tab ${z+1}`)+" ",1),s.value===z?(e.openBlock(),e.createElementBlock("span",du,[...M[0]||(M[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)])])):e.createCommentVNode("",!0)],10,cu))),128))]),e.createElementVNode("div",fu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(k,z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:k.name||z,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===z?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100 py-2"])},[k.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:k.html,class:"text-gray-900 leading-relaxed"},null,8,pu)):L.$slots[`tab-${z}`]?e.renderSlot(L.$slots,`tab-${z}`,{key:1,item:k,data:t.data}):k.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(en),e.mergeProps({key:2,ref_for:!0},H(k),{items:k.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):k.component||k.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(k.component||k.name,k)),e.mergeProps({key:3,ref_for:!0},k.component==="Card"?k:H(k),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(L.$slots,k.slot||`tab-${z}`,{key:4,item:k,data:t.data})],2)),[[e.vShow,s.value===z]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",uu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(k,z)=>(e.openBlock(),e.createElementBlock("div",{key:k.name||k.component||z,class:e.normalizeClass(A(k))},[L.$slots[`panel-${z}`]?e.renderSlot(L.$slots,`panel-${z}`,{key:0,item:k,data:t.data}):k.items||k.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(en),e.mergeProps({key:1,ref_for:!0},H(k),{items:k.items||[],class:["w-full h-auto",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):k.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(k.component,k)),e.mergeProps({key:2,ref_for:!0},H(k),{class:["w-full h-auto",[t.styling?.classItem]],styling:t.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",mu,[e.renderSlot(L.$slots,k.slot||`panel-${z}`,{item:k,data:t.data})]))],2))),128))])],2))],2)])],2))}}),hu=["onClick"],wr=nt(e.defineComponent({__name:"CopyNotification",setup(t,{expose:n}){const o=e.ref([]);let s=1;const r=()=>{if(o.value.length>=10){const a=o.value[0];clearTimeout(a.timer),o.value.shift()}const i={id:s++,timer:setTimeout(()=>{l(i.id)},1500)};o.value.push(i)},l=i=>{const a=o.value.findIndex(c=>c.id===i);if(a!==-1){const c=o.value[a];clearTimeout(c.timer),o.value.splice(a,1)}};return n({addNotification:r}),e.onUnmounted(()=>{o.value.forEach(i=>{clearTimeout(i.timer)})}),(i,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(Or),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),a[0]||(a[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:d=>l(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(Wn),{class:"h-4 w-4"})],8,hu)]))),128))]),_:1})]))}}),[["__scopeId","data-v-d1ac6329"]]);tn.install=function(t){t.component("vs-widget-file",un),t.component("vs-widget-comments",fn),t.component("vs-widget-history",pn),t.component("vs-widget-gallery",mn),t.component("vs-widget-map",vn),t.component("vs-group-interface",Pn),t.component("CommentsWidget",fn),t.component("HistoryWidget",pn),t.component("GalleryWidget",mn),t.component("FilesWidget",un),t.component("MapWidget",vn),t.component("Card",tn),t.component("CardItem",en),t.component("DescriptionListWidget",Gn),t.component("CopyNotification",wr),t.component("GroupInterfaceWidget",Pn)},he.Card=tn,he.CardItem=en,he.CommentsWidget=fn,he.CopyNotification=wr,he.DescriptionListWidget=Gn,he.FilesWidget=un,he.GalleryWidget=mn,he.GroupInterfaceWidget=Pn,he.HistoryWidget=pn,he.MapWidget=vn,he.TableWidget=vr,he.default=tn,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(he,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):(he=typeof globalThis<"u"?globalThis:he||self,e(he.WidgetLib={},he.Vue,he.OpenGISCore))})(this,(function(he,e,Ne){"use strict";function Br(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 $r=Br(e);const jo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tr=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,o,s)=>s?s.toUpperCase():o.toLowerCase()),Lr=t=>{const n=Tr(t);return n.charAt(0).toUpperCase()+n.slice(1)},Ar=(...t)=>t.filter((n,o,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===o).join(" ").trim();var an={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 Dr=({size:t,strokeWidth:n=2,absoluteStrokeWidth:o,color:s,iconNode:r,name:i,class:l,...a},{slots:c})=>e.h("svg",{...an,width:t||an.width,height:t||an.height,stroke:s||an.stroke,"stroke-width":o?Number(n)*24/Number(t):n,class:Ar("lucide",...i?[`lucide-${jo(Lr(i))}-icon`,`lucide-${jo(i)}`]:["lucide-icon"]),...a},[...r.map(d=>e.h(...d)),...c.default?[c.default()]:[]]);const ae=(t,n)=>(o,{slots:s})=>e.h(Dr,{...o,iconNode:n,name:t},s);const Ir=ae("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 Or=ae("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Mr=ae("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Rr=ae("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]);const Fr=ae("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 Pr=ae("copy-plus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Ho=ae("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 zr=ae("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 St=ae("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 jr=ae("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 Hr=ae("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 Ur=ae("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 qr=ae("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 Wr=ae("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 Uo=ae("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 Kr=ae("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 Gr=ae("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 qo=ae("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Zr=ae("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 Wo=ae("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 Jr=ae("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 Ko=ae("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 cn=ae("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 Yr=ae("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 Go=ae("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 Xr=ae("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 zn=ae("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qr={class:"border-t pt-3 mt-4"},Vr={class:"flex gap-2"},ei={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ti={class:"flex-1 space-y-2"},ni={class:"flex justify-between items-center"},oi={class:"flex gap-2"},si=["disabled"],Zo=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,i=()=>{s.value.trim()&&(r("sendComment",s.value),s.value="")},l=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),i())};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Qr,[e.createElementVNode("div",Vr,[e.createElementVNode("span",ei,[e.createVNode(e.unref(Go),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",ti,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=d=>s.value=d),onKeydown:l,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",ni,[c[4]||(c[4]=e.createElementVNode("span",{class:"text-xs text-gray-500 hidden sm:inline"},"Cmd+Enter to send",-1)),e.createElementVNode("div",oi,[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(zn),{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:i},[e.createVNode(e.unref(Wo),{class:"h-3 w-3 mr-1"}),c[3]||(c[3]=e.createTextVNode(" Send ",-1))],8,si)])])])])]))}}),ri={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"},ii=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(),i=e.ref(!0),l=async d=>{s.value&&r.value&&!r.value.contains(d.target)&&!i.value&&(s.value=!1),i.value=!1},a=()=>{s.value=!1,o("edit")},c=()=>{s.value=!1,o("delete")};return e.onMounted(()=>{document.addEventListener("click",l)}),e.onUnmounted(()=>{document.removeEventListener("click",l)}),(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",ri,[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(Ko),{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(cn),{class:"h-3 w-3 mr-2"}),m[1]||(m[1]=e.createTextVNode(" Delete ",-1))])])],512))}}),li={class:"space-y-2"},ai={class:"relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200"},ci={class:"flex-1 min-w-0 space-y-1 relative"},di={class:"flex items-center gap-2"},fi={class:"font-medium text-xs"},pi={class:"text-xs text-gray-500"},ui={key:0,class:"text-xs text-gray-700 leading-relaxed"},mi={class:"flex justify-between text-xs"},hi={class:"flex items-center gap-2"},gi={key:0,class:"flex gap-2"},yi=["disabled"],vi={key:0,class:"ml-8 space-y-1 border-l-2 border-gray-100 pl-3"},bi=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),i=e.ref("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"),l=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=S=>{const k=new Date,_=Math.floor((k.getTime()-S.getTime())/(1e3*60*60));return _<1?`${Math.floor((k.getTime()-S.getTime())/6e4)}m`:_<24?`${_}h`:`${Math.floor(_/24)}d`},h=()=>{m.value=!m.value,m.value?o("like",s.comment.id,"add"):o("like",s.comment.id,"delete")},E=()=>{o("edit",s.comment.id,r.value),d.value=!1},b=(S,k)=>{o("like",S,k)},v=(S,k)=>{o("edit",S,k)};return(S,k)=>{const _=e.resolveComponent("CommentItem",!0);return e.openBlock(),e.createElementBlock("div",li,[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",ai,[e.createVNode(e.unref(Go),{class:"h-3 w-3 text-gray-500"})]),e.createElementVNode("div",ci,[e.createElementVNode("div",di,[e.createElementVNode("span",fi,e.toDisplayString(t.comment?.author),1),e.createElementVNode("span",pi,e.toDisplayString(f(t.comment?.createdAt)),1)]),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,"onUpdate:modelValue":k[0]||(k[0]=C=>r.value=C),class:e.normalizeClass(d.value?l.value:i.value)},null,2)),[[e.vModelText,r.value]]):(e.openBlock(),e.createElementBlock("p",ui,e.toDisplayString(t.comment?.text),1)),e.createElementVNode("div",mi,[e.createElementVNode("div",hi,[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:k[1]||(k[1]=C=>h())},[e.createVNode(e.unref(Ur),{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:k[2]||(k[2]=C=>c.value=!0)},[e.createVNode(e.unref(Zr),{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:k[3]||(k[3]=C=>a.value=!0)},[e.createVNode(e.unref(zr),{class:"h-3 w-3"})])]),d.value?(e.openBlock(),e.createElementBlock("div",gi,[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:k[4]||(k[4]=C=>d.value=!1)},[e.createVNode(e.unref(zn),{class:"h-3 w-3"}),k[11]||(k[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:k[5]||(k[5]=C=>E())},[e.createVNode(e.unref(Wo),{class:"h-3 w-3 mr-1"}),k[12]||(k[12]=e.createTextVNode(" Send ",-1))],8,yi)])):e.createCommentVNode("",!0)])]),a.value?(e.openBlock(),e.createBlock(ii,{key:0,showMoreOptions:a.value,"onUpdate:showMoreOptions":k[6]||(k[6]=C=>a.value=C),onEdit:k[7]||(k[7]=C=>d.value=!0),onDelete:k[8]||(k[8]=C=>S.$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",vi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.comment?.replies,C=>(e.openBlock(),e.createBlock(_,{key:C.id,comment:C,isInside:!0,onDelete:w=>S.$emit("delete",C.id),onLike:b,onEdit:v},null,8,["comment","onDelete"]))),128)),c.value&&!t.isInside?(e.openBlock(),e.createBlock(Zo,{key:0,onSendComment:k[9]||(k[9]=C=>S.$emit("reply",t.comment?.id,C)),isReply:c.value,"onUpdate:isReply":k[10]||(k[10]=C=>c.value=C)},null,8,["isReply"])):e.createCommentVNode("",!0)]))])}}}),ki=["id"],Ei={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},dn=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 i(){if(!o.id)return;const f=await fetch(`/api/widget/comment/${o.id}`).then(h=>h.json());r.value=f.rows.map(h=>({id:h.communication_id,author:h.username,text:h.body,createdAt:new Date(h.cdate)}))}r.value.length===0&&i();const l=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 i()),s("add",f)},a=(f,h)=>{o?.onLike?.(f,h),s("like",f,h)},c=(f,h)=>{o.onReply?.(f,h),s("reply",f,h)},d=async(f,h)=>{o.onEdit?o.onEdit(f,h):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:h})}),await i()),s("edit",f,h)},m=async f=>{o.onDelete?o.onDelete(f):o.id&&(await fetch(`/api/widget/comment/${o.id}/${f}`,{method:"DELETE"}),await i()),s("delete",f)};return(f,h)=>(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",Ei,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,E=>(e.openBlock(),e.createBlock(bi,{key:E.id,comment:E,onReply:c,onLike:a,onDelete:h[0]||(h[0]=b=>m(b)),onEdit:d},null,8,["comment"]))),128))],6),e.createVNode(Zo,{onSendComment:h[1]||(h[1]=E=>l(E))})],14,ki))}}),Jo={CopyPlus:Pr,SquarePen:Ko,Trash2:cn},Yo=new Map([["file",{name:"File",color:"bg-green-100 text-green-700 border-green-200",icon:St}],["post",{name:"Post",color:"bg-blue-100 text-blue-700 border-blue-200",icon:Jr}],["user",{name:"User",color:"bg-purple-100 text-purple-700 border-purple-200",icon:Yr}],["custom",{name:"Custom",color:"bg-gray-100 text-gray-700 border-gray-200",icon:qr}]]),wi={class:"mx-auto font-sans"},xi={class:"bg-white rounded-lg border border-neutral-200 p-4 sm:p-6"},Ni={key:0,class:"py-8 text-center text-gray-500 text-sm"},Ci={key:1,class:"py-8 text-center text-gray-500 text-sm"},Si={key:2,class:"space-y-6"},_i={class:"flex justify-end"},Bi={class:"flex items-center gap-2 mb-3 sticky top-0 bg-white py-2 z-20"},$i={class:"text-xs font-semibold text-gray-800 uppercase tracking-wide"},Ti={class:"text-xs text-gray-500"},Li={class:"relative"},Ai={class:"bg-white border border-neutral-200 rounded-lg overflow-hidden divide-y divide-neutral-200"},Di=["onClick"],Ii={class:"flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center"},Oi={class:"flex-1 min-w-0 flex items-center gap-2 text-sm"},Mi={class:"font-medium text-gray-800"},Ri={class:"text-gray-500"},Fi=["title"],Pi={class:"flex-shrink-0 flex items-center gap-2 text-xs text-gray-500 whitespace-nowrap"},zi={class:"px-4 pb-3 pl-[60px] space-y-2"},ji={class:"space-y-1.5"},Hi={class:"text-gray-500 font-[600] text-[0.92rem] min-w-[80px]"},Ui={class:"pl-2 text-gray-500 line-through"},qi={class:"text-gray-800 font-semibold"},Wi={key:0,class:"mt-4 text-center"},Ki={class:"text-xs text-gray-500"},fn=e.defineComponent({__name:"HistoryWidget",props:{data:{},title:{},maxHeight:{},hideChangesValuesKeys:{},iconSource:{default:"entityType"},showEntityId:{type:Boolean,default:!1},id:{},className:{},style:{}},setup(t){const n=t,o=e.ref(Array.isArray(n.data)?[...n.data]:[]),s=e.ref(!1),r=e.reactive({}),i=e.ref(new Map);function l(_){return _?Array.isArray(_)?_:Object.entries(_).map(([C,w],x)=>({changeDataId:`legacy-${x}`,entityKey:C,valueOld:String(w?.old??""),valueNew:String(w?.new??"")})):[]}function a(_){return l(_.changes).length>0}o.value.forEach(_=>{a(_)&&(r[_.id]=!0)}),e.onMounted(async()=>{try{const _=await fetch("/api/suggest/change_type");if(!_.ok)return;const w=(await _.json())?.data;if(!Array.isArray(w))return;const x=new Map;for(const $ of w)$?.id!=null&&x.set(String($.id).toLowerCase(),{text:$.text??$.id,icon:$.icon??null});i.value=x}catch{}}),o.value.length===0&&n.id&&k(),e.watch(()=>n.id,()=>{n.id&&k()});function c(_){return Yo.get(_)??Yo.get("custom")}function d(_){if(n.iconSource==="actionType"){const w=i.value.get((_.action??"").toLowerCase())?.icon;if(w&&w in Jo)return Jo[w]}return c(_.entityType)?.icon}const m=e.computed(()=>new Set(n.hideChangesValuesKeys??[]));function f(_){return i.value.get((_??"").toLowerCase())?.text??_??""}function h(_){try{return new Date(_+"T00:00:00").toLocaleDateString("uk-UA",{day:"numeric",month:"long",year:"numeric"})}catch{return _}}const E=e.computed(()=>{const _=new Map;for(const C of o.value){const w=C.changeDate??C.timestamp?.toLocaleDateString("uk-UA")??"unknown";if(!_.has(w)){const x=C.changeDate?h(C.changeDate):C.timestamp?.toLocaleDateString("uk-UA",{day:"numeric",month:"long",year:"numeric"})??"Без дати";_.set(w,{dateKey:w,dateDisplay:x,rows:[]})}_.get(w).rows.push(C)}return Array.from(_.values()).sort((C,w)=>w.dateKey.localeCompare(C.dateKey))}),b=e.computed(()=>o.value.filter(a).some(_=>!r[_.id]));function v(_){r[_]=!r[_]}function S(){const _=b.value;o.value.forEach(C=>{a(C)&&(r[C.id]=_)})}async function k(){if(n.id){s.value=!0;try{const _=await fetch(`/api/widget/history/${n.id}`);if(!_.ok){o.value=[];return}const w=((await _.json()).rows??[]).map(x=>({id:x.change_id??x.entity_id??"",entityId:x.entity_id??"",entityType:x.entity_type??"custom",action:x.change_type??"",userId:x.change_user_id??"",userName:x.username??"",timestamp:new Date(x.cdate),changeDate:x.change_date,login:x.login,avatar:x.avatar??null,changes:Array.isArray(x.changes)?x.changes.map($=>({changeDataId:$.change_data_id,entityKey:$.entity_key,valueOld:$.value_old??"",valueNew:$.value_new??""})):[]}));o.value=w,w.forEach(x=>{a(x)&&(r[x.id]=!0)})}finally{s.value=!1}}}return(_,C)=>(e.openBlock(),e.createElementBlock("div",wi,[e.createElementVNode("div",xi,[e.createElementVNode("div",{class:"overflow-y-auto",style:e.normalizeStyle({maxHeight:t.maxHeight?t.maxHeight+"px":"calc(100vh - 320px)"})},[s.value?(e.openBlock(),e.createElementBlock("div",Ni," Завантаження... ")):o.value.length===0?(e.openBlock(),e.createElementBlock("div",Ci," Немає записів ")):(e.openBlock(),e.createElementBlock("div",Si,[e.createElementVNode("div",_i,[e.createElementVNode("button",{onClick:S,class:"flex items-center gap-2 text-sm font-semibold text-gray-800 hover:text-blue-600 transition-colors px-4 py-2 rounded-lg border border-neutral-300 hover:border-blue-500 bg-white hover:shadow-sm"},[e.createVNode(e.unref(Rr),{class:e.normalizeClass(["w-4 h-4",{"rotate-180":b.value}])},null,8,["class"]),e.createElementVNode("span",null,e.toDisplayString(b.value?"Розгорнути всі":"Згорнути всі"),1)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w.dateKey},[e.createElementVNode("div",Bi,[e.createElementVNode("h3",$i,e.toDisplayString(w.dateDisplay),1),C[0]||(C[0]=e.createElementVNode("div",{class:"flex-1 h-[1px] bg-neutral-200"},null,-1)),e.createElementVNode("span",Ti,e.toDisplayString(w.rows.length),1)]),e.createElementVNode("div",Li,[C[1]||(C[1]=e.createElementVNode("div",{class:"absolute left-[58px] top-6 bottom-0 w-[1px] bg-neutral-200"},null,-1)),e.createElementVNode("div",Ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.rows,x=>(e.openBlock(),e.createElementBlock("div",{key:x.id,class:"hover:bg-neutral-50 transition-colors"},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-3 px-4 py-2.5",{"cursor-pointer":a(x)}]),onClick:$=>a(x)&&v(x.id)},[e.createElementVNode("div",Ii,[a(x)?(e.openBlock(),e.createBlock(e.unref(Mr),{key:0,class:e.normalizeClass(["w-3.5 h-3.5 text-gray-500 transition-transform duration-200",{"rotate-180":r[x.id]}]),"stroke-width":"1.5"},null,8,["class"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(`flex-shrink-0 w-8 h-8 rounded-full border-2 border-white shadow-sm flex items-center justify-center relative z-10 ${c(x.entityType)?.color??"bg-gray-100"}`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(x)),{class:"w-4 h-4 relative z-10","stroke-width":"1.5"}))],2),e.createElementVNode("div",Oi,[e.createElementVNode("span",Mi,e.toDisplayString(x.userName),1),e.createElementVNode("span",Ri,e.toDisplayString(f(x.action)),1),t.showEntityId&&x.entityId?(e.openBlock(),e.createElementBlock("span",{key:0,class:"rounded border border-neutral-300 bg-neutral-50 px-1.5 py-0.5 font-mono text-[0.65rem] text-gray-600 max-w-[140px] truncate",title:x.entityId},e.toDisplayString(x.entityId),9,Fi)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pi,[e.createElementVNode("span",null,e.toDisplayString(x.timestamp?.toLocaleTimeString("uk-UA",{hour:"2-digit",minute:"2-digit"})),1)])],10,Di),e.withDirectives(e.createElementVNode("div",zi,[e.createElementVNode("div",ji,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l(x.changes),$=>(e.openBlock(),e.createElementBlock("div",{key:$.changeDataId,class:"flex items-center gap-2 text-sm pl-2"},[e.createElementVNode("span",Hi,e.toDisplayString($.entityKey),1),m.value.has($.entityKey)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Ui,e.toDisplayString($.valueOld),1),e.createVNode(e.unref(Or),{class:"w-3 h-3 text-neutral-400","stroke-width":"1.5"}),e.createElementVNode("span",qi,e.toDisplayString($.valueNew),1)],64))]))),128))])],512),[[e.vShow,a(x)&&r[x.id]]])]))),128))])])]))),128))]))],4),!s.value&&o.value.length>0?(e.openBlock(),e.createElementBlock("div",Wi,[e.createElementVNode("p",Ki,e.toDisplayString(o.value.length)+" записів",1)])):e.createCommentVNode("",!0)])]))}}),Gi={key:0,class:"text-xl font-semibold"},Zi={class:"flex gap-1"},Ji={key:0},Yi=["accept"],Xi={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"},Qi=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",Gi,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Zi,[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]=i=>n.value="list")},[e.createVNode(e.unref(Kr),{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]=i=>n.value="grid")},[e.createVNode(e.unref(Hr),{class:"h-4 w-4"})],2),t.editable?(e.openBlock(),e.createElementBlock("label",Ji,[e.createElementVNode("input",{type:"file",class:"hidden",accept:t.accept,onChange:r[2]||(r[2]=i=>s.$emit("onAddFile",i))},null,40,Yi),e.createElementVNode("div",Xi,[e.createVNode(e.unref(qo),{class:"h-4 w-4"}),r[3]||(r[3]=e.createTextVNode(" Додати файл ",-1))])])):e.createCommentVNode("",!0)])],2))}}),jn={pdf:{color:"bg-red-100 text-red-700 border-red-200",icon:St,label:"PDF"},sketch:{color:"bg-gray-100 text-gray-700 border-gray-200",icon:jr,label:"SKETCH"},mp4:{color:"bg-purple-100 text-purple-700 border-purple-200",icon:Xr,label:"VIDEO"},docx:{color:"bg-blue-100 text-blue-700 border-blue-200",icon:St,label:"DOC"},zip:{color:"bg-orange-100 text-orange-700 border-orange-200",icon:Ir,label:"ARCHIVE"},png:{color:"bg-green-100 text-green-700 border-green-200",icon:Uo,label:"IMAGE"},jpg:{color:"bg-green-100 text-green-700 border-green-200",icon:Uo,label:"IMAGE"},xlsx:{color:"bg-emerald-100 text-emerald-700 border-emerald-200",icon:St,label:"EXCEL"},pptx:{color:"bg-amber-100 text-amber-700 border-amber-200",icon:St,label:"PPT"}};function Xo(t,n="en"){const o={month:"short",day:"numeric"};return new Intl.DateTimeFormat(n,o).format(t)}function Qo(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 Vi={class:"space-y-0.5"},el=["onClick"],tl=["onClick"],nl={class:"flex items-center gap-2"},ol={class:"font-medium text-xs truncate hover:text-blue-600 cursor-pointer"},sl={class:"hidden sm:block text-xs text-gray-500 w-16 text-right"},rl={class:"hidden md:block text-xs text-gray-500 w-12 text-right"},il={class:"flex items-center gap-1"},ll=["onClick"],al=["onClick"],cl=e.defineComponent({__name:"FileList",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Vi,[(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(jn)[s?.ext]?.color||"bg-blue-100 text-blue-700 border-blue-200"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(jn)[s?.ext]?.icon||e.unref(jn).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",nl,[e.createElementVNode("span",ol,e.toDisplayString(s?.uploaded_name||s?.name),1)])],8,tl),e.createElementVNode("div",sl,e.toDisplayString(e.unref(Qo)(s.size)),1),e.createElementVNode("div",rl,e.toDisplayString(e.unref(Xo)(s.createdAt)),1),e.createElementVNode("div",il,[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(Ho),{class:"h-3 w-3"})],8,ll),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(cn),{class:"h-3 w-3"})],8,al)])],8,el))),128))]))}}),dl={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3"},fl=["onClick"],pl={class:"space-y-2"},ul={class:"flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden"},ml=["src"],hl={class:"space-y-1"},gl=["title"],yl={class:"text-xs text-gray-500 text-left"},vl={class:"absolute top-2 right-1 flex items-center gap-1"},bl=["onClick"],kl=["onClick"],El=e.defineComponent({__name:"FileGrid",props:{files:{}},emits:["delete","download","openLightbox"],setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",dl,[(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",pl,[e.createElementVNode("div",ul,[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,ml)):(e.openBlock(),e.createBlock(e.unref(St),{key:1,class:"h-10 w-10 text-gray-500"}))]),e.createElementVNode("div",hl,[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,gl),e.createElementVNode("p",yl,e.toDisplayString(e.unref(Xo)(s.createdAt))+", "+e.toDisplayString(e.unref(Qo)(s.size)),1)])]),e.createElementVNode("div",vl,[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(Ho),{class:"h-3 w-3"})],8,bl),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(cn),{class:"h-3 w-3"})],8,kl)])],8,fl))),128))]))}}),wl={class:"mx-auto font-sans"},xl={key:1},pn=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),i=e.ref(!1),l=e.ref(0),a=e.ref(o.files??[]),c=e.computed(()=>{const g=(o.format??[]).map(P=>typeof P=="string"?P.trim():P==null?"":String(P).trim()).filter(P=>P.length>0),D=[];return g.forEach(P=>{const z=P.toLowerCase(),G=z.indexOf("/"),Z=G>=0;let I,F=!1,N;if(Z){I=z;const te=z.slice(G+1);F=te==="*",!F&&te&&(N=`.${te.replace(/^\.+/,"")}`)}else N=z.startsWith(".")?z:`.${z.replace(/^\.+/,"")}`;const j=Z?I:N??"";j&&D.push({acceptValue:j,mime:I,wildcard:F,extension:N})}),D.length?D:null}),d=e.computed(()=>{const B=c.value;if(!B)return;const g=B.map(D=>D.acceptValue).filter(Boolean);return g.length?g.join(","):void 0}),m=B=>{if(!c.value)return!0;const g=B.type?.toLowerCase(),D=B.name?.toLowerCase();return c.value.some(P=>{if(P.mime){if(g){if(P.wildcard){const z=P.mime.split("/")[0];if(g.startsWith(`${z}/`))return!0}else if(g===P.mime)return!0}return!!(P.extension&&D?.endsWith(P.extension))}return!!(P.extension&&D?.endsWith(P.extension))})},f=n;a.value.length===0&&w();const h=(B,g)=>{r.value=g,s.value=!0},E=()=>{r.value&&(k(r.value),r.value=null,s.value=!1)},b=e.computed(()=>Array.isArray(a.value)?a.value.map(B=>B?.file_path):[]),v=B=>{const g=b.value.findIndex(D=>D===B.file_path);g!==-1&&(i.value=!0,l.value=g)},S=B=>{o.onAddFile?o.onAddFile(B):x(B),f("add",B)},k=B=>{o.onDelete?o.onDelete(B):$(B),f("delete",B)},_=B=>{const g=document.createElement("a");g.setAttribute("download",B?.uploaded_name||B?.name),g.href=B?.file_path||B?.path,g.click()},C=e.ref(o.view==="grid"?"grid":"list");async function w(){if(!o.id)return;const B=await fetch(`/api/widget/file/${o.id}`).then(g=>g.json());B.rows.forEach(g=>{g.timestamp=new Date(g.cdate),g.id=g.entity_id,g.entityType=g.entity_type,g.entityId=g.entity_id,g.entityType=g.entity_type,g.action=g.change_type,g.userId=g.change_user_id,g.userName=g.username,g.timestamp=new Date(g.cdate),g.description=g.username,g.status=g.username}),a.value=B.rows}const x=async B=>{const D=B.target?.files;if(!D||D.length===0)return;const P=Array.from(D),z=[],G=[];if(P.forEach(Z=>{m(Z)?z.push(Z):G.push(Z)}),G.length&&console.warn(`Файлы пропущены, потому что не соответствуют разрешённым форматам: ${G.map(Z=>Z.name).join(", ")}`),z.length!==0)try{await Promise.all(z.map(async Z=>{const I=new FormData;I.append("file",Z);const F=`/api/widget/file/${o.id}`,N=await fetch(F,{method:"POST",body:I});if(!N.ok)throw new Error(`HTTP error! status: ${N.status}`);return Z})),await w()}catch(Z){console.error("Помилка при завантаженні файлів:",Z)}},$=async B=>{try{await fetch(`/api/widget/file/${o.id}/${B}`,{method:"DELETE"}),await w()}catch(g){console.error(g)}};return(B,g)=>{const D=e.resolveComponent("MessageBox"),P=e.resolveComponent("Lightbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",wl,[e.createVNode(Qi,{modelValue:C.value,"onUpdate:modelValue":g[0]||(g[0]=z=>C.value=z),title:o.title,onOnAddFile:g[1]||(g[1]=z=>S(z)),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"})},[C.value==="list"?(e.openBlock(),e.createBlock(cl,{key:0,onDelete:h,onDownload:_,onOpenLightbox:g[2]||(g[2]=z=>v(z)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0),C.value==="grid"?(e.openBlock(),e.createBlock(El,{key:1,onDelete:h,onDownload:_,onOpenLightbox:g[3]||(g[3]=z=>v(z)),files:a.value},null,8,["files"])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("div",xl,[...g[6]||(g[6]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Файлів не знайдено")],-1)])]))]),e.createVNode(D,{modelValue:s.value,"onUpdate:modelValue":g[4]||(g[4]=z=>s.value=z),onConfirm:E,title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати"},null,8,["modelValue"]),e.createVNode(P,{modelValue:i.value,"onUpdate:modelValue":g[5]||(g[5]=z=>i.value=z),images:b.value,"start-index":l.value},null,8,["modelValue","images","start-index"])],64)}}}),Nl={key:0,class:"image-wrapper h-full max-h-[400px]",id:"lightbox-gallery"},Cl=["onClick"],Sl={key:0,rel:"noreferrer",class:"relative block h-full w-full"},_l=["src"],Bl={key:0,class:"thumb-cover"},$l=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),i=t,l=e.computed(()=>Array.isArray(i.items)?i.items.map(c=>c?.file_path):[]),a=c=>{const d=l.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",Nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-full w-full image"+h,"cursor-pointer bg-teal-500 rounded-[3px]"]),key:h,onClick:e.withModifiers(E=>a(f),["stop"])},[h<5?(e.openBlock(),e.createElementBlock("div",Sl,[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]",h===0?"max-h-[411px]":"max-h-[calc((411px-3px)/2)]"])},null,10,_l),h===4&&t.items?.length>5?(e.openBlock(),e.createElementBlock("div",Bl," +"+e.toDisplayString(t.items?.length-5),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Cl))),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:l.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)}}}),Tl={key:0,class:"text-xl font-semibold"},Ll={class:"flex gap-1"},Al=["accept"],Dl={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"},Il=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",Tl,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ll,[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,Al),e.createElementVNode("div",Dl,[e.createVNode(e.unref(qo),{class:"h-4 w-4"}),o[1]||(o[1]=e.createTextVNode(" Додати зображення ",-1))])])])],2))}}),Ol={class:"w-full mx-auto font-sans",ref:"containerRef"},Ml={key:1},un=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=w=>{if(!w)return[];const x=Array.isArray(w)?w:w.split(",");return Array.from(new Set(x.map($=>$.trim().replace(/^\./,"").toLowerCase()).filter(Boolean)))},r=["jpg","jpeg","png","gif","webp","bmp","svg","avif","heic","tiff"],i=e.computed(()=>{const w=s(o.format);return w.length>0?w:void 0}),l=e.computed(()=>{const w=i.value;return!w||w.length===0?"image/*":w.map(x=>x.startsWith(".")?x:`.${x}`).join(",")}),a=w=>w?.split(".").pop()?.toLowerCase()??"",c=w=>{const x=w?.toLowerCase();return!!x&&!!i.value&&i.value.includes(x)},d=w=>{const x=w?.toLowerCase();return!!x&&r.includes(x)},m=w=>{const x=w.type?.toLowerCase(),$=w.ext?.toLowerCase();return x?.startsWith("image/")?i.value?c($):!0:$?i.value?c($):d($):!1},f=w=>{if(!w.type?.toLowerCase()?.startsWith("image/"))return!1;if(!i.value)return!0;const $=a(w.name);return c($)},h=w=>w.filter(m),E=e.ref(h(o.items??[])),b=n;E.value.length===0&&_();const v=w=>{o.onAddImage?o.onAddImage(w):k(w),b("add",w)},S=w=>{const x=E.value.find($=>$.file_path===w)?.file_id;x&&(o.onDelete?o.onDelete(x):C(x))},k=async w=>{const x=w.target;if(!x?.files||x.files.length===0)return;const $=Array.from(x.files),B=$.filter(D=>f(D)),g=i.value?.join(", ")??"image/*";if(B.length===0){console.warn(`Допустимі формати: ${g}. Завантажте зображення дозволеного типу.`);return}B.length!==$.length&&console.warn(`Частина файлів відфільтрована; дозволені формати: ${g}.`);try{await Promise.all(B.map(async D=>{const P=new FormData;P.append("file",D);const z=`/api/widget/file/${o.id}`,G=await fetch(z,{method:"POST",body:P});if(!G.ok)throw new Error(`HTTP error! status: ${G.status}`);return D})),await _()}catch(D){console.error("Помилка при завантаженні файлів:",D)}};async function _(){if(!o.id)return;const w=await fetch(`/api/widget/file/${o.id}`).then(x=>x.json());E.value=h(w.rows)}const C=async w=>{try{await fetch(`/api/widget/file/${o.id}/${w}`,{method:"DELETE"}),await _()}catch(x){console.error(x)}};return(w,x)=>(e.openBlock(),e.createElementBlock("div",Ol,[e.createVNode(Il,{title:t.title,accept:l.value,onOnAddImage:x[0]||(x[0]=$=>v($))},null,8,["title","accept"]),E.value.length>0?(e.openBlock(),e.createBlock($l,{key:0,items:E.value,onDelete:x[1]||(x[1]=$=>S($))},null,8,["items"])):(e.openBlock(),e.createElementBlock("div",Ml,[...x[2]||(x[2]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("p",{class:"text-gray-500 leading-[3]"},"Зображень не знайдено")],-1)])]))],512))}}),Rl={class:"text-value"},Fl={class:"text-sm text-gray-900"},Pl=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",Rl,[e.createElementVNode("span",Fl,e.toDisplayString(o.value),1)]))}}),ot=(t,n)=>{const o=t.__vccOpts||t;for(const[s,r]of n)o[s]=r;return o},zl=ot(Pl,[["__scopeId","data-v-c14550b7"]]),jl={class:"link-value"},Hl=["href"],Ul=ot(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",jl,[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,Hl)]))}}),[["__scopeId","data-v-e6eb07a6"]]),ql={class:"date-value"},Wl={class:"text-sm text-gray-900"},Kl=ot(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",ql,[e.createElementVNode("span",Wl,e.toDisplayString(o.value),1)]))}}),[["__scopeId","data-v-b9600618"]]),Gl={class:"status-value"},Zl={key:0,class:"mr-1"},Jl=ot(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,i)=>(e.openBlock(),e.createElementBlock("div",Gl,[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",Zl,[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-c72e0b01"]]),Yl={class:"custom-value"},Xl={class:"text-sm text-gray-900"},Ql=ot(e.defineComponent({__name:"CustomValue",props:{item:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Yl,[e.renderSlot(n.$slots,"default",{item:t.item,value:t.item.value},()=>[e.createElementVNode("span",Xl,e.toDisplayString(String(t.item.value)),1)],!0)]))}}),[["__scopeId","data-v-11a73810"]]),Vl=["id"],ea={key:0,class:"text-xl font-semibold text-gray-900 mb-4"},ta={key:1,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"},aa={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},ca={class:"flex items-start gap-3"},da={key:0,class:"flex-shrink-0"},fa={class:"flex-1 min-w-0"},pa={class:"flex items-center gap-2 mb-2"},ua={class:"text-sm font-medium text-gray-900"},ma=["title"],ha={key:3,class:"overflow-x-auto"},ga={class:"min-w-full divide-y divide-gray-200"},ya={class:"bg-white divide-y divide-gray-200"},va={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},ba={class:"flex items-center gap-2"},ka=["title"],Ea={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Hn=ot(e.defineComponent({__name:"DescriptionListWidget",props:{title:{},items:{},view:{},id:{},className:{},style:{}},setup(t){const n=o=>{switch(o.type){case"link":return Ul;case"date":return Kl;case"status":return Jl;case"custom":return Ql;default:return zl}};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",ea,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.view==="table"?(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[0]||(s[0]=[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))])])])):t.view==="grid"?(e.openBlock(),e.createElementBlock("div",aa,[(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",ca,[r.icon?(e.openBlock(),e.createElementBlock("div",da,[e.createElementVNode("i",{class:e.normalizeClass([r.icon,"text-gray-500 text-lg"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("div",fa,[e.createElementVNode("div",pa,[e.createElementVNode("h4",ua,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,ma)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])])]))),128))])):(e.openBlock(),e.createElementBlock("div",ha,[e.createElementVNode("table",ga,[e.createElementVNode("tbody",ya,[(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",va,[e.createElementVNode("div",ba,[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,ka)):e.createCommentVNode("",!0)])]),e.createElementVNode("td",Ea,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n(r)),{item:r},null,8,["item"]))])]))),128))])])]))],14,Vl))}}),[["__scopeId","data-v-36d43e50"]]);function Vo(t){return new Promise((n,o)=>{if(typeof document>"u"){o(new Error("Document is not available"));return}if(Array.from(document.scripts||[]).some(i=>i.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 wa(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 xa="https://unpkg.com/imask@7.6.1/dist/imask.min.js";let Un=null;function Na(){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 Ca(){return Un||(Un=Vo(xa).then(()=>{const t=Na();if(!t)throw new Error("IMask is not available after loading the script");return t})),Un}function Sa(){return typeof window>"u"?"":window.location?.origin??""}function es(){if(!(typeof window>"u"))return window.maplibregl}const ts=Symbol("vs-widget-map");function qn(t){if(t==null||t==="")return"";if(typeof t=="object")try{return JSON.stringify(t)}catch{return""}return String(t)}function _a(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 Ba(t){return typeof t=="string"?document.getElementById(t):"value"in t?t.value??null:t}function Wn(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=Sa(),i=s.replace(/^\/+/,"");return r?`${r}/${i}`:i?`/${i}`:""}function $a(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 Ta(t){return t.sourceLayer||t.layer||t.service_layer||t.service_key||t.map_key||t.dataset?.layer||t.id?.toString()}function mn(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 ns=["#1d4ed8","#db2777","#059669","#f97316","#0ea5e9","#d946ef","#facc15","#14b8a6","#e11d48","#16a34a"];function La(t){const n=t?.color??ns[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(([l,a])=>{const c=typeof a=="string"?a.trim():"",d=String(l).trim();c&&d&&(r[d]=c)}):ns.forEach((l,a)=>{r[String(a+1)]=l}),!Object.keys(r).length)return n;const i=["match",["to-string",["coalesce",["get",o],""]]];return Object.entries(r).forEach(([l,a])=>{i.push(String(l),a)}),i.push(n),i}const jt="map-highlight-source",Aa="map-highlight-fill",Da="map-highlight-line";function Ia(t){return t?typeof t.toJSON=="function"?t.toJSON():t.geometry?{type:"Feature",geometry:t.geometry,properties:t.properties??{}}:null:null}function os(t,n){return t?t.replace(/\{([^}]+)\}/g,(o,s)=>{const r=n?.[s];return r==null?"":String(r)}):""}async function Oa(){return wa("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.css"),await Vo("https://unpkg.com/maplibre-gl@^5.6.2/dist/maplibre-gl.js"),es()}function hn(t){const n=e.inject(ts,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:[]}),i=e.ref([]),l=e.ref([]),a=e.ref(null),c=e.ref(null),d=e.ref(null);let m=t.style??null,f=null;const h=u=>{u&&(o.value?o.value.setStyle(u):m=u)},E=()=>{r.value.overlays=l.value.map(u=>({id:u.id,name:u.config.name,visible:u.visible}))},b=u=>{const A=Array.isArray(u)?u:[];i.value=A,A.some(U=>U.key===r.value.selectedBasemap)||(r.value.selectedBasemap=A[0]?.key??"")},v=u=>{u&&l.value.forEach(A=>{A.layerIds.forEach(R=>{u.getLayer(R)&&u.removeLayer(R)}),u.getSource(A.sourceId)&&u.removeSource(A.sourceId),A.layerIds=[]})},S=()=>{const u=o.value;!u||typeof u.isStyleLoaded!="function"||!u.isStyleLoaded()||(l.value.forEach(A=>{k(u,A)}),z())},k=(u,A)=>{const R=$a(A.config);R==="vtile"?C(u,A):R==="raster"&&_(u,A)},_=(u,A)=>{const R=A.config,U=A.sourceId,Y=Wn(R.url);if(!Y)return;u.getSource(U)||u.addSource(U,{type:"raster",tiles:[Y],minzoom:R.minzoom??0,maxzoom:R.maxzoom??24});const q=`${A.id}-raster`;u.getLayer(q)||u.addLayer({id:q,type:"raster",source:U,layout:{visibility:A.visible?"visible":"none"}}),A.layerIds=[q],w(u,A)},C=(u,A)=>{const R=A.config,U=A.sourceId,Y=Wn(R.url);if(!Y)return;u.getSource(U)||u.addSource(U,{type:"vector",tiles:[Y],minzoom:R.minzoom??0,maxzoom:R.maxzoom??24});const q=R.style??{},oe=La(q),fe=[],ie={visibility:A.visible?"visible":"none"},De=Ta(R),Ke={source:U,layout:ie};if(De&&(Ke["source-layer"]=De),(q.type??"polygon").toLowerCase()==="point"){const Pe=`${A.id}-circle`;u.getLayer(Pe)||u.addLayer({id:Pe,type:"circle",...Ke,paint:{"circle-color":oe,"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}}),fe.push(Pe);const Ge=q.text??q.label;if(Ge){const et=`${A.id}-symbol`,sn=mn(q.textSize)??10,Ft=q.textHaloColor??q.stroke??"#ffffff",Pt=mn(q.textHaloWidth)??1,wt=mn(q.textZoom??q.pointZoom),xt={"text-color":q.textColor??"#000000","text-halo-color":Ft,"text-halo-width":Pt},pt={id:et,type:"symbol",...Ke,layout:{"text-field":["coalesce",["get",Ge],""],"text-size":sn,"text-anchor":"top"},paint:xt};wt!=null&&(pt.minzoom=wt),u.getLayer(et)||u.addLayer(pt),fe.push(et)}}else{const Pe=`${A.id}-fill`;u.getLayer(Pe)||u.addLayer({id:Pe,type:"fill",...Ke,paint:{"fill-color":oe,"fill-opacity":q.opacity??.5,"fill-outline-color":q.stroke??q.color??"#0ea5e9"}}),fe.push(Pe);const Ge=`${A.id}-line`;u.getLayer(Ge)||u.addLayer({id:Ge,type:"line",...Ke,paint:{"line-color":q.stroke??q.color??"#0b74c4","line-width":mn(q.width??q.border)??1,"line-opacity":q.opacity??1}}),fe.push(Ge)}A.layerIds=fe,w(u,A)},w=(u,A)=>{const R=A.visible?"visible":"none";A.layerIds.forEach(U=>{u.getLayer(U)&&u.setLayoutProperty(U,"visibility",R)})},x=u=>{const A=Array.isArray(u)?u:[];v(o.value??void 0),d.value=null,I();const R=A.map((U,Y)=>{if(!U)return null;const q=Wn(U.url);if(!q)return null;const oe=U.id!=null?String(U.id):`overlay-${Y}`;return{id:oe,config:{...U,id:oe,url:q},visible:!1,sourceId:`${oe}-source`,layerIds:[]}}).filter(U=>!!U);l.value=R,E(),S()},$=(u,A)=>{const R=l.value.find(Y=>Y.id===u);if(!R)return;R.visible=A,E();const U=o.value;if(!(!U||typeof U.isStyleLoaded!="function"||!U.isStyleLoaded())){if(!R.layerIds.length){k(U,R);return}w(U,R)}},B=()=>{a.value&&(a.value.remove(),a.value=null)},g=(u,A={})=>!Array.isArray(u.popup)||!u.popup.length?[]:u.popup.map(R=>({label:R.label??R.field,value:qn(A?.[R.field])})).filter(R=>R.label&&R.value!==void 0),D=u=>{const A=o.value;if(!A||!u?.point)return;const R=A.queryRenderedFeatures(u.point);for(const U of R){const Y=U.layer?.id??U.sourceLayer;if(!Y)continue;const q=He(Y);if(!q)continue;const oe=g(q,U.properties??U.layer?.properties??{});if(!oe.length)continue;const fe=_a(oe),ie=es();if(!ie)return;const De=u.lngLat;if(c.value===Y&&a.value){a.value.setLngLat(De),a.value.setHTML(fe);return}c.value=Y,B(),a.value=new ie.Popup({closeButton:!1,closeOnClick:!1}).setLngLat(De).setHTML(fe).addTo(A);return}c.value=null,B()},P=()=>{c.value=null,B()},z=()=>{const u=o.value;!u||typeof u.isStyleLoaded!="function"||!u.isStyleLoaded()||u.getSource(jt)||(u.addSource(jt,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),u.addLayer({id:Aa,type:"fill",source:jt,paint:{"fill-color":"#2563eb","fill-opacity":.35}}),u.addLayer({id:Da,type:"line",source:jt,paint:{"line-color":"#1d4ed8","line-width":2}}))},G=u=>{const A=o.value;if(!A||typeof A.isStyleLoaded!="function"||!A.isStyleLoaded())return;z();const R=A.getSource(jt);if(!(!R||typeof R.setData!="function")){if(!u){R.setData({type:"FeatureCollection",features:[]});return}R.setData({type:"FeatureCollection",features:[u]})}},Z=u=>{const A=Ia(u);A&&G(A)},I=()=>{G(null)},F=()=>{d.value=null,I()},N=u=>{if(u)return typeof u=="string"?u:u.field??u.name??u.key??u.label},j=u=>{if(u)return typeof u=="string"?u:u.label??u.title??u.field??u.name},te=(u,A)=>!u||!u.length?[]:u.map(R=>{const U=N(R);if(!U)return null;const Y=j(R),q=qn(A?.[U]);return!Y||q===""?null:{label:Y,value:q}}).filter(R=>!!R),Re=(u,A)=>!Array.isArray(u)||!u.length?[]:u.map(R=>{if(!R?.name)return null;const U=R.title??R.name,Y=qn(A?.[R.name]);return!U||Y===""?null:{label:U,value:Y}}).filter(R=>!!R),ye=(u,A)=>!Array.isArray(u)||!u.length?[]:u.map(U=>{const Y=os(U.url,A),q=U.label??U.url;return Y?{label:q,url:Y,target:U.target}:null}).filter(U=>!!U),me=async(u,A)=>{const R=os(u,A);if(!R)return null;try{const U=await fetch(R);return U.ok?await U.json():null}catch{return null}},we=async(u,A)=>{const R=A.properties??A.layer?.properties??{},U=te(u.card?.rows,R);let Y,q;if(u.card?.api){const ie=await me(u.card.api,R);ie&&(typeof ie.html=="string"&&ie.html.trim()&&(Y=ie.html),Array.isArray(ie.columns)&&ie.columns.length&&(q=ie.columns))}let oe=U;if(!Y&&q){const ie=Re(q,R);ie.length&&(oe=ie)}if(!oe.length&&!Y)return null;const fe=ye(u.card?.actions,R);return{title:R?.name??u.name,rows:oe,html:Y,actions:fe.length?fe:void 0}},ft=async u=>{const A=o.value;if(!A||!u?.point)return;const R=A.queryRenderedFeatures(u.point);for(const U of R){const Y=U.layer?.id??U.sourceLayer;if(!Y)continue;const q=He(Y);if(!q||!q.card)continue;const oe=await we(q,U);if(oe){d.value=oe,Z(U);return}}d.value=null,I()},Et=()=>{const u=o.value;u&&(u.on("mousemove",D),u.on("mouseleave",P),u.on("click",ft))},Be=()=>{const u=o.value;u&&(u.off("mousemove",D),u.off("mouseleave",P),u.off("click",ft),B(),I())},He=u=>{if(u)return l.value.find(A=>A.layerIds.includes(u))?.config},W=async()=>{const u=await Oa(),A=Ba(t.container);if(!u||!A)return;const R={container:A,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 u.Map(R);const U=()=>{S()};f=U,o.value.on("style.load",U),o.value.on("load",()=>{s.value=!0,m&&o.value&&(o.value.setStyle(m),m=null),S(),Et()})};e.onMounted(W),e.onBeforeUnmount(()=>{Be(),o.value&&f&&o.value.off("style.load",f),v(o.value??void 0),o.value?.remove(),o.value=null,s.value=!1});const K={map:o,ready:s,setStyle:h,flyTo:u=>o.value?.flyTo(u),fitBounds:(u,A)=>o.value?.fitBounds(u,A),setCenter:u=>o.value?.setCenter(u),setZoom:u=>o.value?.setZoom(u),addControl:(u,A)=>o.value?.addControl(u,A),removeControl:u=>o.value?.removeControl(u),on:(u,...A)=>o.value?.on(u,...A),off:(u,...A)=>o.value?.off(u,...A),project:u=>o.value?.project(u),unproject:u=>o.value?.unproject(u),state:r,basemapOptions:i,setOverlays:x,toggleOverlay:$,getOverlayConfig:He,selectedCard:d,setBasemapOptions:b,clearCard:F};return e.provide(ts,K),K}const Ma={class:"map-base-layer-menu"},Ra={key:1,class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 border rounded-lg text-sm cursor-pointer layers-button"},Fa={class:"flex items-center justify-between p-2 border-b"},Pa={class:"p-2 border-b"},za={class:"flex items-center"},ja=["value","checked","onChange"],Ha={class:"ml-2"},Ua={class:"p-2"},qa={class:"flex items-center"},Wa=["checked"],Ka=["checked","onChange"],Ga={class:"ml-2"},Za=e.defineComponent({__name:"LayerMenu",setup(t){const{state:n,basemapOptions:o,setBasemap:s,toggleGeometry:r,toggleOverlay:i}=hn(),l=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??[]),h=v=>{s?.(v)},E=()=>{r?.(!m.value)},b=v=>{i?.(v.id,!v.visible)};return(v,S)=>(e.openBlock(),e.createElementBlock("div",Ma,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:S[0]||(S[0]=k=>l.value=!0),class:"z-[500] bg-white absolute top-[10px] right-[10px] p-1.5 text-sm border rounded-lg cursor-pointer layers-button"}," Шари ")),l.value?(e.openBlock(),e.createElementBlock("div",Ra,[e.createElementVNode("div",Fa,[S[3]||(S[3]=e.createElementVNode("div",null,"Шари",-1)),e.createElementVNode("button",{type:"button",class:"text-gray-500 hover:text-gray-800",onClick:S[1]||(S[1]=k=>l.value=!1)},[...S[2]||(S[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",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k.key},[e.createElementVNode("label",za,[e.createElementVNode("input",{type:"radio",name:a,value:k.key,checked:d.value===k.key,onChange:_=>h(k.key)},null,40,ja),e.createElementVNode("span",Ha,e.toDisplayString(k.name||k.key),1)])]))),128))]),e.createElementVNode("div",Ua,[e.createElementVNode("label",qa,[e.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:E},null,40,Wa),S[4]||(S[4]=e.createElementVNode("span",{class:"ml-2"},"Геометрія/Межі",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,k=>(e.openBlock(),e.createElementBlock("label",{class:"flex items-center",key:k.id},[e.createElementVNode("input",{type:"checkbox",checked:k.visible,onChange:_=>b(k)},null,40,Ka),e.createElementVNode("span",Ga,e.toDisplayString(k.name||k.id),1)]))),128))])])):e.createCommentVNode("",!0)]))}}),Ja={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]"},Ya={class:"leading-tight"},Xa=e.defineComponent({__name:"Legend",props:{items:{}},setup(t){return(n,o)=>t.items.length?(e.openBlock(),e.createElementBlock("div",Ja,[(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",Ya,e.toDisplayString(s.label),1)]))),128))])):e.createCommentVNode("",!0)}}),Qa={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]"},Va={class:"font-mono"},ec=e.defineComponent({__name:"CursorCoordinates",props:{coordinates:{}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Qa,[e.createElementVNode("span",Va,e.toDisplayString(t.coordinates),1)]))}}),tc={class:"map-search-widget absolute top-[10px] left-[10px] flex flex-col gap-2 rounded-xl widget min-w-[200px]"},nc=["title"],oc={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"},sc=["onClick"],rc=["placeholder"],ic={class:"divide-y divide-gray-100"},lc=["onClick"],ac=600,cc="0000000000:00:000:0000",dc=30,fc=8,pc="https://data.softpro.ua/api-user/gis-url-proxy",uc="https://geo.rv.ua/api-user/dzk.api",mc="https://nominatim.openstreetmap.org/search",hc=e.defineComponent({__name:"MapSearchWidget",props:{config:{}},setup(t){const n=t,o=hn(),s=e.getCurrentInstance();function r(){return s?.appContext.config.globalProperties?.$settings?.map?.searchViewbox}const l=!!r()?["xy","parcel","address"]:["xy","parcel"],a=e.computed(()=>{const W=n.config?.tools?.filter(K=>l.includes(K));return W&&W.length?W:l}),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),h=e.ref(null),E=e.ref(null),b=e.ref(null),v=e.ref([]),S=e.ref(null),k=e.computed(()=>d.value==="address"&&v.value.length>0);let _=null,C=null,w=null;const x=e.reactive({position:"absolute",left:"0px",top:"0px",width:"100%",display:"none"});function $(){if(!E.value)return;const W=E.value.getBoundingClientRect(),K=W.width+dc,u=W.left+window.scrollX,A=W.bottom+window.scrollY+fc;x.left=`${u}px`,x.top=`${A}px`,x.width=`${K}px`,x.display="block"}const B=()=>{k.value&&$()};function g(){_&&(clearTimeout(_),_=null)}function D(){C?.destroy(),C=null}async function P(){if(d.value!=="parcel")return;const W=b.value;if(!W)return;const K=await Ca();d.value==="parcel"&&(D(),C=K(W,{mask:cc,lazy:!1,placeholderChar:"_"}),C.on("accept",()=>{m.value=C?.value??""}))}function z(){return(C?.value??m.value).trim()}function G(){if(!(typeof window>"u"))return window.maplibregl}function Z(W){const K=o.map.value;if(!K)return;const u=G();if(u){if(w){w.setLngLat([W.lat,W.lng]);return}w=new u.Marker({color:"#2563eb"}).setLngLat([W.lat,W.lng]).addTo(K)}}function I(){w&&(w.remove(),w=null)}e.watch(d,W=>{m.value="",f.value=!1,v.value=[],g(),W==="parcel"?e.nextTick(()=>{P().catch(K=>{Ne.notify({type:"error",title:"Маска кадастру",message:K?.message||"Не вдалося ініціалізувати маску"})})}):D()}),e.watch(k,W=>{W?e.nextTick(()=>{$()}):x.display="none"}),e.watch(m,W=>{if(d.value!=="address"){v.value=[],g();return}if(!W.trim()){v.value=[],g();return}g(),_=window.setTimeout(()=>{we(W).catch(K=>{const u=K?.message||"Помилка пошуку адреси";Ne.notify({type:"error",title:"Пошук адреси",message:u})})},ac)});function F(W){d.value=W}function N(W){const K=W.target;if(f.value){const u=h.value;u&&!u.contains(K)&&(f.value=!1)}if(k.value){const u=S.value;u&&!u.contains(K)&&(v.value=[])}}e.onMounted(()=>{window.addEventListener("click",N,!0),window.addEventListener("scroll",B,!0),window.addEventListener("resize",B),d.value==="parcel"&&e.nextTick(()=>{P().catch(W=>{Ne.notify({type:"error",title:"Маска кадастру",message:W?.message||"Не вдалося ініціалізувати маску"})})})}),e.onBeforeUnmount(()=>{window.removeEventListener("click",N,!0),window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",B),g(),D(),I()});function j(W){return W==="xy"?"Координати":W==="parcel"?"Кадастр":"Адреси"}function te(W){const K=W.replace(/[,]+/g," ").trim();if(!K)return null;const u=K.split(/\s+/).filter(Boolean);if(u.length<2)return null;console.log(u);const A=u.slice(0,2).map(Number);if(console.log(A),!A.every(ie=>Number.isFinite(ie)))return null;let[R,U]=A,Y=R,q=U;const oe=ie=>Math.abs(ie)<=90,fe=ie=>Math.abs(ie)<=180;if(!oe(Y)||!fe(q))if(oe(q)&&fe(Y))Y=R,q=U;else return null;return console.log(Y,q),{lat:Y,lng:q}}function Re(W){return(W?.items||[]).map((u,A)=>{const R=Number(u?.position?.lat),U=Number(u?.position?.lng);return!Number.isFinite(R)||!Number.isFinite(U)?null:{id:String(u?.id??A),title:u?.title||u?.address?.label||"Знайдений обʼєкт",lat:R,lng:U}}).filter(u=>!!u)}function ye(W){const K=W?.result||W?.data||W;if(!K)return[];const u=K.geom_centroid;if(!u||!Array.isArray(u.coordinates))return[];const[A,R]=u.coordinates;return!Number.isFinite(A)||!Number.isFinite(R)?[]:[{id:"parcel",title:K.cadnum||K.cad_num||"Земельна ділянка",lat:A,lng:R}]}function me(W){return(Array.isArray(W?.features)?W.features:[]).map((u,A)=>{const R=u?.geometry?.coordinates,U=Number(R?.[0]),Y=Number(R?.[1]);if(!Number.isFinite(U)||!Number.isFinite(Y))return null;const q=u?.properties||{},oe=q?.geocoding?.label||q?.display_name||q?.label||"Адреса";return{id:String(q?.geocoding?.place_id||q?.place_id||A),title:oe,lat:U,lng:Y}}).filter(u=>!!u)}async function we(W){v.value=[],g();const K=new URL(mc);K.searchParams.set("format","geojson"),K.searchParams.set("q",W),K.searchParams.set("addressdetails","1"),K.searchParams.set("bounded","1");const u=r();u&&K.searchParams.set("viewbox",u);const A=await fetch(K.toString());if(!A.ok)throw new Error(`HTTP ${A.status}`);const R=await A.json(),U=me(R);if(!U.length){Ne.notify({type:"warning",title:"Пошук адреси",message:"Не знайдено результатів"});return}v.value=U}function ft(W){Be(W),v.value=[],m.value=""}function Et(W){const u=W.replace(/\s+/g,"").split(":");if(u.length!==4)return!1;const A=[10,2,3,4];return u.every((R,U)=>R.length===A[U]&&/^\d+$/.test(R))}function Be(W){const K=n.config?.zoom??17;o.flyTo?.({center:[W.lat,W.lng],zoom:K}),Z(W)}async function He(){const W=d.value==="parcel"?z():m.value.trim();if(W){if(d.value==="xy"){const K=te(W);if(console.log(K),!K){Ne.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}Be(K),m.value="";return}if(d.value==="address"){try{await we(W)}catch(K){const u=K?.message||"Помилка пошуку адреси";Ne.notify({type:"error",title:"Пошук адреси",message:u})}return}try{const K=new URL(d.value==="here"?pc:uc);if(d.value==="here")K.searchParams.set("searchtext",W);else{if(!Et(W)){Ne.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}K.searchParams.set("cad_num",W)}const u=await fetch(K.toString());if(!u.ok)throw new Error(`HTTP ${u.status}`);const A=await u.json(),R=d.value==="here"?Re(A):ye(A);if(!R.length)Ne.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const U=R[0];Be(U),d.value==="parcel"&&C&&(C.value=""),m.value=""}}catch(K){const u=K?.message||"Помилка пошуку";Ne.notify({type:"error",title:"Пошук",message:u})}}}return(W,K)=>(e.openBlock(),e.createElementBlock("div",tc,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(He,["prevent"])},[a.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:h,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:K[0]||(K[0]=u=>f.value=!f.value)},[e.createElementVNode("span",{class:"block w-full truncate",title:j(d.value)},e.toDisplayString(j(d.value)),9,nc),(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"},[...K[3]||(K[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",oc,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,u=>(e.openBlock(),e.createElementBlock("li",{key:u,class:"px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",onClick:A=>F(u)},e.toDisplayString(j(u)),9,sc))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"searchWrapperRef",ref:E,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:b,"onUpdate:modelValue":K[1]||(K[1]=u=>m.value=u),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":K[2]||(K[2]=u=>m.value=u),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,rc)),[[e.vModelText,m.value,void 0,{trim:!0}]]),K[4]||(K[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)),k.value?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:"body"},[e.createElementVNode("div",{ref_key:"addressResultsRef",ref:S,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(x)},[e.createElementVNode("ul",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,u=>(e.openBlock(),e.createElementBlock("li",{key:u.id,class:"px-3 py-2 cursor-pointer hover:bg-gray-50",onClick:A=>ft(u)},e.toDisplayString(u.title),9,lc))),128))])],4)])):e.createCommentVNode("",!0)],512)],32)]))}}),gc={class:"map-center-control"},yc=["aria-label"],vc=e.defineComponent({directives:{tooltip:Ne.TooltipDirective},__name:"MapCenterControl",props:{center:{},zoom:{},targetCenter:{},targetZoom:{},targetLabel:{},targetAriaLabel:{}},setup(t){const n=t,{map:o,ready:s}=hn(),r=e.ref(null),i=e.ref(null),l=e.ref(null),a=e.ref(null);function c(b){if(Array.isArray(b)&&b.length>=2){const[v,S]=b.slice(0,2).map(k=>Number(k));return Number.isNaN(v)||Number.isNaN(S)?null:[v,S]}if(b&&typeof b=="object"){const v=b,S=v.lng??v.lon??v.long??v.x,k=v.lat??v.y;if(S!=null&&k!=null){const _=Number(S),C=Number(k);if(!Number.isNaN(_)&&!Number.isNaN(C))return[_,C]}}if(typeof b=="string"){const v=b.split(",").map(S=>Number(S.trim()));if(v.length>=2&&v.every(S=>!Number.isNaN(S)))return[v[0],v[1]]}return null}e.watch(()=>n.center,b=>{const v=c(b);v&&(r.value=v)},{immediate:!0}),e.watch(()=>n.zoom,b=>{const v=Number(b);Number.isNaN(v)||(i.value=v)},{immediate:!0}),e.watch(()=>n.targetCenter,b=>{l.value=c(b)},{immediate:!0}),e.watch(()=>n.targetZoom,b=>{const v=Number(b);a.value=Number.isNaN(v)?null:v},{immediate:!0});const d=e.computed(()=>n.targetLabel?.trim()||"Точка"),m=e.computed(()=>n.targetAriaLabel||"Перейти до точки"),f=e.computed(()=>!!l.value);e.onMounted(async()=>{const b=o.value;if(b){if(!r.value){const v=b.getCenter();r.value=[v.lng,v.lat]}i.value==null&&(i.value=b.getZoom())}});function h(){const b=o.value;if(!b)return;const v=r.value||(()=>{const k=b.getCenter();return[k.lng,k.lat]})(),S=i.value??b.getZoom();b.flyTo({center:v,zoom:S})}function E(){const b=o.value;if(!b||!l.value)return;const v=a.value??i.value??b.getZoom();b.flyTo({center:l.value,zoom:v})}return(b,v)=>{const S=e.resolveDirective("tooltip");return e.openBlock(),e.createElementBlock("div",gc,[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(h,["stop"])},[e.createVNode(e.unref(Wr),{class:"w-4 h-4"})])),[[S,"Центр мапи"]]),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(E,["stop"])},[e.createVNode(e.unref(Gr),{class:"w-4 h-4"})],8,yc)),[[S,d.value]]):e.createCommentVNode("",!0)])}}}),ss=ot(vc,[["__scopeId","data-v-73fcd71f"]]),bc={key:1,class:"absolute bottom-[50px] right-[10px] flex flex-col items-center gap-2 pointer-events-none z-[520]"},kc={key:0,class:"flex flex-col items-center gap-2 pointer-events-auto"},Ec=["aria-label"],wc={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)]"},xc={class:"text-slate-900 font-semibold mb-1"},Nc=["innerHTML"],Cc={key:1,class:"space-y-2"},Sc={class:"text-gray-500"},_c={class:"font-medium text-slate-900"},Bc={key:2,class:"mt-2 flex flex-col gap-2"},$c=["href","target"],ut="map-basemap-source",Ht="map-basemap-layer",Tc=20,_t="map-katottg-geometry-source",gn="map-katottg-geometry-line",st="map-geometry-source",Bt="map-geometry-fill",$t="map-geometry-line",Tt="map-geometry-circle",yn=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"}],i=(e.getCurrentInstance()?.appContext.config.globalProperties?.$settings??{})?.map??{};function l(p){if(p){if(Array.isArray(p)&&p.length>=2){const M=Number(p[0]),H=Number(p[1]);return!Number.isFinite(M)||!Number.isFinite(H)?void 0:[M,H]}if(typeof p=="object"){const M=p,H=M.lng??M.lon??M.long??M.x,X=M.lat??M.y;if(H!=null&&X!=null){const _e=Number(H),Ye=Number(X);if(Number.isFinite(_e)&&Number.isFinite(Ye))return[_e,Ye]}}}}function a(p){if(p==null)return;const M=Number(p);return Number.isFinite(M)?M:void 0}const c=()=>typeof window>"u"?"":window.location?.origin??"",d=p=>{if(!p)return"";const M=p.trim();if(!M)return"";const X=M.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s+/g,"");if(!X)return"";if(/^https?:\/\//i.test(X))return X;const _e=c(),Ye=X.replace(/^\/+/,"");return _e?`${_e}/${Ye}`:Ye?`/${Ye}`:""},m=e.computed(()=>n.katottg!=null?n.katottg:i.katottg),f=e.computed(()=>(Array.isArray(i.basemaps)&&i.basemaps.length?i.basemaps:o).map((H,X)=>{const _e=typeof H.url=="string"?H.url.trim():"";return _e?{key:(H.key??H.name??`base-${X}`).trim()||`base-${X}`,url:_e,name:H.name??H.key??`Layer ${X+1}`}:null}).filter(H=>!!H)),h=l(i.center),E=a(i.zoom),b=zo(n.geom),v=Sr(b),S=v?[(v[0]+v[2])/2,(v[1]+v[3])/2]:void 0,k=e.ref(null),_=e.computed(()=>l(n.center)??null),C=e.computed(()=>_.value??h??null),w=p=>p?{version:8,sources:{[ut]:{type:"raster",tiles:[p],tileSize:256}},layers:[{id:Ht,type:"raster",source:ut,layout:{visibility:"visible"}}]}:{version:8,sources:{},layers:[]},x=d(f.value[0]?.url),$=hn({container:k,center:S??C.value??void 0,zoom:n.zoom??E,style:w(x)}),{map:B,setCenter:g,setZoom:D,state:P,getOverlayConfig:z,selectedCard:G,setBasemapOptions:Z,clearCard:I,addControl:F,removeControl:N,ready:j}=$,te=e.computed({get:()=>P.value.selectedBasemap??"",set:p=>{P.value.selectedBasemap=p}}),Re=e.computed({get:()=>P.value.geometryVisible??!0,set:p=>{P.value.geometryVisible=p}}),ye=e.computed(()=>{const p=n.height;return{height:typeof p=="number"?`${p}px`:String(p)}}),me=e.ref(!1),we=e.ref(!1),ft=e.computed(()=>me.value?"!fixed inset-0 w-screen h-screen z-[9999] bg-white":"relative w-full"),Et=e.computed(()=>{const p=["w-full","h-full"];return me.value||p.push(`min-h-[${ye.value.height}]`),p.join(" ")}),Be=e.computed(()=>G.value),He=()=>I?.(),W=e.ref(S??C.value??null),K=e.ref(n.zoom??E??null),u=e.ref(C.value);e.watch(C,p=>{u.value=p},{immediate:!0});const A=e.computed(()=>u.value??null),R=e.computed(()=>typeof n.zoom=="number"?n.zoom:typeof K.value=="number"?K.value:Tc),U=["home","fullscreen","scale","position"],Y=e.computed(()=>!Array.isArray(n.tools)||!n.tools.length?U:n.tools.filter(p=>U.includes(p))),q=p=>Y.value.includes(p);e.watch([B,j],([p,M])=>{if(!(!p||!M)){if(!W.value){const H=p.getCenter();W.value=[H.lng,H.lat]}K.value==null&&(K.value=p.getZoom())}},{immediate:!0});const oe=e.ref(null),fe=e.ref(""),ie=e.ref(null),De=p=>p?we.value?!0:typeof p.isStyleLoaded=="function"&&p.isStyleLoaded()?(we.value=!0,!0):!1:!1,Ke=p=>{if(!p)return"";const M=Number(p.lat??p[1]),H=Number(p.lng??p[0]);return!Number.isFinite(M)||!Number.isFinite(H)?"":`${H.toFixed(5)}, ${M.toFixed(5)}`},on=p=>{p?.lngLat&&(fe.value=Ke(p.lngLat))},Pe=()=>{fe.value=""},Ge=p=>{p&&(p.on("mousemove",on),p.on("mouseleave",Pe),ie.value=p)},et=p=>{p&&(p.off("mousemove",on),p.off("mouseleave",Pe),ie.value=null)},sn=e.computed(()=>q("scale"));e.watch([B,j],([p,M],[H])=>{H&&et(H),!(!p||!M)&&Ge(p)},{immediate:!0}),e.watch([B,j,sn],([p,M,H])=>{if(oe.value&&N&&(N(oe.value),oe.value=null),!p||!M||!H)return;const X=window?.maplibregl;X&&(oe.value=new X.ScaleControl({unit:"metric"}),F?.(oe.value,"bottom-left"))},{immediate:!0});const Ft=e.computed(()=>Array.isArray(n.legend)?n.legend.map((p,M)=>{const H=typeof p?.color=="string"?p.color.trim():"",X=typeof p?.label=="string"?p.label.trim():"";return!H||!X?null:{color:H,label:X,key:`${X}-${M}`}}).filter(p=>!!p):[]),Pt=e.computed(()=>Array.isArray(n.layers)&&n.layers.length?n.layers:Array.isArray(i.layers)&&i.layers.length?i.layers:[]);e.watch(f,p=>{if(Z?.(p),!p.length){te.value="";return}p.some(M=>M.key===te.value)||(te.value=p[0].key)},{immediate:!0});const wt=p=>{if(!p?.getStyle)return;const M=p.getStyle()??{},H=Array.isArray(M.layers)?M.layers:[];return H.length?H.find(_e=>_e.type!=="background")?.id??H[0]?.id:void 0},xt=p=>{p&&(p.getLayer(Ht)&&p.removeLayer(Ht),p.getSource(ut)&&p.removeSource(ut))},pt=(p,M)=>{if(!p)return;const H=wt(p);p.addSource(ut,{type:"raster",tiles:[M],tileSize:256}),p.addLayer({id:Ht,type:"raster",source:ut,layout:{visibility:"visible"}},H)},Mo=p=>{if(!p)return;const M=d(p.url);if(!M){tt.value=null;return}tt.value=M,xt(B.value),T()},tt=e.ref(null),y=e.ref(x||null),O=p=>{if(!p||p.__pendingBasemapHooked)return;p.__pendingBasemapHooked=!0;const M=()=>{p.__pendingBasemapHooked=!1,T()};p.once("style.load",M),p.once("styledata",M)},T=()=>{const p=B.value,M=tt.value;if(!(!M||!p)){if(!De(p)){O(p);return}if(y.value===M&&p.getSource(ut)&&p.getLayer(Ht)){tt.value=null;return}xt(p),pt(p,M),y.value=M,tt.value=null}},L=()=>{const p=te.value;if(!p)return;const M=f.value.find(H=>H.key===p);M&&Mo(M)};e.watch(te,()=>{L()},{immediate:!0}),e.watch(Pt,p=>{$.setOverlays?.(p)},{immediate:!0,deep:!0});const J=e.ref(null);let le=0;const ne=e.computed(()=>zo(J.value)),xe={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}},nt={"line-color":"#1d4ed8","line-width":2,"line-dasharray":[6,4]},re=e.ref(b),Ue=e.ref(v),ve=e.ref(!1),Ze=e.computed(()=>{if(!Ue.value)return null;const[p,M,H,X]=Ue.value;return[(p+H)/2,(M+X)/2]}),zt=e.computed(()=>!!Ue.value),qe=e.ref(!!v);e.ref(!1);const Ro=()=>{me.value=!me.value},Je=e.ref(!1),Fo=()=>{const p=B.value;if(!p||!De(p))return;const M=re.value;if(!M){Tu(p),rn();return}let H=p.getSource(st);H?H.setData(M):(p.addSource(st,{type:"geojson",data:M}),$u(p),H=p.getSource(st)),Nr(p,Re.value?"visible":"none"),Lu(),rn(),Ue.value&&(!qe.value&&(ve.value||!Je.value)?(p.fitBounds(Ue.value,{padding:40,maxZoom:16,duration:0}),Je.value=!0,ve.value=!1):qe.value&&(qe.value=!1,ve.value=!1,Je.value=!0))},$u=p=>{const M=xe;p.getLayer(Bt)||p.addLayer({id:Bt,type:"fill",source:st,paint:M.fill}),p.getLayer($t)||p.addLayer({id:$t,type:"line",source:st,paint:M.line}),p.getLayer(Tt)||p.addLayer({id:Tt,type:"circle",source:st,paint:M.circle,filter:["==","$type","Point"]})},Tu=p=>{[Tt,$t,Bt].forEach(M=>{p.getLayer(M)&&p.removeLayer(M)}),p.getSource(st)&&p.removeSource(st)},Nr=(p,M)=>{De(p)&&[Tt,$t,Bt].forEach(H=>{p.getLayer(H)&&p.setLayoutProperty(H,"visibility",M)})},Lu=()=>{const p=B.value;if(!p||!De(p))return;const M=xe;p.getLayer(Bt)&&Object.entries(M.fill).forEach(([H,X])=>{p.setPaintProperty(Bt,H,X)}),p.getLayer($t)&&Object.entries(M.line).forEach(([H,X])=>{p.setPaintProperty($t,H,X)}),p.getLayer(Tt)&&Object.entries(M.circle).forEach(([H,X])=>{p.setPaintProperty(Tt,H,X)})},Cr=p=>{p.getLayer(gn)||p.addLayer({id:gn,type:"line",source:_t,layout:{visibility:"visible"},paint:nt})},rn=()=>{const p=B.value;if(!p||!De(p))return;const M=ne.value??{type:"FeatureCollection",features:[]};if(!p.getSource(_t)){p.addSource(_t,{type:"geojson",data:M}),Cr(p);return}const H=p.getSource(_t);H&&typeof H.setData=="function"&&H.setData(M),Cr(p)},Au=p=>{p.getLayer(gn)&&p.removeLayer(gn),p.getSource(_t)&&p.removeSource(_t)},Du=async p=>{const M=typeof p=="string"?p.trim():"",H=++le;if(!M){J.value=null;return}try{const X=await fetch(`https://data.gki.com.ua/api-user/atu/${M}`);if(le!==H)return;if(!X.ok){J.value=null;return}const _e=await X.json();if(le!==H)return;J.value=_e}catch{if(le!==H)return;J.value=null}};e.watch(m,p=>{Du(p)},{immediate:!0}),e.watch(ne,()=>{rn()},{immediate:!0}),e.watch(()=>n.geom,p=>{re.value=zo(p),Ue.value=Sr(re.value),Ze.value&&(W.value=Ze.value),Je.value=!1,ve.value=!0,Fo()},{deep:!0,immediate:!0}),e.watch(Re,()=>{const p=B.value;p&&De(p)&&Nr(p,Re.value?"visible":"none")});const Nt=()=>{we.value=!0,Fo(),rn(),T()},Po=()=>{Fo(),rn()};e.watch(B,(p,M)=>{M&&(M.off("style.load",Nt),M.off("load",Nt),M.off("idle",Po)),we.value=!1,p&&(p.on("load",Nt),p.on("style.load",Nt),p.on("idle",Po),typeof p.isStyleLoaded=="function"&&p.isStyleLoaded()&&Nt())}),e.watch(_,p=>{!B.value||!p||zt.value||g(p)}),e.watch(()=>n.zoom,p=>{!B.value||typeof p!="number"||D(p)}),e.onBeforeUnmount(()=>{oe.value&&N&&N(oe.value),ie.value?et(ie.value):B.value&&et(B.value);const p=B.value;p&&(Au(p),p.off("style.load",Nt),p.off("load",Nt),p.off("idle",Po))});function Iu(p){p&&(te.value=p)}function Ou(p){Re.value=p}$.setBasemap=Iu,$.toggleGeometry=Ou,$.setOverlays?.(Pt.value);function zo(p){if(!p)return null;if(p.type==="FeatureCollection")return p;if(p.type==="Feature")return{type:"FeatureCollection",features:[p]};const M=p.geometry??p;if(!M?.type)return null;if(M.type==="GeometryCollection"&&Array.isArray(M.geometries)){const H=M.geometries.filter(X=>X&&typeof X.type=="string").map(X=>({type:"Feature",geometry:X}));return H.length?{type:"FeatureCollection",features:H}:null}if(M.type==="MultiPoint"&&Array.isArray(M.coordinates)){const H=M.coordinates.filter(X=>Array.isArray(X)&&X.length>=2).map(X=>({type:"Feature",geometry:{type:"Point",coordinates:X}}));return H.length?{type:"FeatureCollection",features:H}:null}return{type:"FeatureCollection",features:[{type:"Feature",geometry:M}]}}function Sr(p){if(!p?.features?.length)return null;let M=1/0,H=1/0,X=-1/0,_e=-1/0;const Ye=ln=>{if(typeof ln[0]=="number"){const[Ct,_r]=ln;M=Math.min(M,Ct),H=Math.min(H,_r),X=Math.max(X,Ct),_e=Math.max(_e,_r);return}ln.forEach(Ct=>Ye(Ct))};return p.features.forEach(ln=>{const Ct=ln?.geometry?.coordinates;Ct&&Ye(Ct)}),M===1/0||H===1/0?null:[M,H,X,_e]}return(p,M)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(ft.value),style:e.normalizeStyle(me.value?void 0:ye.value)},[e.createElementVNode("div",{ref_key:"mapContainer",ref:k,class:e.normalizeClass(Et.value)},null,2),e.createVNode(Xa,{items:Ft.value},null,8,["items"]),q("search")?(e.openBlock(),e.createBlock(hc,{key:0})):e.createCommentVNode("",!0),q("home")||q("fullscreen")?(e.openBlock(),e.createElementBlock("div",bc,[q("home")?(e.openBlock(),e.createElementBlock("div",kc,[e.createVNode(ss,{center:A.value,zoom:R.value},null,8,["center","zoom"]),t.geom?(e.openBlock(),e.createBlock(ss,{key:0,"target-center":Ze.value,"target-zoom":R.value,"target-label":"Об'єкт","target-aria-label":"Перейти до об'єкта"},null,8,["target-center","target-zoom"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),q("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:Ro,"aria-label":me.value?"Вихід з повноекранного режиму":"Увімкнути повноекранний режим"},[...M[0]||(M[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,Ec)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("div",wc,[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:He},[...M[1]||(M[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])]),e.createElementVNode("div",xc,e.toDisplayString(Be.value.title||"Об'єкт"),1),Be.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(${ye.value.height}-120px)]`]),innerHTML:Be.value.html},null,10,Nc)):(e.openBlock(),e.createElementBlock("div",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value.rows,H=>(e.openBlock(),e.createElementBlock("div",{key:H.label,class:"flex justify-between text-[0.85rem] text-slate-700"},[e.createElementVNode("span",Sc,e.toDisplayString(H.label)+":",1),e.createElementVNode("span",_c,e.toDisplayString(H.value),1)]))),128))])),Be.value.actions?.length?(e.openBlock(),e.createElementBlock("div",Bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value.actions,H=>(e.openBlock(),e.createElementBlock("a",{key:H.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:H.url,target:H.target??void 0,rel:"noreferrer"},e.toDisplayString(H.label),9,$c))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(Za),q("position")&&fe.value?(e.openBlock(),e.createBlock(ec,{key:3,class:"absolute bottom-[10px] right-[10px] z-[500]",coordinates:fe.value},null,8,["coordinates"])):e.createCommentVNode("",!0)],6))}});function We(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const Lc=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kn=()=>{},vn=()=>!1,Gn=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),rt=Object.assign,Xe=Array.isArray,be=t=>typeof t=="string",Zn=t=>typeof t=="symbol",Ac=t=>t!==null&&typeof t=="object",rs=We(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Dc=We("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)))},Ic=/-\w/g,it=Jn(t=>t.replace(Ic,n=>n.slice(1).toUpperCase())),Yn=Jn(t=>t.charAt(0).toUpperCase()+t.slice(1)),Oc=Jn(t=>t?`on${Yn(t)}`:""),Ut={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"},Mc={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},Rc=/;(?![^(]*\))/g,Fc=/:([^]+)/,Pc=/\/\*[^]*?\*\//g;function zc(t){const n={};return t.replace(Pc,"").split(Rc).forEach(o=>{if(o){const s=o.split(Fc);s.length>1&&(n[s[0].trim()]=s[1].trim())}}),n}const jc="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",Hc="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",Uc="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",qc="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Wc=We(jc),Kc=We(Hc),Gc=We(Uc),Zc=We(qc);const qt=Symbol(process.env.NODE_ENV!=="production"?"Fragment":""),Wt=Symbol(process.env.NODE_ENV!=="production"?"Teleport":""),Xn=Symbol(process.env.NODE_ENV!=="production"?"Suspense":""),bn=Symbol(process.env.NODE_ENV!=="production"?"KeepAlive":""),is=Symbol(process.env.NODE_ENV!=="production"?"BaseTransition":""),mt=Symbol(process.env.NODE_ENV!=="production"?"openBlock":""),ls=Symbol(process.env.NODE_ENV!=="production"?"createBlock":""),as=Symbol(process.env.NODE_ENV!=="production"?"createElementBlock":""),Qn=Symbol(process.env.NODE_ENV!=="production"?"createVNode":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"createElementVNode":""),Kt=Symbol(process.env.NODE_ENV!=="production"?"createCommentVNode":""),eo=Symbol(process.env.NODE_ENV!=="production"?"createTextVNode":""),cs=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":""),ds=Symbol(process.env.NODE_ENV!=="production"?"renderSlot":""),fs=Symbol(process.env.NODE_ENV!=="production"?"createSlots":""),kn=Symbol(process.env.NODE_ENV!=="production"?"toDisplayString":""),En=Symbol(process.env.NODE_ENV!=="production"?"mergeProps":""),lo=Symbol(process.env.NODE_ENV!=="production"?"normalizeClass":""),ao=Symbol(process.env.NODE_ENV!=="production"?"normalizeStyle":""),Gt=Symbol(process.env.NODE_ENV!=="production"?"normalizeProps":""),Zt=Symbol(process.env.NODE_ENV!=="production"?"guardReactiveProps":""),co=Symbol(process.env.NODE_ENV!=="production"?"toHandlers":""),fo=Symbol(process.env.NODE_ENV!=="production"?"camelize":""),Jc=Symbol(process.env.NODE_ENV!=="production"?"capitalize":""),po=Symbol(process.env.NODE_ENV!=="production"?"toHandlerKey":""),wn=Symbol(process.env.NODE_ENV!=="production"?"setBlockTracking":""),Yc=Symbol(process.env.NODE_ENV!=="production"?"pushScopeId":""),Xc=Symbol(process.env.NODE_ENV!=="production"?"popScopeId":""),uo=Symbol(process.env.NODE_ENV!=="production"?"withCtx":""),Qc=Symbol(process.env.NODE_ENV!=="production"?"unref":""),Vc=Symbol(process.env.NODE_ENV!=="production"?"isRef":""),mo=Symbol(process.env.NODE_ENV!=="production"?"withMemo":""),ps=Symbol(process.env.NODE_ENV!=="production"?"isMemoSame":""),Lt={[qt]:"Fragment",[Wt]:"Teleport",[Xn]:"Suspense",[bn]:"KeepAlive",[is]:"BaseTransition",[mt]:"openBlock",[ls]:"createBlock",[as]:"createElementBlock",[Qn]:"createVNode",[Vn]:"createElementVNode",[Kt]:"createCommentVNode",[eo]:"createTextVNode",[cs]:"createStaticVNode",[to]:"resolveComponent",[no]:"resolveDynamicComponent",[oo]:"resolveDirective",[so]:"resolveFilter",[ro]:"withDirectives",[io]:"renderList",[ds]:"renderSlot",[fs]:"createSlots",[kn]:"toDisplayString",[En]:"mergeProps",[lo]:"normalizeClass",[ao]:"normalizeStyle",[Gt]:"normalizeProps",[Zt]:"guardReactiveProps",[co]:"toHandlers",[fo]:"camelize",[Jc]:"capitalize",[po]:"toHandlerKey",[wn]:"setBlockTracking",[Yc]:"pushScopeId",[Xc]:"popScopeId",[uo]:"withCtx",[Qc]:"unref",[Vc]:"isRef",[mo]:"withMemo",[ps]:"isMemoSame"};function ed(t){Object.getOwnPropertySymbols(t).forEach(n=>{Lt[n]=t[n]})}const Ie={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function td(t,n=""){return{type:0,source:n,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:Ie}}function Jt(t,n,o,s,r,i,l,a=!1,c=!1,d=!1,m=Ie){return t&&(a?(t.helper(mt),t.helper(It(t.inSSR,d))):t.helper(Dt(t.inSSR,d)),l&&t.helper(ro)),{type:13,tag:n,props:o,children:s,patchFlag:r,dynamicProps:i,directives:l,isBlock:a,disableTracking:c,isComponent:d,loc:m}}function ht(t,n=Ie){return{type:17,loc:n,elements:t}}function Fe(t,n=Ie){return{type:15,loc:n,properties:t}}function ue(t,n){return{type:16,loc:Ie,key:be(t)?Q(t,!0):t,value:n}}function Q(t,n=!1,o=Ie,s=0){return{type:4,loc:o,content:t,isStatic:n,constType:n?3:s}}function ze(t,n=Ie){return{type:8,loc:n,children:t}}function ge(t,n=[],o=Ie){return{type:14,loc:o,callee:t,arguments:n}}function At(t,n=void 0,o=!1,s=!1,r=Ie){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:Ie}}function nd(t,n,o=!1,s=!1){return{type:20,index:t,value:n,needPauseTracking:o,inVOnce:s,needArraySpread:!1,loc:Ie}}function od(t){return{type:21,body:t,loc:Ie}}function Dt(t,n){return t||n?Qn:Vn}function It(t,n){return t||n?ls:as}function go(t,{helper:n,removeHelper:o,inSSR:s}){t.isBlock||(t.isBlock=!0,o(Dt(s,t.isComponent)),n(mt),n(It(s,t.isComponent)))}const us=new Uint8Array([123,123]),ms=new Uint8Array([125,125]);function hs(t){return t>=97&&t<=122||t>=65&&t<=90}function Oe(t){return t===32||t===10||t===9||t===12||t===13}function lt(t){return t===47||t===62||Oe(t)}function xn(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 sd{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=us,this.delimiterClose=ms,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=us,this.delimiterClose=ms}getPos(n){let o=1,s=n+1;const r=this.newlines.length;let i=-1;if(r>100){let l=-1,a=r;for(;l+1<a;){const c=l+a>>>1;this.newlines[c]<n?l=c:a=c}i=l}else for(let l=r-1;l>=0;l--)if(n>this.newlines[l]){i=l;break}return i>=0&&(o=i+2,s=n-this.newlines[i]),{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?lt(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||Oe(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):hs(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){lt(n)&&this.handleTagName(n)}stateInSFCRootTagName(n){if(lt(n)){const o=this.buffer.slice(this.sectionStart,this.index);o!=="template"&&this.enterRCDATA(xn("</"+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){Oe(n)||(n===62?(process.env.NODE_ENV!=="production"&&this.cbs.onerr(14,this.index),this.state=1,this.sectionStart=this.index+1):(this.state=hs(n)?9:27,this.sectionStart=this.index))}stateInClosingTagName(n){(n===62||Oe(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):Oe(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):Oe(n)||(this.state=11,this.stateBeforeAttrName(n))}stateInAttrName(n){n===61||lt(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||lt(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||lt(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||lt(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||lt(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)):Oe(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):Oe(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){Oe(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 rd={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 at(t,n){const o=yo("MODE",n),s=yo(t,n);return o===3?s===!0:s!==!1}function Ot(t,n,o,...s){const r=at(t,n);return process.env.NODE_ENV!=="production"&&r&&Nn(t,n,o,...s),r}function Nn(t,n,o,...s){if(yo(t,n)==="suppress-warning")return;const{message:i,link:l}=rd[t],a=`(deprecation ${t}) ${typeof i=="function"?i(...s):i}${l?`
2
+ Details: ${l}`:""}`,c=new SyntaxError(a);c.code=t,o&&(c.loc=o),n.onWarn(c)}function vo(t){throw t}function gs(t){process.env.NODE_ENV!=="production"&&console.warn(`[Vue warn] ${t.message}`)}function se(t,n,o,s){const r=process.env.NODE_ENV!=="production"?(o||id)[t]+(s||""):`https://vuejs.org/error-reference/#compiler-${t}`,i=new SyntaxError(String(r));return i.code=t,i.loc=n,i}const id={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
+ 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 ys(t){switch(t){case"Teleport":case"teleport":return Wt;case"Suspense":case"suspense":return Xn;case"KeepAlive":case"keep-alive":return bn;case"BaseTransition":case"base-transition":return is}}const ld=/^$|^\d|[^\$\w\xA0-\uFFFF]/,bo=t=>!ld.test(t),vs=/[A-Za-z_$\xA0-\uFFFF]/,ad=/[\.\?\w$\xA0-\uFFFF]/,cd=/\s+[.[]\s*|\s*[.[]\s+/g,bs=t=>t.type===4?t.content:t.loc.source,ks=t=>{const n=bs(t).trim().replace(cd,a=>a.trim());let o=0,s=[],r=0,i=0,l=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,i++;else if(!(a===0?vs:ad).test(c))return!1;break;case 1:c==="'"||c==='"'||c==="`"?(s.push(o),o=3,l=c):c==="["?r++:c==="]"&&(--r||(o=s.pop()));break;case 2:if(c==="'"||c==='"'||c==="`")s.push(o),o=3,l=c;else if(c==="(")i++;else if(c===")"){if(a===n.length-1)return!1;--i||(o=s.pop())}break;case 3:c===l&&(o=s.pop(),l=null);break}}return!r&&!i},dd=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,fd=t=>dd.test(bs(t));function Es(t,n){if(!t)throw new Error(n||"unexpected compiler condition")}function Te(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)&&(be(n)?r.name===n:n.test(r.name)))return r}}function Yt(t,n,o=!1,s=!1){for(let r=0;r<t.props.length;r++){const i=t.props[r];if(i.type===6){if(o)continue;if(i.name===n&&(i.value||s))return i}else if(i.name==="bind"&&(i.exp||s)&&ct(i.arg,n))return i}}function ct(t,n){return!!(t&&$e(t)&&t.content===n)}function pd(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 ws(t){return t.type===7&&t.name==="pre"}function ud(t){return t.type===7&&t.name==="slot"}function Cn(t){return t.type===1&&t.tagType===3}function Sn(t){return t.type===1&&t.tagType===2}const md=new Set([Gt,Zt]);function xs(t,n=[]){if(t&&!be(t)&&t.type===14){const o=t.callee;if(!be(o)&&md.has(o))return xs(t.arguments[0],n.concat(t))}return[t,n]}function _n(t,n,o){let s,r=t.type===13?t.props:t.arguments[2],i=[],l;if(r&&!be(r)&&r.type===14){const a=xs(r);r=a[0],i=a[1],l=i[i.length-1]}if(r==null||be(r))s=Fe([n]);else if(r.type===14){const a=r.arguments[0];!be(a)&&a.type===15?Ns(n,a)||a.properties.unshift(n):r.callee===co?s=ge(o.helper(En),[Fe([n]),r]):r.arguments.unshift(Fe([n])),!s&&(s=r)}else r.type===15?(Ns(n,r)||r.properties.unshift(n),s=r):(s=ge(o.helper(En),[Fe([n]),r]),l&&l.callee===Zt&&(l=i[i.length-2]));t.type===13?l?l.arguments[0]=s:t.props=s:l?l.arguments[0]=s:t.arguments[2]=s}function Ns(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 Xt(t,n){return`_${n}_${t.replace(/[^\w]/g,(o,s)=>o==="-"?"_":t.charCodeAt(s).toString())}`}function hd(t){return t.type===14&&t.callee===mo?t.arguments[1].returns:t}const gd=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function Cs(t){for(let n=0;n<t.length;n++)if(!Oe(t.charCodeAt(n)))return!1;return!0}function Eo(t){return t.type===2&&Cs(t.content)||t.type===12&&Eo(t.content)}function wo(t){return t.type===3||Eo(t)}const Ss={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:vn,isPreTag:vn,isIgnoreNewlineTag:vn,isCustomElement:vn,onError:vo,onWarn:gs,comments:process.env.NODE_ENV!=="production",prefixIdentifiers:!1};let ee=Ss,Qt=null,Qe="",Ce=null,V=null,Le="",Ve=-1,gt=-1,xo=0,dt=!1,No=null;const de=[],ce=new sd(de,{onerr:Ae,ontext(t,n){Bn(Ee(t,n),t,n)},ontextentity(t,n,o){Bn(t,n,o)},oninterpolation(t,n){if(dt)return Bn(Ee(t,n),t,n);let o=t+ce.delimiterOpen.length,s=n-ce.delimiterClose.length;for(;Oe(Qe.charCodeAt(o));)o++;for(;Oe(Qe.charCodeAt(s-1));)s--;let r=Ee(o,s);r.includes("&")&&(r=ee.decodeEntities(r,!1)),Co({type:5,content:Tn(r,!1,pe(o,s)),loc:pe(t,n)})},onopentagname(t,n){const o=Ee(t,n);Ce={type:1,tag:o,ns:ee.getNamespace(o,de[0],ee.ns),tagType:0,props:[],children:[],loc:pe(t-1,n),codegenNode:void 0}},onopentagend(t){Bs(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&&Ae(24,de[0].loc.start.offset);for(let l=0;l<=r;l++){const a=de.shift();$n(a,n,l<r)}break}s||Ae(23,$s(t,60))}},onselfclosingtag(t){const n=Ce.tag;Ce.isSelfClosing=!0,Bs(t),de[0]&&de[0].tag===n&&$n(de.shift(),t)},onattribname(t,n){V={type:6,name:Ee(t,n),nameLoc:pe(t,n),value:void 0,loc:pe(t)}},ondirname(t,n){const o=Ee(t,n),s=o==="."||o===":"?"bind":o==="@"?"on":o==="#"?"slot":o.slice(2);if(!dt&&s===""&&Ae(26,t),dt||s==="")V={type:6,name:o,nameLoc:pe(t,n),value:void 0,loc:pe(t)};else if(V={type:7,name:s,rawName:o,exp:void 0,arg:void 0,modifiers:o==="."?[Q("prop")]:[],loc:pe(t)},s==="pre"){dt=ce.inVPre=!0,No=Ce;const r=Ce.props;for(let i=0;i<r.length;i++)r[i].type===7&&(r[i]=Sd(r[i]))}},ondirarg(t,n){if(t===n)return;const o=Ee(t,n);if(dt&&!ws(V))V.name+=o,yt(V.nameLoc,n);else{const s=o[0]!=="[";V.arg=Tn(s?o:o.slice(1,-1),s,pe(t,n),s?3:0)}},ondirmodifier(t,n){const o=Ee(t,n);if(dt&&!ws(V))V.name+="."+o,yt(V.nameLoc,n);else if(V.name==="slot"){const s=V.arg;s&&(s.content+="."+o,yt(s.loc,n))}else{const s=Q(o,!0,pe(t,n));V.modifiers.push(s)}},onattribdata(t,n){Le+=Ee(t,n),Ve<0&&(Ve=t),gt=n},onattribentity(t,n,o){Le+=t,Ve<0&&(Ve=n),gt=o},onattribnameend(t){const n=V.loc.start.offset,o=Ee(n,t);V.type===7&&(V.rawName=o),Ce.props.some(s=>(s.type===7?s.rawName:s.name)===o)&&Ae(2,n)},onattribend(t,n){if(Ce&&V){if(yt(V.loc,n),t!==0)if(Le.includes("&")&&(Le=ee.decodeEntities(Le,!0)),V.type===6)V.name==="class"&&(Le=As(Le).trim()),t===1&&!Le&&Ae(13,n),V.value={type:2,content:Le,loc:t===1?pe(Ve,gt):pe(Ve-1,gt+1)},ce.inSFCRoot&&Ce.tag==="template"&&V.name==="lang"&&Le&&Le!=="html"&&ce.enterRCDATA(xn("</template"),0);else{let o=0;V.exp=Tn(Le,!1,pe(Ve,gt),0,o),V.name==="for"&&(V.forParseResult=vd(V.exp));let s=-1;V.name==="bind"&&(s=V.modifiers.findIndex(r=>r.content==="sync"))>-1&&Ot("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")&&Ce.props.push(V)}Le="",Ve=gt=-1},oncomment(t,n){ee.comments&&Co({type:3,content:Ee(t,n),loc:pe(t-4,n+3)})},onend(){const t=Qe.length;if(process.env.NODE_ENV!=="production"&&ce.state!==1)switch(ce.state){case 5:case 8:Ae(5,t);break;case 3:case 4:Ae(25,ce.sectionStart);break;case 28:ce.currentSequence===ke.CdataEnd?Ae(6,t):Ae(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:Ae(9,t);break}for(let n=0;n<de.length;n++)$n(de[n],t-1),Ae(24,de[n].loc.start.offset)},oncdata(t,n){de[0].ns!==0?Bn(Ee(t,n),t,n):Ae(1,t-9)},onprocessinginstruction(t){(de[0]?de[0].ns:ee.ns)===0&&Ae(21,t-1)}}),_s=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,yd=/^\(|\)$/g;function vd(t){const n=t.loc,o=t.content,s=o.match(gd);if(!s)return;const[,r,i]=s,l=(f,h,E=!1)=>{const b=n.start.offset+h,v=b+f.length;return Tn(f,!1,pe(b,v),0,E?1:0)},a={source:l(i.trim(),o.indexOf(i,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let c=r.trim().replace(yd,"").trim();const d=r.indexOf(c),m=c.match(_s);if(m){c=c.replace(_s,"").trim();const f=m[1].trim();let h;if(f&&(h=o.indexOf(f,d+c.length),a.key=l(f,h,!0)),m[2]){const E=m[2].trim();E&&(a.index=l(E,o.indexOf(E,a.key?h+f.length:d+c.length),!0))}}return c&&(a.value=l(c,d,!0)),a}function Ee(t,n){return Qe.slice(t,n)}function Bs(t){ce.inSFCRoot&&(Ce.innerLoc=pe(t+1,t+1)),Co(Ce);const{tag:n,ns:o}=Ce;o===0&&ee.isPreTag(n)&&xo++,ee.isVoidTag(n)?$n(Ce,t):(de.unshift(Ce),(o===1||o===2)&&(ce.inXML=!0)),Ce=null}function Bn(t,n,o){{const i=de[0]&&de[0].tag;i!=="script"&&i!=="style"&&t.includes("&")&&(t=ee.decodeEntities(t,!1))}const s=de[0]||Qt,r=s.children[s.children.length-1];r&&r.type===2?(r.content+=t,yt(r.loc,o)):s.children.push({type:2,content:t,loc:pe(n,o)})}function $n(t,n,o=!1){o?yt(t.loc,$s(n,60)):yt(t.loc,bd(n,62)+1),ce.inSFCRoot&&(t.children.length?t.innerLoc.end=rt({},t.children[t.children.length-1].loc.end):t.innerLoc.end=rt({},t.innerLoc.start),t.innerLoc.source=Ee(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:s,ns:r,children:i}=t;if(dt||(s==="slot"?t.tagType=2:Ts(t)?t.tagType=3:Ed(t)&&(t.tagType=1)),ce.inRCDATA||(t.children=Ls(i)),r===0&&ee.isIgnoreNewlineTag(s)){const l=i[0];l&&l.type===2&&(l.content=l.content.replace(/^\r?\n/,""))}r===0&&ee.isPreTag(s)&&xo--,No===t&&(dt=ce.inVPre=!1,No=null),ce.inXML&&(de[0]?de[0].ns:ee.ns)===0&&(ce.inXML=!1);{const l=t.props;if(process.env.NODE_ENV!=="production"&&at("COMPILER_V_IF_V_FOR_PRECEDENCE",ee)){let c=!1,d=!1;for(let m=0;m<l.length;m++){const f=l[m];if(f.type===7&&(f.name==="if"?c=!0:f.name==="for"&&(d=!0)),c&&d){Nn("COMPILER_V_IF_V_FOR_PRECEDENCE",ee,t.loc);break}}}if(!ce.inSFCRoot&&at("COMPILER_NATIVE_TEMPLATE",ee)&&t.tag==="template"&&!Ts(t)){process.env.NODE_ENV!=="production"&&Nn("COMPILER_NATIVE_TEMPLATE",ee,t.loc);const c=de[0]||Qt,d=c.children.indexOf(t);c.children.splice(d,1,...t.children)}const a=l.find(c=>c.type===6&&c.name==="inline-template");a&&Ot("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 bd(t,n){let o=t;for(;Qe.charCodeAt(o)!==n&&o<Qe.length-1;)o++;return o}function $s(t,n){let o=t;for(;Qe.charCodeAt(o)!==n&&o>=0;)o--;return o}const kd=new Set(["if","else","else-if","for","slot"]);function Ts({tag:t,props:n}){if(t==="template"){for(let o=0;o<n.length;o++)if(n[o].type===7&&kd.has(n[o].name))return!0}return!1}function Ed({tag:t,props:n}){if(ee.isCustomElement(t))return!1;if(t==="component"||wd(t.charCodeAt(0))||ys(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(Ot("COMPILER_IS_ON_ELEMENT",ee,s.loc))return!0}}else if(s.name==="bind"&&ct(s.arg,"is")&&Ot("COMPILER_IS_ON_ELEMENT",ee,s.loc))return!0}return!1}function wd(t){return t>64&&t<91}const xd=/\r\n/g;function Ls(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(xd,`
4
+ `);else if(Cs(r.content)){const i=t[s-1]&&t[s-1].type,l=t[s+1]&&t[s+1].type;!i||!l||n&&(i===3&&(l===3||l===1)||i===1&&(l===3||l===1&&Nd(r.content)))?(o=!0,t[s]=null):r.content=" "}else n&&(r.content=As(r.content))}return o?t.filter(Boolean):t}function Nd(t){for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o===10||o===13)return!0}return!1}function As(t){let n="",o=!1;for(let s=0;s<t.length;s++)Oe(t.charCodeAt(s))?o||(n+=" ",o=!0):(n+=t[s],o=!1);return n}function Co(t){(de[0]||Qt).children.push(t)}function pe(t,n){return{start:ce.getPos(t),end:n==null?n:ce.getPos(n),source:n==null?n:Ee(t,n)}}function Cd(t){return pe(t.start.offset,t.end.offset)}function yt(t,n){t.end=ce.getPos(n),t.source=Ee(t.start.offset,n)}function Sd(t){const n={type:6,name:t.rawName,nameLoc:pe(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 Tn(t,n=!1,o,s=0,r=0){return Q(t,n,o,s)}function Ae(t,n,o){ee.onError(se(t,pe(n,n),void 0,o))}function _d(){ce.reset(),Ce=null,V=null,Le="",Ve=-1,gt=-1,de.length=0}function Bd(t,n){if(_d(),Qe=t,ee=rt({},Ss),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.");ce.mode=ee.parseMode==="html"?1:ee.parseMode==="sfc"?2:0,ce.inXML=ee.ns===1||ee.ns===2;const o=n&&n.delimiters;o&&(ce.delimiterOpen=xn(o[0]),ce.delimiterClose=xn(o[1]));const s=Qt=td([],t);return ce.parse(Qe),s.loc=pe(0,t.length),s.children=Ls(s.children),Qt=null,s}function $d(t,n){Ln(t,void 0,n,!!Ds(t))}function Ds(t){const n=t.children.filter(o=>o.type!==3);return n.length===1&&n[0].type===1&&!Sn(n[0])?n[0]:null}function Ln(t,n,o,s=!1,r=!1){const{children:i}=t,l=[];for(let m=0;m<i.length;m++){const f=i[m];if(f.type===1&&f.tagType===0){const h=s?0:Me(f,o);if(h>0){if(h>=2){f.codegenNode.patchFlag=-1,l.push(f);continue}}else{const E=f.codegenNode;if(E.type===13){const b=E.patchFlag;if((b===void 0||b===512||b===1)&&Os(f,o)>=2){const v=Ms(f);v&&(E.props=o.hoist(v))}E.dynamicProps&&(E.dynamicProps=o.hoist(E.dynamicProps))}}}else if(f.type===12&&(s?0:Me(f,o))>=2){f.codegenNode.type===14&&f.codegenNode.arguments.length>0&&f.codegenNode.arguments.push(-1+(process.env.NODE_ENV!=="production"?` /* ${Ut[-1]} */`:"")),l.push(f);continue}if(f.type===1){const h=f.tagType===1;h&&o.scopes.vSlot++,Ln(f,t,o,!1,r),h&&o.scopes.vSlot--}else if(f.type===11)Ln(f,t,o,f.children.length===1,!0);else if(f.type===9)for(let h=0;h<f.branches.length;h++)Ln(f.branches[h],t,o,f.branches[h].children.length===1,r)}let a=!1;if(l.length===i.length&&t.type===1){if(t.tagType===0&&t.codegenNode&&t.codegenNode.type===13&&Xe(t.codegenNode.children))t.codegenNode.children=c(ht(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(ht(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=Te(t,"slot",!0),f=m&&m.arg&&d(n.codegenNode,m.arg);f&&(f.returns=c(ht(f.returns)),a=!0)}}if(!a)for(const m of l)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 h=m.children.properties.find(E=>E.key===f||E.key.content===f);return h&&h.value}}l.length&&o.transformHoist&&o.transformHoist(i,o,t)}function Me(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 l=3;const a=Os(t,n);if(a===0)return o.set(t,0),0;a<l&&(l=a);for(let c=0;c<t.children.length;c++){const d=Me(t.children[c],n);if(d===0)return o.set(t,0),0;d<l&&(l=d)}if(l>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=Me(d.exp,n);if(m===0)return o.set(t,0),0;m<l&&(l=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(mt),n.removeHelper(It(n.inSSR,r.isComponent)),r.isBlock=!1,n.helper(Dt(n.inSSR,r.isComponent))}return o.set(t,l),l}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 Me(t.content,n);case 4:return t.constType;case 8:let i=3;for(let l=0;l<t.children.length;l++){const a=t.children[l];if(be(a)||Zn(a))continue;const c=Me(a,n);if(c===0)return 0;c<i&&(i=c)}return i;case 20:return 2;default:return process.env.NODE_ENV,0}}const Td=new Set([lo,ao,Gt,Zt]);function Is(t,n){if(t.type===14&&!be(t.callee)&&Td.has(t.callee)){const o=t.arguments[0];if(o.type===4)return Me(o,n);if(o.type===14)return Is(o,n)}return 0}function Os(t,n){let o=3;const s=Ms(t);if(s&&s.type===15){const{properties:r}=s;for(let i=0;i<r.length;i++){const{key:l,value:a}=r[i],c=Me(l,n);if(c===0)return c;c<o&&(o=c);let d;if(a.type===4?d=Me(a,n):a.type===14?d=Is(a,n):d=0,d===0)return d;d<o&&(o=d)}}return o}function Ms(t){const n=t.codegenNode;if(n.type===13)return n.props}function Ld(t,{filename:n="",prefixIdentifiers:o=!1,hoistStatic:s=!1,hmr:r=!1,cacheHandlers:i=!1,nodeTransforms:l=[],directiveTransforms:a={},transformHoist:c=null,isBuiltInComponent:d=Kn,isCustomElement:m=Kn,expressionPlugins:f=[],scopeId:h=null,slotted:E=!0,ssr:b=!1,inSSR:v=!1,ssrCssVars:S="",bindingMetadata:k=Lc,inline:_=!1,isTS:C=!1,onError:w=vo,onWarn:x=gs,compatConfig:$}){const B=n.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),g={filename:n,selfName:B&&Yn(it(B[1])),prefixIdentifiers:o,hoistStatic:s,hmr:r,cacheHandlers:i,nodeTransforms:l,directiveTransforms:a,transformHoist:c,isBuiltInComponent:d,isCustomElement:m,expressionPlugins:f,scopeId:h,slotted:E,ssr:b,inSSR:v,ssrCssVars:S,bindingMetadata:k,inline:_,isTS:C,onError:w,onWarn:x,compatConfig:$,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(D){const P=g.helpers.get(D)||0;return g.helpers.set(D,P+1),D},removeHelper(D){const P=g.helpers.get(D);if(P){const z=P-1;z?g.helpers.set(D,z):g.helpers.delete(D)}},helperString(D){return`_${Lt[g.helper(D)]}`},replaceNode(D){if(process.env.NODE_ENV!=="production"){if(!g.currentNode)throw new Error("Node being replaced is already removed.");if(!g.parent)throw new Error("Cannot replace root node.")}g.parent.children[g.childIndex]=g.currentNode=D},removeNode(D){if(process.env.NODE_ENV!=="production"&&!g.parent)throw new Error("Cannot remove root node.");const P=g.parent.children,z=D?P.indexOf(D):g.currentNode?g.childIndex:-1;if(process.env.NODE_ENV!=="production"&&z<0)throw new Error("node being removed is not a child of current parent");!D||D===g.currentNode?(g.currentNode=null,g.onNodeRemoved()):g.childIndex>z&&(g.childIndex--,g.onNodeRemoved()),g.parent.children.splice(z,1)},onNodeRemoved:Kn,addIdentifiers(D){},removeIdentifiers(D){},hoist(D){be(D)&&(D=Q(D)),g.hoists.push(D);const P=Q(`_hoisted_${g.hoists.length}`,!1,D.loc,2);return P.hoisted=D,P},cache(D,P=!1,z=!1){const G=nd(g.cached.length,D,P,z);return g.cached.push(G),G}};return g.filters=new Set,g}function Ad(t,n){const o=Ld(t,n);An(t,o),n.hoistStatic&&$d(t,o),n.ssr||Dd(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 Dd(t,n){const{helper:o}=n,{children:s}=t;if(s.length===1){const r=Ds(t);if(r&&r.codegenNode){const i=r.codegenNode;i.type===13&&go(i,n),t.codegenNode=i}else t.codegenNode=s[0]}else if(s.length>1){let r=64;process.env.NODE_ENV!=="production"&&s.filter(i=>i.type!==3).length===1&&(r|=2048),t.codegenNode=Jt(n,o(qt),void 0,t.children,r,void 0,void 0,!0,void 0,!1)}}function Id(t,n){let o=0;const s=()=>{o--};for(;o<t.children.length;o++){const r=t.children[o];be(r)||(n.grandParent=n.parent,n.parent=t,n.childIndex=o,n.onNodeRemoved=s,An(r,n))}}function An(t,n){n.currentNode=t;const{nodeTransforms:o}=n,s=[];for(let i=0;i<o.length;i++){const l=o[i](t,n);if(l&&(Xe(l)?s.push(...l):s.push(l)),n.currentNode)t=n.currentNode;else return}switch(t.type){case 3:n.ssr||n.helper(Kt);break;case 5:n.ssr||n.helper(kn);break;case 9:for(let i=0;i<t.branches.length;i++)An(t.branches[i],n);break;case 10:case 11:case 1:case 0:Id(t,n);break}n.currentNode=t;let r=s.length;for(;r--;)s[r]()}function Rs(t,n){const o=be(t)?s=>s===t:s=>t.test(s);return(s,r)=>{if(s.type===1){const{props:i}=s;if(s.tagType===3&&i.some(ud))return;const l=[];for(let a=0;a<i.length;a++){const c=i[a];if(c.type===7&&o(c.name)){i.splice(a,1),a--;const d=n(s,c,r);d&&l.push(d)}}return l}}}const Dn="/*@__PURE__*/",Fs=t=>`${Lt[t]}: _${Lt[t]}`;function Od(t,{mode:n="function",prefixIdentifiers:o=n==="module",sourceMap:s=!1,filename:r="template.vue.html",scopeId:i=null,optimizeImports:l=!1,runtimeGlobalName:a="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:d="vue/server-renderer",ssr:m=!1,isTS:f=!1,inSSR:h=!1}){const E={mode:n,prefixIdentifiers:o,sourceMap:s,filename:r,scopeId:i,optimizeImports:l,runtimeGlobalName:a,runtimeModuleName:c,ssrRuntimeModuleName:d,ssr:m,isTS:f,inSSR:h,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(v){return`_${Lt[v]}`},push(v,S=-2,k){E.code+=v},indent(){b(++E.indentLevel)},deindent(v=!1){v?--E.indentLevel:b(--E.indentLevel)},newline(){b(E.indentLevel)}};function b(v){E.push(`
5
+ `+" ".repeat(v),0)}return E}function Md(t,n={}){const o=Od(t,n);n.onContextCreated&&n.onContextCreated(o);const{mode:s,push:r,prefixIdentifiers:i,indent:l,deindent:a,newline:c,scopeId:d,ssr:m}=o,f=Array.from(t.helpers),h=f.length>0,E=!i&&s!=="module";Rd(t,o);const v=m?"ssrRender":"render",k=(m?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(r(`function ${v}(${k}) {`),l(),E&&(r("with (_ctx) {"),l(),h&&(r(`const { ${f.map(Fs).join(", ")} } = _Vue
6
+ `,-1),c())),t.components.length&&(So(t.components,"component",o),(t.directives.length||t.temps>0)&&c()),t.directives.length&&(So(t.directives,"directive",o),t.temps>0&&c()),t.filters&&t.filters.length&&(c(),So(t.filters,"filter",o),c()),t.temps>0){r("let ");for(let _=0;_<t.temps;_++)r(`${_>0?", ":""}_temp${_}`)}return(t.components.length||t.directives.length||t.temps)&&(r(`
7
+ `,0),c()),m||r("return "),t.codegenNode?Se(t.codegenNode,o):r("null"),E&&(a(),r("}")),a(),r("}"),{ast:t,code:o.code,preamble:"",map:o.map?o.map.toJSON():void 0}}function Rd(t,n){const{ssr:o,prefixIdentifiers:s,push:r,newline:i,runtimeModuleName:l,runtimeGlobalName:a,ssrRuntimeModuleName:c}=n,d=a,m=Array.from(t.helpers);if(m.length>0&&(r(`const _Vue = ${d}
8
+ `,-1),t.hoists.length)){const f=[Qn,Vn,Kt,eo,cs].filter(h=>m.includes(h)).map(Fs).join(", ");r(`const { ${f} } = _Vue
9
+ `,-1)}Fd(t.hoists,n),i(),r("return ")}function So(t,n,{helper:o,push:s,newline:r,isTS:i}){const l=o(n==="filter"?so:n==="component"?to:oo);for(let a=0;a<t.length;a++){let c=t[a];const d=c.endsWith("__self");d&&(c=c.slice(0,-6)),s(`const ${Xt(c,n)} = ${l}(${JSON.stringify(c)}${d?", true":""})${i?"!":""}`),a<t.length-1&&r()}}function Fd(t,n){if(!t.length)return;n.pure=!0;const{push:o,newline:s}=n;s();for(let r=0;r<t.length;r++){const i=t[r];i&&(o(`const _hoisted_${r+1} = `),Se(i,n),s())}n.pure=!1}function Pd(t){return be(t)||t.type===4||t.type===2||t.type===5||t.type===8}function _o(t,n){const o=t.length>3||process.env.NODE_ENV!=="production"&&t.some(s=>Xe(s)||!Pd(s));n.push("["),o&&n.indent(),Vt(t,n,o),o&&n.deindent(),n.push("]")}function Vt(t,n,o=!1,s=!0){const{push:r,newline:i}=n;for(let l=0;l<t.length;l++){const a=t[l];be(a)?r(a,-3):Xe(a)?_o(a,n):Se(a,n),l<t.length-1&&(o?(s&&r(","),i()):s&&r(", "))}}function Se(t,n){if(be(t)){n.push(t,-3);return}if(Zn(t)){n.push(n.helper(t));return}switch(t.type){case 1:case 9:case 11:process.env.NODE_ENV!=="production"&&Es(t.codegenNode!=null,"Codegen node is missing for element/if/for node. Apply appropriate transforms first."),Se(t.codegenNode,n);break;case 2:zd(t,n);break;case 4:Ps(t,n);break;case 5:jd(t,n);break;case 12:Se(t.codegenNode,n);break;case 8:zs(t,n);break;case 3:Ud(t,n);break;case 13:qd(t,n);break;case 14:Kd(t,n);break;case 15:Gd(t,n);break;case 17:Zd(t,n);break;case 18:Jd(t,n);break;case 19:Yd(t,n);break;case 20:Xd(t,n);break;case 21:Vt(t.body,n,!0,!1);break;case 22:break;case 23:break;case 24:break;case 25:break;case 26:break;case 10:break;default:if(process.env.NODE_ENV!=="production")return Es(!1,`unhandled codegen node type: ${t.type}`),t}}function zd(t,n){n.push(JSON.stringify(t.content),-3,t)}function Ps(t,n){const{content:o,isStatic:s}=t;n.push(s?JSON.stringify(o):o,-3,t)}function jd(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Dn),o(`${s(kn)}(`),Se(t.content,n),o(")")}function zs(t,n){for(let o=0;o<t.children.length;o++){const s=t.children[o];be(s)?n.push(s,-3):Se(s,n)}}function Hd(t,n){const{push:o}=n;if(t.type===8)o("["),zs(t,n),o("]");else if(t.isStatic){const s=bo(t.content)?t.content:JSON.stringify(t.content);o(s,-2,t)}else o(`[${t.content}]`,-3,t)}function Ud(t,n){const{push:o,helper:s,pure:r}=n;r&&o(Dn),o(`${s(Kt)}(${JSON.stringify(t.content)})`,-3,t)}function qd(t,n){const{push:o,helper:s,pure:r}=n,{tag:i,props:l,children:a,patchFlag:c,dynamicProps:d,directives:m,isBlock:f,disableTracking:h,isComponent:E}=t;let b;if(c)if(process.env.NODE_ENV!=="production")if(c<0)b=c+` /* ${Ut[c]} */`;else{const S=Object.keys(Ut).map(Number).filter(k=>k>0&&c&k).map(k=>Ut[k]).join(", ");b=c+` /* ${S} */`}else b=String(c);m&&o(s(ro)+"("),f&&o(`(${s(mt)}(${h?"true":""}), `),r&&o(Dn);const v=f?It(n.inSSR,E):Dt(n.inSSR,E);o(s(v)+"(",-2,t),Vt(Wd([i,l,a,b,d]),n),o(")"),f&&o(")"),m&&(o(", "),Se(m,n),o(")"))}function Wd(t){let n=t.length;for(;n--&&t[n]==null;);return t.slice(0,n+1).map(o=>o||"null")}function Kd(t,n){const{push:o,helper:s,pure:r}=n,i=be(t.callee)?t.callee:s(t.callee);r&&o(Dn),o(i+"(",-2,t),Vt(t.arguments,n),o(")")}function Gd(t,n){const{push:o,indent:s,deindent:r,newline:i}=n,{properties:l}=t;if(!l.length){o("{}",-2,t);return}const a=l.length>1||process.env.NODE_ENV!=="production"&&l.some(c=>c.value.type!==4);o(a?"{":"{ "),a&&s();for(let c=0;c<l.length;c++){const{key:d,value:m}=l[c];Hd(d,n),o(": "),Se(m,n),c<l.length-1&&(o(","),i())}a&&r(),o(a?"}":" }")}function Zd(t,n){_o(t.elements,n)}function Jd(t,n){const{push:o,indent:s,deindent:r}=n,{params:i,returns:l,body:a,newline:c,isSlot:d}=t;d&&o(`_${Lt[uo]}(`),o("(",-2,t),Xe(i)?Vt(i,n):i&&Se(i,n),o(") => "),(c||a)&&(o("{"),s()),l?(c&&o("return "),Xe(l)?_o(l,n):Se(l,n)):a&&Se(a,n),(c||a)&&(r(),o("}")),d&&(t.isNonScopedSlot&&o(", undefined, true"),o(")"))}function Yd(t,n){const{test:o,consequent:s,alternate:r,newline:i}=t,{push:l,indent:a,deindent:c,newline:d}=n;if(o.type===4){const f=!bo(o.content);f&&l("("),Ps(o,n),f&&l(")")}else l("("),Se(o,n),l(")");i&&a(),n.indentLevel++,i||l(" "),l("? "),Se(s,n),n.indentLevel--,i&&d(),i||l(" "),l(": ");const m=r.type===19;m||n.indentLevel++,Se(r,n),m||n.indentLevel--,i&&c(!0)}function Xd(t,n){const{push:o,helper:s,indent:r,deindent:i,newline:l}=n,{needPauseTracking:a,needArraySpread:c}=t;c&&o("[...("),o(`_cache[${t.index}] || (`),a&&(r(),o(`${s(wn)}(-1`),t.inVOnce&&o(", true"),o("),"),l(),o("(")),o(`_cache[${t.index}] = `),Se(t.value,n),a&&(o(`).cacheIndex = ${t.index},`),l(),o(`${s(wn)}(1),`),l(),o(`_cache[${t.index}]`),i()),o(")"),c&&o(")]")}const Qd=new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b"),Vd=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function vt(t,n,o=!1,s=!1){const r=t.content;if(r.trim())try{new Function(s?` ${r} `:`return ${o?`(${r}) => {}`:`(${r})`}`)}catch(i){let l=i.message;const a=r.replace(Vd,"").match(Qd);a&&(l=`avoid using JavaScript keyword as property name: "${a[0]}"`),n.onError(se(46,t.loc,void 0,l))}}const ef=(t,n)=>{if(t.type===5)t.content=Bo(t.content,n);else if(t.type===1){const o=Te(t,"memo");for(let s=0;s<t.props.length;s++){const r=t.props[s];if(r.type===7&&r.name!=="for"){const i=r.exp,l=r.arg;i&&i.type===4&&!(r.name==="on"&&l)&&!(o&&l&&l.type===4&&l.content==="key")&&(r.exp=Bo(i,n,r.name==="slot")),l&&l.type===4&&!l.isStatic&&(r.arg=Bo(l,n))}}}};function Bo(t,n,o=!1,s=!1,r=Object.create(n.identifiers)){return process.env.NODE_ENV!=="production"&&vt(t,n,o,s),t}const tf=Rs(/^(?:if|else|else-if)$/,(t,n,o)=>nf(t,n,o,(s,r,i)=>{const l=o.parent.children;let a=l.indexOf(s),c=0;for(;a-->=0;){const d=l[a];d&&d.type===9&&(c+=d.branches.length)}return()=>{if(i)s.codegenNode=Hs(r,c,o);else{const d=sf(s.codegenNode);d.alternate=Hs(r,c+s.branches.length-1,o)}}}));function nf(t,n,o,s){if(n.name!=="else"&&(!n.exp||!n.exp.content.trim())){const r=n.exp?n.exp.loc:t.loc;o.onError(se(28,n.loc)),n.exp=Q("true",!1,r)}if(process.env.NODE_ENV!=="production"&&n.exp&&vt(n.exp,o),n.name==="if"){const r=js(t,n),i={type:9,loc:Cd(t.loc),branches:[r]};if(o.replaceNode(i),s)return s(i,r,!0)}else{const r=o.parent.children,i=[];let l=r.indexOf(t);for(;l-->=-1;){const a=r[l];if(a&&wo(a)){o.removeNode(a),process.env.NODE_ENV!=="production"&&a.type===3&&i.unshift(a);continue}if(a&&a.type===9){(n.name==="else-if"||n.name==="else")&&a.branches[a.branches.length-1].condition===void 0&&o.onError(se(30,t.loc)),o.removeNode();const c=js(t,n);if(process.env.NODE_ENV!=="production"&&i.length&&!(o.parent&&o.parent.type===1&&(o.parent.tag==="transition"||o.parent.tag==="Transition"))&&(c.children=[...i,...c.children]),process.env.NODE_ENV!=="production"){const m=c.userKey;m&&a.branches.forEach(({userKey:f})=>{of(f,m)&&o.onError(se(29,c.userKey.loc))})}a.branches.push(c);const d=s&&s(a,c,!1);An(c,o),d&&d(),o.currentNode=null}else o.onError(se(30,t.loc));break}}}function js(t,n){const o=t.tagType===3;return{type:10,loc:t.loc,condition:n.name==="else"?void 0:n.exp,children:o&&!Te(t,"for")?t.children:[t],userKey:Yt(t,"key"),isTemplateIf:o}}function Hs(t,n,o){return t.condition?ho(t.condition,Us(t,n,o),ge(o.helper(Kt),[process.env.NODE_ENV!=="production"?'"v-if"':'""',"true"])):Us(t,n,o)}function Us(t,n,o){const{helper:s}=o,r=ue("key",Q(`${n}`,!1,Ie,2)),{children:i}=t,l=i[0];if(i.length!==1||l.type!==1)if(i.length===1&&l.type===11){const c=l.codegenNode;return _n(c,r,o),c}else{let c=64;return process.env.NODE_ENV!=="production"&&!t.isTemplateIf&&i.filter(d=>d.type!==3).length===1&&(c|=2048),Jt(o,s(qt),Fe([r]),i,c,void 0,void 0,!0,!1,!1,t.loc)}else{const c=l.codegenNode,d=hd(c);return d.type===13&&go(d,o),_n(d,r,o),c}}function of(t,n){if(!t||t.type!==n.type)return!1;if(t.type===6){if(t.value.content!==n.value.content)return!1}else{const o=t.exp,s=n.exp;if(o.type!==s.type||o.type!==4||o.isStatic!==s.isStatic||o.content!==s.content)return!1}return!0}function sf(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const rf=Rs("for",(t,n,o)=>{const{helper:s,removeHelper:r}=o;return lf(t,n,o,i=>{const l=ge(s(io),[i.source]),a=Cn(t),c=Te(t,"memo"),d=Yt(t,"key",!1,!0);d&&d.type;let m=d&&(d.type===6?d.value?Q(d.value.content,!0):void 0:d.exp);const f=d&&m?ue("key",m):null,h=i.source.type===4&&i.source.constType>0,E=h?64:d?128:256;return i.codegenNode=Jt(o,s(qt),void 0,l,E,void 0,void 0,!0,!h,!1,t.loc),()=>{let b;const{children:v}=i;process.env.NODE_ENV!=="production"&&a&&t.children.some(_=>{if(_.type===1){const C=Yt(_,"key");if(C)return o.onError(se(33,C.loc)),!0}});const S=v.length!==1||v[0].type!==1,k=Sn(t)?t:a&&t.children.length===1&&Sn(t.children[0])?t.children[0]:null;if(k?(b=k.codegenNode,a&&f&&_n(b,f,o)):S?b=Jt(o,s(qt),f?Fe([f]):void 0,t.children,64,void 0,void 0,!0,void 0,!1):(b=v[0].codegenNode,a&&f&&_n(b,f,o),b.isBlock!==!h&&(b.isBlock?(r(mt),r(It(o.inSSR,b.isComponent))):r(Dt(o.inSSR,b.isComponent))),b.isBlock=!h,b.isBlock?(s(mt),s(It(o.inSSR,b.isComponent))):s(Dt(o.inSSR,b.isComponent))),c){const _=At($o(i.parseResult,[Q("_cached")]));_.body=od([ze(["const _memo = (",c.exp,")"]),ze(["if (_cached",...m?[" && _cached.key === ",m]:[],` && ${o.helperString(ps)}(_cached, _memo)) return _cached`]),ze(["const _item = ",b]),Q("_item.memo = _memo"),Q("return _item")]),l.arguments.push(_,Q("_cache"),Q(String(o.cached.length))),o.cached.push(null)}else l.arguments.push(At($o(i.parseResult),b,!0))}})});function lf(t,n,o,s){if(!n.exp){o.onError(se(31,n.loc));return}const r=n.forParseResult;if(!r){o.onError(se(32,n.loc));return}qs(r,o);const{addIdentifiers:i,removeIdentifiers:l,scopes:a}=o,{source:c,value:d,key:m,index:f}=r,h={type:11,loc:n.loc,source:c,valueAlias:d,keyAlias:m,objectIndexAlias:f,parseResult:r,children:Cn(t)?t.children:[t]};o.replaceNode(h),a.vFor++;const E=s&&s(h);return()=>{a.vFor--,E&&E()}}function qs(t,n){t.finalized||(process.env.NODE_ENV!=="production"&&(vt(t.source,n),t.key&&vt(t.key,n,!0),t.index&&vt(t.index,n,!0),t.value&&vt(t.value,n,!0)),t.finalized=!0)}function $o({value:t,key:n,index:o},s=[]){return af([t,n,o,...s])}function af(t){let n=t.length;for(;n--&&!t[n];);return t.slice(0,n+1).map((o,s)=>o||Q("_".repeat(s+1),!1))}const Ws=Q("undefined",!1),cf=(t,n)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const o=Te(t,"slot");if(o)return o.exp,n.scopes.vSlot++,()=>{n.scopes.vSlot--}}},df=(t,n,o,s)=>At(t,o,!1,!0,o.length?o[0].loc:s);function ff(t,n,o=df){n.helper(uo);const{children:s,loc:r}=t,i=[],l=[];let a=n.scopes.vSlot>0||n.scopes.vFor>0;const c=Te(t,"slot",!0);if(c){const{arg:S,exp:k}=c;S&&!$e(S)&&(a=!0),i.push(ue(S||Q("default",!0),o(k,void 0,s,r)))}let d=!1,m=!1;const f=[],h=new Set;let E=0;for(let S=0;S<s.length;S++){const k=s[S];let _;if(!Cn(k)||!(_=Te(k,"slot",!0))){k.type!==3&&f.push(k);continue}if(c){n.onError(se(37,_.loc));break}d=!0;const{children:C,loc:w}=k,{arg:x=Q("default",!0),exp:$,loc:B}=_;let g;$e(x)?g=x?x.content:"default":a=!0;const D=Te(k,"for"),P=o($,D,C,w);let z,G;if(z=Te(k,"if"))a=!0,l.push(ho(z.exp,In(x,P,E++),Ws));else if(G=Te(k,/^else(?:-if)?$/,!0)){let Z=S,I;for(;Z--&&(I=s[Z],!!wo(I)););if(I&&Cn(I)&&Te(I,/^(?:else-)?if$/)){let F=l[l.length-1];for(;F.alternate.type===19;)F=F.alternate;F.alternate=G.exp?ho(G.exp,In(x,P,E++),Ws):In(x,P,E++)}else n.onError(se(30,G.loc))}else if(D){a=!0;const Z=D.forParseResult;Z?(qs(Z,n),l.push(ge(n.helper(io),[Z.source,At($o(Z),In(x,P),!0)]))):n.onError(se(32,D.loc))}else{if(g){if(h.has(g)){n.onError(se(38,B));continue}h.add(g),g==="default"&&(m=!0)}i.push(ue(x,P))}}if(!c){const S=(k,_)=>{const C=o(k,void 0,_,r);return n.compatConfig&&(C.isNonScopedSlot=!0),ue("default",C)};d?f.length&&!f.every(Eo)&&(m?n.onError(se(39,f[0].loc)):i.push(S(void 0,f))):i.push(S(void 0,s))}const b=a?2:On(t.children)?3:1;let v=Fe(i.concat(ue("_",Q(b+(process.env.NODE_ENV!=="production"?` /* ${Mc[b]} */`:""),!1))),r);return l.length&&(v=ge(n.helper(fs),[v,ht(l)])),{slots:v,hasDynamicSlots:a}}function In(t,n,o){const s=[ue("name",t),ue("fn",n)];return o!=null&&s.push(ue("key",Q(String(o),!0))),Fe(s)}function On(t){for(let n=0;n<t.length;n++){const o=t[n];switch(o.type){case 1:if(o.tagType===2||On(o.children))return!0;break;case 9:if(On(o.branches))return!0;break;case 10:case 11:if(On(o.children))return!0;break}}return!1}const Ks=new WeakMap,pf=(t,n)=>function(){if(t=n.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:s,props:r}=t,i=t.tagType===1;let l=i?uf(t,n):`"${s}"`;const a=Ac(l)&&l.callee===no;let c,d,m=0,f,h,E,b=a||l===Wt||l===Xn||!i&&(s==="svg"||s==="foreignObject"||s==="math");if(r.length>0){const v=Gs(t,n,void 0,i,a);c=v.props,m=v.patchFlag,h=v.dynamicPropNames;const S=v.directives;E=S&&S.length?ht(S.map(k=>hf(k,n))):void 0,v.shouldUseBlock&&(b=!0)}if(t.children.length>0)if(l===bn&&(b=!0,m|=1024,process.env.NODE_ENV!=="production"&&t.children.length>1&&n.onError(se(47,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}))),i&&l!==Wt&&l!==bn){const{slots:S,hasDynamicSlots:k}=ff(t,n);d=S,k&&(m|=1024)}else if(t.children.length===1&&l!==Wt){const S=t.children[0],k=S.type,_=k===5||k===8;_&&Me(S,n)===0&&(m|=1),_||k===2?d=S:d=t.children}else d=t.children;h&&h.length&&(f=gf(h)),t.codegenNode=Jt(n,l,c,d,m===0?void 0:m,f,E,!!b,!1,i,t.loc)};function uf(t,n,o=!1){let{tag:s}=t;const r=To(s),i=Yt(t,"is",!1,!0);if(i)if(r||at("COMPILER_IS_ON_ELEMENT",n)){let a;if(i.type===6?a=i.value&&Q(i.value.content,!0):(a=i.exp,a||(a=Q("is",!1,i.arg.loc))),a)return ge(n.helper(no),[a])}else i.type===6&&i.value.content.startsWith("vue:")&&(s=i.value.content.slice(4));const l=ys(s)||n.isBuiltInComponent(s);return l?(o||n.helper(l),l):(n.helper(to),n.components.add(s),Xt(s,"component"))}function Gs(t,n,o=t.props,s,r,i=!1){const{tag:l,loc:a,children:c}=t;let d=[];const m=[],f=[],h=c.length>0;let E=!1,b=0,v=!1,S=!1,k=!1,_=!1,C=!1,w=!1;const x=[],$=P=>{d.length&&(m.push(Fe(Zs(d),a)),d=[]),P&&m.push(P)},B=()=>{n.scopes.vFor>0&&d.push(ue(Q("ref_for",!0),Q("true")))},g=({key:P,value:z})=>{if($e(P)){const G=P.content,Z=Gn(G);if(Z&&(!s||r)&&G.toLowerCase()!=="onclick"&&G!=="onUpdate:modelValue"&&!rs(G)&&(_=!0),Z&&rs(G)&&(w=!0),Z&&z.type===14&&(z=z.arguments[0]),z.type===20||(z.type===4||z.type===8)&&Me(z,n)>0)return;G==="ref"?v=!0:G==="class"?S=!0:G==="style"?k=!0:G!=="key"&&!x.includes(G)&&x.push(G),s&&(G==="class"||G==="style")&&!x.includes(G)&&x.push(G)}else C=!0};for(let P=0;P<o.length;P++){const z=o[P];if(z.type===6){const{loc:G,name:Z,nameLoc:I,value:F}=z;let N=!0;if(Z==="ref"&&(v=!0,B()),Z==="is"&&(To(l)||F&&F.content.startsWith("vue:")||at("COMPILER_IS_ON_ELEMENT",n)))continue;d.push(ue(Q(Z,!0,I),Q(F?F.content:"",N,F?F.loc:G)))}else{const{name:G,arg:Z,exp:I,loc:F,modifiers:N}=z,j=G==="bind",te=G==="on";if(G==="slot"){s||n.onError(se(40,F));continue}if(G==="once"||G==="memo"||G==="is"||j&&ct(Z,"is")&&(To(l)||at("COMPILER_IS_ON_ELEMENT",n))||te&&i)continue;if((j&&ct(Z,"key")||te&&h&&ct(Z,"vue:before-update"))&&(E=!0),j&&ct(Z,"ref")&&B(),!Z&&(j||te)){if(C=!0,I)if(j){if($(),process.env.NODE_ENV!=="production"&&m.some(me=>me.type===15?me.properties.some(({key:we})=>we.type!==4||!we.isStatic?!0:we.content!=="class"&&we.content!=="style"&&!Gn(we.content)):!0)&&Ot("COMPILER_V_BIND_OBJECT_ORDER",n,F),at("COMPILER_V_BIND_OBJECT_ORDER",n)){m.unshift(I);continue}B(),$(),m.push(I)}else $({type:14,loc:F,callee:n.helper(co),arguments:s?[I]:[I,"true"]});else n.onError(se(j?34:35,F));continue}j&&N.some(ye=>ye.content==="prop")&&(b|=32);const Re=n.directiveTransforms[G];if(Re){const{props:ye,needRuntime:me}=Re(z,t,n);!i&&ye.forEach(g),te&&Z&&!$e(Z)?$(Fe(ye,a)):d.push(...ye),me&&(f.push(z),Zn(me)&&Ks.set(z,me))}else Dc(G)||(f.push(z),h&&(E=!0))}}let D;if(m.length?($(),m.length>1?D=ge(n.helper(En),m,a):D=m[0]):d.length&&(D=Fe(Zs(d),a)),C?b|=16:(S&&!s&&(b|=2),k&&!s&&(b|=4),x.length&&(b|=8),_&&(b|=32)),!E&&(b===0||b===32)&&(v||w||f.length>0)&&(b|=512),!n.inSSR&&D)switch(D.type){case 15:let P=-1,z=-1,G=!1;for(let F=0;F<D.properties.length;F++){const N=D.properties[F].key;$e(N)?N.content==="class"?P=F:N.content==="style"&&(z=F):N.isHandlerKey||(G=!0)}const Z=D.properties[P],I=D.properties[z];G?D=ge(n.helper(Gt),[D]):(Z&&!$e(Z.value)&&(Z.value=ge(n.helper(lo),[Z.value])),I&&(k||I.value.type===4&&I.value.content.trim()[0]==="["||I.value.type===17)&&(I.value=ge(n.helper(ao),[I.value])));break;case 14:break;default:D=ge(n.helper(Gt),[ge(n.helper(Zt),[D])]);break}return{props:D,directives:f,patchFlag:b,dynamicPropNames:x,shouldUseBlock:E}}function Zs(t){const n=new Map,o=[];for(let s=0;s<t.length;s++){const r=t[s];if(r.key.type===8||!r.key.isStatic){o.push(r);continue}const i=r.key.content,l=n.get(i);l?(i==="style"||i==="class"||Gn(i))&&mf(l,r):(n.set(i,r),o.push(r))}return o}function mf(t,n){t.value.type===17?t.value.elements.push(n.value):t.value=ht([t.value,n.value],t.loc)}function hf(t,n){const o=[],s=Ks.get(t);s?o.push(n.helperString(s)):(n.helper(oo),n.directives.add(t.name),o.push(Xt(t.name,"directive")));const{loc:r}=t;if(t.exp&&o.push(t.exp),t.arg&&(t.exp||o.push("void 0"),o.push(t.arg)),Object.keys(t.modifiers).length){t.arg||(t.exp||o.push("void 0"),o.push("void 0"));const i=Q("true",!1,r);o.push(Fe(t.modifiers.map(l=>ue(l,i)),r))}return ht(o,t.loc)}function gf(t){let n="[";for(let o=0,s=t.length;o<s;o++)n+=JSON.stringify(t[o]),o<s-1&&(n+=", ");return n+"]"}function To(t){return t==="component"||t==="Component"}const yf=(t,n)=>{if(Sn(t)){const{children:o,loc:s}=t,{slotName:r,slotProps:i}=vf(t,n),l=[n.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;i&&(l[2]=i,a=3),o.length&&(l[3]=At([],o,!1,!1,s),a=4),n.scopeId&&!n.slotted&&(a=5),l.splice(a),t.codegenNode=ge(n.helper(ds),l,s)}};function vf(t,n){let o='"default"',s;const r=[];for(let i=0;i<t.props.length;i++){const l=t.props[i];if(l.type===6)l.value&&(l.name==="name"?o=JSON.stringify(l.value.content):(l.name=it(l.name),r.push(l)));else if(l.name==="bind"&&ct(l.arg,"name")){if(l.exp)o=l.exp;else if(l.arg&&l.arg.type===4){const a=it(l.arg.content);o=l.exp=Q(a,!1,l.arg.loc)}}else l.name==="bind"&&l.arg&&$e(l.arg)&&(l.arg.content=it(l.arg.content)),r.push(l)}if(r.length>0){const{props:i,directives:l}=Gs(t,n,r,!1,!1);s=i,l.length&&n.onError(se(36,l[0].loc))}return{slotName:o,slotProps:s}}const Js=(t,n,o,s)=>{const{loc:r,modifiers:i,arg:l}=t;!t.exp&&!i.length&&o.onError(se(35,r));let a;if(l.type===4)if(l.isStatic){let f=l.content;process.env.NODE_ENV!=="production"&&f.startsWith("vnode")&&o.onError(se(52,l.loc)),f.startsWith("vue:")&&(f=`vnode-${f.slice(4)}`);const h=n.tagType!==0||f.startsWith("vnode")||!/[A-Z]/.test(f)?Oc(it(f)):`on:${f}`;a=Q(h,!0,l.loc)}else a=ze([`${o.helperString(po)}(`,l,")"]);else a=l,a.children.unshift(`${o.helperString(po)}(`),a.children.push(")");let c=t.exp;c&&!c.content.trim()&&(c=void 0);let d=o.cacheHandlers&&!c&&!o.inVOnce;if(c){const f=ks(c),h=!(f||fd(c)),E=c.content.includes(";");process.env.NODE_ENV!=="production"&&vt(c,o,!1,E),(h||d&&f)&&(c=ze([`${h?"$event":"(...args)"} => ${E?"{":"("}`,c,E?"}":")"]))}let m={props:[ue(a,c||Q("() => {}",!1,r))]};return s&&(m=s(m)),d&&(m.props[0].value=o.cache(m.props[0].value)),m.props.forEach(f=>f.key.isHandlerKey=!0),m},bf=(t,n,o)=>{const{modifiers:s,loc:r}=t,i=t.arg;let{exp:l}=t;return l&&l.type===4&&!l.content.trim()&&(l=void 0),i.type!==4?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=i.content?`${i.content} || ""`:'""'),s.some(a=>a.content==="camel")&&(i.type===4?i.isStatic?i.content=it(i.content):i.content=`${o.helperString(fo)}(${i.content})`:(i.children.unshift(`${o.helperString(fo)}(`),i.children.push(")"))),o.inSSR||(s.some(a=>a.content==="prop")&&Ys(i,"."),s.some(a=>a.content==="attr")&&Ys(i,"^")),{props:[ue(i,l)]}},Ys=(t,n)=>{t.type===4?t.isStatic?t.content=n+t.content:t.content=`\`${n}\${${t.content}}\``:(t.children.unshift(`'${n}' + (`),t.children.push(")"))},kf=(t,n)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const o=t.children;let s,r=!1;for(let i=0;i<o.length;i++){const l=o[i];if(ko(l)){r=!0;for(let a=i+1;a<o.length;a++){const c=o[a];if(ko(c))s||(s=o[i]=ze([l],l.loc)),s.children.push(" + ",c),o.splice(a,1),a--;else{s=void 0;break}}}}if(!(!r||o.length===1&&(t.type===0||t.type===1&&t.tagType===0&&!t.props.find(i=>i.type===7&&!n.directiveTransforms[i.name])&&t.tag!=="template")))for(let i=0;i<o.length;i++){const l=o[i];if(ko(l)||l.type===8){const a=[];(l.type!==2||l.content!==" ")&&a.push(l),!n.ssr&&Me(l,n)===0&&a.push(1+(process.env.NODE_ENV!=="production"?` /* ${Ut[1]} */`:"")),o[i]={type:12,content:l,loc:l.loc,codegenNode:ge(n.helper(eo),a)}}}}},Xs=new WeakSet,Ef=(t,n)=>{if(t.type===1&&Te(t,"once",!0))return Xs.has(t)||n.inVOnce||n.inSSR?void 0:(Xs.add(t),n.inVOnce=!0,n.helper(wn),()=>{n.inVOnce=!1;const o=n.currentNode;o.codegenNode&&(o.codegenNode=n.cache(o.codegenNode,!0,!0))})},Qs=(t,n,o)=>{const{exp:s,arg:r}=t;if(!s)return o.onError(se(41,t.loc)),en();const i=s.loc.source.trim(),l=s.type===4?s.content:i,a=o.bindingMetadata[i];if(a==="props"||a==="props-aliased")return o.onError(se(44,s.loc)),en();if(a==="literal-const"||a==="setup-const")return o.onError(se(45,s.loc)),en();if(!l.trim()||!ks(s))return o.onError(se(42,s.loc)),en();const c=r||Q("modelValue",!0),d=r?$e(r)?`onUpdate:${it(r.content)}`:ze(['"onUpdate:" + ',r]):"onUpdate:modelValue";let m;const f=o.isTS?"($event: any)":"$event";m=ze([`${f} => ((`,s,") = $event)"]);const h=[ue(c,t.exp),ue(d,m)];if(t.modifiers.length&&n.tagType===1){const E=t.modifiers.map(v=>v.content).map(v=>(bo(v)?v:JSON.stringify(v))+": true").join(", "),b=r?$e(r)?`${r.content}Modifiers`:ze([r,' + "Modifiers"']):"modelModifiers";h.push(ue(b,Q(`{ ${E} }`,!1,t.loc,2)))}return en(h)};function en(t=[]){return{props:t}}const wf=/[\w).+\-_$\]]/,xf=(t,n)=>{at("COMPILER_FILTERS",n)&&(t.type===5?Mn(t.content,n):t.type===1&&t.props.forEach(o=>{o.type===7&&o.name!=="for"&&o.exp&&Mn(o.exp,n)}))};function Mn(t,n){if(t.type===4)Vs(t,n);else for(let o=0;o<t.children.length;o++){const s=t.children[o];typeof s=="object"&&(s.type===4?Vs(s,n):s.type===8?Mn(t,n):s.type===5&&Mn(s.content,n))}}function Vs(t,n){const o=t.content;let s=!1,r=!1,i=!1,l=!1,a=0,c=0,d=0,m=0,f,h,E,b,v=[];for(E=0;E<o.length;E++)if(h=f,f=o.charCodeAt(E),s)f===39&&h!==92&&(s=!1);else if(r)f===34&&h!==92&&(r=!1);else if(i)f===96&&h!==92&&(i=!1);else if(l)f===47&&h!==92&&(l=!1);else if(f===124&&o.charCodeAt(E+1)!==124&&o.charCodeAt(E-1)!==124&&!a&&!c&&!d)b===void 0?(m=E+1,b=o.slice(0,E).trim()):S();else{switch(f){case 34:r=!0;break;case 39:s=!0;break;case 96:i=!0;break;case 40:d++;break;case 41:d--;break;case 91:c++;break;case 93:c--;break;case 123:a++;break;case 125:a--;break}if(f===47){let k=E-1,_;for(;k>=0&&(_=o.charAt(k),_===" ");k--);(!_||!wf.test(_))&&(l=!0)}}b===void 0?b=o.slice(0,E).trim():m!==0&&S();function S(){v.push(o.slice(m,E).trim()),m=E+1}if(v.length){for(process.env.NODE_ENV!=="production"&&Nn("COMPILER_FILTERS",n,t.loc),E=0;E<v.length;E++)b=Nf(b,v[E],n);t.content=b,t.ast=void 0}}function Nf(t,n,o){o.helper(so);const s=n.indexOf("(");if(s<0)return o.filters.add(n),`${Xt(n,"filter")}(${t})`;{const r=n.slice(0,s),i=n.slice(s+1);return o.filters.add(r),`${Xt(r,"filter")}(${t}${i!==")"?","+i:i}`}}const er=new WeakSet,Cf=(t,n)=>{if(t.type===1){const o=Te(t,"memo");return!o||er.has(t)||n.inSSR?void 0:(er.add(t),()=>{const s=t.codegenNode||n.currentNode.codegenNode;s&&s.type===13&&(t.tagType!==1&&go(s,n),t.codegenNode=ge(n.helper(mo),[o.exp,At(void 0,s),"_cache",String(n.cached.length)]),n.cached.push(null))})}},Sf=(t,n)=>{if(t.type===1){for(const o of t.props)if(o.type===7&&o.name==="bind"&&(!o.exp||o.exp.type===4&&!o.exp.content.trim())&&o.arg){const s=o.arg;if(s.type!==4||!s.isStatic)n.onError(se(53,s.loc)),o.exp=Q("",!0,s.loc);else{const r=it(s.content);(vs.test(r[0])||r[0]==="-")&&(o.exp=Q(r,!1,s.loc))}}}};function _f(t){return[[Sf,Ef,tf,Cf,rf,xf,...process.env.NODE_ENV!=="production"?[ef]:[],yf,pf,cf,kf],{on:Js,bind:bf,model:Qs}]}function Bf(t,n={}){const o=n.onError||vo,s=n.mode==="module";n.prefixIdentifiers===!0?o(se(48)):s&&o(se(49));const r=!1;n.cacheHandlers&&o(se(50)),n.scopeId&&!s&&o(se(51));const i=rt({},n,{prefixIdentifiers:r}),l=be(t)?Bd(t,i):t,[a,c]=_f();return Ad(l,rt({},i,{nodeTransforms:[...a,...n.nodeTransforms||[]],directiveTransforms:rt({},c,n.directiveTransforms||{})})),Md(l,i)}const $f=()=>({props:[]});const tr=Symbol(process.env.NODE_ENV!=="production"?"vModelRadio":""),nr=Symbol(process.env.NODE_ENV!=="production"?"vModelCheckbox":""),or=Symbol(process.env.NODE_ENV!=="production"?"vModelText":""),sr=Symbol(process.env.NODE_ENV!=="production"?"vModelSelect":""),Lo=Symbol(process.env.NODE_ENV!=="production"?"vModelDynamic":""),rr=Symbol(process.env.NODE_ENV!=="production"?"vOnModifiersGuard":""),ir=Symbol(process.env.NODE_ENV!=="production"?"vOnKeysGuard":""),lr=Symbol(process.env.NODE_ENV!=="production"?"vShow":""),Ao=Symbol(process.env.NODE_ENV!=="production"?"Transition":""),ar=Symbol(process.env.NODE_ENV!=="production"?"TransitionGroup":"");ed({[tr]:"vModelRadio",[nr]:"vModelCheckbox",[or]:"vModelText",[sr]:"vModelSelect",[Lo]:"vModelDynamic",[rr]:"withModifiers",[ir]:"withKeys",[lr]:"vShow",[Ao]:"Transition",[ar]:"TransitionGroup"});let Mt;function Tf(t,n=!1){return Mt||(Mt=document.createElement("div")),n?(Mt.innerHTML=`<div foo="${t.replace(/"/g,"&quot;")}">`,Mt.children[0].getAttribute("foo")):(Mt.innerHTML=t,Mt.textContent)}const Lf={parseMode:"html",isVoidTag:Zc,isNativeTag:t=>Wc(t)||Kc(t)||Gc(t),isPreTag:t=>t==="pre",isIgnoreNewlineTag:t=>t==="pre"||t==="textarea",decodeEntities:Tf,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return Ao;if(t==="TransitionGroup"||t==="transition-group")return ar},getNamespace(t,n,o){let s=n?n.ns:o;if(n&&s===2)if(n.tag==="annotation-xml"){if(t==="svg")return 1;n.props.some(r=>r.type===6&&r.name==="encoding"&&r.value!=null&&(r.value.content==="text/html"||r.value.content==="application/xhtml+xml"))&&(s=0)}else/^m(?:[ions]|text)$/.test(n.tag)&&t!=="mglyph"&&t!=="malignmark"&&(s=0);else n&&s===1&&(n.tag==="foreignObject"||n.tag==="desc"||n.tag==="title")&&(s=0);if(s===0){if(t==="svg")return 1;if(t==="math")return 2}return s}},Af=t=>{t.type===1&&t.props.forEach((n,o)=>{n.type===6&&n.name==="style"&&n.value&&(t.props[o]={type:7,name:"bind",arg:Q("style",!0,n.loc),exp:Df(n.value.content,n.loc),modifiers:[],loc:n.loc})})},Df=(t,n)=>{const o=zc(t);return Q(JSON.stringify(o),!1,n,3)};function je(t,n){return se(t,n,process.env.NODE_ENV!=="production"?If:void 0)}const If={54:"v-html is missing expression.",55:"v-html will override element children.",56:"v-text is missing expression.",57:"v-text will override element children.",58:"v-model can only be used on <input>, <textarea> and <select> elements.",59:"v-model argument is not supported on plain elements.",60:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",61:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",62:"v-show is missing expression.",63:"<Transition> expects exactly one child element or component.",64:"Tags with side effect (<script> and <style>) are ignored in client component templates."},Of=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(je(54,r)),n.children.length&&(o.onError(je(55,r)),n.children.length=0),{props:[ue(Q("innerHTML",!0,r),s||Q("",!0))]}},Mf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(je(56,r)),n.children.length&&(o.onError(je(57,r)),n.children.length=0),{props:[ue(Q("textContent",!0),s?Me(s,o)>0?s:ge(o.helperString(kn),[s],r):Q("",!0))]}},Rf=(t,n,o)=>{const s=Qs(t,n,o);if(!s.props.length||n.tagType===1)return s;t.arg&&o.onError(je(59,t.arg.loc));function r(){const a=Te(n,"bind");a&&ct(a.arg,"value")&&o.onError(je(61,a.loc))}const{tag:i}=n,l=o.isCustomElement(i);if(i==="input"||i==="textarea"||i==="select"||l){let a=or,c=!1;if(i==="input"||l){const d=Yt(n,"type");if(d){if(d.type===7)a=Lo;else if(d.value)switch(d.value.content){case"radio":a=tr;break;case"checkbox":a=nr;break;case"file":c=!0,o.onError(je(60,t.loc));break;default:process.env.NODE_ENV!=="production"&&r();break}}else pd(n)?a=Lo:process.env.NODE_ENV!=="production"&&r()}else i==="select"?a=sr:process.env.NODE_ENV!=="production"&&r();c||(s.needRuntime=o.helper(a))}else o.onError(je(58,t.loc));return s.props=s.props.filter(a=>!(a.key.type===4&&a.key.content==="modelValue")),s},Ff=We("passive,once,capture"),Pf=We("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),zf=We("left,right"),cr=We("onkeyup,onkeydown,onkeypress"),jf=(t,n,o,s)=>{const r=[],i=[],l=[];for(let a=0;a<n.length;a++){const c=n[a].content;c==="native"&&Ot("COMPILER_V_ON_NATIVE",o,s)||Ff(c)?l.push(c):zf(c)?$e(t)?cr(t.content.toLowerCase())?r.push(c):i.push(c):(r.push(c),i.push(c)):Pf(c)?i.push(c):r.push(c)}return{keyModifiers:r,nonKeyModifiers:i,eventOptionModifiers:l}},dr=(t,n)=>$e(t)&&t.content.toLowerCase()==="onclick"?Q(n,!0):t.type!==4?ze(["(",t,`) === "onClick" ? "${n}" : (`,t,")"]):t,Hf=(t,n,o)=>Js(t,n,o,s=>{const{modifiers:r}=t;if(!r.length)return s;let{key:i,value:l}=s.props[0];const{keyModifiers:a,nonKeyModifiers:c,eventOptionModifiers:d}=jf(i,r,o,t.loc);if(c.includes("right")&&(i=dr(i,"onContextmenu")),c.includes("middle")&&(i=dr(i,"onMouseup")),c.length&&(l=ge(o.helper(rr),[l,JSON.stringify(c)])),a.length&&(!$e(i)||cr(i.content.toLowerCase()))&&(l=ge(o.helper(ir),[l,JSON.stringify(a)])),d.length){const m=d.map(Yn).join("");i=$e(i)?Q(`${i.content}${m}`,!0):ze(["(",i,`) + "${m}"`])}return{props:[ue(i,l)]}}),Uf=(t,n,o)=>{const{exp:s,loc:r}=t;return s||o.onError(je(62,r)),{props:[],needRuntime:o.helper(lr)}},qf=(t,n)=>{if(t.type===1&&t.tagType===1&&n.isBuiltInComponent(t.tag)===Ao)return()=>{if(!t.children.length)return;fr(t)&&n.onError(je(63,{start:t.children[0].loc.start,end:t.children[t.children.length-1].loc.end,source:""}));const s=t.children[0];if(s.type===1)for(const r of s.props)r.type===7&&r.name==="show"&&t.props.push({type:6,name:"persisted",nameLoc:t.loc,value:void 0,loc:t.loc})}};function fr(t){const n=t.children=t.children.filter(s=>!wo(s)),o=n[0];return n.length!==1||o.type===11||o.type===9&&o.branches.some(fr)}const Wf=(t,n)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(process.env.NODE_ENV!=="production"&&n.onError(je(64,t.loc)),n.removeNode())};function Kf(t,n){return t==="template"?!0:t in pr?pr[t].has(n):n in ur?ur[n].has(t):!(t in mr&&mr[t].has(n)||n in hr&&hr[n].has(t))}const Rt=new Set(["h1","h2","h3","h4","h5","h6"]),bt=new Set([]),pr={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:bt,iframe:bt,option:bt,textarea:bt,style:bt,title:bt},ur={html:bt,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},mr={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},hr={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:Rt,h2:Rt,h3:Rt,h4:Rt,h5:Rt,h6:Rt},Gf=(t,n)=>{if(t.type===1&&t.tagType===0&&n.parent&&n.parent.type===1&&n.parent.tagType===0&&!Kf(n.parent.tag,t.tag)){const o=new SyntaxError(`<${t.tag}> cannot be child of <${n.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);o.loc=t.loc,n.onWarn(o)}},Zf=[Af,...process.env.NODE_ENV!=="production"?[qf,Gf]:[]],Jf={cloak:$f,html:Of,text:Mf,model:Rf,on:Hf,show:Uf};function Yf(t,n={}){return Bf(t,rt({},Lf,n,{nodeTransforms:[Wf,...Zf,...n.nodeTransforms||[]],directiveTransforms:rt({},Jf,n.directiveTransforms||{}),transformHoist:null}))}function Xf(t,n={}){const o=t.trim().startsWith("<")?t:`<span>${t}</span>`,{code:s}=Yf(o,{mode:"function"}),r=new Function("Vue",`${s}; return render;`)($r);return e.defineComponent({name:"DynamicFromString",props:n.props??{},emits:n.emits??[],setup(){return n.setup?.()??{}},render:r})}const Do={};function Qf(t){return Do[t]||(Do[t]=Xf(t,{props:{row:{type:Object,default:void 0},value:{type:null,default:void 0},data:{type:Object,default:void 0},column:{type:Object,default:void 0}}})),Do[t]}const Vf={class:"mt-4 flex flex-wrap items-center justify-between gap-3 text-sm text-gray-600"},ep={class:"flex items-center gap-2"},tp=["disabled"],np={class:"text-sm"},op=["disabled"],sp=e.defineComponent({__name:"TablePagination",props:{currentPage:{},totalPages:{},label:{}},setup(t){const n=t,o=e.computed(()=>n.currentPage<=1),s=e.computed(()=>n.currentPage>=n.totalPages);return(r,i)=>(e.openBlock(),e.createElementBlock("div",Vf,[e.createElementVNode("div",null,e.toDisplayString(t.label),1),e.createElementVNode("div",ep,[e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:o.value,onClick:i[0]||(i[0]=l=>r.$emit("previous"))}," Назад ",8,tp),e.createElementVNode("span",np,"Сторінка "+e.toDisplayString(t.currentPage)+" з "+e.toDisplayString(t.totalPages),1),e.createElementVNode("button",{class:"rounded-md border border-gray-300 px-3 py-1 text-sm transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:text-gray-400",disabled:s.value,onClick:i[1]||(i[1]=l=>r.$emit("next"))}," Далі ",8,op)])]))}}),rp={class:"relative inline-flex"},ip=["aria-label"],lp={class:"px-3 pb-2"},ap={class:"px-3 pb-3 max-h-64 overflow-y-auto"},cp=["onClick"],dp={class:"truncate"},fp={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},pp="inline-flex items-center justify-center size-8 rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",up=e.defineComponent({__name:"TableColumnSettings",props:{columns:{}},emits:["update:columns"],setup(t,{emit:n}){const o=t,s=n,r=e.useAttrs(),i=e.ref(!1),l=e.ref(""),a=e.ref([...o.columns]),c=e.ref(null),d=e.ref(null),m=e.ref(null),f=e.ref({top:0,left:0}),h=e.computed(()=>{if(!l.value)return a.value;const C=l.value.toLowerCase();return a.value.filter(w=>E(w).toLowerCase().includes(C))});e.watch(()=>o.columns,C=>{if(!C){a.value=[];return}const w=JSON.stringify(C),x=JSON.stringify(a.value);w!==x&&(a.value=[...C])},{deep:!0}),e.watch(a,C=>{s("update:columns",C)},{deep:!0});function E(C){return C.ua||C.label||C.name||"Колонка"}function b(C){const w=!C.hidden;w&&a.value.filter(x=>!x.hidden).length<=1||(C.hidden=w)}function v(){i.value=!i.value,i.value&&e.nextTick(()=>{m.value?.focus(),S()})}function S(){if(!c.value)return;const C=c.value.getBoundingClientRect();f.value={top:C.bottom+window.scrollY+6,left:C.left+window.scrollX-200}}function k(C){if(!i.value)return;const w=C.target;w&&(d.value?.contains(w)||c.value?.contains(w)||(i.value=!1))}function _(C){C.key==="Escape"&&(i.value=!1)}return e.onMounted(()=>{document.addEventListener("click",k,!0),document.addEventListener("keydown",_)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",k,!0),document.removeEventListener("keydown",_)}),(C,w)=>(e.openBlock(),e.createElementBlock("div",rp,[e.createElementVNode("button",{ref_key:"buttonRef",ref:c,type:"button",onClick:v,class:e.normalizeClass([pp,e.unref(r).class]),"aria-label":e.unref(r)["aria-label"]??"Налаштування колонок",title:"Налаштування колонок"},[...w[2]||(w[2]=[e.createStaticVNode('<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="icon icon-tabler icons-tabler-outline icon-tabler-columns" height="18" width="18" aria-hidden="true"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6h5.5"></path><path d="M4 10h5.5"></path><path d="M4 14h5.5"></path><path d="M4 18h5.5"></path><path d="M14.5 6h5.5"></path><path d="M14.5 10h5.5"></path><path d="M14.5 14h5.5"></path><path d="M14.5 18h5.5"></path></svg>',1)])],10,ip),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"modalRef",ref:d,class:"fixed z-50 w-64 bg-white rounded-xl shadow-lg border border-gray-200 dark:bg-neutral-900 dark:border-neutral-700",style:e.normalizeStyle({top:`${f.value.top}px`,left:`${f.value.left}px`})},[w[5]||(w[5]=e.createElementVNode("div",{class:"flex items-center justify-between h-12 px-4 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Налаштування колонок ",-1)),e.createElementVNode("div",lp,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,"onUpdate:modelValue":w[0]||(w[0]=x=>l.value=x),type:"text",class:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200",placeholder:"Пошук колонок"},null,512),[[e.vModelText,l.value]])]),e.createElementVNode("div",ap,[w[4]||(w[4]=e.createElementVNode("p",{class:"px-1 pb-2 text-xs text-gray-500 uppercase tracking-wide"},"Виберіть колонки",-1)),e.createElementVNode("ul",{class:"space-y-1",onClick:w[1]||(w[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x.name,class:"flex items-center justify-between rounded-lg px-3 py-2 text-sm text-gray-800 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-800 cursor-pointer",onClick:$=>b(x)},[e.createElementVNode("span",dp,e.toDisplayString(E(x)),1),e.createElementVNode("span",{class:e.normalizeClass(["flex items-center justify-center size-4 rounded border border-gray-300 text-white",x.hidden?"bg-white text-transparent":"bg-blue-600 border-blue-600"])},[x.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",fp,[...w[3]||(w[3]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])]))],2)],8,cp))),128))])])],4)):e.createCommentVNode("",!0)]))]))}}),mp=["data-action-key"],hp=["onClick"],gp={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},yp={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vp={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},bp={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},kp=e.defineComponent({__name:"RowActionsButton",props:{row:{},actions:{},isOpen:{type:Boolean},actionKey:{}},emits:["toggle"],setup(t,{emit:n}){const o=t,s=n,r=e.ref(null),i=e.computed(()=>!!o.actions?.length),l=e.ref({scrollX:0,scrollY:0,width:0,height:0}),a=e.ref(!1);function c(){s("toggle")}function d(b){b.handler?.(o.row)}const m=e.computed(()=>{if(!o.isOpen)return{};const b=r.value;if(!b)return{};const v=b.getBoundingClientRect(),S=8,k=160,w=(o.actions?.length??0)*36+S*2,x=l.value.height||(typeof window<"u"?window.innerHeight:0),$=l.value.width||(typeof window<"u"?window.innerWidth:0),B=l.value.scrollX||(typeof window<"u"?window.scrollX:0),g=l.value.scrollY||(typeof window<"u"?window.scrollY:0);let D=v.bottom+g+S,P=v.right+B-k;const z=B+$-k-S;return P>z&&(P=z),P<B+S&&(P=B+S),D+w>g+x-S&&(D=v.top+g-w-S),D<g+S&&(D=g+S),{top:`${D}px`,left:`${P}px`,width:"auto"}});function f(){typeof window>"u"||(l.value={scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})}function h(){typeof window>"u"||a.value||(a.value=!0,f(),window.addEventListener("scroll",f,{passive:!0}),window.addEventListener("resize",f))}function E(){typeof window>"u"||!a.value||(a.value=!1,window.removeEventListener("scroll",f),window.removeEventListener("resize",f))}return e.watch(()=>o.isOpen,b=>{b?h():E()},{immediate:!0}),e.onMounted(()=>{o.isOpen&&h()}),e.onBeforeUnmount(()=>{E()}),(b,v)=>i.value&&t.actionKey?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative inline-flex","data-action-key":t.actionKey,ref_key:"anchorRef",ref:r},[e.createElementVNode("button",{type:"button",class:"inline-flex size-7 items-center justify-center rounded-md border border-gray-200 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:e.withModifiers(c,["stop"])},[...v[1]||(v[1]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"1"}),e.createElementVNode("circle",{cx:"12",cy:"19",r:"1"})],-1)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-50 w-40 overflow-hidden rounded-lg border border-gray-200 bg-white py-1 shadow-lg",style:e.normalizeStyle(m.value),onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,S=>(e.openBlock(),e.createElementBlock("button",{key:S.type,type:"button",class:e.normalizeClass(["flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors",S.variant==="danger"?"text-red-600 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"]),onClick:k=>d(S)},[e.renderSlot(b.$slots,"icon",{action:S},()=>[S.type==="view"?(e.openBlock(),e.createElementBlock("svg",gp,[...v[2]||(v[2]=[e.createElementVNode("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):S.type==="edit"?(e.openBlock(),e.createElementBlock("svg",yp,[...v[3]||(v[3]=[e.createElementVNode("path",{d:"M18 2a2.828 2.828 0 1 1 4 4L7 21l-4 1 1-4Z"},null,-1)])])):S.type==="delete"?(e.openBlock(),e.createElementBlock("svg",vp,[...v[4]||(v[4]=[e.createElementVNode("path",{d:"M3 6h18"},null,-1),e.createElementVNode("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},null,-1),e.createElementVNode("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},null,-1),e.createElementVNode("line",{x1:"10",x2:"10",y1:"11",y2:"17"},null,-1),e.createElementVNode("line",{x1:"14",x2:"14",y1:"11",y2:"17"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",bp,[...v[5]||(v[5]=[e.createElementVNode("path",{d:"M12 8v8"},null,-1),e.createElementVNode("path",{d:"M8 12h8"},null,-1)])]))]),e.createTextVNode(" "+e.toDisplayString(S.label),1)],10,hp))),128))],4)):e.createCommentVNode("",!0)]))],8,mp)):e.createCommentVNode("",!0)}}),gr=typeof window<"u",yr=typeof document<"u";function Ep(t){if(!yr)throw new Error("Tooltip requires document to be defined");const n=document.createElement("div");return n.className="fixed z-[9999] p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none transition-opacity duration-150",n.style.opacity="0",n.style.visibility="hidden",n.style.maxWidth="240px",n.style.whiteSpace="normal",n.style.wordBreak="break-word",document.body.appendChild(n),n}function vr(t){if(!t)return null;if(typeof t=="string"){const o=t.trim();return o?{text:o,wrap:!0}:null}const n=typeof t.text=="string"&&t.text.trim()?t.text.trim():void 0;return n?{text:n,wrap:t.wrap!==!1}:null}function Io(t,n){if(!yr||!gr)return;const o=Ep(n.wrap),s={options:n,tooltipEl:o,show:r=>{if(!s.options.text||!gr)return;o.textContent=s.options.text;const l=(r.currentTarget??t).getBoundingClientRect(),a=o.getBoundingClientRect(),c=window.innerWidth-a.width-12,d=Math.max(12,Math.min(l.left,c));o.style.left=`${d}px`,o.style.top=`${l.bottom+4}px`,o.style.opacity="1",o.style.visibility="visible"},hide:()=>{o.style.opacity="0",o.style.visibility="hidden"}};t.addEventListener("mouseenter",s.show),t.addEventListener("mouseleave",s.hide),t.addEventListener("focus",s.show),t.addEventListener("blur",s.hide),t.__tooltipState__=s}function Oo(t){const n=t.__tooltipState__;n&&(t.removeEventListener("mouseenter",n.show),t.removeEventListener("mouseleave",n.hide),t.removeEventListener("focus",n.show),t.removeEventListener("blur",n.hide),n.tooltipEl.remove(),delete t.__tooltipState__)}const wp={mounted(t,n){const o=vr(n.value);o&&Io(t,o)},updated(t,n){const o=vr(n.value),s=t;if(!o){Oo(s);return}const r=s.__tooltipState__;if(!r){Io(s,o);return}if(r.options.wrap!==o.wrap){Oo(s),Io(s,o);return}r.options=o},unmounted(t){Oo(t)}},xp={class:"flex flex-col gap-4 mb-[15px]"},Np={class:"flex flex-wrap items-center gap-4"},Cp={class:"relative"},Sp={class:"ml-auto flex items-center gap-2"},_p={class:"overflow-x-auto"},Bp={class:"min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600"},$p={class:"text-left font-medium text-gray-700"},Tp={key:0,class:"py-2 pr-4 min-w-[80px] max-w-[120px] text-right"},Lp={class:"divide-y divide-gray-200"},Ap=["href"],Dp={key:2},Ip={key:3},Op={key:0,class:"py-2 pr-4 text-right"},Mp={key:0},Rp={key:0},Fp=["colspan"],br=e.defineComponent({__name:"TableWidget",props:{addButton:{type:Boolean,default:!0},actions:{},columns:{},name:{},label:{},component:{},path:{},slot:{},col:{},width:{},html:{},title:{},type:{},token:{},count:{},props:{},items:{}},setup(t){const n=e.getCurrentInstance(),o=e.ref([]),s=e.ref([]),r=wp,i=t,l=e.ref([]),a=e.ref(""),c=e.ref(""),d=e.ref(""),m=e.ref(1),f=e.ref(10),h=e.ref(0),E=e.ref(0),b=e.ref("id"),v=e.ref("");let S=null,k=0;const _=e.ref(null);async function C(){const y=m.value,O=++k,T=i.columns!==void 0,L=T?Array.isArray(i.columns)?i.columns:[]:void 0;T&&(s.value=G(L??[]));const J=i.actions!==void 0,le=J?Array.isArray(i.actions)?i.actions:[]:void 0;J&&(l.value=le??[]);const ne=new URLSearchParams,xe=d.value.trim();xe&&ne.set("search",xe),ne.set("page",String(y)),ne.set("limit",String(f.value));const nt=`/api/data/${i.token}${ne.toString()?`?${ne.toString()}`:""}`;let re;try{const Je=await fetch(nt);if(!Je.ok)throw new Error(`Request failed with status ${Je.status}`);re=await Je.json()}catch(Je){O===k&&(o.value=[],E.value=0,h.value=0),console.error("Failed to load table data",Je);return}if(O!==k)return;o.value=Array.isArray(re?.rows)?re.rows:[];const Ue=Array.isArray(re?.columns)?re.columns:[];s.value=G(L??Ue),l.value=le!==void 0?Array.isArray(le)?le:[]:Array.isArray(re?.actions)?re.actions:[],a.value=re?.form,c.value=re?.addToken,b.value=typeof re?.pk=="string"&&re.pk?re.pk:b.value,typeof re?.form=="string"&&re.form&&(v.value=re.form.replace(/\.form$/,".table")),q();const ve=Number(re?.total??re?.count??re?.totalCount),Ze=Number(re?.filtered??re?.filteredCount);h.value=Number.isFinite(ve)&&ve>0?ve:o.value.length,E.value=Number.isFinite(Ze)&&Ze>0?Ze:Math.max(o.value.length,h.value);const zt=Math.max(1,Math.ceil((E.value||o.value.length||1)/f.value));let qe=y;typeof re?.page=="number"&&re.page>0&&(qe=re.page),qe>zt&&(qe=zt),qe<1&&(qe=1);const Ro=qe!==y;if(m.value=qe,Ro&&E.value>0)return C()}const{$notify:w,$confirm:x,$form:$}=n?.appContext?.config?.globalProperties||{};function B(){if(Ne.emitter?.emit){Ne.emitter.emit("updateCard");return}if(typeof window<"u"&&typeof window.location?.reload=="function"){window.location.reload();return}C()}async function g(y){typeof $=="function"&&(await $({token:y.token}),B())}async function D(){typeof $=="function"&&(await $({token:c.value}),B())}function P(y){x({title:"Підтвердіть дію",type:"error",message:"Ви впевненні що бажаєте видалити даний рядок?",onConfirm:async()=>{const O=await fetch(`/api/table/${y.token}`,{method:"DELETE"});if(!O.ok){const{error:T}=await O.json();w({title:"Помилка",type:"warning",message:T});return}w({title:"Видаленно",message:"Успішно видалено"}),await C()}})}e.onMounted(async()=>{await C(),Ne.emitter?.on?.("updateCard",C)}),e.onBeforeUnmount(()=>{Ne.emitter?.off?.("updateCard",C)});function z(y){return typeof y?.format=="string"?y.format.toLowerCase():""}function G(y){const O=new Map;s.value.forEach(L=>{L?.name&&O.set(L.name,!!L.hidden)});const T=y.map(L=>{const J=O.has(L.name)?O.get(L.name):!!L.hidden;return{...L,hidden:J}});return T.length&&!T.some(L=>!L.hidden)&&(T[0].hidden=!1),T}const Z=e.computed(()=>{const y=s.value.filter(O=>!O.hidden);return y.length?y:s.value}),I=e.computed(()=>{const y=[],O=new Set;for(const T of l.value){if(typeof T=="string"){if(T==="edit"){const L="row:edit";O.has(L)||(y.push({key:L,type:"edit",label:"Редагувати",scope:"row",handler:fe}),O.add(L));continue}if(T==="delete"||T==="del"){const L="row:delete";O.has(L)||(y.push({key:L,type:"delete",label:"Видалити",scope:"row",handler:ie,variant:"danger"}),O.add(L));continue}if(T==="add"){const L="toolbar:add";O.has(L)||(y.push({key:L,type:"add",label:"Додати",scope:"toolbar"}),O.add(L))}continue}if(T&&typeof T=="object"){const L=String(T.name??T.type??"action"),J=String(T.label??T.title??L),le=T.scope==="toolbar"?"toolbar":"row",ne=`${le}:${L}`;if(O.has(ne))continue;O.add(ne),y.push({key:ne,type:L,label:J,scope:le,handler:le==="row"?xe=>De(T,xe):void 0,variant:T.variant==="danger"?"danger":"default",original:T})}}return y}),F=e.computed(()=>I.value.filter(y=>y.scope==="row"&&typeof y.handler=="function")),N=e.computed(()=>I.value.filter(y=>y.scope==="toolbar")),j=e.computed(()=>F.value.length>0),te=e.computed(()=>N.value.some(y=>y.type==="add")),Re=e.computed(()=>{const y=!!c.value;return i.addButton!==void 0?i.addButton&&y:te.value&&y}),ye=e.computed(()=>o.value),me=e.computed(()=>{const y=E.value||ye.value.length,O=Math.ceil(y/f.value);return O>0?O:1}),we=e.computed(()=>{const y=ye.value.length,O=E.value||y,T=h.value||O;return`Показано ${y} з ${O} (усього ${T})`});function ft(){m.value<me.value&&(m.value+=1,C())}function Et(){m.value>1&&(m.value-=1,C())}e.watch(s,y=>{y?.length&&(y.some(O=>!O.hidden)||(y[0].hidden=!1))},{deep:!0}),e.watch(()=>i.columns,y=>{if(y===void 0){C();return}const O=Array.isArray(y)?y:[];s.value=G(O)},{deep:!0}),e.watch(()=>i.actions,y=>{if(y===void 0){C();return}l.value=Array.isArray(y)?y:[]},{deep:!0});function Be(){S&&clearTimeout(S),q(),S=setTimeout(()=>{m.value=1,C()},300)}function He(y){const O=b.value||"id",T=y?.token??y?.[O]??y?.id;return T?String(T):""}function W(y){const O=Z.value[y],T=["py-2",...A(O)];y===0&&T.push("pl-4");const L=y===Z.value.length-1&&!j.value;return T.push(L?"pr-4":"pr-5"),T.join(" ")}function K(y,O){const T=["py-2",...A(O)];z(O)==="badge"&&T.push("center"),u(O)==="wrap"?T.push("whitespace-normal","break-words"):T.push("truncate"),y===0&&T.push("pl-4");const L=y===Z.value.length-1&&!j.value;return T.push(L?"pr-4":"pr-5"),T.join(" ")}function u(y){return(typeof y?.overflow=="string"?y.overflow.toLowerCase():"")==="wrap"?"wrap":"clip"}function A(y){const O=[],T=ne=>{if(ne==null||ne==="")return;const xe=Number(ne);return Number.isFinite(xe)&&xe>0?`${xe}px`:String(ne).replace(/\s+/g,"")},L=T(y?.width),J=T(y?.minWidth),le=T(y?.maxWidth);return L?(O.push(`min-w-[${L}]`,`max-w-[${L}]`),O):(O.push(`min-w-[${J??"100px"}]`),O.push(`max-w-[${le??"350px"}]`),O)}function R(y){if(!F.value.length)return!1;const O=b.value||"id";return!!(y?.token||y?.[O]||y?.id)}function U(y){return _.value===He(y)}function Y(y){const O=He(y);O&&(_.value=_.value===O?null:O)}function q(){_.value=null}function oe(y,O){const T=O?.tooltip;if(!T)return;const L=tt(y,O);let J,le=O?.tooltipWrap!==!1;if(typeof T=="string"){const ne=T.trim();if(!ne)return;const xe=ne.toLowerCase();if(["true","1","yes"].includes(xe))J=typeof L=="string"?L:String(L??"");else{if(["false","0","no"].includes(xe))return;J=ne}}else T===!0?J=L:typeof T=="object"&&(typeof T.text=="string"&&(J=T.text.trim()),typeof T.wrap=="boolean"&&(le=T.wrap!==!1));if(!J){if(L==null||L==="")return;J=String(L)}if(J.trim())return le?{text:J,wrap:!0}:J}function fe(y){q(),g(y)}function ie(y){q(),P(y)}async function De(y,O){q();const T=b.value||"id",L=y.isId?O?.[T]??O?.id:O?.token??O?.[T]??O?.id;if(!L){console.warn("Cannot execute action without identifier",y);return}if(y.form&&typeof y.api=="string"&&y.api&&typeof $=="function"){await et(y,O,L);return}if(y.form&&typeof $=="function"){const J=await on(y.form,L),le={form:y.form,token:J?.token??O?.token??L,schema:J?.schema,mode:J?.mode??"edit"};J?.data!==void 0&&(le.defaultValue=J.data);try{await $(le),B()}catch(ne){console.error("Failed to execute form action",ne)}return}if(typeof y.api=="string"&&y.api){const J=Ke(y.api,L);window.location.href=J;return}O?.token&&typeof $=="function"&&(await $({token:O.token}),B())}function Ke(y,O){return`${y.endsWith("/")?y:`${y}/`}${O}`}async function on(y,O){const T=`/api/form/${y}/${O}`;try{const L=await fetch(T);if(!L.ok)throw new Error(`Request failed with status ${L.status}`);return await L.json()}catch(L){console.error("Failed to load form config",L),w({title:"Помилка",type:"warning",message:"Не вдалося отримати дані форми."});return}}async function Pe(y){const O=`/api/template/form/${y}`;try{const T=await fetch(O);if(!T.ok)throw new Error(`Request failed with status ${T.status}`);return(await T.json())?.schema}catch(T){console.error("Failed to load form template",T);return}}function Ge(y){if(y!=null){if(y?.data!==void 0)return y.data;if(y?.defaultValue!==void 0)return y.defaultValue;if(y?.values!==void 0)return y.values;if(typeof y=="object"&&!Array.isArray(y)){const{schema:O,token:T,mode:L,message:J,successMessage:le,...ne}=y;if(Object.keys(ne).length)return ne}}}async function et(y,O,T){const L=Ke(y.api,T),J=(typeof y.method=="string"?y.method:"PUT").toUpperCase();let le;try{const ve=await fetch(L);if(!ve.ok)throw new Error(`Request failed with status ${ve.status}`);le=await ve.json()}catch(ve){console.error("Failed to load action data",ve),Ft("Не вдалося отримати дані форми.");return}const ne=typeof y.form=="string"?y.form.replace(/\.table$/,".form"):void 0,xe=le?.schema??(ne?await Pe(ne):void 0),nt={mode:le?.mode??"edit"};ne&&(nt.form=ne),xe&&(nt.schema=xe);const re=Ge(le);re!==void 0&&(nt.defaultValue=re);const Ue=await $(nt);if(Ue)try{const ve=await fetch(L,{method:J,headers:{"Content-Type":"application/json"},body:JSON.stringify(Ue)});if(!ve.ok){const Ze=await sn(ve),zt=Ze?.error??Ze?.message??"Не вдалося зберегти дані.";throw new Error(zt)}Pt(`Дані успішно ${nt.value==="add"?"збережено":"оновлено"}`),B()}catch(ve){console.error("Failed to submit action data",ve),Ft("Не вдалося зберегти дані.")}}async function sn(y){try{return await y.json()}catch{return}}function Ft(y){w({title:"Помилка",type:"error",message:y})}function Pt(y){w({title:"Успіх",type:"success",message:y})}function wt(y){if(!_.value)return;const O=y.target;if(!O)return;const T=O.closest("[data-action-key]");T&&T.getAttribute("data-action-key")===_.value||q()}e.onMounted(()=>{document.addEventListener("click",wt,!0)}),e.onBeforeUnmount(()=>{S&&clearTimeout(S),document.removeEventListener("click",wt,!0),Ne.emitter?.off?.("updateCard",C)});function xt(y,O){const L=y?.[`${O.name}_text`];if(Array.isArray(L))return L.length?L.join(", "):"-";if(L!=null&&L!=="")return L;const J=y?.[O.name];return Array.isArray(J)?J.length?J.join(", "):"-":J??"-"}function pt(y,O){const L=y?.[`${O.name}_data`];if(L&&typeof L=="object")return{text:L.text??L.label??L.name??L.title??"-",color:L.color,textColor:L.textColor};const J=y?.[`${O.name}_text`]??y?.[O.name];return{text:(Array.isArray(J)?J.join(", "):J)??"-"}}function Mo(y,O){const T=pt(y,O);return T.color?{backgroundColor:T.color,color:T.textColor??"#ffffff"}:{}}function tt(y,O){const T=z(O);if(T==="badge")return pt(y,O).text;if(T==="select")return xt(y,O);if(T==="slot")return"-";if(T==="text")return y?.[O.name]??"-";const L=y?.[`${O.name}_data`];return L!=null&&typeof L!="object"?L:y?.[`${O.name}_text`]??y?.[O.name]??"-"}return(y,O)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",xp,[e.createElementVNode("div",Np,[e.createElementVNode("div",Cp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":O[0]||(O[0]=T=>d.value=T),type:"text",class:"w-52 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",onInput:Be},null,544),[[e.vModelText,d.value]])]),e.createElementVNode("div",Sp,[e.createVNode(up,{columns:s.value,"onUpdate:columns":O[1]||(O[1]=T=>s.value=T)},null,8,["columns"]),Re.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:D,class:"inline-flex size-8 items-center justify-center rounded-lg bg-blue-500 text-white shadow-sm transition-colors hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",title:"Додати запис","aria-label":"Додати запис"},[...O[2]||(O[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)])])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",_p,[e.createElementVNode("table",Bp,[e.createElementVNode("thead",$p,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(T,L)=>(e.openBlock(),e.createElementBlock("th",{key:T.name,class:e.normalizeClass(W(L))},e.toDisplayString(T.ua),3))),128)),j.value?(e.openBlock(),e.createElementBlock("th",Tp," Дії ")):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",Lp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,T=>(e.openBlock(),e.createElementBlock("tr",{class:"bg-white odd:bg-gray-50",key:T.id??JSON.stringify(T)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(L,J)=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:L.name,class:e.normalizeClass(K(J,L))},[L.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:L.link.replace("{{id}}",T.id),class:"font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"},e.toDisplayString(tt(T,L)),9,Ap)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[z(L)==="slot"&&(L.slot?.content||L.slot)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Qf)(L.slot.content||L.slot)),{key:0,data:T,row:T,column:L,value:T?.[L.name]},null,8,["data","row","column","value"])):z(L)==="badge"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"items-center px-2 py-1 rounded-full text-xs font-semibold text-center justify-center flex",style:e.normalizeStyle(Mo(T,L))},e.toDisplayString(pt(T,L).text),5)):z(L)==="select"?(e.openBlock(),e.createElementBlock("span",Dp,e.toDisplayString(xt(T,L)),1)):(e.openBlock(),e.createElementBlock("span",Ip,e.toDisplayString(tt(T,L)),1))],64))],2)),[[e.unref(r),oe(T,L)]])),128)),j.value?(e.openBlock(),e.createElementBlock("td",Op,[R(T)?(e.openBlock(),e.createElementBlock("div",Mp,[e.createVNode(kp,{row:T,actions:F.value,"is-open":U(T),"action-key":He(T),onToggle:L=>Y(T)},null,8,["row","actions","is-open","action-key","onToggle"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128)),ye.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",Rp,[e.createElementVNode("td",{colspan:Z.value.length+(j.value?1:0),class:"py-6 text-center text-gray-500"}," Немає записів для відображення ",8,Fp)]))])])]),e.createVNode(sp,{"current-page":m.value,"total-pages":me.value,label:we.value,onPrevious:Et,onNext:ft},null,8,["current-page","total-pages","label"])]))}}),Pp={class:"p-[20px]"},zp={class:"flex gap-[6px] mb-5"},jp={class:"vs-form-text relative bg-white rounded-lg flex-grow"},Hp={class:"grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6"},Up={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},qp={class:"space-y-8"},Wp={key:0},Kp={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},Gp=["onClick"],Zp={class:"md:col-span-2"},Jp={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},Yp={class:"text-sm text-gray-500 dark:text-neutral-500"},Xp={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Qp=["checked","onChange"],Vp={class:"grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6"},eu={class:"md:col-span-2"},tu={class:"font-semibold text-gray-800 dark:text-neutral-200"},nu=["onClick"],ou={class:"md:col-span-2"},su={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},ru={class:"text-sm text-gray-500 dark:text-neutral-500"},iu={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},lu=["checked","onChange"],Rn="uk",Fn=e.defineComponent({__name:"GroupInterfaceWidget",props:{data:{},id:{}},setup(t){const n=["en","uk","ua"],o=()=>{if(typeof window>"u")return Rn;const $=localStorage.language,B=typeof navigator<"u"?navigator.language:Rn;return($||B||Rn).split(/[-_]/)[0].toLowerCase()||Rn},s=t,r=e.ref(""),i=["view","add","edit","del"],l=e.ref({}),a=e.ref(o()),c={view:"Перегляд",add:"Додавання",edit:"Редагування",del:"Видалення"},d=$=>c[$]??$,m=()=>{a.value=o()},f=()=>{const $=[];return a.value&&$.push(a.value),n.forEach(B=>{B&&!$.includes(B)&&$.push(B)}),$.includes("path")||$.push("path"),$},h=$=>{const B=f();for(const g of B){const D=$[g];if(typeof D=="string"&&D.trim())return D}return""};e.onMounted(async()=>{m();const B=await(await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`)).json();B.routes&&B.routes.forEach(g=>{l.value[g.path]=new Set(g.actions)})});const E=($,B)=>l.value[$]?.has(B)??!1,b=($,B)=>{l.value[$]||(l.value[$]=new Set),l.value[$].has(B)?l.value[$].delete(B):l.value[$].add(B)},v=($,B)=>{$.forEach(g=>{g.path&&(l.value[g.path]||(l.value[g.path]=new Set),l.value[g.path].has(B)?l.value[g.path].delete(B):l.value[g.path].add(B))})},S=e.computed(()=>Object.entries(l.value).map(([$,B])=>({path:$,actions:Array.from(B)})).filter($=>$.actions.length)),k=async()=>{await fetch(`/api/access-group/${s.id}?tab=vs-group-interface`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({routes:S.value})}),Ne.notify({title:"Success!",message:"Permissions saved."})},_=()=>{l.value={}},C=$=>{if(!r.value.trim())return $;const B=r.value.toLowerCase();return $.filter(g=>h(g).toLowerCase().includes(B)||(g.path?.toLowerCase().includes(B)??!1))},w=e.computed(()=>C(s.data.routers.filter($=>!$.menu))),x=e.computed(()=>s.data.routers.filter($=>$.menu).map($=>({...$,menu:C($.menu||[])})).filter($=>$.menu&&$.menu.length>0));return($,B)=>(e.openBlock(),e.createElementBlock("div",Pp,[e.createElementVNode("div",zp,[e.createElementVNode("div",jp,[B[1]||(B[1]=e.createElementVNode("i",{class:"absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti"},null,-1)),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:"Пошук","onUpdate:modelValue":B[0]||(B[0]=g=>r.value=g),class:"bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("button",{onClick:_,class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"}," Скинути всі "),e.createElementVNode("button",{onClick:k,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")]),e.createElementVNode("div",Hp,[B[2]||(B[2]=e.createElementVNode("div",{class:"self-center col-span-2"},[e.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(g,D)=>e.createElementVNode("div",{class:"col-span-1 text-center",key:D},[e.createElementVNode("h3",Up,e.toDisplayString(d(g)),1)])),64))]),e.createElementVNode("div",qp,[w.value.length?(e.openBlock(),e.createElementBlock("div",Wp,[e.createElementVNode("ul",Kp,[B[3]||(B[3]=e.createElementVNode("li",{class:"md:col-span-2"},[e.createElementVNode("h3",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Без категорії")],-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(g,D)=>e.createElementVNode("li",{key:D,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:P=>v(w.value,i[D])}," Перемкнути всі ",8,Gp)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(g,D)=>(e.openBlock(),e.createElementBlock("ul",{key:"uncat-"+D,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",Zp,[e.createElementVNode("p",Jp,e.toDisplayString(h(g)),1),e.createElementVNode("p",Yp,e.toDisplayString(g.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(P,z)=>e.createElementVNode("li",{key:z,class:"col-span-1"},[e.createElementVNode("div",Xp,[e.createElementVNode("input",{type:"checkbox",checked:E(g.path,P),onChange:G=>b(g.path,P),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,Qp)])])),64))]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(g,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:"space-y-5"},[e.createElementVNode("ul",Vp,[e.createElementVNode("li",eu,[e.createElementVNode("h3",tu,e.toDisplayString(h(g)),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(P,z)=>e.createElementVNode("li",{key:z,class:"md:block md:col-span-1 md:text-center"},[e.createElementVNode("button",{type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline",onClick:G=>v(g.menu,i[z])}," Перемкнути всі ",8,nu)])),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.menu,(P,z)=>(e.openBlock(),e.createElementBlock("ul",{key:z,class:"grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"},[e.createElementVNode("li",ou,[e.createElementVNode("p",su,e.toDisplayString(h(P)),1),e.createElementVNode("p",ru,e.toDisplayString(P.path),1)]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,(G,Z)=>e.createElementVNode("li",{key:Z,class:"col-span-1"},[e.createElementVNode("div",iu,[e.createElementVNode("input",{type:"checkbox",checked:E(P.path,G),onChange:I=>b(P.path,G),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"},null,40,lu)])])),64))]))),128))]))),128))])]))}}),kt={"vs-widget-comments":dn,"vs-widget-history":fn,"vs-widget-gallery":un,"vs-widget-file":pn,"vs-widget-list":Hn,"vs-widget-map":yn,"vs-widget-table":br,"vs-group-interface":Fn};function kr(t){if(t==null)return null;const n=Number(t);return Number.isFinite(n)?Math.max(1,Math.min(12,Math.floor(n))):null}function Er(t){const n={...t};return Array.isArray(t.items)&&(n.items=t.items.map(o=>Er(o))),n}function au(t,n=12){if(!t.length)return;const o=[],s=[];if(t.forEach(c=>{const d=kr(c.col);d?(c.col=d,o.push({item:c,span:d})):s.push(c)}),!o.length&&s.length){s.forEach(c=>{c.col=12});return}const r=o.reduce((c,d)=>c+d.span,0);let i=n-r;if(s.length===0)return;i<=0&&(i=n);const l=Math.max(1,Math.floor(i/s.length));let a=Math.max(0,i-l*s.length);s.forEach(c=>{let d=l;a>0&&(d+=1,a-=1),c.col=Math.max(1,Math.min(12,d))})}function Pn(t,n=12){if(!Array.isArray(t)||!t.length)return[];const o=t.map(s=>Er(s));return o.forEach(s=>{Array.isArray(s.items)&&s.items.length&&(s.items=Pn(s.items,12))}),au(o,n),o}function wr(t){const n=kr(t);return n?n>=12?["md:col-span-12","lg:col-span-12"]:[`md:col-span-${n}`,`lg:col-span-${n}`]:[]}const cu={class:"text-lg font-semibold text-gray-900"},du=["innerHTML"],fu={key:0,class:"grid grid-cols-12 gap-4"},pu={key:0,class:"mb-4 pb-2 border-b border-gray-200"},uu={class:"text-lg font-semibold text-gray-900"},mu=["innerHTML"],tn=e.defineComponent({__name:"CardItem",props:{items:{},type:{},col:{},data:{},html:{},title:{},hideTitle:{type:Boolean},styling:{},name:{},label:{},component:{},slot:{},id:{},className:{},style:{}},setup(t){const n=t,o=e.computed(()=>{if(!n.col)return{};const d=Math.max(1,Math.min(12,Number(n.col)));return{[`md:col-span-${d}`]:!0,[`lg:col-span-${d}`]:!0}}),s=e.computed(()=>Pn(n.items));function r(d){const m=["col-span-12"],f=wr(d.col);return f.length&&m.push(...f),m}function i(d){return kt[d]||d}function l(d,m){if(!d||typeof m!="string"||!m)return{found:!1,value:void 0};const f=m.split(".");let h=d;for(const E of f){if(h==null||typeof h!="object"&&!Array.isArray(h))return{found:!1,value:void 0};if(!(E in h))return{found:!1,value:void 0};h=h[E]}return{found:!0,value:h}}const a=function(d={}){const m={...d};return Object.entries(m).forEach(([f,h])=>{if(f!=="props"&&typeof h=="string"){const E=l(n.data,h);E.found&&(m[f]=E.value)}}),d.props&&typeof d.props=="object"&&Object.entries(d.props).forEach(([f,h])=>{if(typeof h=="string"){const E=l(n.data,h);m[f]=E.found?E.value:h}else m[f]=h}),delete m.props,m},c=e.computed(()=>{const d={};return n.col&&(d.col=n.col),d});return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[o.value,t.styling?.classItem],"w-full bg-gray-50 rounded-lg p-4 col-span-12"])},[!t.hideTitle&&t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-4 pb-2 border-b border-gray-200",t.styling?.classItemTitle])},[e.createElementVNode("h3",cu,e.toDisplayString(t.title),1)],2)):e.createCommentVNode("",!0),t.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:t.html,class:"text-gray-900 leading-relaxed"},null,8,du)):t.type?.includes("tabs")?(e.openBlock(),e.createBlock(nn,{key:2,view:t.type,panels:t.items,data:t.data,styling:t.styling},null,8,["view","panels","data","styling"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[s.value.length?(e.openBlock(),e.createElementBlock("div",fu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(f,h)=>(e.openBlock(),e.createElementBlock("div",{key:f.name||f.component||h,class:e.normalizeClass(r(f))},[f.title||f.label?(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("h3",uu,e.toDisplayString(f.title||f.label),1)])):e.createCommentVNode("",!0),f.html?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:f.html,class:"text-gray-900 leading-relaxed"},null,8,mu)):f.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i(f.component)),e.mergeProps({key:2,ref_for:!0},{geom:t.data.geom,id:t.data.id,...c.value,...a(f),data:t.data},{class:"w-full"}),null,16)):e.renderSlot(d.$slots,"default",{key:3})],2))),128))])):e.createCommentVNode("",!0)],64))],2))}}),hu={class:"grid grid-cols-12 gap-[20px]"},gu={key:0,class:"col-span-4"},yu=["innerHTML"],vu=["onClick"],bu=["innerHTML"],ku={key:1,class:"flex w-full"},Eu={class:"flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative"},wu=["onClick"],xu={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"},Nu={class:"flex-1 p-4"},Cu=["innerHTML"],Su={class:"grid grid-cols-12 gap-4"},_u={key:3,class:"w-full h-full"},nn=e.defineComponent({__name:"Card",props:{panels:{default:()=>[]},data:{default:()=>({})},view:{default:"plain"},styling:{},classWrapper:{default:""},classPanel:{},normalizeTabs:{type:Boolean,default:!0},backgroundClass:{},tabContentWrapperClass:{},tabPanelClass:{},id:{},className:{},style:{}},setup(t){const n=t;function o(){const I=typeof window<"u"?window:globalThis,F="__vsCardAnonymousCounter__",N=I[F]??0;return I[F]=N+1,N===0?"tab":`tab${N}`}const s=e.ref(0),r=e.ref([]);let i=!1,l=!1;const a=e.ref(n.id??o());e.watch(()=>n.id,I=>{I&&(a.value=I)});const c=new Map,d=e.computed(()=>n.view==="tabs"||n.view==="vertical-tabs");e.provide("vsCardTabsContext",d);function m(I,F){const N=F?.path;return N?(c.has(N)||c.set(N,e.defineAsyncComponent(()=>import(N))),c.get(N)):typeof I=="string"&&kt[I]?kt[I]:F?.component&&kt[F.component]?kt[F.component]:F?.name&&kt[F.name]?kt[F.name]:I}function f(I){return I.forEach(F=>{F.type&&(F.view=F.type)}),r.value=I.filter(F=>F.type==="pin"),I.filter(F=>F.type!=="pin")}const h=e.computed(()=>{let I;return n.panels&&n.panels.length>0?I=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(I=n.data.filter(N=>N.type.includes("tabs"))[0]?.items),Pn(I,12)}),E=e.computed(()=>a.value);function b(){l||(l=!0)}const v=e.computed(()=>{let I;return n.panels&&n.panels.length>0?I=n.normalizeTabs?f(n.panels):n.panels:n.data&&Array.isArray(n.data)&&(I=n.data),Pn(I,12)}),S=e.computed(()=>({[`view-${n.view}`]:!0}));function k(I,F){if(!I||typeof F!="string"||!F)return{found:!1,value:void 0};const N=F.split(".");let j=I;for(const te of N){if(j==null||typeof j!="object"&&!Array.isArray(j))return{found:!1,value:void 0};if(!(te in j))return{found:!1,value:void 0};j=j[te]}return{found:!0,value:j}}const _=I=>{const F={...I};return Object.entries(F).forEach(([N,j])=>{if(N!=="props"&&typeof j=="string"){const te=k(n.data,j);te.found&&(F[N]=te.value)}}),I.props&&typeof I.props=="object"&&Object.entries(I.props).forEach(([N,j])=>{if(typeof j=="string"){const te=k(n.data,j);F[N]=te.found?te.value:j}else F[N]=j}),delete F.props,n.data&&(F.data=n.data),F};function C(I){const F=["col-span-12"],N=wr(I.col);return N.length&&F.push(...N),F}const w=e.ref([]),x=e.ref([]),$=e.ref([]);function B(I,F){I&&I instanceof HTMLElement&&(w.value[F]=I)}function g(){x.value=w.value.map(I=>I.offsetWidth),$.value=w.value.map(I=>I.offsetLeft)}function D(){if(typeof window>"u")return null;const I=E.value;if(!I)return null;const N=new URL(window.location.href).searchParams.get(I);if(N===null)return null;const j=Number.parseInt(N,10);return Number.isNaN(j)?null:j}function P(I){if(typeof window>"u")return;const F=E.value;if(!F||!l)return;const N=new URL(window.location.href);I<=0?N.searchParams.delete(F):N.searchParams.set(F,String(I));const j=window.history.state??{};window.history.replaceState(j,document.title,N)}function z(){if(i||!h.value.length)return;b();const I=D();if(I===null)return;const F=Math.min(Math.max(I,0),h.value.length-1);F!==I&&P(F),F!==s.value&&(s.value=F),i=!0}function G(){i=!1,z()}let Z=null;return e.onMounted(()=>{e.nextTick(()=>{z(),g()}),typeof window<"u"&&window.addEventListener("popstate",G),Z=new ResizeObserver(()=>g()),Z.observe(document.body)}),e.onBeforeUnmount(()=>{Z?.disconnect(),typeof window<"u"&&window.removeEventListener("popstate",G)}),e.watch(s,I=>{e.nextTick(()=>{g()}),P(I)}),e.watch(h,()=>{i=!1,z()}),(I,F)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.classWrapper||S.value)},[e.createElementVNode("div",hu,[r.value.length!==0?(e.openBlock(),e.createElementBlock("div",gu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value[0].items,(N,j)=>(e.openBlock(),e.createElementBlock("div",{key:N.name||j,class:"w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"},[N.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:N.html,class:"text-gray-900 leading-relaxed"},null,8,yu)):N.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(N.component,N)),e.mergeProps({key:1,ref_for:!0},N.component==="Card"?N:_(N),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(r.value.length!==0?"col-span-8":"col-span-12")},[t.view==="tabs"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden w-full",t.styling?.classTabWrapper])},[e.createElementVNode("div",{class:e.normalizeClass(["flex border-b border-gray-200 bg-gray-50 relative gap-4 my-6",t.styling?.classTabHeader])},[x.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",style:e.normalizeStyle({width:x.value[s.value]+"px",left:$.value[s.value]+"px"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(N,j)=>(e.openBlock(),e.createElementBlock("button",{key:N.name||j,ref_for:!0,ref:te=>B(te,j),onClick:te=>s.value=j,class:e.normalizeClass(["px-1 py-2 text-sm font-medium transition-colors",s.value===j?"text-blue-600 border-blue-600 border-b-2 ":"text-gray-600 hover:text-gray-800"])},e.toDisplayString(N.title||N.label||N.name||`Tab ${j+1}`),11,vu))),128))],2),e.createElementVNode("div",{class:e.normalizeClass([t.styling?.classTabContent,"p-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(N,j)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:N.name||j,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===j?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100"])},[N.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:N.html,class:"text-gray-900 leading-relaxed"},null,8,bu)):I.$slots[`tab-${j}`]?e.renderSlot(I.$slots,`tab-${j}`,{key:1,item:N,data:t.data}):N.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(tn),e.mergeProps({key:2,ref_for:!0},_(N),{items:N.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):N.component||N.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(N.component||N.name,N)),e.mergeProps({key:3,ref_for:!0},N.component==="Card"?N:_(N),{styling:t.styling,id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["styling","id","class"])):e.renderSlot(I.$slots,N.slot||`tab-${j}`,{key:4,item:N,data:t.data})],2)),[[e.vShow,s.value===j]])),128))],2)],2)):t.view==="vertical-tabs"?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("div",Eu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(N,j)=>(e.openBlock(),e.createElementBlock("button",{key:N.name||j,onClick:te=>s.value=j,class:e.normalizeClass(["relative px-1 py-4 text-sm font-medium text-left transition-colors duration-300",s.value===j?"text-blue-600 bg-white":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"])},[e.createTextVNode(e.toDisplayString(N.title||N.label||N.name||`Tab ${j+1}`)+" ",1),s.value===j?(e.openBlock(),e.createElementBlock("span",xu,[...F[0]||(F[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"},[e.createElementVNode("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})],-1)])])):e.createCommentVNode("",!0)],10,wu))),128))]),e.createElementVNode("div",Nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(N,j)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:N.name||j,class:e.normalizeClass(["transition-all duration-300 ease-in-out",s.value===j?"opacity-100 translate-y-0":"opacity-0 -translate-y-2",t.classPanel||"w-full border-gray-100 py-2"])},[N.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:N.html,class:"text-gray-900 leading-relaxed"},null,8,Cu)):I.$slots[`tab-${j}`]?e.renderSlot(I.$slots,`tab-${j}`,{key:1,item:N,data:t.data}):N.items?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(tn),e.mergeProps({key:2,ref_for:!0},_(N),{items:N.items,"hide-title":!0,class:["w-full h-full",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):N.component||N.name?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(N.component||N.name,N)),e.mergeProps({key:3,ref_for:!0},N.component==="Card"?N:_(N),{id:t.data.id,class:["w-full h-full",t.styling?.classItem]}),null,16,["id","class"])):e.renderSlot(I.$slots,N.slot||`tab-${j}`,{key:4,item:N,data:t.data})],2)),[[e.vShow,s.value===j]])),128))])])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.styling?.classPlain||"p-1 w-full")},[e.createElementVNode("div",Su,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(N,j)=>(e.openBlock(),e.createElementBlock("div",{key:N.name||N.component||j,class:e.normalizeClass(C(N))},[I.$slots[`panel-${j}`]?e.renderSlot(I.$slots,`panel-${j}`,{key:0,item:N,data:t.data}):N.items||N.html?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(tn),e.mergeProps({key:1,ref_for:!0},_(N),{items:N.items||[],class:["w-full h-auto",t.styling?.classItem],styling:t.styling}),null,16,["items","class","styling"])):N.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(N.component,N)),e.mergeProps({key:2,ref_for:!0},_(N),{class:["w-full h-auto",[t.styling?.classItem]],styling:t.styling}),null,16,["class","styling"])):(e.openBlock(),e.createElementBlock("div",_u,[e.renderSlot(I.$slots,N.slot||`panel-${j}`,{item:N,data:t.data})]))],2))),128))])],2))],2)])],2))}}),Bu=["onClick"],xr=ot(e.defineComponent({__name:"CopyNotification",setup(t,{expose:n}){const o=e.ref([]);let s=1;const r=()=>{if(o.value.length>=10){const a=o.value[0];clearTimeout(a.timer),o.value.shift()}const l={id:s++,timer:setTimeout(()=>{i(l.id)},1500)};o.value.push(l)},i=l=>{const a=o.value.findIndex(c=>c.id===l);if(a!==-1){const c=o.value[a];clearTimeout(c.timer),o.value.splice(a,1)}};return n({addNotification:r}),e.onUnmounted(()=>{o.value.forEach(l=>{clearTimeout(l.timer)})}),(l,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"fixed top-4 right-4 z-50 space-y-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:"bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"},[e.createVNode(e.unref(Fr),{class:"h-5 w-5 text-green-100 flex-shrink-0"}),a[0]||(a[0]=e.createElementVNode("div",{class:"flex-1"},[e.createElementVNode("p",{class:"font-medium text-sm"},"Ссылка скопирована!"),e.createElementVNode("p",{class:"text-xs text-green-100 opacity-90"},"Файл добавлен в буфер обмена")],-1)),e.createElementVNode("button",{onClick:d=>i(c.id),class:"text-green-100 hover:text-white transition-colors flex-shrink-0"},[e.createVNode(e.unref(zn),{class:"h-4 w-4"})],8,Bu)]))),128))]),_:1})]))}}),[["__scopeId","data-v-55903525"]]);nn.install=function(t){t.component("vs-widget-file",pn),t.component("vs-widget-comments",dn),t.component("vs-widget-history",fn),t.component("vs-widget-gallery",un),t.component("vs-widget-map",yn),t.component("vs-group-interface",Fn),t.component("CommentsWidget",dn),t.component("HistoryWidget",fn),t.component("GalleryWidget",un),t.component("FilesWidget",pn),t.component("MapWidget",yn),t.component("Card",nn),t.component("CardItem",tn),t.component("DescriptionListWidget",Hn),t.component("CopyNotification",xr),t.component("GroupInterfaceWidget",Fn)},he.Card=nn,he.CardItem=tn,he.CommentsWidget=dn,he.CopyNotification=xr,he.DescriptionListWidget=Hn,he.FilesWidget=pn,he.GalleryWidget=un,he.GroupInterfaceWidget=Fn,he.HistoryWidget=fn,he.MapWidget=yn,he.TableWidget=br,he.default=nn,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));