sm-click-library-ui 0.0.611-dev.55 → 0.0.611-dev.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-DAUF3xLx.js → index-BvG9FtI4.js} +11 -20
- package/dist/sm-click-library-ui.es.js +1 -1
- package/dist/sm-click-library-ui.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/tailwind.css +3 -6
- package/dist/{vue3-lottie.es-CG11cwKh.js → vue3-lottie.es-2Ci7xIr3.js} +1 -1
- package/dist/{web-Bibs_wLt.js → web-DW5U5Z4O.js} +2 -2
- package/dist/{web-DclfLItE.js → web-dk1zfPIk.js} +2 -2
- package/package.json +1 -1
|
@@ -251,7 +251,7 @@ if (n > 0 && t < 1) {
|
|
|
251
251
|
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
|
|
252
252
|
viewBox="0 0 24 24">
|
|
253
253
|
<circle cx="12" cy="12" r="10"/>
|
|
254
|
-
</svg>`}return(oe,ie)=>ae.value.length?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$O,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae.value,(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ce,class:e$b.normalizeClass(["flex items-center border-b dark:border-gray-300 border-gray-700 justify-center gap-2 bg-base-200 px-2 py-1 text-center hover:bg-base-100","text-primary dark:text-primary/70",ee.rowClass,{[ee.roundedClassLast]:ce===ae.value.length-1}])},[ee.iconMode==="emoji"?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_2$J,e$b.toDisplayString(re({type:le.type})),1)):(e$b.openBlock(),e$b.createElementBlock("span",{key:1,innerHTML:re({type:le.type})},null,8,_hoisted_3$F)),le.type==="URL"?(e$b.openBlock(),e$b.createElementBlock("a",{key:2,href:le.url,target:"_blank",rel:"noopener noreferrer",title:le.url,class:"w-full truncate sm:whitespace-normal sm:truncate-0 hover:underline"},e$b.toDisplayString(le.text?le.text:"Abrir link"),9,_hoisted_4$D)):(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_5$z,e$b.toDisplayString(le.text?le.text:"Insira o texto..."),1))],2))),128))])):e$b.createCommentVNode("",!0)}},_hoisted_1$N={class:"flex items-start gap-3 p-3 pb-2"},_hoisted_2$I={class:"flex-1"},_hoisted_3$E={class:"text-[13px] font-semibold leading-5"},_hoisted_4$C={key:0,class:"flex justify-end px-3 pb-1 pt-1 text-[11px] opacity-75"},_sfc_main$S={__name:"CallPermissionCard",props:{time:{type:String,default:""},compact:{type:Boolean,default:!1},status:{type:Object,default:null},phone:{type:String,default:""}},emits:["preferences"],setup(ee){const te=ee,ne=e$b.computed(()=>te.phone?`${te.phone} pode ligar para você?`:"Este número pode ligar para você?"),ae=e$b.computed(()=>{const re=te.status;if(!re)return"Definir preferências";if((re.status||"").toLowerCase()==="reject")return"Agora não";const ie=re.expirate_at;return ie===0||ie==="0"?"Permitir ligações":`Permitir até ${new Date(ie*1e3).toLocaleDateString("pt-BR")}`});return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["w-full overflow-hidden rounded-lg bg-base-200 dark:shadow-gray-800 text-start shadow-sm dark:border-base-100 dark:bg-base-300/70",ee.compact?"max-w-[320px]":""])},[e$b.createElementVNode("div",_hoisted_1$N,[oe[2]||(oe[2]=e$b.createElementVNode("div",{class:"flex size-9 min-h-9 min-w-9 items-center justify-center rounded-full bg-primary text-white","aria-hidden":"true"},[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"size-5",viewBox:"0 0 24 24",fill:"currentColor"},[e$b.createElementVNode("path",{d:"M6.62 10.79a15.053 15.053 0 006.59 6.59l2.2-2.2a1.003 1.003 0 01.94-.27c1.03.26 2.13.4 3.25.4.55 0 1 .45 1 1V21a1 1 0 01-1 1C10.07 22 2 13.93 2 3a1 1 0 011-1h3.69c.55 0 1 .45 1 1 0 1.12.14 2.22.4 3.25.07.34-.03.69-.27.94l-2.2 2.2z"})])],-1)),e$b.createElementVNode("div",_hoisted_2$I,[e$b.createElementVNode("p",_hoisted_3$E,e$b.toDisplayString(ne.value),1),oe[1]||(oe[1]=e$b.createElementVNode("p",{class:"mt-0.5 text-[12px] leading-4 opacity-80"}," Você pode atualizar suas preferências quando quiser no perfil comercial. ",-1))])]),e$b.createElementVNode("button",{disabled:"",type:"button",class:"flex transition w-full items-center bg-emerald-500 hover:bg-emerald-600 justify-center gap-1.5 rounded-b-lg py-2.5 text-[13px] font-semibold text-white",onClick:oe[0]||(oe[0]=ie=>re.$emit("preferences"))},[e$b.createTextVNode(e$b.toDisplayString(ae.value)+" ",1),oe[3]||(oe[3]=e$b.createElementVNode("svg",{class:"size-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"})],-1))]),ee.time?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_4$C,e$b.toDisplayString(ee.time),1)):e$b.createCommentVNode("",!0)],2))}},_hoisted_1$M={class:"mt-1 flex flex-col gap-1 pb-3"},_hoisted_2$H={key:0,class:"font-semibold"},_hoisted_3$D={key:0,class:"flex-justify-center bg-base-300 rounded"},_hoisted_4$B=["src"],_hoisted_5$y=["src"],_hoisted_6$u=["src"],_hoisted_7$q={key:1},_hoisted_8$m={key:2,class:"opacity-70"},_hoisted_9$j={key:1,class:"pb-2"},_sfc_main$R={__name:"MessageTemplate",props:{message:{type:Object,required:!0},from_me:Boolean},emits:["open-preferences"],setup(ee){const te=ee,ne=useMessageUiStore();function ae(le){if(typeof le!="string")return null;try{const de=new URL(le).pathname.split(".").pop().toLowerCase();return["jpeg","jpg","png"].includes(de)?"image":de==="mp4"?"video":de==="pdf"?"pdf":null}catch{return null}}function re(le){return typeof le!="string"?!1:/^https:\/\/[^\s/$.?#].[^\s]*$/i.test(le.trim())}const oe=e$b.computed(()=>{var le,ce,de,ue,be;return String(((ce=(le=te.message)==null?void 0:le.template)==null?void 0:ce.type)||"").toUpperCase()==="CALL_PERMISSION_REQUEST"||Array.isArray((de=te.message)==null?void 0:de.components)&&te.message.components.some(fe=>String((fe==null?void 0:fe.type)||"").toLowerCase()==="call_permission_request")||Array.isArray((be=(ue=te.message)==null?void 0:ue.object)==null?void 0:be.components)&&te.message.object.components.some(fe=>String((fe==null?void 0:fe.type)||"").toLowerCase()==="call_permission_request")}),ie=e$b.computed(()=>{var le,ce,de,ue,be;return ne.instancePhone||((le=te.message)==null?void 0:le.phone)||((de=(ce=te.message)==null?void 0:ce.contact)==null?void 0:de.number)||((be=(ue=te.message)==null?void 0:ue.contact)==null?void 0:be.phone)||""});return(le,ce)=>{var de;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[ce[1]||(ce[1]=e$b.createElementVNode("div",{class:"mt-[-19px]"},[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-meta size-4 rounded-full text-blue-500",viewBox:"0 0 16 16"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"})])],-1)),e$b.createElementVNode("main",_hoisted_1$M,[ee.message.template.header?(e$b.openBlock(),e$b.createElementBlock("header",_hoisted_2$H,[re(ee.message.template.header)?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_3$D,[ae(ee.message.template.header)==="image"?(e$b.openBlock(),e$b.createElementBlock("img",{key:0,src:ee.message.template.header,class:"max-h-96 w-auto rounded object-contain mx-auto"},null,8,_hoisted_4$B)):ae(ee.message.template.header)==="video"?(e$b.openBlock(),e$b.createElementBlock("video",{key:1,src:ee.message.template.header,controls:"",class:"max-h-96 w-auto rounded object-contain mx-auto"},null,8,_hoisted_5$y)):ae(ee.message.template.header)==="pdf"?(e$b.openBlock(),e$b.createElementBlock("embed",{key:2,src:ee.message.template.header,type:"application/pdf",class:"w-full h-96 rounded mx-auto"},null,8,_hoisted_6$u)):e$b.createCommentVNode("",!0)])):(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.template.header},null,8,["content"]))])):e$b.createCommentVNode("",!0),ee.message.template.body?(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_7$q,[e$b.createVNode(MessageMarkdown,{content:ee.message.template.body},null,8,["content"])])):e$b.createCommentVNode("",!0),ee.message.template.footer?(e$b.openBlock(),e$b.createElementBlock("footer",_hoisted_8$m,[e$b.createVNode(MessageMarkdown,{content:ee.message.template.footer},null,8,["content"])])):e$b.createCommentVNode("",!0)]),ee.message.template.buttons?(e$b.openBlock(),e$b.createBlock(_sfc_main$T,{key:0,class:"-mx-2",items:ee.message.template.buttons,"icon-mode":"svg"},null,8,["items"])):e$b.createCommentVNode("",!0),oe.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$j,[e$b.createVNode(_sfc_main$S,{status:((de=ee.message.template)==null?void 0:de.call_permission_status)||null,compact:!1,phone:ie.value,onPreferences:ce[0]||(ce[0]=ue=>le.$emit("open-preferences"))},null,8,["status","phone"])])):e$b.createCommentVNode("",!0)],64)}}},_hoisted_1$L={class:"min-w-[300px] max-w-[460px]"},_hoisted_2$G={key:0,class:"p-1 pt-0"},_hoisted_3$C={key:0,class:"rounded bg-base-300 p-1 flex justify-center"},_hoisted_4$A=["src"],_hoisted_5$x=["src"],_hoisted_6$t=["src"],_hoisted_7$p={key:1,class:"font-semibold text-[14px] leading-tight pt-3 px-1"},_hoisted_8$l={key:1,class:"px-2 pb-2 pt-1"},_hoisted_9$i={class:"whitespace-pre-line text-[14px] leading-snug opacity-90"},_hoisted_10$g={key:2,class:"px-2 pb-2 pt-1"},_hoisted_11$f={class:"whitespace-pre-line text-[14px] leading-snug opacity-60"},_hoisted_12$d={key:3,class:"-mx-2 border-t border-white/5"},_hoisted_13$b={class:"px-3 pb-2 space-y-2"},_hoisted_14$a={key:0,class:"flex items-start gap-2"},_hoisted_15$8={class:"text-[13px] text-base-content/80 leading-snug"},_hoisted_16$7={key:1,class:"flex items-center gap-1.5"},_hoisted_17$3={class:"text-[11px] font-mono text-base-content/50 truncate"},_hoisted_18$3={class:"flex items-center justify-between"},_hoisted_19$3={class:"text-[12px] font-bold text-emerald-400 tabular-nums"},_hoisted_20$3=["innerHTML"],_hoisted_21$2={class:"text-[14px] font-medium"},_sfc_main$Q={__name:"MessageButtons",props:{content:{type:Object,required:!0}},emits:["action"],setup(ee,{emit:te}){var ke,ve,_e,$e,ye,Ee;const ne=ee,ae=te,re=(((ke=ne.content)==null?void 0:ke.type)||"").toLowerCase(),oe={request_contact_info:"Compartilhar número"};((_e=(ve=ne.content)==null?void 0:ve.headers)==null?void 0:_e.type)==="text"&&((ye=($e=ne.content)==null?void 0:$e.headers)!=null&&ye.content);const ie=((Ee=ne.content)==null?void 0:Ee.body)||"",le=e$b.computed(()=>{var Le;const Se=(Le=ne.content)==null?void 0:Le.buttons;return Se?Array.isArray(Se)?Se:typeof Se!="object"?[]:[{type:re,text:Se.display_text,...Se}]:[]}),ce=e$b.computed(()=>le.value.find(Se=>Se.type==="review_and_pay")||null);function de(Se,Le){if(!Se)return"";const Ae=Se.value/Se.offset;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:Le||"BRL",minimumFractionDigits:2,maximumFractionDigits:2}).format(Ae)}catch{return`${Le} ${Ae.toFixed(2)}`}}const ue={voice_call:`
|
|
254
|
+
</svg>`}return(oe,ie)=>ae.value.length?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$O,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae.value,(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ce,class:e$b.normalizeClass(["flex items-center border-b dark:border-gray-300 border-gray-700 justify-center gap-2 bg-base-200 px-2 py-1 text-center hover:bg-base-100","text-primary dark:text-primary/70",ee.rowClass,{[ee.roundedClassLast]:ce===ae.value.length-1}])},[ee.iconMode==="emoji"?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_2$J,e$b.toDisplayString(re({type:le.type})),1)):(e$b.openBlock(),e$b.createElementBlock("span",{key:1,innerHTML:re({type:le.type})},null,8,_hoisted_3$F)),le.type==="URL"?(e$b.openBlock(),e$b.createElementBlock("a",{key:2,href:le.url,target:"_blank",rel:"noopener noreferrer",title:le.url,class:"w-full truncate sm:whitespace-normal sm:truncate-0 hover:underline"},e$b.toDisplayString(le.text?le.text:"Abrir link"),9,_hoisted_4$D)):(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_5$z,e$b.toDisplayString(le.text?le.text:"Insira o texto..."),1))],2))),128))])):e$b.createCommentVNode("",!0)}},_hoisted_1$N={class:"flex items-start gap-3 p-3 pb-2"},_hoisted_2$I={class:"flex-1"},_hoisted_3$E={class:"text-[13px] font-semibold leading-5"},_hoisted_4$C={key:0,class:"flex justify-end px-3 pb-1 pt-1 text-[11px] opacity-75"},_sfc_main$S={__name:"CallPermissionCard",props:{time:{type:String,default:""},compact:{type:Boolean,default:!1},status:{type:Object,default:null},phone:{type:String,default:""}},emits:["preferences"],setup(ee){const te=ee,ne=e$b.computed(()=>te.phone?`${te.phone} pode ligar para você?`:"Este número pode ligar para você?"),ae=e$b.computed(()=>{const re=te.status;if(!re)return"Definir preferências";if((re.status||"").toLowerCase()==="reject")return"Agora não";const ie=re.expirate_at;return ie===0||ie==="0"?"Permitir ligações":`Permitir até ${new Date(ie*1e3).toLocaleDateString("pt-BR")}`});return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["w-full overflow-hidden rounded-lg bg-base-200 dark:shadow-gray-800 text-start shadow-sm dark:border-base-100 dark:bg-base-300/70",ee.compact?"max-w-[320px]":""])},[e$b.createElementVNode("div",_hoisted_1$N,[oe[2]||(oe[2]=e$b.createElementVNode("div",{class:"flex size-9 min-h-9 min-w-9 items-center justify-center rounded-full bg-primary text-white","aria-hidden":"true"},[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"size-5",viewBox:"0 0 24 24",fill:"currentColor"},[e$b.createElementVNode("path",{d:"M6.62 10.79a15.053 15.053 0 006.59 6.59l2.2-2.2a1.003 1.003 0 01.94-.27c1.03.26 2.13.4 3.25.4.55 0 1 .45 1 1V21a1 1 0 01-1 1C10.07 22 2 13.93 2 3a1 1 0 011-1h3.69c.55 0 1 .45 1 1 0 1.12.14 2.22.4 3.25.07.34-.03.69-.27.94l-2.2 2.2z"})])],-1)),e$b.createElementVNode("div",_hoisted_2$I,[e$b.createElementVNode("p",_hoisted_3$E,e$b.toDisplayString(ne.value),1),oe[1]||(oe[1]=e$b.createElementVNode("p",{class:"mt-0.5 text-[12px] leading-4 opacity-80"}," Você pode atualizar suas preferências quando quiser no perfil comercial. ",-1))])]),e$b.createElementVNode("button",{disabled:"",type:"button",class:"flex transition w-full items-center bg-emerald-500 hover:bg-emerald-600 justify-center gap-1.5 rounded-b-lg py-2.5 text-[13px] font-semibold text-white",onClick:oe[0]||(oe[0]=ie=>re.$emit("preferences"))},[e$b.createTextVNode(e$b.toDisplayString(ae.value)+" ",1),oe[3]||(oe[3]=e$b.createElementVNode("svg",{class:"size-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 9-7 7-7-7"})],-1))]),ee.time?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_4$C,e$b.toDisplayString(ee.time),1)):e$b.createCommentVNode("",!0)],2))}},_hoisted_1$M={class:"mt-1 flex flex-col gap-1 pb-3"},_hoisted_2$H={key:0,class:"font-semibold"},_hoisted_3$D={key:0,class:"flex-justify-center bg-base-300 rounded"},_hoisted_4$B=["src"],_hoisted_5$y=["src"],_hoisted_6$u=["src"],_hoisted_7$q={key:1},_hoisted_8$m={key:2,class:"opacity-70"},_hoisted_9$j={key:1,class:"pb-2"},_sfc_main$R={__name:"MessageTemplate",props:{message:{type:Object,required:!0},from_me:Boolean},emits:["open-preferences"],setup(ee){const te=ee,ne=useMessageUiStore();function ae(le){if(typeof le!="string")return null;try{const de=new URL(le).pathname.split(".").pop().toLowerCase();return["jpeg","jpg","png"].includes(de)?"image":de==="mp4"?"video":de==="pdf"?"pdf":null}catch{return null}}function re(le){return typeof le!="string"?!1:/^https:\/\/[^\s/$.?#].[^\s]*$/i.test(le.trim())}const oe=e$b.computed(()=>{var le,ce,de,ue,be;return String(((ce=(le=te.message)==null?void 0:le.template)==null?void 0:ce.type)||"").toUpperCase()==="CALL_PERMISSION_REQUEST"||Array.isArray((de=te.message)==null?void 0:de.components)&&te.message.components.some(fe=>String((fe==null?void 0:fe.type)||"").toLowerCase()==="call_permission_request")||Array.isArray((be=(ue=te.message)==null?void 0:ue.object)==null?void 0:be.components)&&te.message.object.components.some(fe=>String((fe==null?void 0:fe.type)||"").toLowerCase()==="call_permission_request")}),ie=e$b.computed(()=>{var le,ce,de,ue,be;return ne.instancePhone||((le=te.message)==null?void 0:le.phone)||((de=(ce=te.message)==null?void 0:ce.contact)==null?void 0:de.number)||((be=(ue=te.message)==null?void 0:ue.contact)==null?void 0:be.phone)||""});return(le,ce)=>{var de;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[ce[1]||(ce[1]=e$b.createElementVNode("div",{class:"mt-[-19px]"},[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-meta size-4 rounded-full text-blue-500",viewBox:"0 0 16 16"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.217 5.243C9.145 3.988 10.171 3 11.483 3 13.96 3 16 6.153 16.001 9.907c0 2.29-.986 3.725-2.757 3.725-1.543 0-2.395-.866-3.924-3.424l-.667-1.123-.118-.197a54.944 54.944 0 0 0-.53-.877l-1.178 2.08c-1.673 2.925-2.615 3.541-3.923 3.541C1.086 13.632 0 12.217 0 9.973 0 6.388 1.995 3 4.598 3c.319 0 .625.039.924.122.31.086.611.22.913.407.577.359 1.154.915 1.782 1.714Zm1.516 2.224c-.252-.41-.494-.787-.727-1.133L9 6.326c.845-1.305 1.543-1.954 2.372-1.954 1.723 0 3.102 2.537 3.102 5.653 0 1.188-.39 1.877-1.195 1.877-.773 0-1.142-.51-2.61-2.87l-.937-1.565ZM4.846 4.756c.725.1 1.385.634 2.34 2.001A212.13 212.13 0 0 0 5.551 9.3c-1.357 2.126-1.826 2.603-2.581 2.603-.777 0-1.24-.682-1.24-1.9 0-2.602 1.298-5.264 2.846-5.264.091 0 .181.006.27.018Z"})])],-1)),e$b.createElementVNode("main",_hoisted_1$M,[ee.message.template.header?(e$b.openBlock(),e$b.createElementBlock("header",_hoisted_2$H,[re(ee.message.template.header)?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_3$D,[ae(ee.message.template.header)==="image"?(e$b.openBlock(),e$b.createElementBlock("img",{key:0,src:ee.message.template.header,class:"max-h-96 w-auto rounded object-contain mx-auto"},null,8,_hoisted_4$B)):ae(ee.message.template.header)==="video"?(e$b.openBlock(),e$b.createElementBlock("video",{key:1,src:ee.message.template.header,controls:"",class:"max-h-96 w-auto rounded object-contain mx-auto"},null,8,_hoisted_5$y)):ae(ee.message.template.header)==="pdf"?(e$b.openBlock(),e$b.createElementBlock("embed",{key:2,src:ee.message.template.header,type:"application/pdf",class:"w-full h-96 rounded mx-auto"},null,8,_hoisted_6$u)):e$b.createCommentVNode("",!0)])):(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.template.header},null,8,["content"]))])):e$b.createCommentVNode("",!0),ee.message.template.body?(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_7$q,[e$b.createVNode(MessageMarkdown,{content:ee.message.template.body},null,8,["content"])])):e$b.createCommentVNode("",!0),ee.message.template.footer?(e$b.openBlock(),e$b.createElementBlock("footer",_hoisted_8$m,[e$b.createVNode(MessageMarkdown,{content:ee.message.template.footer},null,8,["content"])])):e$b.createCommentVNode("",!0)]),ee.message.template.buttons?(e$b.openBlock(),e$b.createBlock(_sfc_main$T,{key:0,class:"-mx-2",items:ee.message.template.buttons,"icon-mode":"svg"},null,8,["items"])):e$b.createCommentVNode("",!0),oe.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$j,[e$b.createVNode(_sfc_main$S,{status:((de=ee.message.template)==null?void 0:de.call_permission_status)||null,compact:!1,phone:ie.value,onPreferences:ce[0]||(ce[0]=ue=>le.$emit("open-preferences"))},null,8,["status","phone"])])):e$b.createCommentVNode("",!0)],64)}}},_hoisted_1$L={class:"min-w-[min(300px,100%)] max-w-[460px]"},_hoisted_2$G={key:0,class:"p-1 pt-0"},_hoisted_3$C={key:0,class:"rounded bg-base-300 p-1 flex justify-center"},_hoisted_4$A=["src"],_hoisted_5$x=["src"],_hoisted_6$t=["src"],_hoisted_7$p={key:1,class:"font-semibold text-[14px] leading-tight"},_hoisted_8$l={key:1},_hoisted_9$i={class:"whitespace-pre-line text-[14px] leading-snug opacity-90"},_hoisted_10$g={key:2,class:"pt-1"},_hoisted_11$f={class:"whitespace-pre-line text-[14px] leading-snug opacity-60"},_hoisted_12$d={key:3,class:"-mx-2 border-t border-white/5"},_hoisted_13$b={class:"px-3 pb-2 space-y-2"},_hoisted_14$a={key:0,class:"flex items-start gap-2"},_hoisted_15$8={class:"text-[13px] text-base-content/80 leading-snug"},_hoisted_16$7={key:1,class:"flex items-center gap-1.5"},_hoisted_17$3={class:"text-[11px] font-mono text-base-content/50 truncate min-w-0"},_hoisted_18$3={class:"flex items-center justify-between"},_hoisted_19$3={class:"text-[12px] font-bold text-emerald-400 tabular-nums"},_hoisted_20$3=["innerHTML"],_hoisted_21$2={class:"text-[14px] font-medium"},_sfc_main$Q={__name:"MessageButtons",props:{content:{type:Object,required:!0}},emits:["action"],setup(ee,{emit:te}){var ke,ve,_e,$e,ye,Ee;const ne=ee,ae=te,re=(((ke=ne.content)==null?void 0:ke.type)||"").toLowerCase(),oe={request_contact_info:"Compartilhar número"};((_e=(ve=ne.content)==null?void 0:ve.headers)==null?void 0:_e.type)==="text"&&((ye=($e=ne.content)==null?void 0:$e.headers)!=null&&ye.content);const ie=((Ee=ne.content)==null?void 0:Ee.body)||"",le=e$b.computed(()=>{var Le;const Se=(Le=ne.content)==null?void 0:Le.buttons;return Se?Array.isArray(Se)?Se:typeof Se!="object"?[]:[{type:re,text:Se.display_text,...Se}]:[]}),ce=e$b.computed(()=>le.value.find(Se=>Se.type==="review_and_pay")||null);function de(Se,Le){if(!Se)return"";const Ae=Se.value/Se.offset;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:Le||"BRL",minimumFractionDigits:2,maximumFractionDigits:2}).format(Ae)}catch{return`${Le} ${Ae.toFixed(2)}`}}const ue={voice_call:`
|
|
255
255
|
<svg class="size-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
|
256
256
|
<path d="M6.97825 3.99999c-.3729 0-.74128.08169-1.07926.23934-.32394.15109-.61243.36845-.84696.63786-1.81892 1.82189-2.35302 3.87423-1.89899 5.93671.43916 1.9949 1.77747 3.8929 3.45642 5.572 1.67897 1.6791 3.57614 3.0176 5.57034 3.4591 2.0612.4563 4.1141-.0726 5.9396-1.8853.2705-.2348.4888-.524.6405-.8489.1581-.3387.2401-.7081.2401-1.0819 0-.3739-.082-.7432-.2401-1.0819-.1516-.3247-.3696-.6137-.6398-.8483l-1.2098-1.2106c-.5043-.5041-1.1879-.7872-1.9007-.7872-.7128 0-1.3968.2835-1.9011.7876l-.6178.6181c-.1512.1513-.3563.2363-.5701.2363-.2138 0-.4189-.085-.5701-.2363l-1.85336-1.8545c-.15117-.1513-.23609-.3565-.23609-.5704 0-.214.08493-.4192.23613-.5705l.61812-.61851c.5037-.50461.7867-1.18868.7867-1.90191s-.2833-1.39767-.7871-1.90228L8.90499 4.8778c-.23462-.26969-.5233-.48727-.84749-.63847-.33798-.15765-.70636-.23934-1.07925-.23934Z"/>
|
|
257
257
|
<path fill-rule="evenodd" d="M18.0299 8.98132c0 .55229-.4477 1-1 .99999l-3.03-.00002c-.5522 0-1-.44772-1-1V5.99995c0-.55229.4478-1 1-1 .5523 0 1 .44771 1 1v.58112l3.3184-3.29111c.3921-.38892 1.0253-.38631 1.4142.00582.3889.39213.3863 1.02529-.0058 1.4142l-3.2984 3.27133h.6016c.5523.00001 1 .44773 1 1.00001Z" clip-rule="evenodd"/>
|
|
@@ -278,7 +278,7 @@ if (n > 0 && t < 1) {
|
|
|
278
278
|
</svg>`};function be(Se){return typeof Se!="string"?!1:/^https:\/\/[^\s/$.?#].[^\s]*$/i.test(Se.trim())}function fe(){var De,Oe;const Se=(De=ne.content)==null?void 0:De.headers;if(!Se)return{kind:null,value:""};const Le=String((Se==null?void 0:Se.type)||"").toLowerCase(),Ae=(Se==null?void 0:Se.content)??(Se==null?void 0:Se.media)??"";if(["text","image","video","document"].includes(Le))return{kind:Le,value:Ae};if(typeof Ae=="string"&&be(Ae))try{const Ie=(Oe=new URL(Ae).pathname.split(".").pop())==null?void 0:Oe.toLowerCase();if(["jpeg","jpg","png","gif","webp"].includes(Ie))return{kind:"image",value:Ae};if(["mp4","mov","webm"].includes(Ie))return{kind:"video",value:Ae};if(Ie==="pdf")return{kind:"document",value:Ae}}catch{}return{kind:"text",value:Ae}}const{kind:ge,value:me}=fe();function pe(){ae("action",{type:re,...ne.content})}return(Se,Le)=>{var Ae,De;return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$L,[(Ae=ee.content)!=null&&Ae.headers?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$G,[["image","video","document"].includes(e$b.unref(ge))&&be(e$b.unref(me))?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_3$C,[e$b.unref(ge)==="image"?(e$b.openBlock(),e$b.createElementBlock("img",{key:0,src:e$b.unref(me),class:"max-h-96 max-w-full rounded object-contain",alt:"header image"},null,8,_hoisted_4$A)):e$b.unref(ge)==="video"?(e$b.openBlock(),e$b.createElementBlock("video",{key:1,src:e$b.unref(me),controls:"",class:"max-h-96 max-w-full rounded object-contain"},null,8,_hoisted_5$x)):e$b.unref(ge)==="document"?(e$b.openBlock(),e$b.createElementBlock("embed",{key:2,src:e$b.unref(me),type:"application/pdf",class:"w-full h-96 rounded"},null,8,_hoisted_6$t)):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),(De=ee.content.headers)!=null&&De.text?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$p,[e$b.createVNode(MessageMarkdown,{content:ee.content.headers.text||ee.content.headers.text},null,8,["content"])])):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),ce.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$l,[e$b.createElementVNode("p",_hoisted_9$i,[e$b.createVNode(MessageMarkdown,{content:e$b.unref(ie)},null,8,["content"])])])),ce.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10$g,[e$b.createElementVNode("p",_hoisted_11$f,[e$b.createVNode(MessageMarkdown,{content:ee.content.footer},null,8,["content"])])])),ce.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_12$d,[Le[4]||(Le[4]=e$b.createElementVNode("div",{class:"px-3 pt-2 pb-1 flex items-center gap-2"},[e$b.createElementVNode("svg",{class:"size-3.5 shrink-0 text-base-content/40",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1H2V7ZM2 10h20v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7Zm3 3a1 1 0 0 0 0 2h3a1 1 0 0 0 0-2H5Z"})]),e$b.createElementVNode("p",{class:"text-[11px] font-medium text-base-content/50 uppercase tracking-wide leading-none"}," Solicitação de pagamento ")],-1)),e$b.createElementVNode("div",_hoisted_13$b,[ce.value.description?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_14$a,[Le[0]||(Le[0]=e$b.createElementVNode("svg",{class:"size-3.5 mt-0.5 shrink-0 text-base-content/40",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M5 4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4Zm5 4a1 1 0 0 0 0 2h4a1 1 0 0 0 0-2h-4Zm0 3a1 1 0 0 0 0 2h4a1 1 0 0 0 0-2h-4Zm0 3a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2h-2Z","clip-rule":"evenodd"})],-1)),e$b.createElementVNode("span",_hoisted_15$8,e$b.toDisplayString(ce.value.description),1)])):e$b.createCommentVNode("",!0),ce.value.reference_id?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$7,[Le[1]||(Le[1]=e$b.createElementVNode("span",{class:"text-[10px] uppercase tracking-wider font-semibold text-base-content/40"},"Ref.",-1)),e$b.createElementVNode("span",_hoisted_17$3,e$b.toDisplayString(ce.value.reference_id),1)])):e$b.createCommentVNode("",!0),Le[3]||(Le[3]=e$b.createElementVNode("div",{class:"border-t border-dashed border-base-content/10"},null,-1)),e$b.createElementVNode("div",_hoisted_18$3,[Le[2]||(Le[2]=e$b.createElementVNode("span",{class:"text-[12px] font-medium text-base-content/60 uppercase tracking-wide"},"Total a pagar",-1)),e$b.createElementVNode("span",_hoisted_19$3,e$b.toDisplayString(de(ce.value.total_amount,ce.value.currency)),1)])])])):e$b.createCommentVNode("",!0),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(le.value,(Oe,Ie)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:Oe.id||Oe.type||Oe.text,class:"-mx-2"},[Oe.type!=="review_and_pay"?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,class:e$b.normalizeClass(["group flex border-b border-base-100 w-full items-center justify-center gap-1 bg-base-200 px-3 py-2 text-primary hover:bg-base-100 transition",Ie===le.value.length-1?"rounded-b-md":""]),onClick:pe},[e$b.createElementVNode("span",{innerHTML:ue[Oe.type]||ue.voice_call,class:"inline-flex"},null,8,_hoisted_20$3),e$b.createElementVNode("span",_hoisted_21$2,e$b.toDisplayString((Oe==null?void 0:Oe.text)||oe[Oe==null?void 0:Oe.type]||"sem texto"),1)],2)):e$b.createCommentVNode("",!0)]))),128))])}}},_sfc_main$P={},_hoisted_1$K={class:"media-hover-frame"};function _sfc_render$2(ee,te){return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$K,[...te[0]||(te[0]=[e$b.createStaticVNode('<svg class="media-corner media-corner-tl" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg><svg class="media-corner media-corner-tr" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg><svg class="media-corner media-corner-bl" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg><svg class="media-corner media-corner-br" viewBox="0 0 24 24" fill="none" stroke="currentColor" data-v-8194d834><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7" data-v-8194d834></path></svg>',4)])])}const MediaHoverFrame=_export_sfc$1(_sfc_main$P,[["render",_sfc_render$2],["__scopeId","data-v-8194d834"]]),_sfc_main$O={props:{content:{type:String,required:!0},isCircle:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},computed:{containerClass(){return this.isCircle?"h-[150px] min-w-[150px]":this.compact?"mx-auto aspect-video h-auto w-[300px] max-w-full":"h-[200px] w-full min-w-[200px]"},loadingClass(){return this.isCircle?"size-full rounded-full":"size-full rounded-xl"},videoClass(){return this.isCircle?"size-full rounded-full object-cover":"size-full rounded-xl object-scale-down"}},data(){return{isLoading:!0,shouldLoad:!1}},mounted(){this.observer=new IntersectionObserver(this.onIntersection,{root:null,rootMargin:"0px",threshold:.5}),this.observer.observe(this.$refs.videoContainer)},beforeUnmount(){var ee;(ee=this.observer)==null||ee.disconnect()},methods:{onIntersection(ee){ee.forEach(te=>{te.isIntersecting&&te.intersectionRatio>=.5&&(this.shouldLoad=!0,this.isLoading=!1,this.observer.unobserve(this.$refs.videoContainer))})}}},_hoisted_1$J=["src","type"];function _sfc_render$1(ee,te,ne,ae,re,oe){return e$b.openBlock(),e$b.createElementBlock("div",{ref:"videoContainer",class:e$b.normalizeClass(["video-container group relative shrink cursor-pointer",oe.containerClass])},[te[2]||(te[2]=e$b.createElementVNode("svg",{class:"absolute inset-0 z-50 m-auto size-[30%] text-gray-100 hover:opacity-70","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.6 5.2A1 1 0 0 0 7 6v12a1 1 0 0 0 1.6.8l8-6a1 1 0 0 0 0-1.6l-8-6Z","clip-rule":"evenodd"})],-1)),re.isLoading?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["flex justify-center bg-base-300 p-3",oe.loadingClass])},[...te[0]||(te[0]=[e$b.createElementVNode("div",{class:"loader m-auto size-12 rounded-full border-4 border-teal-600"},null,-1)])],2)):re.shouldLoad?(e$b.openBlock(),e$b.createElementBlock("video",{key:ne.content,ref:"videoRef",class:e$b.normalizeClass(["bg-base-300",oe.videoClass])},[e$b.createElementVNode("source",{src:ne.content,type:ne.content.type},null,8,_hoisted_1$J),te[1]||(te[1]=e$b.createTextVNode(" Seu navegador não suporta esse vídeo. ",-1))],2)):e$b.createCommentVNode("",!0)],2)}const VideoLazy=_export_sfc$1(_sfc_main$O,[["render",_sfc_render$1]]),_hoisted_1$I=["src"],_hoisted_2$F=["aria-label"],_hoisted_3$B={key:0,class:"ptv-icon",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},_hoisted_4$z=["viewBox"],_hoisted_5$w=["cx","cy","r"],_hoisted_6$s=["cx","cy","r","stroke-dashoffset"],_hoisted_7$o=["cx","cy","r","stroke-width","aria-valuemax","aria-valuenow"],_hoisted_8$k=["cx","cy"],_hoisted_9$h={class:"ptv-time"},RING_WIDTH=4,HOVER_GROWTH=10,PLAYING_GROWTH=44,_sfc_main$N={__name:"MessagePtv",props:{src:{type:String,required:!0},duration:{type:[Number,String],default:0},baseSize:{type:Number,default:200}},setup(ee){const te=ee,ne=e$b.ref(null),ae=e$b.ref(null),re=e$b.ref(!1),oe=e$b.ref(!1),ie=e$b.ref(!1),le=e$b.ref(0),ce=e$b.ref(Number(te.duration)||0),de=e$b.computed(()=>re.value||ie.value?te.baseSize+PLAYING_GROWTH:oe.value?te.baseSize+HOVER_GROWTH:te.baseSize),ue=e$b.computed(()=>de.value/2),be=e$b.computed(()=>ue.value-RING_WIDTH/2),fe=e$b.computed(()=>`${te.src}#t=0.001`),ge=e$b.computed(()=>ce.value?Math.min(le.value/ce.value,1):0),me=e$b.computed(()=>re.value||ie.value||oe.value),pe=e$b.computed(()=>{const Ne=ge.value*2*Math.PI;return{x:ue.value+be.value*Math.cos(Ne),y:ue.value+be.value*Math.sin(Ne)}}),ke=e$b.computed(()=>{const Ne=re.value||ie.value?Math.max(ce.value-le.value,0):ce.value;return`${Math.floor(Ne/60)}:${String(Math.floor(Ne%60)).padStart(2,"0")}`});let ve;function _e(){const Ne=ae.value;Ne&&(le.value=Ne.currentTime,ve=requestAnimationFrame(_e))}function $e(){re.value=!0,cancelAnimationFrame(ve),ve=requestAnimationFrame(_e)}function ye(){re.value=!1,cancelAnimationFrame(ve)}function Ee(){ye(),Ae(0)}function Se(){var Pe;const Ne=(Pe=ae.value)==null?void 0:Pe.duration;Number.isFinite(Ne)&&Ne>0&&(ce.value=Ne)}function Le(){const Ne=ae.value;Ne&&(Ne.paused?Ne.play().catch(()=>ye()):Ne.pause())}function Ae(Ne){const Pe=ae.value;if(!Pe)return;const Be=Math.min(Math.max(Ne,0),ce.value||0);Pe.currentTime=Be,le.value=Be}function De(Ne){var Me;const Pe=(Me=ne.value)==null?void 0:Me.getBoundingClientRect();if(!Pe)return 0;const Be=Math.atan2(Ne.clientX-(Pe.left+Pe.width/2),Pe.top+Pe.height/2-Ne.clientY);return(Be<0?Be+2*Math.PI:Be)/(2*Math.PI)}function Oe(Ne){Ae(De(Ne)*ce.value)}function Ie(){ie.value=!1,window.removeEventListener("pointermove",Oe),window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie)}function ze(Ne){Ne.stopPropagation(),Ne.preventDefault(),ce.value&&(ie.value=!0,Oe(Ne),window.addEventListener("pointermove",Oe),window.addEventListener("pointerup",Ie),window.addEventListener("pointercancel",Ie))}function Ve(Ne){const Pe={ArrowRight:1,ArrowUp:1,ArrowLeft:-1,ArrowDown:-1}[Ne.key]??0;Pe&&(Ne.preventDefault(),Ae(le.value+Pe))}return e$b.onBeforeUnmount(()=>{cancelAnimationFrame(ve),Ie()}),(Ne,Pe)=>(e$b.openBlock(),e$b.createElementBlock("div",{ref_key:"rootEl",ref:ne,class:e$b.normalizeClass(["ptv",{"is-playing":re.value,"is-scrubbing":ie.value}]),style:e$b.normalizeStyle({width:`${de.value}px`,height:`${de.value}px`}),onPointerenter:Pe[0]||(Pe[0]=Be=>oe.value=!0),onPointerleave:Pe[1]||(Pe[1]=Be=>oe.value=!1)},[e$b.createElementVNode("video",{ref_key:"videoRef",ref:ae,class:"ptv-video",src:fe.value,playsinline:"",preload:"metadata",onLoadedmetadata:Se,onPlay:$e,onPause:ye,onEnded:Ee},null,40,_hoisted_1$I),e$b.createElementVNode("button",{type:"button",class:"ptv-toggle","aria-label":re.value?"Pausar vídeo":"Tocar vídeo",onClick:e$b.withModifiers(Le,["stop"])},[re.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$B,[...Pe[2]||(Pe[2]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.6 5.2A1 1 0 0 0 7 6v12a1 1 0 0 0 1.6.8l8-6a1 1 0 0 0 0-1.6l-8-6Z","clip-rule":"evenodd"},null,-1)])]))],8,_hoisted_2$F),(e$b.openBlock(),e$b.createElementBlock("svg",{class:"ptv-ring",viewBox:`0 0 ${de.value} ${de.value}`},[e$b.createElementVNode("circle",{class:"ptv-ring-track",cx:ue.value,cy:ue.value,r:be.value,"stroke-width":RING_WIDTH},null,8,_hoisted_5$w),e$b.createElementVNode("circle",{class:"ptv-ring-progress",cx:ue.value,cy:ue.value,r:be.value,"stroke-width":RING_WIDTH,pathLength:"1","stroke-dasharray":"1","stroke-dashoffset":1-ge.value},null,8,_hoisted_6$s),e$b.createElementVNode("circle",{class:"ptv-scrub",cx:ue.value,cy:ue.value,r:be.value,"stroke-width":RING_WIDTH*4,role:"slider",tabindex:"0","aria-label":"Posição do vídeo","aria-valuemin":"0","aria-valuemax":Math.round(ce.value),"aria-valuenow":Math.round(le.value),onPointerdown:ze,onKeydown:Ve},null,40,_hoisted_7$o),me.value?(e$b.openBlock(),e$b.createElementBlock("circle",{key:0,class:"ptv-knob",cx:pe.value.x,cy:pe.value.y,r:RING_WIDTH},null,8,_hoisted_8$k)):e$b.createCommentVNode("",!0)],8,_hoisted_4$z)),e$b.createElementVNode("span",_hoisted_9$h,e$b.toDisplayString(ke.value),1)],38))}},MessagePtv=_export_sfc$1(_sfc_main$N,[["__scopeId","data-v-4481c02f"]]),_hoisted_1$H={class:"sidebar rounded shadow transition duration-150 ease-in-out"},_hoisted_2$E={class:"flex items-center gap-4 p-1"},_hoisted_3$A=["href","download","title"],_hoisted_4$y={class:"max-w-28 pr-3 md:max-w-32"},_hoisted_5$v={class:"line-clamp-2 truncate"},_hoisted_6$r=["href","download","title"],_sfc_main$M={__name:"MessageFileCard",props:{file:{type:Object,default:()=>({})}},emits:["download"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.computed(()=>{var oe,ie,le,ce;return((oe=ne.file)==null?void 0:oe.title)||((ie=ne.file)==null?void 0:ie.name)||((le=ne.file)==null?void 0:le.filename)||((ce=ne.file)==null?void 0:ce.original_name)||"arquivo"});return(oe,ie)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$H,[e$b.createElementVNode("div",_hoisted_2$E,[e$b.createElementVNode("a",{href:ee.file.url,download:re.value,title:re.value,onClick:ie[0]||(ie[0]=e$b.withModifiers(le=>ae("download",ee.file,re.value),["prevent"]))},[...ie[2]||(ie[2]=[e$b.createElementVNode("svg",{class:"header size-14 rounded p-1 text-primary","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-7Zm3 2h2.01v2.01h-2V8h2v2.01h-2V12h2v2.01h-2V16h2v2.01h-2v2H12V18h2v-1.99h-2V14h2v-1.99h-2V10h2V8.01h-2V6h2V4Z","clip-rule":"evenodd"})],-1)])],8,_hoisted_3$A),e$b.createElementVNode("main",_hoisted_4$y,[e$b.createElementVNode("p",_hoisted_5$v,e$b.toDisplayString(re.value),1),e$b.createElementVNode("a",{target:"_blank",class:"cursor-pointer text-primary hover:underline",href:ee.file.url,download:re.value,title:re.value,onClick:ie[1]||(ie[1]=e$b.withModifiers(le=>ae("download",ee.file,re.value),["prevent"]))}," Baixar arquivo ",8,_hoisted_6$r)])])]))}},_hoisted_1$G={key:1,class:"flex items-center justify-center text-xs opacity-60"},_hoisted_2$D={key:2,class:"loader-dots relative my-2 block h-5 w-14"},_sfc_main$L={__name:"MessageTgSticker",props:{content:{type:Object,default:()=>({})},variant:{type:String,default:"chat"}},setup(ee){const te=e$b.defineAsyncComponent(async()=>(await Promise.resolve().then(()=>vue3Lottie_es)).Vue3Lottie),ne=ee,ae=e$b.ref(null),re=e$b.ref(!1),oe=e$b.computed(()=>ne.variant==="thumbnail"?96:ne.variant==="composer"?180:220),ie=e$b.computed(()=>ne.variant==="chat"?"flex items-center justify-center p-1":"flex size-full items-center justify-center");return e$b.watch(()=>{var le;return(le=ne.content)==null?void 0:le.url},async le=>{if(ae.value=null,re.value=!1,!!le)try{const[{ungzip:ce},de]=await Promise.all([Promise.resolve().then(()=>pako),fetch(le)]),ue=ce(new Uint8Array(await de.arrayBuffer()));ae.value=JSON.parse(new TextDecoder("utf-8").decode(ue))}catch{re.value=!0}},{immediate:!0}),(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(ie.value)},[ae.value?(e$b.openBlock(),e$b.createBlock(e$b.unref(te),{key:0,speed:1,"animation-data":ae.value,height:oe.value,width:oe.value,loop:"",autoplay:""},null,8,["animation-data","height","width"])):re.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$G," Figurinha indisponível ")):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$D,[...ce[0]||(ce[0]=[e$b.createElementVNode("div",{class:"loader-dot"},null,-1),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.2s]"},null,-1),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.4s]"},null,-1)])]))],2))}},MessageTgSticker=_export_sfc$1(_sfc_main$L,[["__scopeId","data-v-b1c4fd4b"]]),GIF_TYPES$1=new Set(["gif","image/gif"]),STICKER_TYPES=new Set(["image/webp","webp"]),TG_STICKER_TYPES=new Set(["application/x-tgsticker","x-tgsticker"]),HEIF_TYPES=new Set(["heif","heic","image/heif","image/heic"]),AUDIO_TYPES=new Set(["audio","audio/mpeg","audio/ogg","audio/wav","audio/mp3","mpeg","mp3","ogg","wav","aac","webm"]),VIDEO_TYPES=new Set(["video","video/mp4","mp4"]),IMAGE_TYPES=new Set(["image","image/jpeg","jpeg","image/png","png","jpg"]),MIME_BY_EXTENSION={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",heif:"image/heif",heic:"image/heic",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",mov:"video/quicktime",m4v:"video/x-m4v",avi:"video/x-msvideo",mkv:"video/x-matroska",mp3:"audio/mpeg",wav:"audio/wav",m4a:"audio/mp4",aac:"audio/aac",pdf:"application/pdf"};function normalizeMediaValue(ee){return typeof ee=="string"?ee.trim().toLowerCase():""}function inferMimeTypeFromName(ee,te=""){const ne=normalizeMediaValue(ee).split(".").pop()||"";return MIME_BY_EXTENSION[ne]||te}function resolveFileMimeType(ee="",te="",ne=""){return normalizeMediaValue(typeof te=="string"?te:te==null?void 0:te.type)||inferMimeTypeFromName(ee,ne)}function mediaItemName(ee){var te,ne,ae,re;return normalizeMediaValue(((te=ee==null?void 0:ee.content)==null?void 0:te.title)||((ne=ee==null?void 0:ee.content)==null?void 0:ne.name)||((ae=ee==null?void 0:ee.content)==null?void 0:ae.filename)||((re=ee==null?void 0:ee.content)==null?void 0:re.original_name)||(ee==null?void 0:ee.title)||(ee==null?void 0:ee.name)||(ee==null?void 0:ee.fileName)||(ee==null?void 0:ee.filename)||(ee==null?void 0:ee.original_name)||"")}function resolveMediaType(ee){var ne,ae;const te=normalizeMediaValue(((ne=ee==null?void 0:ee.content)==null?void 0:ne.type)||(ee==null?void 0:ee.type)||((ae=ee==null?void 0:ee.mimeType)==null?void 0:ae.type)||(ee==null?void 0:ee.mimeType)||"");return te||inferMimeTypeFromName(mediaItemName(ee))}function isHeif(ee){const te=resolveMediaType(ee);return HEIF_TYPES.has(te)||/\.(heif|heic)$/i.test(mediaItemName(ee))}function shouldRenderHeifAsVideo(ee,te="web"){return isHeif(ee)&&normalizeMediaValue(te)!=="ios"}function isSticker(ee){return STICKER_TYPES.has(resolveMediaType(ee))}function isTgSticker(ee){return TG_STICKER_TYPES.has(resolveMediaType(ee))||/\.tgs(ticker)?$/i.test(mediaItemName(ee))}function isVideo(ee){const te=resolveMediaType(ee);return VIDEO_TYPES.has(te)||/^video\//i.test(te)}function isPtv(ee){var te;return isVideo(ee)&&!!(((te=ee==null?void 0:ee.content)==null?void 0:te.isptv)??(ee==null?void 0:ee.isptv))}function isGif(ee){var ne;const te=resolveMediaType(ee);return isVideo(ee)&&((ne=ee==null?void 0:ee.content)==null?void 0:ne.is_gif)||GIF_TYPES$1.has(te)}function isImage(ee){const te=resolveMediaType(ee);return!te||isSticker(ee)||isGif(ee)?!1:isHeif(ee)||IMAGE_TYPES.has(te)||te.startsWith("image/")}function isAudio(ee){const te=resolveMediaType(ee);return AUDIO_TYPES.has(te)||/^audio\//i.test(te)}const GIF_TYPES=["gif","image/gif"];function getMimeType(ee){var te;return normalizeMediaValue(typeof(ee==null?void 0:ee.type)=="string"?ee.type:(te=ee==null?void 0:ee.content)==null?void 0:te.type)}function isGifLike(ee){return GIF_TYPES.includes(getMimeType(ee))}function useVideoPreview(ee,te="web"){return isHeif(ee)?shouldRenderHeifAsVideo(ee,te):isGifLike(ee)}function useImagePreview(ee,te="web"){return isHeif(ee)?!shouldRenderHeifAsVideo(ee,te):!isGifLike(ee)}function previewMediaSrc(ee,te="web"){var ne,ae,re,oe;return useVideoPreview(ee,te)?(ee==null?void 0:ee.blobUrl)||((ne=ee==null?void 0:ee.content)==null?void 0:ne.data64)||(ee==null?void 0:ee.data64)||((ae=ee==null?void 0:ee.content)==null?void 0:ae.url)||(ee==null?void 0:ee.url):((re=ee==null?void 0:ee.content)==null?void 0:re.data64)||(ee==null?void 0:ee.data64)||((oe=ee==null?void 0:ee.content)==null?void 0:oe.url)||(ee==null?void 0:ee.url)}function messageCaption(ee){return(ee==null?void 0:ee.caption)||(ee==null?void 0:ee.text)||""}const _hoisted_1$F={key:0},_hoisted_2$C=["alt"],_hoisted_3$z=["src","alt"],_hoisted_4$x=["src"],_hoisted_5$u=["src"],_hoisted_6$q=["src"],_hoisted_7$n=["aria-label"],_hoisted_8$j=["src"],_hoisted_9$g=["aria-label"],_hoisted_10$f=["src"],_hoisted_11$e={class:"pdf-mobile-header"},_hoisted_12$c={class:"min-w-0"},_hoisted_13$a={class:"truncate text-sm font-medium"},_hoisted_14$9={key:1,class:"renderer-loading"},CHAT_IMAGE_MAX_HEIGHT=300,_sfc_main$K={__name:"MessageFileRenderer",props:{message:{type:Object,required:!0},variant:{type:String,default:"chat"},showCaption:{type:Boolean,default:!0},interactive:{type:Boolean,default:!0}},emits:["expand","open-native-pdf","download","error"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useMessageUiStore(),oe=e$b.computed(()=>re.deviceType),ie=e$b.computed(()=>{var mt;return((mt=ne.message)==null?void 0:mt.content)||{}}),le=e$b.computed(()=>{var mt;return String(((mt=ie.value)==null?void 0:mt.type)||"").toLowerCase()}),ce=e$b.computed(()=>previewMediaSrc(ie.value,oe.value)),de=e$b.computed(()=>oe.value!=="ios"&&!isImageSourcePreloaded(ce.value)),ue=e$b.computed(()=>{var mt,je;return((mt=ie.value)==null?void 0:mt.data64)||((je=ie.value)==null?void 0:je.url)||""}),be=e$b.computed(()=>messageCaption(ie.value)),fe=e$b.computed(()=>{var mt,je,Qe,ut;return((mt=ie.value)==null?void 0:mt.title)||((je=ie.value)==null?void 0:je.name)||((Qe=ie.value)==null?void 0:Qe.filename)||((ut=ie.value)==null?void 0:ut.original_name)||"arquivo"}),ge=e$b.computed(()=>Object.keys(ie.value||{}).length>0),me=e$b.computed(()=>re.isWebDevice),pe=e$b.computed(()=>ne.variant==="composer"),ke=e$b.computed(()=>ne.variant==="thumbnail"),ve=e$b.computed(()=>ne.interactive&&!ke.value),_e=e$b.computed(()=>isHeif(ie.value)&&useVideoPreview(ie.value,oe.value)),$e=e$b.computed(()=>ve.value&&!isSticker(ne.message)&&!_e.value),ye=e$b.computed(()=>["application/pdf","pdf"].includes(le.value)),Ee=e$b.computed(()=>["gif","image/gif"].includes(le.value)),Se=e$b.computed(()=>{if(ye.value)return"pdf";if(isAudio(ne.message))return"audio";if(isTgSticker(ne.message))return"sticker";if(isSticker(ne.message))return"image";if(isImage(ne.message))return useVideoPreview(ie.value,oe.value)?"video":"image";if(isPtv(ne.message)&&ne.variant==="chat")return"ptv";if(isVideo(ne.message))return"video";if(isGif(ne.message)){if(Ee.value||useImagePreview(ie.value,oe.value))return"image";if(useVideoPreview(ie.value,oe.value))return"video"}return"file"}),Le=e$b.computed(()=>ne.showCaption&&!!be.value&&!pe.value&&!ke.value),Ae=e$b.computed(()=>Se.value==="video"?"Abrir vídeo":"Ampliar"),De=e$b.computed(()=>`${Ae.value}: ${fe.value}`),Oe=e$b.computed(()=>ke.value?"renderer renderer-thumbnail":pe.value?"renderer renderer-composer":"renderer renderer-chat"),Ie=e$b.computed(()=>ke.value?"media-surface media-surface-thumbnail":pe.value?"media-surface media-surface-composer":"media-surface media-surface-chat"),ze=e$b.computed(()=>ke.value?"icon-surface icon-surface-thumbnail":"icon-surface"),Ve=e$b.computed(()=>isSticker(ne.message)&&!ke.value?"media-image-sticker":ke.value?"media-image media-image-thumbnail":pe.value?"media-image media-image-composer":"media-image media-image-chat"),Ne=e$b.computed(()=>ke.value?"media-video-heif-thumbnail":pe.value?"media-video-heif-composer":"media-video-heif-chat"),Pe=e$b.computed(()=>$e.value&&ne.variant==="chat"&&(Se.value==="image"||Se.value==="video")),Be=e$b.computed(()=>Se.value==="video"?"renderer-caption pt-2":"renderer-caption"),Me=e$b.computed(()=>pe.value?"pdf-shell pdf-shell-composer":"pdf-shell"),xe=e$b.computed(()=>pe.value?"file-shell file-shell-composer":"file-shell"),Ce={w:260,h:195},Fe=e$b.ref(null),Re=e$b.ref(isImageSourcePreloaded(ce.value));e$b.watch(ce,mt=>{Fe.value=null,Re.value=isImageSourcePreloaded(mt)});const qe=e$b.computed(()=>ne.variant==="chat"&&Se.value==="image"&&!isSticker(ne.message)),Ge=e$b.computed(()=>Fe.value||mediaSizeFromContent(ie.value,ce.value)),Ze=e$b.computed(()=>{if(!qe.value)return null;const mt=Ge.value||Ce,je=Math.min(mt.h,CHAT_IMAGE_MAX_HEIGHT);return{width:`${Math.round(je*mt.w/mt.h)}px`,maxWidth:"100%",aspectRatio:`${mt.w} / ${mt.h}`}}),Xe=e$b.computed(()=>qe.value?"media-image-reserved":""),Ue=e$b.computed(()=>Re.value?"media-image-revealed":"media-image-revealing"),at=e$b.computed(()=>qe.value&&!Re.value);function Je(mt){const je=mt.target,{naturalWidth:Qe,naturalHeight:ut}=je;!Qe||!ut||sameMediaSource(je.currentSrc||je.src,ce.value)&&(Fe.value={w:Qe,h:ut},rememberMediaSize(ce.value,Qe,ut))}function lt(){Re.value=!0}async function it(mt){Je(mt);const je=mt.target,Qe=je.currentSrc||je.src;if(!(de.value&&!sameMediaSource(Qe,ce.value))){if(typeof je.decode=="function"){try{await je.decode()}catch{}if(!sameMediaSource(je.currentSrc||je.src,Qe))return}lt()}}function gt(mt){$e.value&&ae("expand",ne.message,mt)}function Et(mt){const je=(mt==null?void 0:mt.data64)||(mt==null?void 0:mt.url);if(!je||String(je).startsWith("undefined")){ae("error","PDF inválido.");return}if(!me.value){ae("open-native-pdf",je);return}N$3.show([{src:je,type:"iframe",caption:mt.caption||mt.title||"Documento PDF"}],{Carousel:{Toolbar:{display:{left:["counter"],middle:[],right:["toggleFull","close"]}}},Html:{videoTpl:'<iframe src="{{src}}" width="90%" height="85vh" style="border-radius: 12px; border: none;"></iframe>'},dragToClose:!1})}return(mt,je)=>{var ut,dt,pt,tt;const Qe=e$b.resolveDirective("lazy");return ge.value?(e$b.openBlock(),e$b.createElementBlock("section",{key:0,class:e$b.normalizeClass(Oe.value)},[(ut=ie.value)!=null&&ut.story_reply?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$F,[...je[5]||(je[5]=[e$b.createElementVNode("p",{class:"italic opacity-70"},"Resposta de stories",-1)])])):e$b.createCommentVNode("",!0),Se.value==="image"?(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent($e.value?"button":"div"),{key:1,type:$e.value?"button":void 0,class:e$b.normalizeClass([Ie.value,$e.value?"group":"",at.value?"media-surface-pending":""]),style:e$b.normalizeStyle(Ze.value),"aria-label":$e.value?De.value:void 0,onClick:je[0]||(je[0]=We=>$e.value&>(!1))},{default:e$b.withCtx(()=>[de.value?e$b.withDirectives((e$b.openBlock(),e$b.createElementBlock("img",{key:0,alt:fe.value,class:e$b.normalizeClass([Ve.value,Xe.value,Ue.value]),decoding:"async",onLoad:it,onError:lt},null,42,_hoisted_2$C)),[[Qe,ce.value]]):(e$b.openBlock(),e$b.createElementBlock("img",{key:1,src:ce.value,alt:fe.value,class:e$b.normalizeClass([Ve.value,Xe.value,Ue.value]),decoding:"async",onLoad:it,onError:lt},null,42,_hoisted_3$z)),Pe.value?(e$b.openBlock(),e$b.createBlock(MediaHoverFrame,{key:2})):e$b.createCommentVNode("",!0)]),_:1},8,["type","class","style","aria-label"])):Se.value==="ptv"?(e$b.openBlock(),e$b.createBlock(MessagePtv,{key:2,src:ce.value,duration:(dt=ie.value)==null?void 0:dt.duration},null,8,["src","duration"])):Se.value==="video"?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:3},[_e.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(Ie.value)},[e$b.createElementVNode("video",{class:e$b.normalizeClass(["media-video media-video-heif",Ne.value]),src:ce.value,autoplay:"",muted:"",loop:"",playsinline:""},null,10,_hoisted_4$x)],2)):ke.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(Ie.value)},[e$b.createElementVNode("video",{class:e$b.normalizeClass(["media-video media-video-thumbnail",{"media-video-ptv":(pt=ie.value)==null?void 0:pt.isptv}]),src:ce.value,autoplay:"",muted:"",loop:"",playsinline:""},null,10,_hoisted_5$u)],2)):pe.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:2,class:e$b.normalizeClass(Ie.value)},[e$b.createElementVNode("video",{class:"media-video",src:ce.value,controls:"",autoplay:"",muted:"",loop:"",playsinline:""},null,8,_hoisted_6$q)],2)):$e.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:3,type:"button",class:"video-trigger group","aria-label":De.value,onClick:je[1]||(je[1]=We=>gt(!0))},[e$b.createVNode(VideoLazy,{content:ce.value,"is-circle":(tt=ie.value)==null?void 0:tt.isptv,compact:ee.variant==="chat"},null,8,["content","is-circle","compact"]),Pe.value?(e$b.openBlock(),e$b.createBlock(MediaHoverFrame,{key:0})):e$b.createCommentVNode("",!0)],8,_hoisted_7$n)):(e$b.openBlock(),e$b.createElementBlock("div",{key:4,class:e$b.normalizeClass(Ie.value)},[e$b.createElementVNode("video",{class:"media-video media-video-thumbnail",src:ce.value,autoplay:"",muted:"",loop:"",playsinline:""},null,8,_hoisted_8$j)],2))],64)):Se.value==="pdf"?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:4},[ke.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(ze.value)},[...je[6]||(je[6]=[e$b.createElementVNode("svg",{class:"size-14 text-red-500",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"})],-1)])],2)):me.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(Me.value)},[e$b.createElementVNode("button",{type:"button",class:e$b.normalizeClass(Ie.value),"aria-label":`Abrir PDF ${fe.value}`,onClick:je[2]||(je[2]=We=>Et(ie.value))},[ue.value&&!ue.value.startsWith("undefined")?(e$b.openBlock(),e$b.createElementBlock("iframe",{key:0,src:`${ue.value}#toolbar=0&navpanes=0`,class:"pdf-frame",loading:"lazy"},null,8,_hoisted_10$f)):e$b.createCommentVNode("",!0),je[7]||(je[7]=e$b.createElementVNode("div",{class:"absolute inset-0 flex items-end justify-start bg-gradient-to-t from-black/50 to-transparent p-2 transition-opacity"},[e$b.createElementVNode("span",{class:"flex items-center gap-1.5 rounded-md border border-gray-600 bg-gray-500/80 px-2.5 py-1 text-xs font-medium text-white shadow backdrop-blur-sm"},[e$b.createElementVNode("svg",{class:"size-3.5 shrink-0",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Abrir PDF ")])],-1))],10,_hoisted_9$g)],2)):(e$b.openBlock(),e$b.createElementBlock("button",{key:2,type:"button",class:"pdf-mobile-card",onClick:je[3]||(je[3]=We=>ae("open-native-pdf",ue.value))},[e$b.createElementVNode("div",_hoisted_11$e,[je[9]||(je[9]=e$b.createElementVNode("svg",{class:"size-5 shrink-0",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2 2 2 0 0 0 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.376A2.626 2.626 0 0 0 15 15.375v-1.75A2.626 2.626 0 0 0 12.375 11H11Zm1 5v-3h.375a.626.626 0 0 1 .625.626v1.748a.625.625 0 0 1-.626.626H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z","clip-rule":"evenodd"})],-1)),e$b.createElementVNode("div",_hoisted_12$c,[e$b.createElementVNode("p",_hoisted_13$a,e$b.toDisplayString(fe.value),1),je[8]||(je[8]=e$b.createElementVNode("p",{class:"text-xs opacity-75"},"Toque para abrir o documento",-1))])])]))],64)):Se.value==="sticker"?(e$b.openBlock(),e$b.createElementBlock("div",{key:5,class:e$b.normalizeClass(ze.value)},[e$b.createVNode(MessageTgSticker,{content:ie.value,variant:ee.variant},null,8,["content","variant"])],2)):Se.value==="audio"?(e$b.openBlock(),e$b.createElementBlock("div",{key:6,class:e$b.normalizeClass(ze.value)},[...je[10]||(je[10]=[e$b.createElementVNode("svg",{class:"size-14 text-primary",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 7V2.221a2 2 0 0 0-.5.365L4.586 6.5a2 2 0 0 0-.365.5H9Zm2 0V2h7a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9h5a2 2 0 0 0 2-2Zm2.318.052h-.002A1 1 0 0 0 12 8v5.293A4.033 4.033 0 0 0 10.5 13C8.787 13 7 14.146 7 16s1.787 3 3.5 3 3.5-1.146 3.5-3c0-.107-.006-.211-.017-.313A1.04 1.04 0 0 0 14 15.5V9.766c.538.493 1 1.204 1 2.234a1 1 0 1 0 2 0c0-1.881-.956-3.14-1.86-3.893a6.4 6.4 0 0 0-1.636-.985 4.009 4.009 0 0 0-.165-.063l-.014-.005-.005-.001-.002-.001ZM9 16c0-.356.452-1 1.5-1s1.5.644 1.5 1-.452 1-1.5 1S9 16.356 9 16Z","clip-rule":"evenodd"})],-1)])],2)):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:7},[ke.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(ze.value)},[...je[11]||(je[11]=[e$b.createElementVNode("svg",{class:"size-14 text-primary",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2.221V7H4.221a2 2 0 0 1 .365-.5L8.5 2.586A2 2 0 0 1 9 2.22ZM11 2v5a2 2 0 0 1-2 2H4v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-7Z","clip-rule":"evenodd"})],-1)])],2)):(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(xe.value)},[e$b.createVNode(_sfc_main$M,{file:ie.value,onDownload:je[4]||(je[4]=(We,Ke)=>ae("download",We,Ke))},null,8,["file"])],2))],64)),Le.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:8,class:e$b.normalizeClass(Be.value)},[e$b.createVNode(MessageMarkdown,{content:be.value},null,8,["content"])],2)):e$b.createCommentVNode("",!0)],2)):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_14$9,[...je[12]||(je[12]=[e$b.createElementVNode("div",{class:"loader-dots relative my-2 block h-5 w-20"},[e$b.createElementVNode("div",{class:"loader-dot"}),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.2s]"}),e$b.createElementVNode("div",{class:"loader-dot [animation-delay:.4s]"})],-1)])]))}}},MessageFileRenderer=_export_sfc$1(_sfc_main$K,[["__scopeId","data-v-daf5c706"]]),_hoisted_1$E={class:"sm-quote-content"},_hoisted_2$B={key:1,class:"sm-quote-description"},_hoisted_3$y={key:0,class:"sm-quote-author message-self-name"},_hoisted_4$w={key:2,class:"sm-quote-line"},_hoisted_5$t={class:"sm-quote-icon","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_6$p=["d"],_hoisted_7$m={key:3,class:"sm-quote-line sm-quote-line--kind"},_hoisted_8$i=["fill","stroke","stroke-width"],_hoisted_9$f=["d"],_hoisted_10$e={key:2},_hoisted_11$d={key:4,class:"sm-quote-template"},_hoisted_12$b={key:0,class:"font-semibold"},_hoisted_13$9=["src"],_hoisted_14$8={key:2,class:"opacity-70"},_hoisted_15$7={key:5,class:"mt-3 flex justify-between px-3"},_hoisted_16$6={key:0,class:"sm-quote-media"},_sfc_main$J={__name:"MessageQuote",props:{message:{type:Object,required:!0},isMessage:{type:Boolean,default:!1},messageId:{type:String,required:!1,default:null},attendant:{type:[Object,null],required:!1,default:null},chatId:{type:String,required:!1,default:null}},emits:["go"],setup(ee,{emit:te}){const ne=te,ae=ee,re=/^https:\/\/[^\s/$.?#].[^\s]*$/i,oe={audio:{label:"",icon:null},image:{label:"Foto",icon:"image"},sticker:{label:"Figurinha",icon:"sticker"},video:{label:"Vídeo",icon:"video"},gif:{label:"GIF",icon:"video"},pdf:{label:"PDF",icon:"pdf"},file:{label:"Arquivo",icon:"file"}},ie=["M5 8c.6 0 1 .4 1 1v3a4 4 0 0 0 4 4h4a4 4 0 0 0 4-4V9a1 1 0 1 1 2 0v3a6 6 0 0 1-6 6h-1v2h2a1 1 0 1 1 0 2H9a1 1 0 1 1 0-2h2v-2h-1a6 6 0 0 1-6-6V9c0-.6.4-1 1-1Z","M7 6a4 4 0 0 1 4-4h2a4 4 0 0 1 4 4v5a4 4 0 0 1-4 4h-2a4 4 0 0 1-4-4V6Z"],le={image:"M7.5 4.6A2 2 0 0 1 8.9 4h6.2c.5 0 1 .2 1.4.6L17.9 6H19a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8c0-1.1.9-2 2-2h1l1.5-1.4ZM10 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm2-4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z",sticker:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25z",video:"M19 3a2 2 0 0 1 2 2v2h-2V5.4L17.4 7h-2.8l2-2h-2.2l-2 2H9.6l2-2H9.4l-2 2H3V5c0-1.1.9-2 2-2h14ZM3 9v10c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V9H3Zm2-2.4L6.6 5H5v1.6ZM9.6 11a1 1 0 0 1 1 .1l4 3a1 1 0 0 1 0 1.6l-4 3A1 1 0 0 1 9 18v-6c0-.4.2-.7.6-.9Z",pdf:"M9 2.2V7H4.2l.4-.5 3.9-4 .5-.3Zm2-.2v5a2 2 0 0 1-2 2H4a2 2 0 0 0-2 2v7c0 1.1.9 2 2 2 0 1.1.9 2 2 2h12a2 2 0 0 0 2-2 2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2V4a2 2 0 0 0-2-2h-7Zm-6 9a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h.5a2.5 2.5 0 0 0 0-5H5Zm1.5 3H6v-1h.5a.5.5 0 0 1 0 1Zm4.5-3a1 1 0 0 0-1 1v5c0 .6.4 1 1 1h1.4a2.6 2.6 0 0 0 2.6-2.6v-1.8a2.6 2.6 0 0 0-2.6-2.6H11Zm1 5v-3h.4a.6.6 0 0 1 .6.6v1.8a.6.6 0 0 1-.6.6H12Zm5-5a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-1h1a1 1 0 1 0 0-2h-1v-1h1a1 1 0 1 0 0-2h-2Z",file:"M9 2.2V7H4.2l.4-.5 3.9-4 .5-.3Zm2-.2v5a2 2 0 0 1-2 2H4v11c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-7Z"},ce=useMessageUiStore(),de=e$b.computed(()=>ce.deviceType),ue=e$b.computed(()=>{var De;return((De=ce.loggedAttendant)==null?void 0:De.name)??""}),be=e$b.computed(()=>{var De;return((De=ae.message)==null?void 0:De.type)??""}),fe=e$b.computed(()=>be.value==="pdf"),ge=e$b.computed(()=>be.value==="voice_call"),me=e$b.computed(()=>{const De=ae.message;return isAudio(De)?"audio":isImage(De)?"image":isSticker(De)||isTgSticker(De)?"sticker":isVideo(De)?"video":isGif(De)?"gif":fe.value?"pdf":"file"}),pe=e$b.computed(()=>me.value==="audio"?null:le[oe[me.value].icon]),ke=e$b.computed(()=>oe[me.value].label),ve=e$b.computed(()=>messageCaption(ae.message)),_e=e$b.computed(()=>!!be.value&&!ge.value),$e=e$b.computed(()=>["image","sticker","video","gif","pdf"].includes(me.value)&&!!be.value),ye=e$b.computed(()=>{var De;return{type:((De=ae.message)==null?void 0:De.type)||"document",content:ae.message||{}}}),Ee=e$b.computed(()=>{var ze,Ve,Ne,Pe,Be;const De=ae.message||{},Oe=ae.isMessage?((ze=ae.attendant)==null?void 0:ze.name)||((Ve=De==null?void 0:De.sender)==null?void 0:Ve.name):((Ne=De==null?void 0:De.sent_by)==null?void 0:Ne.name)||((Pe=De==null?void 0:De.sender)==null?void 0:Pe.name);return Oe?(ae.isMessage||!!((Be=De==null?void 0:De.sent_by)!=null&&Be.name))&&Oe===ue.value?"Você":Oe:""}),Se=e$b.computed(()=>{var ze;const De=Number((ze=ae.message)==null?void 0:ze.duration);if(!Number.isFinite(De)||De<0)return"00:00";const Oe=Math.floor(De/60),Ie=Math.floor(De%60);return`${String(Oe).padStart(2,"0")}:${String(Ie).padStart(2,"0")}`});function Le(De){return typeof De!="string"?!1:re.test(De.trim())}function Ae(){ae.isMessage&&ne("go",ae.messageId,ae.chatId)}return(De,Oe)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["sm-quote",[ee.isMessage?"sm-quote--reply":"sm-quote--composer header",!ee.isMessage&&de.value!=="web"?"mb-2 rounded-xl":"",!ee.isMessage&&de.value==="web"?"rounded-t-xl":""]])},[(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.isMessage?"button":"div"),{type:ee.isMessage?"button":void 0,class:"sm-quote-card",onClick:Ae},{default:e$b.withCtx(()=>[e$b.createElementVNode("div",_hoisted_1$E,[Ee.value?(e$b.openBlock(),e$b.createElementBlock("p",{key:0,class:"sm-quote-author message-sender-name",style:e$b.normalizeStyle(e$b.unref(senderColorStyle)(Ee.value))},e$b.toDisplayString(Ee.value),5)):e$b.createCommentVNode("",!0),ee.message.description?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$B,[ee.isMessage?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$y,"Você")):e$b.createCommentVNode("",!0),e$b.createVNode(MessageMarkdown,{content:ee.message.description},null,8,["content"])])):e$b.createCommentVNode("",!0),me.value==="audio"?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_4$w,[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_5$t,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie,Ie=>e$b.createElementVNode("path",{key:Ie,d:Ie},null,8,_hoisted_6$p)),64))])),e$b.createTextVNode(" "+e$b.toDisplayString(Se.value),1)])):e$b.createCommentVNode("",!0),_e.value?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$m,[pe.value?(e$b.openBlock(),e$b.createElementBlock("svg",{key:0,class:"sm-quote-icon","aria-hidden":"true",viewBox:"0 0 24 24",fill:me.value==="sticker"?"none":"currentColor",stroke:me.value==="sticker"?"currentColor":void 0,"stroke-width":me.value==="sticker"?1.5:void 0,"stroke-linecap":"round","stroke-linejoin":"round"},[e$b.createElementVNode("path",{d:pe.value,"fill-rule":"evenodd","clip-rule":"evenodd"},null,8,_hoisted_9$f)],8,_hoisted_8$i)):e$b.createCommentVNode("",!0),ve.value?(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ve.value},null,8,["content"])):ke.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_10$e,e$b.toDisplayString(ke.value),1)):e$b.createCommentVNode("",!0)])):ee.message.template?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_11$d,[ee.message.template.header?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_12$b,[Le(ee.message.template.header)?(e$b.openBlock(),e$b.createElementBlock("img",{key:0,src:ee.message.template.header,class:"h-auto max-w-full rounded"},null,8,_hoisted_13$9)):(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.template.header},null,8,["content"]))])):e$b.createCommentVNode("",!0),ee.message.template.body?(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:1,content:ee.message.template.body},null,8,["content"])):e$b.createCommentVNode("",!0),ee.message.template.footer?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_14$8,[e$b.createVNode(MessageMarkdown,{content:ee.message.template.footer},null,8,["content"])])):e$b.createCommentVNode("",!0)])):ge.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_15$7,[e$b.createVNode(_sfc_main$Q,{content:ee.message},null,8,["content"])])):(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:6,content:ee.message.text},null,8,["content"]))]),$e.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$6,[e$b.createVNode(MessageFileRenderer,{message:ye.value,variant:"thumbnail",interactive:!1,"show-caption":!1},null,8,["message"])])):e$b.createCommentVNode("",!0)]),_:1},8,["type"])),ee.isMessage?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("button",{key:0,class:"sm-quote-close",title:"Fechar",type:"button",onClick:Oe[0]||(Oe[0]=Ie=>e$b.unref(ce).clearQuote())},[...Oe[1]||(Oe[1]=[e$b.createElementVNode("svg",{class:"size-5","aria-hidden":"true",viewBox:"0 0 24 24",fill:"none"},[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18 18 6m0 12L6 6"})],-1)])]))],2))}},MessageQuote=_export_sfc$1(_sfc_main$J,[["__scopeId","data-v-d51d74c6"]]);function viewSingleImage(ee,te=""){ee&&N$3.show([{src:ee,type:"image",caption:te}])}const _hoisted_1$D={class:"mx-auto"},_hoisted_2$A={key:0,class:"mb-1 flex items-center opacity-95"},_hoisted_3$x={class:"mb-2 overflow-hidden max-h-[400px] rounded-md bg-base-300 dark:shadow-gray-500 relative"},_hoisted_4$v=["href"],_hoisted_5$s={key:0,class:"text-start"},_hoisted_6$o={key:1,class:"text-white font-normal hover:font-medium transition-all ease-in-out select-none"},_hoisted_7$l=["src"],_sfc_main$I={__name:"MessageAd",props:{message:{type:Object,required:!0},from_me:{type:Boolean,required:!0}},setup(ee){function te(ne){try{return ne.split("/")[2]}catch{return ne}}return(ne,ae)=>{var re,oe,ie,le,ce;return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$D,[(re=ee.message.ad_info)!=null&&re.sourceUrl?(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_2$A,[...ae[1]||(ae[1]=[e$b.createElementVNode("svg",{class:"mr-2 size-5 rotate-90","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2a1 1 0 0 1 .932.638l7 18a1 1 0 0 1-1.326 1.281L13 19.517V13a1 1 0 1 0-2 0v6.517l-5.606 2.402a1 1 0 0 1-1.326-1.281l7-18A1 1 0 0 1 12 2Z","clip-rule":"evenodd"})],-1),e$b.createElementVNode("p",{class:"italic"},"Enviada via anúncio",-1)])])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_3$x,[(oe=ee.message.ad_info)!=null&&oe.sourceUrl?(e$b.openBlock(),e$b.createElementBlock("a",{key:0,target:"_blank",rel:"noopener noreferrer",href:ee.message.ad_info.sourceUrl,class:e$b.normalizeClass([ee.from_me?"header":"bg-gray-900/80 dark:bg-primary/10","flex flex-col p-4 px-2 absolute bottom-0 w-full"])},[(ie=ee.message.ad_info)!=null&&ie.title?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_5$s,e$b.toDisplayString(ee.message.ad_info.title),1)):e$b.createCommentVNode("",!0),(le=ee.message.ad_info)!=null&&le.sourceUrl?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_6$o,e$b.toDisplayString(te(ee.message.ad_info.sourceUrl)),1)):e$b.createCommentVNode("",!0)],10,_hoisted_4$v)):e$b.createCommentVNode("",!0),(ce=ee.message.ad_info)!=null&&ce.thumbnailUrl?(e$b.openBlock(),e$b.createElementBlock("img",{key:1,class:"mx-auto cursor-pointer object-scale-down",src:ee.message.ad_info.thumbnailUrl,onClick:ae[0]||(ae[0]=de=>e$b.unref(viewSingleImage)(ee.message.ad_info.thumbnailUrl))},null,8,_hoisted_7$l)):e$b.createCommentVNode("",!0)]),e$b.createVNode(MessageMarkdown,{content:ee.message.text},null,8,["content"])])}}},_hoisted_1$C={class:"mx-auto mb-2"},_hoisted_2$z=["href"],_hoisted_3$w={class:"group relative overflow-hidden rounded-lg"},_hoisted_4$u=["src"],_hoisted_5$r={class:"italic text-white text-sm block"},_hoisted_6$n={class:"w-full mt-2 whitespace-pre-wrap break-words"},_sfc_main$H={__name:"MessageComment",props:{message:{type:Object,required:!0},from_me:{type:Boolean,required:!0}},setup(ee){const te=e$b.ref(!1),ne=()=>{te.value=!te.value};return(ae,re)=>{var oe,ie,le,ce,de;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.createElementVNode("div",_hoisted_1$C,[e$b.createElementVNode("a",{href:(oe=ee.message.post_info)==null?void 0:oe.permalink,target:"_blank",rel:"noopener noreferrer",class:"italic"}," Comentário de postagem ",8,_hoisted_2$z)]),e$b.createElementVNode("div",null,[e$b.createElementVNode("div",_hoisted_3$w,[e$b.createElementVNode("img",{class:"mx-auto cursor-pointer object-scale-down max-h-[600px] max-w-full",src:(ie=ee.message.post_info)==null?void 0:ie.thumbnail_url,onClick:re[0]||(re[0]=ue=>{var be;return e$b.unref(viewSingleImage)((be=ee.message.post_info)==null?void 0:be.thumbnail_url)})},null,8,_hoisted_4$u),(le=ee.message.post_info)!=null&&le.caption?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:"absolute bottom-0 left-0 right-0 bg-black/60 p-2 cursor-pointer transition-all",onClick:e$b.withModifiers(ne,["stop"])},[e$b.createElementVNode("span",_hoisted_5$r,e$b.toDisplayString(te.value||ee.message.post_info.caption.length<=80?ee.message.post_info.caption:ee.message.post_info.caption.slice(0,80)+"..."),1)])):e$b.createCommentVNode("",!0),((de=(ce=ee.message.post_info)==null?void 0:ce.caption)==null?void 0:de.length)>80?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:"absolute bottom-1 right-1 flex items-center justify-center text-white bg-black/60 rounded-full w-6 h-6 cursor-pointer shadow-md hover:shadow-lg hover:bg-black border border-white/40 transition-all duration-200 z-10",onClick:e$b.withModifiers(ne,["stop"])},[(e$b.openBlock(),e$b.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2.5",stroke:"currentColor",class:e$b.normalizeClass(["size-4 transition-transform duration-300 drop-shadow-sm",te.value?"rotate-180":""])},[...re[1]||(re[1]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"},null,-1)])],2))])):e$b.createCommentVNode("",!0)]),e$b.createElementVNode("div",_hoisted_6$n,e$b.toDisplayString(ee.message.text),1)])],64)}}};let element=null,detach=null,peaks=null,peaksDuration=0;function forgetPeaks(){peaks=null,peaksDuration=0}function hardStop(ee){if(ee)try{ee.pause();const te=ee.currentSrc||ee.src||"";ee.removeAttribute("src"),ee.load(),te.startsWith("blob:")&&URL.revokeObjectURL(te)}catch{}}const useAudioPlaybackStore=pinia.defineStore("smClickAudioPlayback",{state:()=>({trackId:null,meta:null,isPlaying:!1,currentTime:0,duration:0,rate:1,mountedIds:[]}),getters:{hasTrack:ee=>!!ee.trackId,isFloating:ee=>!!ee.trackId&&!ee.mountedIds.includes(ee.trackId),progress:ee=>ee.duration>0?ee.currentTime/ee.duration:0},actions:{isActive(ee){return!!ee&&this.trackId===ee},activeElement(){return element},activeSrc(){return(element==null?void 0:element.currentSrc)||(element==null?void 0:element.src)||""},setPeaks(ee,te,ne){!this.isActive(ee)||!te||(peaks=te,peaksDuration=ne||this.duration||0)},activePeaks(){return!peaks||!peaksDuration?null:{peaks,duration:peaksDuration}},acquire(ee){return ee&&!this.mountedIds.includes(ee)&&this.mountedIds.push(ee),ee&&this.trackId===ee&&element?element:new Audio},claim(ee,te,ne=null){!ee||!te||(element&&element!==te&&(this.unbind(),this.mountedIds.includes(this.trackId)?element.pause():hardStop(element)),element=te,forgetPeaks(),this.trackId=ee,this.meta=ne||null,this.duration=Number.isFinite(te.duration)?te.duration:0,this.currentTime=te.currentTime||0,this.rate=te.playbackRate||1,this.bind(te))},setMeta(ee,te){this.isActive(ee)&&(this.meta=te||null)},release(ee,te){if(this.mountedIds=this.mountedIds.filter(ne=>ne!==ee),te&&te!==element){hardStop(te);return}element&&(element.paused||element.ended)&&this.clear()},bind(ee){this.unbind();const te=()=>{this.currentTime=ee.currentTime||0},ne=()=>{this.duration=Number.isFinite(ee.duration)?ee.duration:0},ae=()=>{this.isPlaying=!0},re=()=>{this.isPlaying=!1},oe=()=>{this.isPlaying=!1,this.currentTime=0,this.mountedIds.includes(this.trackId)||this.clear()},ie=()=>{this.rate=ee.playbackRate||1};ee.addEventListener("timeupdate",te),ee.addEventListener("loadedmetadata",ne),ee.addEventListener("durationchange",ne),ee.addEventListener("play",ae),ee.addEventListener("pause",re),ee.addEventListener("ended",oe),ee.addEventListener("ratechange",ie),detach=()=>{ee.removeEventListener("timeupdate",te),ee.removeEventListener("loadedmetadata",ne),ee.removeEventListener("durationchange",ne),ee.removeEventListener("play",ae),ee.removeEventListener("pause",re),ee.removeEventListener("ended",oe),ee.removeEventListener("ratechange",ie)},this.isPlaying=!ee.paused&&!ee.ended},unbind(){detach&&detach(),detach=null},toggle(){element&&(element.paused||element.ended?element.play().catch(()=>{}):element.pause())},play(){var ee;(ee=element==null?void 0:element.play)==null||ee.call(element).catch(()=>{})},pause(){var ee;(ee=element==null?void 0:element.pause)==null||ee.call(element)},seek(ee){if(!element)return;const te=Number.isFinite(element.duration)?element.duration:0;element.currentTime=Math.max(0,Math.min(ee,te||ee)),this.currentTime=element.currentTime},setRate(ee){element&&(element.playbackRate=ee,this.rate=ee)},clear(){this.unbind(),hardStop(element),element=null,forgetPeaks(),this.trackId=null,this.meta=null,this.isPlaying=!1,this.currentTime=0,this.duration=0,this.rate=1}}});function detachSharedMedia(ee,te,ne){var ae,re;if(!(!ee||!te||ee.media!==te)&&ne.activeElement()===te){try{(ae=ee.unAll)==null||ae.call(ee)}catch{}try{(re=ee.subscriptions)==null||re.forEach(oe=>oe==null?void 0:oe())}catch{}try{ee.media=new Audio}catch{}}}function attachSharedMedia(ee,te,{rate:ne=1}={}){var ae,re,oe,ie,le;if(!ee||!te)return null;try{ee.media=te,(ae=ee.initPlayerEvents)==null||ae.call(ee),(re=ee.setPlaybackRate)==null||re.call(ee,ne),te.paused||(ie=(oe=ee.timer)==null?void 0:oe.start)==null||ie.call(oe)}catch(ce){return console.error("Falha ao religar áudio em reprodução:",ce),null}return{duration:((le=ee.getDuration)==null?void 0:le.call(ee))||0,currentTime:te.currentTime||0,isPlaying:!te.paused&&!te.ended}}function resolveColor(ee,te){if(!ee||!te||!ee.includes("color-mix("))return ee;const ne=document.createElement("span");ne.style.cssText="position:absolute;inline-size:0;block-size:0;visibility:hidden",ne.style.color=ee,te.appendChild(ne);const ae=getComputedStyle(ne).color;return ne.remove(),ae||ee}function readWaveColors(ee){const te={wave:"rgba(148, 163, 184, 0.5)",progress:"#0ea5e9",cursor:"#ffffff"};if(!ee)return te;const ne=getComputedStyle(ee),ae=(re,oe)=>resolveColor(ne.getPropertyValue(re).trim(),ee)||oe;return{wave:ae("--audio-wave",te.wave),progress:ae("--audio-progress",te.progress),cursor:ae("--audio-cursor",te.cursor)}}const _hoisted_1$B=["aria-pressed","aria-label","onKeydown"],_hoisted_2$y={key:1,class:"size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},_hoisted_3$v={class:"relative flex h-10 min-w-0 flex-1 items-center"},_hoisted_4$t=["aria-label"],BAR_WIDTH=3,BAR_GAP=3,_sfc_main$G={__name:"MessageAudio",props:{audio:{type:String,required:!0},isOwner:{type:Boolean,default:!1},trackId:{type:[String,Number],default:null},trackMeta:{type:Object,default:null},height:{type:Number,default:40},barWidth:{type:Number,default:3},barRadius:{type:Number,default:3},barHeight:{type:Number,default:.85},barGap:{type:Number,default:2},fullWidth:{type:Boolean,default:!1},minWidth:{type:String,default:"200px"},prefWidth:{type:String,default:"37vw"},maxWidth:{type:String,default:"300px"},onlyOneAtATime:{type:Boolean,default:!0}},emits:["duration","currentTime"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.computed(()=>ne.fullWidth?{inlineSize:"100%",minInlineSize:ne.minWidth}:{inlineSize:`clamp(${ne.minWidth}, ${ne.prefWidth}, ${ne.maxWidth})`,minInlineSize:"0"}),oe=e$b.ref(null),ie=e$b.ref(null);let le=null,ce=null,de=null;const ue=useAudioPlaybackStore(),be=e$b.computed(()=>ne.trackId!=null&&ne.trackId!==""),fe=e$b.ref(!1),ge=e$b.ref(!0),me=e$b.ref(0),pe=e$b.ref(0),ke=e$b.ref(1),ve=/^data:(audio\/[^,;]+(?:;[^,;=]+=[^,;]+)*);base64,/,_e=Ze=>typeof Ze=="string"&&ve.test(Ze),$e=Ze=>typeof Ze=="string"&&Ze.length>=16&&/^[A-Za-z0-9+/=\s]+$/.test(Ze)&&Ze.length%4===0;function ye(Ze,Xe="audio/mp3"){var lt;const Ue=(lt=Ze.match(ve))==null?void 0:lt[1],at=Ze.includes(",")?Ze.slice(Ze.indexOf(",")+1):Ze,Je=Uint8Array.from(atob(at),it=>it.charCodeAt(0));return new Blob([Je],{type:Ue||Xe})}function Ee(){var Ze,Xe;detachSharedMedia(le,ce,ue);try{(Ze=le==null?void 0:le.unAll)==null||Ze.call(le)}catch{}try{(Xe=le==null?void 0:le.destroy)==null||Xe.call(le)}catch{}le=null}async function Se(){if(!ie.value)return;Ee();const Ze=be.value&&ue.isActive(ne.trackId)&&!!ue.activeElement();be.value?ce=ue.acquire(ne.trackId):ce||(ce=new Audio);const Xe=readWaveColors(oe.value);le=w$5.create({container:ie.value,media:Ze?new Audio:ce,waveColor:Xe.wave,progressColor:Xe.progress,cursorColor:Xe.cursor,cursorWidth:12,height:ne.height,barWidth:ne.barWidth,barRadius:ne.barRadius,barHeight:ne.barHeight,barGap:ne.barGap,hideScrollbar:!0}),le.on("ready",()=>{me.value=le.getDuration(),ae("duration",me.value),ge.value=!1,le.setPlaybackRate(ke.value),Ae()}),le.on("error",Ue=>{ge.value=!1,console.error("Falha ao carregar áudio:",Ue)}),le.on("play",()=>{if(fe.value=!0,ne.onlyOneAtATime&&!be.value){const Ue=window.__activeWSInstance;if(Ue&&Ue!==le)try{Ue.pause()}catch{}window.__activeWSInstance=le}}),le.on("pause",()=>{fe.value=!1,window.__activeWSInstance===le&&(window.__activeWSInstance=null)}),le.on("finish",()=>{fe.value=!1,window.__activeWSInstance===le&&(window.__activeWSInstance=null)}),le.on("audioprocess",()=>{pe.value=le.getCurrentTime(),ae("currentTime",pe.value)}),le.on("seek",()=>{pe.value=le.getCurrentTime(),ae("currentTime",pe.value)}),ie.value.addEventListener("pointerdown",Pe),Ze&&(ke.value=ue.rate||1),await De(ne.audio),Ze&&Le()}function Le(){const Ze=attachSharedMedia(le,ce,{rate:ke.value});Ze&&(me.value=Ze.duration||ue.duration,pe.value=Ze.currentTime,fe.value=Ze.isPlaying)}function Ae(){if(!(!be.value||!ue.isActive(ne.trackId)))try{ue.setPeaks(ne.trackId,le.exportPeaks(),le.getDuration())}catch{}}async function De(Ze){if(le){ge.value=!0;try{_e(Ze)||$e(Ze)?await le.loadBlob(ye(Ze)):await le.load(Ze)}catch{try{await le.load(Ze)}catch(Xe){console.error("Falha ao carregar áudio:",Xe),ge.value=!1}}}}function Oe(){le&&(be.value&&!ue.isActive(ne.trackId)&&(ue.claim(ne.trackId,ce,ne.trackMeta),ue.setRate(ke.value),Ae()),le.playPause())}function Ie(){var Ze;ke.value=ke.value>=2?1:+(ke.value+.5).toFixed(1),(Ze=le==null?void 0:le.setPlaybackRate)==null||Ze.call(le,ke.value),be.value&&ue.isActive(ne.trackId)&&ue.setRate(ke.value)}let ze=!1;function Ve(Ze){var Je,lt;const Xe=(lt=(Je=ie.value)==null?void 0:Je.getBoundingClientRect)==null?void 0:lt.call(Je);if(!Xe)return null;const at=(("touches"in Ze?Ze.touches[0].clientX:Ze.clientX)-Xe.left)/Xe.width;return Math.max(0,Math.min(1,at))}function Ne(Ze){var Ue;const Xe=Ve(Ze);Xe!=null&&((Ue=le==null?void 0:le.seekTo)==null||Ue.call(le,Xe))}function Pe(Ze){ze=!0,Ne(Ze),window.addEventListener("pointermove",Be,{passive:!0}),window.addEventListener("pointerup",Me,{passive:!0})}function Be(Ze){ze&&Ne(Ze)}function Me(){ze=!1,window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",Me)}let xe=null;function Ce(){var Xe;if(!le||!oe.value)return;const Ze=readWaveColors(oe.value);(Xe=le.setOptions)==null||Xe.call(le,{waveColor:Ze.wave,progressColor:Ze.progress,cursorColor:Ze.cursor})}const Fe=e$b.ref(null),Re=e$b.ref(20);let qe=null;const Ge=Ze=>({animationDelay:`-${(1.2-Ze%8*.1).toFixed(2)}s`});return e$b.onMounted(async()=>{await e$b.nextTick(),await Se();const Ze=()=>{if(!Fe.value)return;const Ue=Fe.value.clientWidth;Re.value=Math.floor(Ue/(BAR_WIDTH+BAR_GAP))};e$b.watch(ge,Ue=>{Ue?e$b.nextTick(()=>{Fe.value&&!qe&&(Ze(),qe=new ResizeObserver(Ze),qe.observe(Fe.value))}):qe&&(qe.disconnect(),qe=null)},{immediate:!0});const Xe=async()=>{var at,Je;if(!le)return;const Ue=((at=le.getCurrentTime)==null?void 0:at.call(le))??0;await Se();try{(Je=le.seekTo)==null||Je.call(le,Ue/(me.value||1))}catch{}};window.addEventListener("resize",Xe),de=Xe,xe=new MutationObserver(Ce),xe.observe(document.documentElement,{attributeFilter:["class","style"]})}),e$b.onBeforeUnmount(()=>{var Ze;qe&&qe.disconnect(),xe&&xe.disconnect();try{window.removeEventListener("resize",de)}catch{}try{(Ze=ie.value)==null||Ze.removeEventListener("pointerdown",Pe)}catch{}if(Ee(),be.value)ue.release(ne.trackId,ce);else if(ce)try{ce.pause(),ce.removeAttribute("src"),ce.load()}catch{}ce=null}),e$b.watch(()=>ne.audio,Ze=>{Ze&&De(Ze)}),e$b.watch(ke,Ze=>{var Xe;return(Xe=le==null?void 0:le.setPlaybackRate)==null?void 0:Xe.call(le,Ze)}),e$b.watch(()=>be.value?ue.isPlaying:null,Ze=>{Ze===null||!ue.isActive(ne.trackId)||(fe.value=Ze)}),e$b.watch(()=>ne.trackMeta,Ze=>{be.value&&ue.setMeta(ne.trackId,Ze)}),(Ze,Xe)=>(e$b.openBlock(),e$b.createElementBlock("div",{ref_key:"rootEl",ref:oe,class:e$b.normalizeClass(["audio-row flex min-w-0 max-w-full select-none items-center gap-2.5",ee.isOwner?"ms-auto":"me-auto"]),style:e$b.normalizeStyle(re.value)},[e$b.createElementVNode("button",{type:"button",class:"audio-play grid size-10 shrink-0 place-items-center rounded-full transition focus:outline-none focus-visible:ring-2 focus-visible:ring-current","aria-pressed":fe.value?"true":"false","aria-label":fe.value?"Pausar":"Tocar",onClick:Oe,onKeydown:e$b.withKeys(e$b.withModifiers(Oe,["prevent"]),["space"])},[fe.value?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$y,[...Xe[1]||(Xe[1]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H8Zm7 0a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-1Z","clip-rule":"evenodd"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",{key:0,class:e$b.normalizeClass(["size-5 translate-x-px",{"animate-pulse":ge.value}]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Xe[0]||(Xe[0]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.6 5.2A1 1 0 0 0 7 6v12a1 1 0 0 0 1.6.8l8-6a1 1 0 0 0 0-1.6l-8-6Z","clip-rule":"evenodd"},null,-1)])],2))],40,_hoisted_1$B),e$b.createElementVNode("div",_hoisted_3$v,[ge.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"loaderContainerEl",ref:Fe,class:"loading-equalizer"},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(Re.value,Ue=>(e$b.openBlock(),e$b.createElementBlock("span",{key:Ue,style:e$b.normalizeStyle(Ge(Ue))},null,4))),128))],512)):e$b.createCommentVNode("",!0),e$b.withDirectives(e$b.createElementVNode("div",{ref_key:"waveEl",ref:ie,class:"ws-surface block size-full min-w-0 cursor-pointer"},null,512),[[e$b.vShow,!ge.value]])]),e$b.withDirectives(e$b.createElementVNode("button",{type:"button",class:"audio-rate shrink-0 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-5 transition","aria-label":`Velocidade ${ke.value.toFixed(1)}x. Clique para mudar`,onClick:Ie},e$b.toDisplayString(ke.value.toFixed(1))+"x ",9,_hoisted_4$t),[[e$b.vShow,fe.value]])],6))}},MessageAudio=_export_sfc$1(_sfc_main$G,[["__scopeId","data-v-3befd007"]]),_hoisted_1$A={class:"relative"},_hoisted_2$x={key:0,class:"relative"},_hoisted_3$u={key:1,class:"relative h-[200px] w-full lg:w-[300px] rounded-lg bg-base-200 border border-base-300 overflow-hidden"},MAX_FILE_SIZE=7*1024*1024,_sfc_main$F={__name:"MessageFileLoading",props:{message:{type:Object,required:!0}},setup(ee){const te=ee,ne=e$b.computed(()=>{var oe;const ae=(oe=te.message)==null?void 0:oe.content;return ae!=null&&ae.data64?Math.ceil(ae.data64.length/1.33)<=MAX_FILE_SIZE:!1});return(ae,re)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$A,[ne.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$x,[e$b.createVNode(MessageFileRenderer,{message:ee.message},null,8,["message"]),re[0]||(re[0]=e$b.createStaticVNode('<div class="pointer-events-none absolute inset-0 flex flex-col items-center justify-center rounded-md bg-black/30"><div class="loader-dots relative mx-auto block h-5 w-20"><div class="absolute left-0 top-0 mt-1 size-3 animate-loader rounded-full bg-white"></div><div class="absolute left-0 top-0 mt-1 size-3 animate-loader rounded-full bg-white [animation-delay:.2s]"></div><div class="absolute left-0 top-0 mt-1 size-3 animate-loader rounded-full bg-white [animation-delay:.4s]"></div></div><p class="mt-2 text-sm font-medium text-white">Enviando...</p></div>',1))])):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_3$u,[...re[1]||(re[1]=[e$b.createStaticVNode('<div class="absolute inset-0 opacity-30 dark:opacity-20"><div class="absolute top-0 left-0 w-32 h-32 bg-primary rounded-full blur-3xl animate-pulse"></div><div class="absolute bottom-0 right-0 w-40 h-40 bg-primary rounded-full blur-3xl animate-pulse [animation-delay:.5s]"></div></div><div class="relative h-full flex flex-col items-center justify-center gap-4 p-6"><div class="rounded-full bg-base-100 p-4 ring-2 ring-primary backdrop-blur-sm"><svg class="size-10 text-primary animate-bounce" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16.88 9.1A4 4 0 0 1 16 17H5a5 5 0 0 1-1-9.9V7a3 3 0 0 1 4.52-2.59A4.98 4.98 0 0 1 17 8c0 .38-.04.74-.12 1.1zM11 11h3l-4-4-4 4h3v3h2v-3z"></path></svg></div><div class="flex flex-col items-center gap-3"><p class="text-sm font-semibold">Enviando arquivo</p><div class="flex items-center gap-1.5"><div class="size-2 rounded-full bg-primary animate-bounce"></div><div class="size-2 rounded-full bg-primary animate-bounce [animation-delay:.1s]"></div><div class="size-2 rounded-full bg-primary animate-bounce [animation-delay:.2s]"></div></div></div></div>',2)])]))]))}},_hoisted_1$z=["data-group-items"],_hoisted_2$w={class:"flex size-5 cursor-pointer items-center justify-center rounded border-2 border-gray-400 transition-colors hover:border-primary dark:border-gray-600 dark:bg-gray-500/60"},_hoisted_3$t={key:0,class:"size-3.5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_hoisted_4$s=["id","onClick"],_hoisted_5$q=["onClick"],_hoisted_6$m={key:0,class:"size-3.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_hoisted_7$k={key:1,class:"absolute inset-0 flex items-center justify-center bg-black/60 text-xl font-semibold text-white"},_hoisted_8$h={class:"pointer-events-none absolute inset-0 bg-black/30 opacity-0 transition-opacity group-hover:opacity-100"},_hoisted_9$e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute left-2 top-2 size-6",style:{transform:"rotate(135deg)"}},_hoisted_10$d={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute right-2 top-2 size-6",style:{transform:"rotate(-135deg)"}},_hoisted_11$c={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute bottom-2 left-2 size-6",style:{transform:"rotate(45deg)"}},_hoisted_12$a={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",class:"absolute bottom-2 right-2 size-6",style:{transform:"rotate(-45deg)"}},_hoisted_13$8={key:0,class:"pt-1"},_sfc_main$E={__name:"MessageGroupMedia",props:{message:{type:Object,required:!0}},emits:["expand"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useMessageUiStore(),oe=e$b.computed(()=>{var me;return messageCaption((me=ne.message)==null?void 0:me.content)}),ie=e$b.computed(()=>{var me;return(((me=ne.message)==null?void 0:me.items)||[]).slice(0,4)}),le=e$b.computed(()=>{var me,pe;return Math.max((((pe=(me=ne.message)==null?void 0:me.items)==null?void 0:pe.length)||0)-4,0)}),ce=e$b.computed(()=>{var me;return(((me=ne.message)==null?void 0:me.items)||[]).map(pe=>pe==null?void 0:pe.id).filter(pe=>pe!=null&&pe!=="")}),de=e$b.computed(()=>ce.value.join(" ")),ue=e$b.ref(null);function be(me){var ve,_e;const pe=String(((ve=me==null?void 0:me.detail)==null?void 0:ve.itemId)??"");if(!pe)return;const ke=(((_e=ne.message)==null?void 0:_e.items)||[]).findIndex($e=>String($e==null?void 0:$e.id)===pe);ke>=0&&ae("expand",ke)}e$b.onMounted(()=>{var me;return(me=ue.value)==null?void 0:me.addEventListener("open-package-item",be)}),e$b.onBeforeUnmount(()=>{var me;return(me=ue.value)==null?void 0:me.removeEventListener("open-package-item",be)});function fe(me){return me?re.isMessageSelected(me):!1}function ge(me){var pe;return{id:me==null?void 0:me.id,type:(me==null?void 0:me.type)||((pe=me==null?void 0:me.content)==null?void 0:pe.type)||"image",content:{...me==null?void 0:me.content}}}return(me,pe)=>(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.createElementVNode("div",{ref_key:"rootEl",ref:ue,class:"relative grid grid-cols-2 gap-[2px] text-white","data-group-items":de.value},[e$b.unref(re).forwardMode.active?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:"absolute left-1 top-1 z-10",onClick:pe[0]||(pe[0]=e$b.withModifiers(ke=>e$b.unref(re).togglePackageSelection(ce.value),["stop"]))},[e$b.createElementVNode("div",_hoisted_2$w,[(ee.message.items||[]).some(ke=>fe(ke.id))?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$t,[...pe[1]||(pe[1]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):e$b.createCommentVNode("",!0)])])):e$b.createCommentVNode("",!0),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie.value,(ke,ve)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ke.id||ve,id:String(ke.id||ve),class:"group relative aspect-square max-h-[250px] w-full cursor-pointer overflow-hidden rounded-lg",onClick:_e=>ae("expand",ve)},[e$b.createVNode(MessageFileRenderer,{message:ge(ke),variant:"thumbnail","show-caption":!1,interactive:!1},null,8,["message"]),e$b.unref(re).forwardMode.active?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,"aria-label":"Selecionar mídia",class:e$b.normalizeClass(["absolute left-1 top-1 z-10 flex size-5 cursor-pointer items-center justify-center rounded border-2 bg-black/40 transition-colors",fe(ke.id)?"border-primary":"border-gray-400 hover:border-primary"]),onClick:e$b.withModifiers(_e=>e$b.unref(re).toggleMessageSelection(ke.id),["stop"])},[fe(ke.id)?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_6$m,[...pe[2]||(pe[2]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):e$b.createCommentVNode("",!0)],10,_hoisted_5$q)):e$b.createCommentVNode("",!0),ve===3&&le.value>0?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$k," +"+e$b.toDisplayString(le.value),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_8$h,[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_9$e,[...pe[3]||(pe[3]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_10$d,[...pe[4]||(pe[4]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_11$c,[...pe[5]||(pe[5]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])])),(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_12$a,[...pe[6]||(pe[6]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19 9-7 7-7-7"},null,-1)])]))])],8,_hoisted_4$s))),128))],8,_hoisted_1$z),oe.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_13$8,[e$b.createVNode(MessageMarkdown,{content:oe.value},null,8,["content"])])):e$b.createCommentVNode("",!0)],64))}};var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(ee){return ee&&ee.__esModule&&Object.prototype.hasOwnProperty.call(ee,"default")?ee.default:ee}var leafletSrc={exports:{}};/* @preserve
|
|
279
279
|
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
|
280
280
|
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
|
281
|
-
*/(function(ee,te){(function(ne,ae){ae(te)})(commonjsGlobal,function(ne){var ae="1.9.4";function re(se){var he,we,Te,He;for(we=1,Te=arguments.length;we<Te;we++){He=arguments[we];for(he in He)se[he]=He[he]}return se}var oe=Object.create||function(){function se(){}return function(he){return se.prototype=he,new se}}();function ie(se,he){var we=Array.prototype.slice;if(se.bind)return se.bind.apply(se,we.call(arguments,1));var Te=we.call(arguments,2);return function(){return se.apply(he,Te.length?Te.concat(we.call(arguments)):arguments)}}var le=0;function ce(se){return"_leaflet_id"in se||(se._leaflet_id=++le),se._leaflet_id}function de(se,he,we){var Te,He,Ye,ot;return ot=function(){Te=!1,He&&(Ye.apply(we,He),He=!1)},Ye=function(){Te?He=arguments:(se.apply(we,arguments),setTimeout(ot,he),Te=!0)},Ye}function ue(se,he,we){var Te=he[1],He=he[0],Ye=Te-He;return se===Te&&we?se:((se-He)%Ye+Ye)%Ye+He}function be(){return!1}function fe(se,he){if(he===!1)return se;var we=Math.pow(10,he===void 0?6:he);return Math.round(se*we)/we}function ge(se){return se.trim?se.trim():se.replace(/^\s+|\s+$/g,"")}function me(se){return ge(se).split(/\s+/)}function pe(se,he){Object.prototype.hasOwnProperty.call(se,"options")||(se.options=se.options?oe(se.options):{});for(var we in he)se.options[we]=he[we];return se.options}function ke(se,he,we){var Te=[];for(var He in se)Te.push(encodeURIComponent(we?He.toUpperCase():He)+"="+encodeURIComponent(se[He]));return(!he||he.indexOf("?")===-1?"?":"&")+Te.join("&")}var ve=/\{ *([\w_ -]+) *\}/g;function _e(se,he){return se.replace(ve,function(we,Te){var He=he[Te];if(He===void 0)throw new Error("No value provided for variable "+we);return typeof He=="function"&&(He=He(he)),He})}var $e=Array.isArray||function(se){return Object.prototype.toString.call(se)==="[object Array]"};function ye(se,he){for(var we=0;we<se.length;we++)if(se[we]===he)return we;return-1}var Ee="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Se(se){return window["webkit"+se]||window["moz"+se]||window["ms"+se]}var Le=0;function Ae(se){var he=+new Date,we=Math.max(0,16-(he-Le));return Le=he+we,window.setTimeout(se,we)}var De=window.requestAnimationFrame||Se("RequestAnimationFrame")||Ae,Oe=window.cancelAnimationFrame||Se("CancelAnimationFrame")||Se("CancelRequestAnimationFrame")||function(se){window.clearTimeout(se)};function Ie(se,he,we){if(we&&De===Ae)se.call(he);else return De.call(window,ie(se,he))}function ze(se){se&&Oe.call(window,se)}var Ve={__proto__:null,extend:re,create:oe,bind:ie,get lastId(){return le},stamp:ce,throttle:de,wrapNum:ue,falseFn:be,formatNum:fe,trim:ge,splitWords:me,setOptions:pe,getParamString:ke,template:_e,isArray:$e,indexOf:ye,emptyImageUrl:Ee,requestFn:De,cancelFn:Oe,requestAnimFrame:Ie,cancelAnimFrame:ze};function Ne(){}Ne.extend=function(se){var he=function(){pe(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},we=he.__super__=this.prototype,Te=oe(we);Te.constructor=he,he.prototype=Te;for(var He in this)Object.prototype.hasOwnProperty.call(this,He)&&He!=="prototype"&&He!=="__super__"&&(he[He]=this[He]);return se.statics&&re(he,se.statics),se.includes&&(Pe(se.includes),re.apply(null,[Te].concat(se.includes))),re(Te,se),delete Te.statics,delete Te.includes,Te.options&&(Te.options=we.options?oe(we.options):{},re(Te.options,se.options)),Te._initHooks=[],Te.callInitHooks=function(){if(!this._initHooksCalled){we.callInitHooks&&we.callInitHooks.call(this),this._initHooksCalled=!0;for(var Ye=0,ot=Te._initHooks.length;Ye<ot;Ye++)Te._initHooks[Ye].call(this)}},he},Ne.include=function(se){var he=this.prototype.options;return re(this.prototype,se),se.options&&(this.prototype.options=he,this.mergeOptions(se.options)),this},Ne.mergeOptions=function(se){return re(this.prototype.options,se),this},Ne.addInitHook=function(se){var he=Array.prototype.slice.call(arguments,1),we=typeof se=="function"?se:function(){this[se].apply(this,he)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(we),this};function Pe(se){if(!(typeof L>"u"||!L||!L.Mixin)){se=$e(se)?se:[se];for(var he=0;he<se.length;he++)se[he]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Be={on:function(se,he,we){if(typeof se=="object")for(var Te in se)this._on(Te,se[Te],he);else{se=me(se);for(var He=0,Ye=se.length;He<Ye;He++)this._on(se[He],he,we)}return this},off:function(se,he,we){if(!arguments.length)delete this._events;else if(typeof se=="object")for(var Te in se)this._off(Te,se[Te],he);else{se=me(se);for(var He=arguments.length===1,Ye=0,ot=se.length;Ye<ot;Ye++)He?this._off(se[Ye]):this._off(se[Ye],he,we)}return this},_on:function(se,he,we,Te){if(typeof he!="function"){console.warn("wrong listener type: "+typeof he);return}if(this._listens(se,he,we)===!1){we===this&&(we=void 0);var He={fn:he,ctx:we};Te&&(He.once=!0),this._events=this._events||{},this._events[se]=this._events[se]||[],this._events[se].push(He)}},_off:function(se,he,we){var Te,He,Ye;if(this._events&&(Te=this._events[se],!!Te)){if(arguments.length===1){if(this._firingCount)for(He=0,Ye=Te.length;He<Ye;He++)Te[He].fn=be;delete this._events[se];return}if(typeof he!="function"){console.warn("wrong listener type: "+typeof he);return}var ot=this._listens(se,he,we);if(ot!==!1){var vt=Te[ot];this._firingCount&&(vt.fn=be,this._events[se]=Te=Te.slice()),Te.splice(ot,1)}}},fire:function(se,he,we){if(!this.listens(se,we))return this;var Te=re({},he,{type:se,target:this,sourceTarget:he&&he.sourceTarget||this});if(this._events){var He=this._events[se];if(He){this._firingCount=this._firingCount+1||1;for(var Ye=0,ot=He.length;Ye<ot;Ye++){var vt=He[Ye],xt=vt.fn;vt.once&&this.off(se,xt,vt.ctx),xt.call(vt.ctx||this,Te)}this._firingCount--}}return we&&this._propagateEvent(Te),this},listens:function(se,he,we,Te){typeof se!="string"&&console.warn('"string" type argument expected');var He=he;typeof he!="function"&&(Te=!!he,He=void 0,we=void 0);var Ye=this._events&&this._events[se];if(Ye&&Ye.length&&this._listens(se,He,we)!==!1)return!0;if(Te){for(var ot in this._eventParents)if(this._eventParents[ot].listens(se,he,we,Te))return!0}return!1},_listens:function(se,he,we){if(!this._events)return!1;var Te=this._events[se]||[];if(!he)return!!Te.length;we===this&&(we=void 0);for(var He=0,Ye=Te.length;He<Ye;He++)if(Te[He].fn===he&&Te[He].ctx===we)return He;return!1},once:function(se,he,we){if(typeof se=="object")for(var Te in se)this._on(Te,se[Te],he,!0);else{se=me(se);for(var He=0,Ye=se.length;He<Ye;He++)this._on(se[He],he,we,!0)}return this},addEventParent:function(se){return this._eventParents=this._eventParents||{},this._eventParents[ce(se)]=se,this},removeEventParent:function(se){return this._eventParents&&delete this._eventParents[ce(se)],this},_propagateEvent:function(se){for(var he in this._eventParents)this._eventParents[he].fire(se.type,re({layer:se.target,propagatedFrom:se.target},se),!0)}};Be.addEventListener=Be.on,Be.removeEventListener=Be.clearAllEventListeners=Be.off,Be.addOneTimeEventListener=Be.once,Be.fireEvent=Be.fire,Be.hasEventListeners=Be.listens;var Me=Ne.extend(Be);function xe(se,he,we){this.x=we?Math.round(se):se,this.y=we?Math.round(he):he}var Ce=Math.trunc||function(se){return se>0?Math.floor(se):Math.ceil(se)};xe.prototype={clone:function(){return new xe(this.x,this.y)},add:function(se){return this.clone()._add(Fe(se))},_add:function(se){return this.x+=se.x,this.y+=se.y,this},subtract:function(se){return this.clone()._subtract(Fe(se))},_subtract:function(se){return this.x-=se.x,this.y-=se.y,this},divideBy:function(se){return this.clone()._divideBy(se)},_divideBy:function(se){return this.x/=se,this.y/=se,this},multiplyBy:function(se){return this.clone()._multiplyBy(se)},_multiplyBy:function(se){return this.x*=se,this.y*=se,this},scaleBy:function(se){return new xe(this.x*se.x,this.y*se.y)},unscaleBy:function(se){return new xe(this.x/se.x,this.y/se.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Ce(this.x),this.y=Ce(this.y),this},distanceTo:function(se){se=Fe(se);var he=se.x-this.x,we=se.y-this.y;return Math.sqrt(he*he+we*we)},equals:function(se){return se=Fe(se),se.x===this.x&&se.y===this.y},contains:function(se){return se=Fe(se),Math.abs(se.x)<=Math.abs(this.x)&&Math.abs(se.y)<=Math.abs(this.y)},toString:function(){return"Point("+fe(this.x)+", "+fe(this.y)+")"}};function Fe(se,he,we){return se instanceof xe?se:$e(se)?new xe(se[0],se[1]):se==null?se:typeof se=="object"&&"x"in se&&"y"in se?new xe(se.x,se.y):new xe(se,he,we)}function Re(se,he){if(se)for(var we=he?[se,he]:se,Te=0,He=we.length;Te<He;Te++)this.extend(we[Te])}Re.prototype={extend:function(se){var he,we;if(!se)return this;if(se instanceof xe||typeof se[0]=="number"||"x"in se)he=we=Fe(se);else if(se=qe(se),he=se.min,we=se.max,!he||!we)return this;return!this.min&&!this.max?(this.min=he.clone(),this.max=we.clone()):(this.min.x=Math.min(he.x,this.min.x),this.max.x=Math.max(we.x,this.max.x),this.min.y=Math.min(he.y,this.min.y),this.max.y=Math.max(we.y,this.max.y)),this},getCenter:function(se){return Fe((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,se)},getBottomLeft:function(){return Fe(this.min.x,this.max.y)},getTopRight:function(){return Fe(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(se){var he,we;return typeof se[0]=="number"||se instanceof xe?se=Fe(se):se=qe(se),se instanceof Re?(he=se.min,we=se.max):he=we=se,he.x>=this.min.x&&we.x<=this.max.x&&he.y>=this.min.y&&we.y<=this.max.y},intersects:function(se){se=qe(se);var he=this.min,we=this.max,Te=se.min,He=se.max,Ye=He.x>=he.x&&Te.x<=we.x,ot=He.y>=he.y&&Te.y<=we.y;return Ye&&ot},overlaps:function(se){se=qe(se);var he=this.min,we=this.max,Te=se.min,He=se.max,Ye=He.x>he.x&&Te.x<we.x,ot=He.y>he.y&&Te.y<we.y;return Ye&&ot},isValid:function(){return!!(this.min&&this.max)},pad:function(se){var he=this.min,we=this.max,Te=Math.abs(he.x-we.x)*se,He=Math.abs(he.y-we.y)*se;return qe(Fe(he.x-Te,he.y-He),Fe(we.x+Te,we.y+He))},equals:function(se){return se?(se=qe(se),this.min.equals(se.getTopLeft())&&this.max.equals(se.getBottomRight())):!1}};function qe(se,he){return!se||se instanceof Re?se:new Re(se,he)}function Ge(se,he){if(se)for(var we=he?[se,he]:se,Te=0,He=we.length;Te<He;Te++)this.extend(we[Te])}Ge.prototype={extend:function(se){var he=this._southWest,we=this._northEast,Te,He;if(se instanceof Xe)Te=se,He=se;else if(se instanceof Ge){if(Te=se._southWest,He=se._northEast,!Te||!He)return this}else return se?this.extend(Ue(se)||Ze(se)):this;return!he&&!we?(this._southWest=new Xe(Te.lat,Te.lng),this._northEast=new Xe(He.lat,He.lng)):(he.lat=Math.min(Te.lat,he.lat),he.lng=Math.min(Te.lng,he.lng),we.lat=Math.max(He.lat,we.lat),we.lng=Math.max(He.lng,we.lng)),this},pad:function(se){var he=this._southWest,we=this._northEast,Te=Math.abs(he.lat-we.lat)*se,He=Math.abs(he.lng-we.lng)*se;return new Ge(new Xe(he.lat-Te,he.lng-He),new Xe(we.lat+Te,we.lng+He))},getCenter:function(){return new Xe((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Xe(this.getNorth(),this.getWest())},getSouthEast:function(){return new Xe(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(se){typeof se[0]=="number"||se instanceof Xe||"lat"in se?se=Ue(se):se=Ze(se);var he=this._southWest,we=this._northEast,Te,He;return se instanceof Ge?(Te=se.getSouthWest(),He=se.getNorthEast()):Te=He=se,Te.lat>=he.lat&&He.lat<=we.lat&&Te.lng>=he.lng&&He.lng<=we.lng},intersects:function(se){se=Ze(se);var he=this._southWest,we=this._northEast,Te=se.getSouthWest(),He=se.getNorthEast(),Ye=He.lat>=he.lat&&Te.lat<=we.lat,ot=He.lng>=he.lng&&Te.lng<=we.lng;return Ye&&ot},overlaps:function(se){se=Ze(se);var he=this._southWest,we=this._northEast,Te=se.getSouthWest(),He=se.getNorthEast(),Ye=He.lat>he.lat&&Te.lat<we.lat,ot=He.lng>he.lng&&Te.lng<we.lng;return Ye&&ot},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(se,he){return se?(se=Ze(se),this._southWest.equals(se.getSouthWest(),he)&&this._northEast.equals(se.getNorthEast(),he)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Ze(se,he){return se instanceof Ge?se:new Ge(se,he)}function Xe(se,he,we){if(isNaN(se)||isNaN(he))throw new Error("Invalid LatLng object: ("+se+", "+he+")");this.lat=+se,this.lng=+he,we!==void 0&&(this.alt=+we)}Xe.prototype={equals:function(se,he){if(!se)return!1;se=Ue(se);var we=Math.max(Math.abs(this.lat-se.lat),Math.abs(this.lng-se.lng));return we<=(he===void 0?1e-9:he)},toString:function(se){return"LatLng("+fe(this.lat,se)+", "+fe(this.lng,se)+")"},distanceTo:function(se){return Je.distance(this,Ue(se))},wrap:function(){return Je.wrapLatLng(this)},toBounds:function(se){var he=180*se/40075017,we=he/Math.cos(Math.PI/180*this.lat);return Ze([this.lat-he,this.lng-we],[this.lat+he,this.lng+we])},clone:function(){return new Xe(this.lat,this.lng,this.alt)}};function Ue(se,he,we){return se instanceof Xe?se:$e(se)&&typeof se[0]!="object"?se.length===3?new Xe(se[0],se[1],se[2]):se.length===2?new Xe(se[0],se[1]):null:se==null?se:typeof se=="object"&&"lat"in se?new Xe(se.lat,"lng"in se?se.lng:se.lon,se.alt):he===void 0?null:new Xe(se,he,we)}var at={latLngToPoint:function(se,he){var we=this.projection.project(se),Te=this.scale(he);return this.transformation._transform(we,Te)},pointToLatLng:function(se,he){var we=this.scale(he),Te=this.transformation.untransform(se,we);return this.projection.unproject(Te)},project:function(se){return this.projection.project(se)},unproject:function(se){return this.projection.unproject(se)},scale:function(se){return 256*Math.pow(2,se)},zoom:function(se){return Math.log(se/256)/Math.LN2},getProjectedBounds:function(se){if(this.infinite)return null;var he=this.projection.bounds,we=this.scale(se),Te=this.transformation.transform(he.min,we),He=this.transformation.transform(he.max,we);return new Re(Te,He)},infinite:!1,wrapLatLng:function(se){var he=this.wrapLng?ue(se.lng,this.wrapLng,!0):se.lng,we=this.wrapLat?ue(se.lat,this.wrapLat,!0):se.lat,Te=se.alt;return new Xe(we,he,Te)},wrapLatLngBounds:function(se){var he=se.getCenter(),we=this.wrapLatLng(he),Te=he.lat-we.lat,He=he.lng-we.lng;if(Te===0&&He===0)return se;var Ye=se.getSouthWest(),ot=se.getNorthEast(),vt=new Xe(Ye.lat-Te,Ye.lng-He),xt=new Xe(ot.lat-Te,ot.lng-He);return new Ge(vt,xt)}},Je=re({},at,{wrapLng:[-180,180],R:6371e3,distance:function(se,he){var we=Math.PI/180,Te=se.lat*we,He=he.lat*we,Ye=Math.sin((he.lat-se.lat)*we/2),ot=Math.sin((he.lng-se.lng)*we/2),vt=Ye*Ye+Math.cos(Te)*Math.cos(He)*ot*ot,xt=2*Math.atan2(Math.sqrt(vt),Math.sqrt(1-vt));return this.R*xt}}),lt=6378137,it={R:lt,MAX_LATITUDE:85.0511287798,project:function(se){var he=Math.PI/180,we=this.MAX_LATITUDE,Te=Math.max(Math.min(we,se.lat),-we),He=Math.sin(Te*he);return new xe(this.R*se.lng*he,this.R*Math.log((1+He)/(1-He))/2)},unproject:function(se){var he=180/Math.PI;return new Xe((2*Math.atan(Math.exp(se.y/this.R))-Math.PI/2)*he,se.x*he/this.R)},bounds:function(){var se=lt*Math.PI;return new Re([-se,-se],[se,se])}()};function gt(se,he,we,Te){if($e(se)){this._a=se[0],this._b=se[1],this._c=se[2],this._d=se[3];return}this._a=se,this._b=he,this._c=we,this._d=Te}gt.prototype={transform:function(se,he){return this._transform(se.clone(),he)},_transform:function(se,he){return he=he||1,se.x=he*(this._a*se.x+this._b),se.y=he*(this._c*se.y+this._d),se},untransform:function(se,he){return he=he||1,new xe((se.x/he-this._b)/this._a,(se.y/he-this._d)/this._c)}};function Et(se,he,we,Te){return new gt(se,he,we,Te)}var mt=re({},Je,{code:"EPSG:3857",projection:it,transformation:function(){var se=.5/(Math.PI*it.R);return Et(se,.5,-se,.5)}()}),je=re({},mt,{code:"EPSG:900913"});function Qe(se){return document.createElementNS("http://www.w3.org/2000/svg",se)}function ut(se,he){var we="",Te,He,Ye,ot,vt,xt;for(Te=0,Ye=se.length;Te<Ye;Te++){for(vt=se[Te],He=0,ot=vt.length;He<ot;He++)xt=vt[He],we+=(He?"L":"M")+xt.x+" "+xt.y;we+=he?Mt.svg?"z":"x":""}return we||"M0 0"}var dt=document.documentElement.style,pt="ActiveXObject"in window,tt=pt&&!document.addEventListener,We="msLaunchUri"in navigator&&!("documentMode"in document),Ke=Bt("webkit"),nt=Bt("android"),ht=Bt("android 2")||Bt("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ft=nt&&Bt("Google")&&st<537&&!("AudioNode"in window),yt=!!window.opera,wt=!We&&Bt("chrome"),Tt=Bt("gecko")&&!Ke&&!yt&&!pt,Dt=!wt&&Bt("safari"),Lt=Bt("phantom"),Gt="OTransition"in dt,Rt=navigator.platform.indexOf("Win")===0,Xt=pt&&"transition"in dt,It="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ht,et="MozPerspective"in dt,ct=!window.L_DISABLE_3D&&(Xt||It||et)&&!Gt&&!Lt,bt=typeof orientation<"u"||Bt("mobile"),_t=bt&&Ke,St=bt&&It,Ct=!window.PointerEvent&&window.MSPointerEvent,Nt=!!(window.PointerEvent||Ct),rt="ontouchstart"in window||!!window.TouchEvent,kt=!window.L_NO_TOUCH&&(rt||Nt),$t=bt&&yt,Pt=bt&&Tt,Ft=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ot=function(){var se=!1;try{var he=Object.defineProperty({},"passive",{get:function(){se=!0}});window.addEventListener("testPassiveEventSupport",be,he),window.removeEventListener("testPassiveEventSupport",be,he)}catch{}return se}(),Ht=function(){return!!document.createElement("canvas").getContext}(),Zt=!!(document.createElementNS&&Qe("svg").createSVGRect),an=!!Zt&&function(){var se=document.createElement("div");return se.innerHTML="<svg/>",(se.firstChild&&se.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),rn=!Zt&&function(){try{var se=document.createElement("div");se.innerHTML='<v:shape adj="1"/>';var he=se.firstChild;return he.style.behavior="url(#default#VML)",he&&typeof he.adj=="object"}catch{return!1}}(),on=navigator.platform.indexOf("Mac")===0,Vt=navigator.platform.indexOf("Linux")===0;function Bt(se){return navigator.userAgent.toLowerCase().indexOf(se)>=0}var Mt={ie:pt,ielt9:tt,edge:We,webkit:Ke,android:nt,android23:ht,androidStock:ft,opera:yt,chrome:wt,gecko:Tt,safari:Dt,phantom:Lt,opera12:Gt,win:Rt,ie3d:Xt,webkit3d:It,gecko3d:et,any3d:ct,mobile:bt,mobileWebkit:_t,mobileWebkit3d:St,msPointer:Ct,pointer:Nt,touch:kt,touchNative:rt,mobileOpera:$t,mobileGecko:Pt,retina:Ft,passiveEvents:Ot,canvas:Ht,svg:Zt,vml:rn,inlineSvg:an,mac:on,linux:Vt},Jt=Mt.msPointer?"MSPointerDown":"pointerdown",Yt=Mt.msPointer?"MSPointerMove":"pointermove",sn=Mt.msPointer?"MSPointerUp":"pointerup",pn=Mt.msPointer?"MSPointerCancel":"pointercancel",$n={touchstart:Jt,touchmove:Yt,touchend:sn,touchcancel:pn},Vn={touchstart:Na,touchmove:In,touchend:In,touchcancel:In},En={},Un=!1;function ca(se,he,we){return he==="touchstart"&&Ba(),Vn[he]?(we=Vn[he].bind(this,we),se.addEventListener($n[he],we,!1),we):(console.warn("wrong event specified:",he),be)}function Yn(se,he,we){if(!$n[he]){console.warn("wrong event specified:",he);return}se.removeEventListener($n[he],we,!1)}function Mn(se){En[se.pointerId]=se}function da(se){En[se.pointerId]&&(En[se.pointerId]=se)}function Xn(se){delete En[se.pointerId]}function Ba(){Un||(document.addEventListener(Jt,Mn,!0),document.addEventListener(Yt,da,!0),document.addEventListener(sn,Xn,!0),document.addEventListener(pn,Xn,!0),Un=!0)}function In(se,he){if(he.pointerType!==(he.MSPOINTER_TYPE_MOUSE||"mouse")){he.touches=[];for(var we in En)he.touches.push(En[we]);he.changedTouches=[he],se(he)}}function Na(se,he){he.MSPOINTER_TYPE_TOUCH&&he.pointerType===he.MSPOINTER_TYPE_TOUCH&&un(he),In(se,he)}function qr(se){var he={},we,Te;for(Te in se)we=se[Te],he[Te]=we&&we.bind?we.bind(se):we;return se=he,he.type="dblclick",he.detail=2,he.isTrusted=!1,he._simulated=!0,he}var Wr=200;function Ur(se,he){se.addEventListener("dblclick",he);var we=0,Te;function He(Ye){if(Ye.detail!==1){Te=Ye.detail;return}if(!(Ye.pointerType==="mouse"||Ye.sourceCapabilities&&!Ye.sourceCapabilities.firesTouchEvents)){var ot=or(Ye);if(!(ot.some(function(xt){return xt instanceof HTMLLabelElement&&xt.attributes.for})&&!ot.some(function(xt){return xt instanceof HTMLInputElement||xt instanceof HTMLSelectElement}))){var vt=Date.now();vt-we<=Wr?(Te++,Te===2&&he(qr(Ye))):Te=1,we=vt}}}return se.addEventListener("click",He),{dblclick:he,simDblclick:He}}function Yr(se,he){se.removeEventListener("dblclick",he.dblclick),se.removeEventListener("click",he.simDblclick)}var Va=ma(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Kn=ma(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),tr=Kn==="webkitTransition"||Kn==="OTransition"?Kn+"End":"transitionend";function nr(se){return typeof se=="string"?document.getElementById(se):se}function Jn(se,he){var we=se.style[he]||se.currentStyle&&se.currentStyle[he];if((!we||we==="auto")&&document.defaultView){var Te=document.defaultView.getComputedStyle(se,null);we=Te?Te[he]:null}return we==="auto"?null:we}function Qt(se,he,we){var Te=document.createElement(se);return Te.className=he||"",we&&we.appendChild(Te),Te}function tn(se){var he=se.parentNode;he&&he.removeChild(se)}function ua(se){for(;se.firstChild;)se.removeChild(se.firstChild)}function Rn(se){var he=se.parentNode;he&&he.lastChild!==se&&he.appendChild(se)}function On(se){var he=se.parentNode;he&&he.firstChild!==se&&he.insertBefore(se,he.firstChild)}function Ma(se,he){if(se.classList!==void 0)return se.classList.contains(he);var we=ha(se);return we.length>0&&new RegExp("(^|\\s)"+he+"(\\s|$)").test(we)}function Wt(se,he){if(se.classList!==void 0)for(var we=me(he),Te=0,He=we.length;Te<He;Te++)se.classList.add(we[Te]);else if(!Ma(se,he)){var Ye=ha(se);Aa(se,(Ye?Ye+" ":"")+he)}}function nn(se,he){se.classList!==void 0?se.classList.remove(he):Aa(se,ge((" "+ha(se)+" ").replace(" "+he+" "," ")))}function Aa(se,he){se.className.baseVal===void 0?se.className=he:se.className.baseVal=he}function ha(se){return se.correspondingElement&&(se=se.correspondingElement),se.className.baseVal===void 0?se.className:se.className.baseVal}function bn(se,he){"opacity"in se.style?se.style.opacity=he:"filter"in se.style&&Xr(se,he)}function Xr(se,he){var we=!1,Te="DXImageTransform.Microsoft.Alpha";try{we=se.filters.item(Te)}catch{if(he===1)return}he=Math.round(he*100),we?(we.Enabled=he!==100,we.Opacity=he):se.style.filter+=" progid:"+Te+"(opacity="+he+")"}function ma(se){for(var he=document.documentElement.style,we=0;we<se.length;we++)if(se[we]in he)return se[we];return!1}function Pn(se,he,we){var Te=he||new xe(0,0);se.style[Va]=(Mt.ie3d?"translate("+Te.x+"px,"+Te.y+"px)":"translate3d("+Te.x+"px,"+Te.y+"px,0)")+(we?" scale("+we+")":"")}function ln(se,he){se._leaflet_pos=he,Mt.any3d?Pn(se,he):(se.style.left=he.x+"px",se.style.top=he.y+"px")}function Ln(se){return se._leaflet_pos||new xe(0,0)}var Qn,ea,Ta;if("onselectstart"in document)Qn=function(){qt(window,"selectstart",un)},ea=function(){en(window,"selectstart",un)};else{var ta=ma(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Qn=function(){if(ta){var se=document.documentElement.style;Ta=se[ta],se[ta]="none"}},ea=function(){ta&&(document.documentElement.style[ta]=Ta,Ta=void 0)}}function Pa(){qt(window,"dragstart",un)}function La(){en(window,"dragstart",un)}var fa,Fa;function Da(se){for(;se.tabIndex===-1;)se=se.parentNode;se.style&&(pa(),fa=se,Fa=se.style.outlineStyle,se.style.outlineStyle="none",qt(window,"keydown",pa))}function pa(){fa&&(fa.style.outlineStyle=Fa,fa=void 0,Fa=void 0,en(window,"keydown",pa))}function ar(se){do se=se.parentNode;while((!se.offsetWidth||!se.offsetHeight)&&se!==document.body);return se}function za(se){var he=se.getBoundingClientRect();return{x:he.width/se.offsetWidth||1,y:he.height/se.offsetHeight||1,boundingClientRect:he}}var Kr={__proto__:null,TRANSFORM:Va,TRANSITION:Kn,TRANSITION_END:tr,get:nr,getStyle:Jn,create:Qt,remove:tn,empty:ua,toFront:Rn,toBack:On,hasClass:Ma,addClass:Wt,removeClass:nn,setClass:Aa,getClass:ha,setOpacity:bn,testProp:ma,setTransform:Pn,setPosition:ln,getPosition:Ln,get disableTextSelection(){return Qn},get enableTextSelection(){return ea},disableImageDrag:Pa,enableImageDrag:La,preventOutline:Da,restoreOutline:pa,getSizedParentNode:ar,getScale:za};function qt(se,he,we,Te){if(he&&typeof he=="object")for(var He in he)Ra(se,He,he[He],we);else{he=me(he);for(var Ye=0,ot=he.length;Ye<ot;Ye++)Ra(se,he[Ye],we,Te)}return this}var _n="_leaflet_events";function en(se,he,we,Te){if(arguments.length===1)rr(se),delete se[_n];else if(he&&typeof he=="object")for(var He in he)Oa(se,He,he[He],we);else if(he=me(he),arguments.length===2)rr(se,function(vt){return ye(he,vt)!==-1});else for(var Ye=0,ot=he.length;Ye<ot;Ye++)Oa(se,he[Ye],we,Te);return this}function rr(se,he){for(var we in se[_n]){var Te=we.split(/\d/)[0];(!he||he(Te))&&Oa(se,Te,null,null,we)}}var Ia={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ra(se,he,we,Te){var He=he+ce(we)+(Te?"_"+ce(Te):"");if(se[_n]&&se[_n][He])return this;var Ye=function(vt){return we.call(Te||se,vt||window.event)},ot=Ye;!Mt.touchNative&&Mt.pointer&&he.indexOf("touch")===0?Ye=ca(se,he,Ye):Mt.touch&&he==="dblclick"?Ye=Ur(se,Ye):"addEventListener"in se?he==="touchstart"||he==="touchmove"||he==="wheel"||he==="mousewheel"?se.addEventListener(Ia[he]||he,Ye,Mt.passiveEvents?{passive:!1}:!1):he==="mouseenter"||he==="mouseleave"?(Ye=function(vt){vt=vt||window.event,ja(se,vt)&&ot(vt)},se.addEventListener(Ia[he],Ye,!1)):se.addEventListener(he,ot,!1):se.attachEvent("on"+he,Ye),se[_n]=se[_n]||{},se[_n][He]=Ye}function Oa(se,he,we,Te,He){He=He||he+ce(we)+(Te?"_"+ce(Te):"");var Ye=se[_n]&&se[_n][He];if(!Ye)return this;!Mt.touchNative&&Mt.pointer&&he.indexOf("touch")===0?Yn(se,he,Ye):Mt.touch&&he==="dblclick"?Yr(se,Ye):"removeEventListener"in se?se.removeEventListener(Ia[he]||he,Ye,!1):se.detachEvent("on"+he,Ye),se[_n][He]=null}function Fn(se){return se.stopPropagation?se.stopPropagation():se.originalEvent?se.originalEvent._stopped=!0:se.cancelBubble=!0,this}function Ha(se){return Ra(se,"wheel",Fn),this}function na(se){return qt(se,"mousedown touchstart dblclick contextmenu",Fn),se._leaflet_disable_click=!0,this}function un(se){return se.preventDefault?se.preventDefault():se.returnValue=!1,this}function Dn(se){return un(se),Fn(se),this}function or(se){if(se.composedPath)return se.composedPath();for(var he=[],we=se.target;we;)he.push(we),we=we.parentNode;return he}function ir(se,he){if(!he)return new xe(se.clientX,se.clientY);var we=za(he),Te=we.boundingClientRect;return new xe((se.clientX-Te.left)/we.x-he.clientLeft,(se.clientY-Te.top)/we.y-he.clientTop)}var Jr=Mt.linux&&Mt.chrome?window.devicePixelRatio:Mt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function sr(se){return Mt.edge?se.wheelDeltaY/2:se.deltaY&&se.deltaMode===0?-se.deltaY/Jr:se.deltaY&&se.deltaMode===1?-se.deltaY*20:se.deltaY&&se.deltaMode===2?-se.deltaY*60:se.deltaX||se.deltaZ?0:se.wheelDelta?(se.wheelDeltaY||se.wheelDelta)/2:se.detail&&Math.abs(se.detail)<32765?-se.detail*20:se.detail?se.detail/-32765*60:0}function ja(se,he){var we=he.relatedTarget;if(!we)return!0;try{for(;we&&we!==se;)we=we.parentNode}catch{return!1}return we!==se}var Qr={__proto__:null,on:qt,off:en,stopPropagation:Fn,disableScrollPropagation:Ha,disableClickPropagation:na,preventDefault:un,stop:Dn,getPropagationPath:or,getMousePosition:ir,getWheelDelta:sr,isExternalTarget:ja,addListener:qt,removeListener:en},lr=Me.extend({run:function(se,he,we,Te){this.stop(),this._el=se,this._inProgress=!0,this._duration=we||.25,this._easeOutPower=1/Math.max(Te||.5,.2),this._startPos=Ln(se),this._offset=he.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Ie(this._animate,this),this._step()},_step:function(se){var he=+new Date-this._startTime,we=this._duration*1e3;he<we?this._runFrame(this._easeOut(he/we),se):(this._runFrame(1),this._complete())},_runFrame:function(se,he){var we=this._startPos.add(this._offset.multiplyBy(se));he&&we._round(),ln(this._el,we),this.fire("step")},_complete:function(){ze(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(se){return 1-Math.pow(1-se,this._easeOutPower)}}),Kt=Me.extend({options:{crs:mt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(se,he){he=pe(this,he),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(se),this._initLayout(),this._onResize=ie(this._onResize,this),this._initEvents(),he.maxBounds&&this.setMaxBounds(he.maxBounds),he.zoom!==void 0&&(this._zoom=this._limitZoom(he.zoom)),he.center&&he.zoom!==void 0&&this.setView(Ue(he.center),he.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Kn&&Mt.any3d&&!Mt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),qt(this._proxy,tr,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(se,he,we){if(he=he===void 0?this._zoom:this._limitZoom(he),se=this._limitCenter(Ue(se),he,this.options.maxBounds),we=we||{},this._stop(),this._loaded&&!we.reset&&we!==!0){we.animate!==void 0&&(we.zoom=re({animate:we.animate},we.zoom),we.pan=re({animate:we.animate,duration:we.duration},we.pan));var Te=this._zoom!==he?this._tryAnimatedZoom&&this._tryAnimatedZoom(se,he,we.zoom):this._tryAnimatedPan(se,we.pan);if(Te)return clearTimeout(this._sizeTimer),this}return this._resetView(se,he,we.pan&&we.pan.noMoveStart),this},setZoom:function(se,he){return this._loaded?this.setView(this.getCenter(),se,{zoom:he}):(this._zoom=se,this)},zoomIn:function(se,he){return se=se||(Mt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+se,he)},zoomOut:function(se,he){return se=se||(Mt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-se,he)},setZoomAround:function(se,he,we){var Te=this.getZoomScale(he),He=this.getSize().divideBy(2),Ye=se instanceof xe?se:this.latLngToContainerPoint(se),ot=Ye.subtract(He).multiplyBy(1-1/Te),vt=this.containerPointToLatLng(He.add(ot));return this.setView(vt,he,{zoom:we})},_getBoundsCenterZoom:function(se,he){he=he||{},se=se.getBounds?se.getBounds():Ze(se);var we=Fe(he.paddingTopLeft||he.padding||[0,0]),Te=Fe(he.paddingBottomRight||he.padding||[0,0]),He=this.getBoundsZoom(se,!1,we.add(Te));if(He=typeof he.maxZoom=="number"?Math.min(he.maxZoom,He):He,He===1/0)return{center:se.getCenter(),zoom:He};var Ye=Te.subtract(we).divideBy(2),ot=this.project(se.getSouthWest(),He),vt=this.project(se.getNorthEast(),He),xt=this.unproject(ot.add(vt).divideBy(2).add(Ye),He);return{center:xt,zoom:He}},fitBounds:function(se,he){if(se=Ze(se),!se.isValid())throw new Error("Bounds are not valid.");var we=this._getBoundsCenterZoom(se,he);return this.setView(we.center,we.zoom,he)},fitWorld:function(se){return this.fitBounds([[-90,-180],[90,180]],se)},panTo:function(se,he){return this.setView(se,this._zoom,{pan:he})},panBy:function(se,he){if(se=Fe(se).round(),he=he||{},!se.x&&!se.y)return this.fire("moveend");if(he.animate!==!0&&!this.getSize().contains(se))return this._resetView(this.unproject(this.project(this.getCenter()).add(se)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new lr,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),he.noMoveStart||this.fire("movestart"),he.animate!==!1){Wt(this._mapPane,"leaflet-pan-anim");var we=this._getMapPanePos().subtract(se).round();this._panAnim.run(this._mapPane,we,he.duration||.25,he.easeLinearity)}else this._rawPanBy(se),this.fire("move").fire("moveend");return this},flyTo:function(se,he,we){if(we=we||{},we.animate===!1||!Mt.any3d)return this.setView(se,he,we);this._stop();var Te=this.project(this.getCenter()),He=this.project(se),Ye=this.getSize(),ot=this._zoom;se=Ue(se),he=he===void 0?ot:he;var vt=Math.max(Ye.x,Ye.y),xt=vt*this.getZoomScale(ot,he),At=He.distanceTo(Te)||1,zt=1.42,jt=zt*zt;function Ut(cn){var Sa=cn?-1:1,Ho=cn?xt:vt,jo=xt*xt-vt*vt+Sa*jt*jt*At*At,Go=2*Ho*jt*At,er=jo/Go,jr=Math.sqrt(er*er+1)-er,Zo=jr<1e-9?-18:Math.log(jr);return Zo}function mn(cn){return(Math.exp(cn)-Math.exp(-cn))/2}function dn(cn){return(Math.exp(cn)+Math.exp(-cn))/2}function gn(cn){return mn(cn)/dn(cn)}var fn=Ut(0);function Wn(cn){return vt*(dn(fn)/dn(fn+zt*cn))}function zo(cn){return vt*(dn(fn)*gn(fn+zt*cn)-mn(fn))/jt}function Io(cn){return 1-Math.pow(1-cn,1.5)}var Ro=Date.now(),Or=(Ut(1)-fn)/zt,Oo=we.duration?1e3*we.duration:1e3*Or*.8;function Hr(){var cn=(Date.now()-Ro)/Oo,Sa=Io(cn)*Or;cn<=1?(this._flyToFrame=Ie(Hr,this),this._move(this.unproject(Te.add(He.subtract(Te).multiplyBy(zo(Sa)/At)),ot),this.getScaleZoom(vt/Wn(Sa),ot),{flyTo:!0})):this._move(se,he)._moveEnd(!0)}return this._moveStart(!0,we.noMoveStart),Hr.call(this),this},flyToBounds:function(se,he){var we=this._getBoundsCenterZoom(se,he);return this.flyTo(we.center,we.zoom,he)},setMaxBounds:function(se){return se=Ze(se),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),se.isValid()?(this.options.maxBounds=se,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(se){var he=this.options.minZoom;return this.options.minZoom=se,this._loaded&&he!==se&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(se):this},setMaxZoom:function(se){var he=this.options.maxZoom;return this.options.maxZoom=se,this._loaded&&he!==se&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(se):this},panInsideBounds:function(se,he){this._enforcingBounds=!0;var we=this.getCenter(),Te=this._limitCenter(we,this._zoom,Ze(se));return we.equals(Te)||this.panTo(Te,he),this._enforcingBounds=!1,this},panInside:function(se,he){he=he||{};var we=Fe(he.paddingTopLeft||he.padding||[0,0]),Te=Fe(he.paddingBottomRight||he.padding||[0,0]),He=this.project(this.getCenter()),Ye=this.project(se),ot=this.getPixelBounds(),vt=qe([ot.min.add(we),ot.max.subtract(Te)]),xt=vt.getSize();if(!vt.contains(Ye)){this._enforcingBounds=!0;var At=Ye.subtract(vt.getCenter()),zt=vt.extend(Ye).getSize().subtract(xt);He.x+=At.x<0?-zt.x:zt.x,He.y+=At.y<0?-zt.y:zt.y,this.panTo(this.unproject(He),he),this._enforcingBounds=!1}return this},invalidateSize:function(se){if(!this._loaded)return this;se=re({animate:!1,pan:!0},se===!0?{animate:!0}:se);var he=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var we=this.getSize(),Te=he.divideBy(2).round(),He=we.divideBy(2).round(),Ye=Te.subtract(He);return!Ye.x&&!Ye.y?this:(se.animate&&se.pan?this.panBy(Ye):(se.pan&&this._rawPanBy(Ye),this.fire("move"),se.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(ie(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:he,newSize:we}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(se){if(se=this._locateOptions=re({timeout:1e4,watch:!1},se),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var he=ie(this._handleGeolocationResponse,this),we=ie(this._handleGeolocationError,this);return se.watch?this._locationWatchId=navigator.geolocation.watchPosition(he,we,se):navigator.geolocation.getCurrentPosition(he,we,se),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(se){if(this._container._leaflet_id){var he=se.code,we=se.message||(he===1?"permission denied":he===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:he,message:"Geolocation error: "+we+"."})}},_handleGeolocationResponse:function(se){if(this._container._leaflet_id){var he=se.coords.latitude,we=se.coords.longitude,Te=new Xe(he,we),He=Te.toBounds(se.coords.accuracy*2),Ye=this._locateOptions;if(Ye.setView){var ot=this.getBoundsZoom(He);this.setView(Te,Ye.maxZoom?Math.min(ot,Ye.maxZoom):ot)}var vt={latlng:Te,bounds:He,timestamp:se.timestamp};for(var xt in se.coords)typeof se.coords[xt]=="number"&&(vt[xt]=se.coords[xt]);this.fire("locationfound",vt)}},addHandler:function(se,he){if(!he)return this;var we=this[se]=new he(this);return this._handlers.push(we),this.options[se]&&we.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),tn(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ze(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var se;for(se in this._layers)this._layers[se].remove();for(se in this._panes)tn(this._panes[se]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(se,he){var we="leaflet-pane"+(se?" leaflet-"+se.replace("Pane","")+"-pane":""),Te=Qt("div",we,he||this._mapPane);return se&&(this._panes[se]=Te),Te},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var se=this.getPixelBounds(),he=this.unproject(se.getBottomLeft()),we=this.unproject(se.getTopRight());return new Ge(he,we)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(se,he,we){se=Ze(se),we=Fe(we||[0,0]);var Te=this.getZoom()||0,He=this.getMinZoom(),Ye=this.getMaxZoom(),ot=se.getNorthWest(),vt=se.getSouthEast(),xt=this.getSize().subtract(we),At=qe(this.project(vt,Te),this.project(ot,Te)).getSize(),zt=Mt.any3d?this.options.zoomSnap:1,jt=xt.x/At.x,Ut=xt.y/At.y,mn=he?Math.max(jt,Ut):Math.min(jt,Ut);return Te=this.getScaleZoom(mn,Te),zt&&(Te=Math.round(Te/(zt/100))*(zt/100),Te=he?Math.ceil(Te/zt)*zt:Math.floor(Te/zt)*zt),Math.max(He,Math.min(Ye,Te))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new xe(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(se,he){var we=this._getTopLeftPoint(se,he);return new Re(we,we.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(se){return this.options.crs.getProjectedBounds(se===void 0?this.getZoom():se)},getPane:function(se){return typeof se=="string"?this._panes[se]:se},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(se,he){var we=this.options.crs;return he=he===void 0?this._zoom:he,we.scale(se)/we.scale(he)},getScaleZoom:function(se,he){var we=this.options.crs;he=he===void 0?this._zoom:he;var Te=we.zoom(se*we.scale(he));return isNaN(Te)?1/0:Te},project:function(se,he){return he=he===void 0?this._zoom:he,this.options.crs.latLngToPoint(Ue(se),he)},unproject:function(se,he){return he=he===void 0?this._zoom:he,this.options.crs.pointToLatLng(Fe(se),he)},layerPointToLatLng:function(se){var he=Fe(se).add(this.getPixelOrigin());return this.unproject(he)},latLngToLayerPoint:function(se){var he=this.project(Ue(se))._round();return he._subtract(this.getPixelOrigin())},wrapLatLng:function(se){return this.options.crs.wrapLatLng(Ue(se))},wrapLatLngBounds:function(se){return this.options.crs.wrapLatLngBounds(Ze(se))},distance:function(se,he){return this.options.crs.distance(Ue(se),Ue(he))},containerPointToLayerPoint:function(se){return Fe(se).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(se){return Fe(se).add(this._getMapPanePos())},containerPointToLatLng:function(se){var he=this.containerPointToLayerPoint(Fe(se));return this.layerPointToLatLng(he)},latLngToContainerPoint:function(se){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Ue(se)))},mouseEventToContainerPoint:function(se){return ir(se,this._container)},mouseEventToLayerPoint:function(se){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(se))},mouseEventToLatLng:function(se){return this.layerPointToLatLng(this.mouseEventToLayerPoint(se))},_initContainer:function(se){var he=this._container=nr(se);if(he){if(he._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");qt(he,"scroll",this._onScroll,this),this._containerId=ce(he)},_initLayout:function(){var se=this._container;this._fadeAnimated=this.options.fadeAnimation&&Mt.any3d,Wt(se,"leaflet-container"+(Mt.touch?" leaflet-touch":"")+(Mt.retina?" leaflet-retina":"")+(Mt.ielt9?" leaflet-oldie":"")+(Mt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var he=Jn(se,"position");he!=="absolute"&&he!=="relative"&&he!=="fixed"&&he!=="sticky"&&(se.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var se=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ln(this._mapPane,new xe(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Wt(se.markerPane,"leaflet-zoom-hide"),Wt(se.shadowPane,"leaflet-zoom-hide"))},_resetView:function(se,he,we){ln(this._mapPane,new xe(0,0));var Te=!this._loaded;this._loaded=!0,he=this._limitZoom(he),this.fire("viewprereset");var He=this._zoom!==he;this._moveStart(He,we)._move(se,he)._moveEnd(He),this.fire("viewreset"),Te&&this.fire("load")},_moveStart:function(se,he){return se&&this.fire("zoomstart"),he||this.fire("movestart"),this},_move:function(se,he,we,Te){he===void 0&&(he=this._zoom);var He=this._zoom!==he;return this._zoom=he,this._lastCenter=se,this._pixelOrigin=this._getNewPixelOrigin(se),Te?we&&we.pinch&&this.fire("zoom",we):((He||we&&we.pinch)&&this.fire("zoom",we),this.fire("move",we)),this},_moveEnd:function(se){return se&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ze(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(se){ln(this._mapPane,this._getMapPanePos().subtract(se))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(se){this._targets={},this._targets[ce(this._container)]=this;var he=se?en:qt;he(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&he(window,"resize",this._onResize,this),Mt.any3d&&this.options.transform3DLimit&&(se?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ze(this._resizeRequest),this._resizeRequest=Ie(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var se=this._getMapPanePos();Math.max(Math.abs(se.x),Math.abs(se.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(se,he){for(var we=[],Te,He=he==="mouseout"||he==="mouseover",Ye=se.target||se.srcElement,ot=!1;Ye;){if(Te=this._targets[ce(Ye)],Te&&(he==="click"||he==="preclick")&&this._draggableMoved(Te)){ot=!0;break}if(Te&&Te.listens(he,!0)&&(He&&!ja(Ye,se)||(we.push(Te),He))||Ye===this._container)break;Ye=Ye.parentNode}return!we.length&&!ot&&!He&&this.listens(he,!0)&&(we=[this]),we},_isClickDisabled:function(se){for(;se&&se!==this._container;){if(se._leaflet_disable_click)return!0;se=se.parentNode}},_handleDOMEvent:function(se){var he=se.target||se.srcElement;if(!(!this._loaded||he._leaflet_disable_events||se.type==="click"&&this._isClickDisabled(he))){var we=se.type;we==="mousedown"&&Da(he),this._fireDOMEvent(se,we)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(se,he,we){if(se.type==="click"){var Te=re({},se);Te.type="preclick",this._fireDOMEvent(Te,Te.type,we)}var He=this._findEventTargets(se,he);if(we){for(var Ye=[],ot=0;ot<we.length;ot++)we[ot].listens(he,!0)&&Ye.push(we[ot]);He=Ye.concat(He)}if(He.length){he==="contextmenu"&&un(se);var vt=He[0],xt={originalEvent:se};if(se.type!=="keypress"&&se.type!=="keydown"&&se.type!=="keyup"){var At=vt.getLatLng&&(!vt._radius||vt._radius<=10);xt.containerPoint=At?this.latLngToContainerPoint(vt.getLatLng()):this.mouseEventToContainerPoint(se),xt.layerPoint=this.containerPointToLayerPoint(xt.containerPoint),xt.latlng=At?vt.getLatLng():this.layerPointToLatLng(xt.layerPoint)}for(ot=0;ot<He.length;ot++)if(He[ot].fire(he,xt,!0),xt.originalEvent._stopped||He[ot].options.bubblingMouseEvents===!1&&ye(this._mouseEvents,he)!==-1)return}},_draggableMoved:function(se){return se=se.dragging&&se.dragging.enabled()?se:this,se.dragging&&se.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var se=0,he=this._handlers.length;se<he;se++)this._handlers[se].disable()},whenReady:function(se,he){return this._loaded?se.call(he||this,{target:this}):this.on("load",se,he),this},_getMapPanePos:function(){return Ln(this._mapPane)||new xe(0,0)},_moved:function(){var se=this._getMapPanePos();return se&&!se.equals([0,0])},_getTopLeftPoint:function(se,he){var we=se&&he!==void 0?this._getNewPixelOrigin(se,he):this.getPixelOrigin();return we.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(se,he){var we=this.getSize()._divideBy(2);return this.project(se,he)._subtract(we)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(se,he,we){var Te=this._getNewPixelOrigin(we,he);return this.project(se,he)._subtract(Te)},_latLngBoundsToNewLayerBounds:function(se,he,we){var Te=this._getNewPixelOrigin(we,he);return qe([this.project(se.getSouthWest(),he)._subtract(Te),this.project(se.getNorthWest(),he)._subtract(Te),this.project(se.getSouthEast(),he)._subtract(Te),this.project(se.getNorthEast(),he)._subtract(Te)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(se){return this.latLngToLayerPoint(se).subtract(this._getCenterLayerPoint())},_limitCenter:function(se,he,we){if(!we)return se;var Te=this.project(se,he),He=this.getSize().divideBy(2),Ye=new Re(Te.subtract(He),Te.add(He)),ot=this._getBoundsOffset(Ye,we,he);return Math.abs(ot.x)<=1&&Math.abs(ot.y)<=1?se:this.unproject(Te.add(ot),he)},_limitOffset:function(se,he){if(!he)return se;var we=this.getPixelBounds(),Te=new Re(we.min.add(se),we.max.add(se));return se.add(this._getBoundsOffset(Te,he))},_getBoundsOffset:function(se,he,we){var Te=qe(this.project(he.getNorthEast(),we),this.project(he.getSouthWest(),we)),He=Te.min.subtract(se.min),Ye=Te.max.subtract(se.max),ot=this._rebound(He.x,-Ye.x),vt=this._rebound(He.y,-Ye.y);return new xe(ot,vt)},_rebound:function(se,he){return se+he>0?Math.round(se-he)/2:Math.max(0,Math.ceil(se))-Math.max(0,Math.floor(he))},_limitZoom:function(se){var he=this.getMinZoom(),we=this.getMaxZoom(),Te=Mt.any3d?this.options.zoomSnap:1;return Te&&(se=Math.round(se/Te)*Te),Math.max(he,Math.min(we,se))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){nn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(se,he){var we=this._getCenterOffset(se)._trunc();return(he&&he.animate)!==!0&&!this.getSize().contains(we)?!1:(this.panBy(we,he),!0)},_createAnimProxy:function(){var se=this._proxy=Qt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(se),this.on("zoomanim",function(he){var we=Va,Te=this._proxy.style[we];Pn(this._proxy,this.project(he.center,he.zoom),this.getZoomScale(he.zoom,1)),Te===this._proxy.style[we]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){tn(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var se=this.getCenter(),he=this.getZoom();Pn(this._proxy,this.project(se,he),this.getZoomScale(he,1))},_catchTransitionEnd:function(se){this._animatingZoom&&se.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(se,he,we){if(this._animatingZoom)return!0;if(we=we||{},!this._zoomAnimated||we.animate===!1||this._nothingToAnimate()||Math.abs(he-this._zoom)>this.options.zoomAnimationThreshold)return!1;var Te=this.getZoomScale(he),He=this._getCenterOffset(se)._divideBy(1-1/Te);return we.animate!==!0&&!this.getSize().contains(He)?!1:(Ie(function(){this._moveStart(!0,we.noMoveStart||!1)._animateZoom(se,he,!0)},this),!0)},_animateZoom:function(se,he,we,Te){this._mapPane&&(we&&(this._animatingZoom=!0,this._animateToCenter=se,this._animateToZoom=he,Wt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:se,zoom:he,noUpdate:Te}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(ie(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&nn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function eo(se,he){return new Kt(se,he)}var yn=Ne.extend({options:{position:"topright"},initialize:function(se){pe(this,se)},getPosition:function(){return this.options.position},setPosition:function(se){var he=this._map;return he&&he.removeControl(this),this.options.position=se,he&&he.addControl(this),this},getContainer:function(){return this._container},addTo:function(se){this.remove(),this._map=se;var he=this._container=this.onAdd(se),we=this.getPosition(),Te=se._controlCorners[we];return Wt(he,"leaflet-control"),we.indexOf("bottom")!==-1?Te.insertBefore(he,Te.firstChild):Te.appendChild(he),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(tn(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(se){this._map&&se&&se.screenX>0&&se.screenY>0&&this._map.getContainer().focus()}}),aa=function(se){return new yn(se)};Kt.include({addControl:function(se){return se.addTo(this),this},removeControl:function(se){return se.remove(),this},_initControlPos:function(){var se=this._controlCorners={},he="leaflet-",we=this._controlContainer=Qt("div",he+"control-container",this._container);function Te(He,Ye){var ot=he+He+" "+he+Ye;se[He+Ye]=Qt("div",ot,we)}Te("top","left"),Te("top","right"),Te("bottom","left"),Te("bottom","right")},_clearControlPos:function(){for(var se in this._controlCorners)tn(this._controlCorners[se]);tn(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var cr=yn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(se,he,we,Te){return we<Te?-1:Te<we?1:0}},initialize:function(se,he,we){pe(this,we),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var Te in se)this._addLayer(se[Te],Te);for(Te in he)this._addLayer(he[Te],Te,!0)},onAdd:function(se){this._initLayout(),this._update(),this._map=se,se.on("zoomend",this._checkDisabledLayers,this);for(var he=0;he<this._layers.length;he++)this._layers[he].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(se){return yn.prototype.addTo.call(this,se),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var se=0;se<this._layers.length;se++)this._layers[se].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(se,he){return this._addLayer(se,he),this._map?this._update():this},addOverlay:function(se,he){return this._addLayer(se,he,!0),this._map?this._update():this},removeLayer:function(se){se.off("add remove",this._onLayerChange,this);var he=this._getLayer(ce(se));return he&&this._layers.splice(this._layers.indexOf(he),1),this._map?this._update():this},expand:function(){Wt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var se=this._map.getSize().y-(this._container.offsetTop+50);return se<this._section.clientHeight?(Wt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=se+"px"):nn(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return nn(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var se="leaflet-control-layers",he=this._container=Qt("div",se),we=this.options.collapsed;he.setAttribute("aria-haspopup",!0),na(he),Ha(he);var Te=this._section=Qt("section",se+"-list");we&&(this._map.on("click",this.collapse,this),qt(he,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var He=this._layersLink=Qt("a",se+"-toggle",he);He.href="#",He.title="Layers",He.setAttribute("role","button"),qt(He,{keydown:function(Ye){Ye.keyCode===13&&this._expandSafely()},click:function(Ye){un(Ye),this._expandSafely()}},this),we||this.expand(),this._baseLayersList=Qt("div",se+"-base",Te),this._separator=Qt("div",se+"-separator",Te),this._overlaysList=Qt("div",se+"-overlays",Te),he.appendChild(Te)},_getLayer:function(se){for(var he=0;he<this._layers.length;he++)if(this._layers[he]&&ce(this._layers[he].layer)===se)return this._layers[he]},_addLayer:function(se,he,we){this._map&&se.on("add remove",this._onLayerChange,this),this._layers.push({layer:se,name:he,overlay:we}),this.options.sortLayers&&this._layers.sort(ie(function(Te,He){return this.options.sortFunction(Te.layer,He.layer,Te.name,He.name)},this)),this.options.autoZIndex&&se.setZIndex&&(this._lastZIndex++,se.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ua(this._baseLayersList),ua(this._overlaysList),this._layerControlInputs=[];var se,he,we,Te,He=0;for(we=0;we<this._layers.length;we++)Te=this._layers[we],this._addItem(Te),he=he||Te.overlay,se=se||!Te.overlay,He+=Te.overlay?0:1;return this.options.hideSingleBase&&(se=se&&He>1,this._baseLayersList.style.display=se?"":"none"),this._separator.style.display=he&&se?"":"none",this},_onLayerChange:function(se){this._handlingClick||this._update();var he=this._getLayer(ce(se.target)),we=he.overlay?se.type==="add"?"overlayadd":"overlayremove":se.type==="add"?"baselayerchange":null;we&&this._map.fire(we,he)},_createRadioElement:function(se,he){var we='<input type="radio" class="leaflet-control-layers-selector" name="'+se+'"'+(he?' checked="checked"':"")+"/>",Te=document.createElement("div");return Te.innerHTML=we,Te.firstChild},_addItem:function(se){var he=document.createElement("label"),we=this._map.hasLayer(se.layer),Te;se.overlay?(Te=document.createElement("input"),Te.type="checkbox",Te.className="leaflet-control-layers-selector",Te.defaultChecked=we):Te=this._createRadioElement("leaflet-base-layers_"+ce(this),we),this._layerControlInputs.push(Te),Te.layerId=ce(se.layer),qt(Te,"click",this._onInputClick,this);var He=document.createElement("span");He.innerHTML=" "+se.name;var Ye=document.createElement("span");he.appendChild(Ye),Ye.appendChild(Te),Ye.appendChild(He);var ot=se.overlay?this._overlaysList:this._baseLayersList;return ot.appendChild(he),this._checkDisabledLayers(),he},_onInputClick:function(){if(!this._preventClick){var se=this._layerControlInputs,he,we,Te=[],He=[];this._handlingClick=!0;for(var Ye=se.length-1;Ye>=0;Ye--)he=se[Ye],we=this._getLayer(he.layerId).layer,he.checked?Te.push(we):he.checked||He.push(we);for(Ye=0;Ye<He.length;Ye++)this._map.hasLayer(He[Ye])&&this._map.removeLayer(He[Ye]);for(Ye=0;Ye<Te.length;Ye++)this._map.hasLayer(Te[Ye])||this._map.addLayer(Te[Ye]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var se=this._layerControlInputs,he,we,Te=this._map.getZoom(),He=se.length-1;He>=0;He--)he=se[He],we=this._getLayer(he.layerId).layer,he.disabled=we.options.minZoom!==void 0&&Te<we.options.minZoom||we.options.maxZoom!==void 0&&Te>we.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var se=this._section;this._preventClick=!0,qt(se,"click",un),this.expand();var he=this;setTimeout(function(){en(se,"click",un),he._preventClick=!1})}}),to=function(se,he,we){return new cr(se,he,we)},Ga=yn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(se){var he="leaflet-control-zoom",we=Qt("div",he+" leaflet-bar"),Te=this.options;return this._zoomInButton=this._createButton(Te.zoomInText,Te.zoomInTitle,he+"-in",we,this._zoomIn),this._zoomOutButton=this._createButton(Te.zoomOutText,Te.zoomOutTitle,he+"-out",we,this._zoomOut),this._updateDisabled(),se.on("zoomend zoomlevelschange",this._updateDisabled,this),we},onRemove:function(se){se.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(se){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(se.shiftKey?3:1))},_zoomOut:function(se){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(se.shiftKey?3:1))},_createButton:function(se,he,we,Te,He){var Ye=Qt("a",we,Te);return Ye.innerHTML=se,Ye.href="#",Ye.title=he,Ye.setAttribute("role","button"),Ye.setAttribute("aria-label",he),na(Ye),qt(Ye,"click",Dn),qt(Ye,"click",He,this),qt(Ye,"click",this._refocusOnMap,this),Ye},_updateDisabled:function(){var se=this._map,he="leaflet-disabled";nn(this._zoomInButton,he),nn(this._zoomOutButton,he),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||se._zoom===se.getMinZoom())&&(Wt(this._zoomOutButton,he),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||se._zoom===se.getMaxZoom())&&(Wt(this._zoomInButton,he),this._zoomInButton.setAttribute("aria-disabled","true"))}});Kt.mergeOptions({zoomControl:!0}),Kt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ga,this.addControl(this.zoomControl))});var no=function(se){return new Ga(se)},dr=yn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(se){var he="leaflet-control-scale",we=Qt("div",he),Te=this.options;return this._addScales(Te,he+"-line",we),se.on(Te.updateWhenIdle?"moveend":"move",this._update,this),se.whenReady(this._update,this),we},onRemove:function(se){se.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(se,he,we){se.metric&&(this._mScale=Qt("div",he,we)),se.imperial&&(this._iScale=Qt("div",he,we))},_update:function(){var se=this._map,he=se.getSize().y/2,we=se.distance(se.containerPointToLatLng([0,he]),se.containerPointToLatLng([this.options.maxWidth,he]));this._updateScales(we)},_updateScales:function(se){this.options.metric&&se&&this._updateMetric(se),this.options.imperial&&se&&this._updateImperial(se)},_updateMetric:function(se){var he=this._getRoundNum(se),we=he<1e3?he+" m":he/1e3+" km";this._updateScale(this._mScale,we,he/se)},_updateImperial:function(se){var he=se*3.2808399,we,Te,He;he>5280?(we=he/5280,Te=this._getRoundNum(we),this._updateScale(this._iScale,Te+" mi",Te/we)):(He=this._getRoundNum(he),this._updateScale(this._iScale,He+" ft",He/he))},_updateScale:function(se,he,we){se.style.width=Math.round(this.options.maxWidth*we)+"px",se.innerHTML=he},_getRoundNum:function(se){var he=Math.pow(10,(Math.floor(se)+"").length-1),we=se/he;return we=we>=10?10:we>=5?5:we>=3?3:we>=2?2:1,he*we}}),ao=function(se){return new dr(se)},ro='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Za=yn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Mt.inlineSvg?ro+" ":"")+"Leaflet</a>"},initialize:function(se){pe(this,se),this._attributions={}},onAdd:function(se){se.attributionControl=this,this._container=Qt("div","leaflet-control-attribution"),na(this._container);for(var he in se._layers)se._layers[he].getAttribution&&this.addAttribution(se._layers[he].getAttribution());return this._update(),se.on("layeradd",this._addAttribution,this),this._container},onRemove:function(se){se.off("layeradd",this._addAttribution,this)},_addAttribution:function(se){se.layer.getAttribution&&(this.addAttribution(se.layer.getAttribution()),se.layer.once("remove",function(){this.removeAttribution(se.layer.getAttribution())},this))},setPrefix:function(se){return this.options.prefix=se,this._update(),this},addAttribution:function(se){return se?(this._attributions[se]||(this._attributions[se]=0),this._attributions[se]++,this._update(),this):this},removeAttribution:function(se){return se?(this._attributions[se]&&(this._attributions[se]--,this._update()),this):this},_update:function(){if(this._map){var se=[];for(var he in this._attributions)this._attributions[he]&&se.push(he);var we=[];this.options.prefix&&we.push(this.options.prefix),se.length&&we.push(se.join(", ")),this._container.innerHTML=we.join(' <span aria-hidden="true">|</span> ')}}});Kt.mergeOptions({attributionControl:!0}),Kt.addInitHook(function(){this.options.attributionControl&&new Za().addTo(this)});var oo=function(se){return new Za(se)};yn.Layers=cr,yn.Zoom=Ga,yn.Scale=dr,yn.Attribution=Za,aa.layers=to,aa.zoom=no,aa.scale=ao,aa.attribution=oo;var xn=Ne.extend({initialize:function(se){this._map=se},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});xn.addTo=function(se,he){return se.addHandler(he,this),this};var io={Events:Be},ur=Mt.touch?"touchstart mousedown":"mousedown",An=Me.extend({options:{clickTolerance:3},initialize:function(se,he,we,Te){pe(this,Te),this._element=se,this._dragStartTarget=he||se,this._preventOutline=we},enable:function(){this._enabled||(qt(this._dragStartTarget,ur,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(An._dragging===this&&this.finishDrag(!0),en(this._dragStartTarget,ur,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(se){if(this._enabled&&(this._moved=!1,!Ma(this._element,"leaflet-zoom-anim"))){if(se.touches&&se.touches.length!==1){An._dragging===this&&this.finishDrag();return}if(!(An._dragging||se.shiftKey||se.which!==1&&se.button!==1&&!se.touches)&&(An._dragging=this,this._preventOutline&&Da(this._element),Pa(),Qn(),!this._moving)){this.fire("down");var he=se.touches?se.touches[0]:se,we=ar(this._element);this._startPoint=new xe(he.clientX,he.clientY),this._startPos=Ln(this._element),this._parentScale=za(we);var Te=se.type==="mousedown";qt(document,Te?"mousemove":"touchmove",this._onMove,this),qt(document,Te?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(se){if(this._enabled){if(se.touches&&se.touches.length>1){this._moved=!0;return}var he=se.touches&&se.touches.length===1?se.touches[0]:se,we=new xe(he.clientX,he.clientY)._subtract(this._startPoint);!we.x&&!we.y||Math.abs(we.x)+Math.abs(we.y)<this.options.clickTolerance||(we.x/=this._parentScale.x,we.y/=this._parentScale.y,un(se),this._moved||(this.fire("dragstart"),this._moved=!0,Wt(document.body,"leaflet-dragging"),this._lastTarget=se.target||se.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Wt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(we),this._moving=!0,this._lastEvent=se,this._updatePosition())}},_updatePosition:function(){var se={originalEvent:this._lastEvent};this.fire("predrag",se),ln(this._element,this._newPos),this.fire("drag",se)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(se){nn(document.body,"leaflet-dragging"),this._lastTarget&&(nn(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),en(document,"mousemove touchmove",this._onMove,this),en(document,"mouseup touchend touchcancel",this._onUp,this),La(),ea();var he=this._moved&&this._moving;this._moving=!1,An._dragging=!1,he&&this.fire("dragend",{noInertia:se,distance:this._newPos.distanceTo(this._startPos)})}});function hr(se,he,we){var Te,He=[1,4,2,8],Ye,ot,vt,xt,At,zt,jt,Ut;for(Ye=0,zt=se.length;Ye<zt;Ye++)se[Ye]._code=zn(se[Ye],he);for(vt=0;vt<4;vt++){for(jt=He[vt],Te=[],Ye=0,zt=se.length,ot=zt-1;Ye<zt;ot=Ye++)xt=se[Ye],At=se[ot],xt._code&jt?At._code&jt||(Ut=ba(At,xt,jt,he,we),Ut._code=zn(Ut,he),Te.push(Ut)):(At._code&jt&&(Ut=ba(At,xt,jt,he,we),Ut._code=zn(Ut,he),Te.push(Ut)),Te.push(xt));se=Te}return se}function mr(se,he){var we,Te,He,Ye,ot,vt,xt,At,zt;if(!se||se.length===0)throw new Error("latlngs not passed");vn(se)||(console.warn("latlngs are not flat! Only the first ring will be used"),se=se[0]);var jt=Ue([0,0]),Ut=Ze(se),mn=Ut.getNorthWest().distanceTo(Ut.getSouthWest())*Ut.getNorthEast().distanceTo(Ut.getNorthWest());mn<1700&&(jt=qa(se));var dn=se.length,gn=[];for(we=0;we<dn;we++){var fn=Ue(se[we]);gn.push(he.project(Ue([fn.lat-jt.lat,fn.lng-jt.lng])))}for(vt=xt=At=0,we=0,Te=dn-1;we<dn;Te=we++)He=gn[we],Ye=gn[Te],ot=He.y*Ye.x-Ye.y*He.x,xt+=(He.x+Ye.x)*ot,At+=(He.y+Ye.y)*ot,vt+=ot*3;vt===0?zt=gn[0]:zt=[xt/vt,At/vt];var Wn=he.unproject(Fe(zt));return Ue([Wn.lat+jt.lat,Wn.lng+jt.lng])}function qa(se){for(var he=0,we=0,Te=0,He=0;He<se.length;He++){var Ye=Ue(se[He]);he+=Ye.lat,we+=Ye.lng,Te++}return Ue([he/Te,we/Te])}var so={__proto__:null,clipPolygon:hr,polygonCenter:mr,centroid:qa};function pr(se,he){if(!he||!se.length)return se.slice();var we=he*he;return se=uo(se,we),se=co(se,we),se}function br(se,he,we){return Math.sqrt(ra(se,he,we,!0))}function lo(se,he,we){return ra(se,he,we)}function co(se,he){var we=se.length,Te=typeof Uint8Array<"u"?Uint8Array:Array,He=new Te(we);He[0]=He[we-1]=1,Wa(se,He,he,0,we-1);var Ye,ot=[];for(Ye=0;Ye<we;Ye++)He[Ye]&&ot.push(se[Ye]);return ot}function Wa(se,he,we,Te,He){var Ye=0,ot,vt,xt;for(vt=Te+1;vt<=He-1;vt++)xt=ra(se[vt],se[Te],se[He],!0),xt>Ye&&(ot=vt,Ye=xt);Ye>we&&(he[ot]=1,Wa(se,he,we,Te,ot),Wa(se,he,we,ot,He))}function uo(se,he){for(var we=[se[0]],Te=1,He=0,Ye=se.length;Te<Ye;Te++)ho(se[Te],se[He])>he&&(we.push(se[Te]),He=Te);return He<Ye-1&&we.push(se[Ye-1]),we}var vr;function gr(se,he,we,Te,He){var Ye=Te?vr:zn(se,we),ot=zn(he,we),vt,xt,At;for(vr=ot;;){if(!(Ye|ot))return[se,he];if(Ye&ot)return!1;vt=Ye||ot,xt=ba(se,he,vt,we,He),At=zn(xt,we),vt===Ye?(se=xt,Ye=At):(he=xt,ot=At)}}function ba(se,he,we,Te,He){var Ye=he.x-se.x,ot=he.y-se.y,vt=Te.min,xt=Te.max,At,zt;return we&8?(At=se.x+Ye*(xt.y-se.y)/ot,zt=xt.y):we&4?(At=se.x+Ye*(vt.y-se.y)/ot,zt=vt.y):we&2?(At=xt.x,zt=se.y+ot*(xt.x-se.x)/Ye):we&1&&(At=vt.x,zt=se.y+ot*(vt.x-se.x)/Ye),new xe(At,zt,He)}function zn(se,he){var we=0;return se.x<he.min.x?we|=1:se.x>he.max.x&&(we|=2),se.y<he.min.y?we|=4:se.y>he.max.y&&(we|=8),we}function ho(se,he){var we=he.x-se.x,Te=he.y-se.y;return we*we+Te*Te}function ra(se,he,we,Te){var He=he.x,Ye=he.y,ot=we.x-He,vt=we.y-Ye,xt=ot*ot+vt*vt,At;return xt>0&&(At=((se.x-He)*ot+(se.y-Ye)*vt)/xt,At>1?(He=we.x,Ye=we.y):At>0&&(He+=ot*At,Ye+=vt*At)),ot=se.x-He,vt=se.y-Ye,Te?ot*ot+vt*vt:new xe(He,Ye)}function vn(se){return!$e(se[0])||typeof se[0][0]!="object"&&typeof se[0][0]<"u"}function $r(se){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),vn(se)}function yr(se,he){var we,Te,He,Ye,ot,vt,xt,At;if(!se||se.length===0)throw new Error("latlngs not passed");vn(se)||(console.warn("latlngs are not flat! Only the first ring will be used"),se=se[0]);var zt=Ue([0,0]),jt=Ze(se),Ut=jt.getNorthWest().distanceTo(jt.getSouthWest())*jt.getNorthEast().distanceTo(jt.getNorthWest());Ut<1700&&(zt=qa(se));var mn=se.length,dn=[];for(we=0;we<mn;we++){var gn=Ue(se[we]);dn.push(he.project(Ue([gn.lat-zt.lat,gn.lng-zt.lng])))}for(we=0,Te=0;we<mn-1;we++)Te+=dn[we].distanceTo(dn[we+1])/2;if(Te===0)At=dn[0];else for(we=0,Ye=0;we<mn-1;we++)if(ot=dn[we],vt=dn[we+1],He=ot.distanceTo(vt),Ye+=He,Ye>Te){xt=(Ye-Te)/He,At=[vt.x-xt*(vt.x-ot.x),vt.y-xt*(vt.y-ot.y)];break}var fn=he.unproject(Fe(At));return Ue([fn.lat+zt.lat,fn.lng+zt.lng])}var mo={__proto__:null,simplify:pr,pointToSegmentDistance:br,closestPointOnSegment:lo,clipSegment:gr,_getEdgeIntersection:ba,_getBitCode:zn,_sqClosestPointOnSegment:ra,isFlat:vn,_flat:$r,polylineCenter:yr},Ua={project:function(se){return new xe(se.lng,se.lat)},unproject:function(se){return new Xe(se.y,se.x)},bounds:new Re([-180,-90],[180,90])},Ya={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Re([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(se){var he=Math.PI/180,we=this.R,Te=se.lat*he,He=this.R_MINOR/we,Ye=Math.sqrt(1-He*He),ot=Ye*Math.sin(Te),vt=Math.tan(Math.PI/4-Te/2)/Math.pow((1-ot)/(1+ot),Ye/2);return Te=-we*Math.log(Math.max(vt,1e-10)),new xe(se.lng*he*we,Te)},unproject:function(se){for(var he=180/Math.PI,we=this.R,Te=this.R_MINOR/we,He=Math.sqrt(1-Te*Te),Ye=Math.exp(-se.y/we),ot=Math.PI/2-2*Math.atan(Ye),vt=0,xt=.1,At;vt<15&&Math.abs(xt)>1e-7;vt++)At=He*Math.sin(ot),At=Math.pow((1-At)/(1+At),He/2),xt=Math.PI/2-2*Math.atan(Ye*At)-ot,ot+=xt;return new Xe(ot*he,se.x*he/we)}},fo={__proto__:null,LonLat:Ua,Mercator:Ya,SphericalMercator:it},po=re({},Je,{code:"EPSG:3395",projection:Ya,transformation:function(){var se=.5/(Math.PI*Ya.R);return Et(se,.5,-se,.5)}()}),kr=re({},Je,{code:"EPSG:4326",projection:Ua,transformation:Et(1/180,1,-1/180,.5)}),bo=re({},at,{projection:Ua,transformation:Et(1,0,-1,0),scale:function(se){return Math.pow(2,se)},zoom:function(se){return Math.log(se)/Math.LN2},distance:function(se,he){var we=he.lng-se.lng,Te=he.lat-se.lat;return Math.sqrt(we*we+Te*Te)},infinite:!0});at.Earth=Je,at.EPSG3395=po,at.EPSG3857=mt,at.EPSG900913=je,at.EPSG4326=kr,at.Simple=bo;var kn=Me.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(se){return se.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(se){return se&&se.removeLayer(this),this},getPane:function(se){return this._map.getPane(se?this.options[se]||se:this.options.pane)},addInteractiveTarget:function(se){return this._map._targets[ce(se)]=this,this},removeInteractiveTarget:function(se){return delete this._map._targets[ce(se)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(se){var he=se.target;if(he.hasLayer(this)){if(this._map=he,this._zoomAnimated=he._zoomAnimated,this.getEvents){var we=this.getEvents();he.on(we,this),this.once("remove",function(){he.off(we,this)},this)}this.onAdd(he),this.fire("add"),he.fire("layeradd",{layer:this})}}});Kt.include({addLayer:function(se){if(!se._layerAdd)throw new Error("The provided object is not a Layer.");var he=ce(se);return this._layers[he]?this:(this._layers[he]=se,se._mapToAdd=this,se.beforeAdd&&se.beforeAdd(this),this.whenReady(se._layerAdd,se),this)},removeLayer:function(se){var he=ce(se);return this._layers[he]?(this._loaded&&se.onRemove(this),delete this._layers[he],this._loaded&&(this.fire("layerremove",{layer:se}),se.fire("remove")),se._map=se._mapToAdd=null,this):this},hasLayer:function(se){return ce(se)in this._layers},eachLayer:function(se,he){for(var we in this._layers)se.call(he,this._layers[we]);return this},_addLayers:function(se){se=se?$e(se)?se:[se]:[];for(var he=0,we=se.length;he<we;he++)this.addLayer(se[he])},_addZoomLimit:function(se){(!isNaN(se.options.maxZoom)||!isNaN(se.options.minZoom))&&(this._zoomBoundLayers[ce(se)]=se,this._updateZoomLevels())},_removeZoomLimit:function(se){var he=ce(se);this._zoomBoundLayers[he]&&(delete this._zoomBoundLayers[he],this._updateZoomLevels())},_updateZoomLevels:function(){var se=1/0,he=-1/0,we=this._getZoomSpan();for(var Te in this._zoomBoundLayers){var He=this._zoomBoundLayers[Te].options;se=He.minZoom===void 0?se:Math.min(se,He.minZoom),he=He.maxZoom===void 0?he:Math.max(he,He.maxZoom)}this._layersMaxZoom=he===-1/0?void 0:he,this._layersMinZoom=se===1/0?void 0:se,we!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Hn=kn.extend({initialize:function(se,he){pe(this,he),this._layers={};var we,Te;if(se)for(we=0,Te=se.length;we<Te;we++)this.addLayer(se[we])},addLayer:function(se){var he=this.getLayerId(se);return this._layers[he]=se,this._map&&this._map.addLayer(se),this},removeLayer:function(se){var he=se in this._layers?se:this.getLayerId(se);return this._map&&this._layers[he]&&this._map.removeLayer(this._layers[he]),delete this._layers[he],this},hasLayer:function(se){var he=typeof se=="number"?se:this.getLayerId(se);return he in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(se){var he=Array.prototype.slice.call(arguments,1),we,Te;for(we in this._layers)Te=this._layers[we],Te[se]&&Te[se].apply(Te,he);return this},onAdd:function(se){this.eachLayer(se.addLayer,se)},onRemove:function(se){this.eachLayer(se.removeLayer,se)},eachLayer:function(se,he){for(var we in this._layers)se.call(he,this._layers[we]);return this},getLayer:function(se){return this._layers[se]},getLayers:function(){var se=[];return this.eachLayer(se.push,se),se},setZIndex:function(se){return this.invoke("setZIndex",se)},getLayerId:function(se){return ce(se)}}),vo=function(se,he){return new Hn(se,he)},Cn=Hn.extend({addLayer:function(se){return this.hasLayer(se)?this:(se.addEventParent(this),Hn.prototype.addLayer.call(this,se),this.fire("layeradd",{layer:se}))},removeLayer:function(se){return this.hasLayer(se)?(se in this._layers&&(se=this._layers[se]),se.removeEventParent(this),Hn.prototype.removeLayer.call(this,se),this.fire("layerremove",{layer:se})):this},setStyle:function(se){return this.invoke("setStyle",se)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var se=new Ge;for(var he in this._layers){var we=this._layers[he];se.extend(we.getBounds?we.getBounds():we.getLatLng())}return se}}),go=function(se,he){return new Cn(se,he)},jn=Ne.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(se){pe(this,se)},createIcon:function(se){return this._createIcon("icon",se)},createShadow:function(se){return this._createIcon("shadow",se)},_createIcon:function(se,he){var we=this._getIconUrl(se);if(!we){if(se==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var Te=this._createImg(we,he&&he.tagName==="IMG"?he:null);return this._setIconStyles(Te,se),(this.options.crossOrigin||this.options.crossOrigin==="")&&(Te.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),Te},_setIconStyles:function(se,he){var we=this.options,Te=we[he+"Size"];typeof Te=="number"&&(Te=[Te,Te]);var He=Fe(Te),Ye=Fe(he==="shadow"&&we.shadowAnchor||we.iconAnchor||He&&He.divideBy(2,!0));se.className="leaflet-marker-"+he+" "+(we.className||""),Ye&&(se.style.marginLeft=-Ye.x+"px",se.style.marginTop=-Ye.y+"px"),He&&(se.style.width=He.x+"px",se.style.height=He.y+"px")},_createImg:function(se,he){return he=he||document.createElement("img"),he.src=se,he},_getIconUrl:function(se){return Mt.retina&&this.options[se+"RetinaUrl"]||this.options[se+"Url"]}});function $o(se){return new jn(se)}var oa=jn.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(se){return typeof oa.imagePath!="string"&&(oa.imagePath=this._detectIconPath()),(this.options.imagePath||oa.imagePath)+jn.prototype._getIconUrl.call(this,se)},_stripUrl:function(se){var he=function(we,Te,He){var Ye=Te.exec(we);return Ye&&Ye[He]};return se=he(se,/^url\((['"])?(.+)\1\)$/,2),se&&he(se,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var se=Qt("div","leaflet-default-icon-path",document.body),he=Jn(se,"background-image")||Jn(se,"backgroundImage");if(document.body.removeChild(se),he=this._stripUrl(he),he)return he;var we=document.querySelector('link[href$="leaflet.css"]');return we?we.href.substring(0,we.href.length-11-1):""}}),_r=xn.extend({initialize:function(se){this._marker=se},addHooks:function(){var se=this._marker._icon;this._draggable||(this._draggable=new An(se,se,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Wt(se,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&nn(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(se){var he=this._marker,we=he._map,Te=this._marker.options.autoPanSpeed,He=this._marker.options.autoPanPadding,Ye=Ln(he._icon),ot=we.getPixelBounds(),vt=we.getPixelOrigin(),xt=qe(ot.min._subtract(vt).add(He),ot.max._subtract(vt).subtract(He));if(!xt.contains(Ye)){var At=Fe((Math.max(xt.max.x,Ye.x)-xt.max.x)/(ot.max.x-xt.max.x)-(Math.min(xt.min.x,Ye.x)-xt.min.x)/(ot.min.x-xt.min.x),(Math.max(xt.max.y,Ye.y)-xt.max.y)/(ot.max.y-xt.max.y)-(Math.min(xt.min.y,Ye.y)-xt.min.y)/(ot.min.y-xt.min.y)).multiplyBy(Te);we.panBy(At,{animate:!1}),this._draggable._newPos._add(At),this._draggable._startPos._add(At),ln(he._icon,this._draggable._newPos),this._onDrag(se),this._panRequest=Ie(this._adjustPan.bind(this,se))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(se){this._marker.options.autoPan&&(ze(this._panRequest),this._panRequest=Ie(this._adjustPan.bind(this,se)))},_onDrag:function(se){var he=this._marker,we=he._shadow,Te=Ln(he._icon),He=he._map.layerPointToLatLng(Te);we&&ln(we,Te),he._latlng=He,se.latlng=He,se.oldLatLng=this._oldLatLng,he.fire("move",se).fire("drag",se)},_onDragEnd:function(se){ze(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",se)}}),va=kn.extend({options:{icon:new oa,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(se,he){pe(this,he),this._latlng=Ue(se)},onAdd:function(se){this._zoomAnimated=this._zoomAnimated&&se.options.markerZoomAnimation,this._zoomAnimated&&se.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(se){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&se.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(se){var he=this._latlng;return this._latlng=Ue(se),this.update(),this.fire("move",{oldLatLng:he,latlng:this._latlng})},setZIndexOffset:function(se){return this.options.zIndexOffset=se,this.update()},getIcon:function(){return this.options.icon},setIcon:function(se){return this.options.icon=se,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var se=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(se)}return this},_initIcon:function(){var se=this.options,he="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),we=se.icon.createIcon(this._icon),Te=!1;we!==this._icon&&(this._icon&&this._removeIcon(),Te=!0,se.title&&(we.title=se.title),we.tagName==="IMG"&&(we.alt=se.alt||"")),Wt(we,he),se.keyboard&&(we.tabIndex="0",we.setAttribute("role","button")),this._icon=we,se.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&qt(we,"focus",this._panOnFocus,this);var He=se.icon.createShadow(this._shadow),Ye=!1;He!==this._shadow&&(this._removeShadow(),Ye=!0),He&&(Wt(He,he),He.alt=""),this._shadow=He,se.opacity<1&&this._updateOpacity(),Te&&this.getPane().appendChild(this._icon),this._initInteraction(),He&&Ye&&this.getPane(se.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&en(this._icon,"focus",this._panOnFocus,this),tn(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&tn(this._shadow),this._shadow=null},_setPos:function(se){this._icon&&ln(this._icon,se),this._shadow&&ln(this._shadow,se),this._zIndex=se.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(se){this._icon&&(this._icon.style.zIndex=this._zIndex+se)},_animateZoom:function(se){var he=this._map._latLngToNewLayerPoint(this._latlng,se.zoom,se.center).round();this._setPos(he)},_initInteraction:function(){if(this.options.interactive&&(Wt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),_r)){var se=this.options.draggable;this.dragging&&(se=this.dragging.enabled(),this.dragging.disable()),this.dragging=new _r(this),se&&this.dragging.enable()}},setOpacity:function(se){return this.options.opacity=se,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var se=this.options.opacity;this._icon&&bn(this._icon,se),this._shadow&&bn(this._shadow,se)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var se=this._map;if(se){var he=this.options.icon.options,we=he.iconSize?Fe(he.iconSize):Fe(0,0),Te=he.iconAnchor?Fe(he.iconAnchor):Fe(0,0);se.panInside(this._latlng,{paddingTopLeft:Te,paddingBottomRight:we.subtract(Te)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function yo(se,he){return new va(se,he)}var Tn=kn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(se){this._renderer=se.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(se){return pe(this,se),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&se&&Object.prototype.hasOwnProperty.call(se,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ga=Tn.extend({options:{fill:!0,radius:10},initialize:function(se,he){pe(this,he),this._latlng=Ue(se),this._radius=this.options.radius},setLatLng:function(se){var he=this._latlng;return this._latlng=Ue(se),this.redraw(),this.fire("move",{oldLatLng:he,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(se){return this.options.radius=this._radius=se,this.redraw()},getRadius:function(){return this._radius},setStyle:function(se){var he=se&&se.radius||this._radius;return Tn.prototype.setStyle.call(this,se),this.setRadius(he),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var se=this._radius,he=this._radiusY||se,we=this._clickTolerance(),Te=[se+we,he+we];this._pxBounds=new Re(this._point.subtract(Te),this._point.add(Te))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(se){return se.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ko(se,he){return new ga(se,he)}var Xa=ga.extend({initialize:function(se,he,we){if(typeof he=="number"&&(he=re({},we,{radius:he})),pe(this,he),this._latlng=Ue(se),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(se){return this._mRadius=se,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var se=[this._radius,this._radiusY||this._radius];return new Ge(this._map.layerPointToLatLng(this._point.subtract(se)),this._map.layerPointToLatLng(this._point.add(se)))},setStyle:Tn.prototype.setStyle,_project:function(){var se=this._latlng.lng,he=this._latlng.lat,we=this._map,Te=we.options.crs;if(Te.distance===Je.distance){var He=Math.PI/180,Ye=this._mRadius/Je.R/He,ot=we.project([he+Ye,se]),vt=we.project([he-Ye,se]),xt=ot.add(vt).divideBy(2),At=we.unproject(xt).lat,zt=Math.acos((Math.cos(Ye*He)-Math.sin(he*He)*Math.sin(At*He))/(Math.cos(he*He)*Math.cos(At*He)))/He;(isNaN(zt)||zt===0)&&(zt=Ye/Math.cos(Math.PI/180*he)),this._point=xt.subtract(we.getPixelOrigin()),this._radius=isNaN(zt)?0:xt.x-we.project([At,se-zt]).x,this._radiusY=xt.y-ot.y}else{var jt=Te.unproject(Te.project(this._latlng).subtract([this._mRadius,0]));this._point=we.latLngToLayerPoint(this._latlng),this._radius=this._point.x-we.latLngToLayerPoint(jt).x}this._updateBounds()}});function _o(se,he,we){return new Xa(se,he,we)}var Sn=Tn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(se,he){pe(this,he),this._setLatLngs(se)},getLatLngs:function(){return this._latlngs},setLatLngs:function(se){return this._setLatLngs(se),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(se){for(var he=1/0,we=null,Te=ra,He,Ye,ot=0,vt=this._parts.length;ot<vt;ot++)for(var xt=this._parts[ot],At=1,zt=xt.length;At<zt;At++){He=xt[At-1],Ye=xt[At];var jt=Te(se,He,Ye,!0);jt<he&&(he=jt,we=Te(se,He,Ye))}return we&&(we.distance=Math.sqrt(he)),we},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return yr(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(se,he){return he=he||this._defaultShape(),se=Ue(se),he.push(se),this._bounds.extend(se),this.redraw()},_setLatLngs:function(se){this._bounds=new Ge,this._latlngs=this._convertLatLngs(se)},_defaultShape:function(){return vn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(se){for(var he=[],we=vn(se),Te=0,He=se.length;Te<He;Te++)we?(he[Te]=Ue(se[Te]),this._bounds.extend(he[Te])):he[Te]=this._convertLatLngs(se[Te]);return he},_project:function(){var se=new Re;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,se),this._bounds.isValid()&&se.isValid()&&(this._rawPxBounds=se,this._updateBounds())},_updateBounds:function(){var se=this._clickTolerance(),he=new xe(se,se);this._rawPxBounds&&(this._pxBounds=new Re([this._rawPxBounds.min.subtract(he),this._rawPxBounds.max.add(he)]))},_projectLatlngs:function(se,he,we){var Te=se[0]instanceof Xe,He=se.length,Ye,ot;if(Te){for(ot=[],Ye=0;Ye<He;Ye++)ot[Ye]=this._map.latLngToLayerPoint(se[Ye]),we.extend(ot[Ye]);he.push(ot)}else for(Ye=0;Ye<He;Ye++)this._projectLatlngs(se[Ye],he,we)},_clipPoints:function(){var se=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(se))){if(this.options.noClip){this._parts=this._rings;return}var he=this._parts,we,Te,He,Ye,ot,vt,xt;for(we=0,He=0,Ye=this._rings.length;we<Ye;we++)for(xt=this._rings[we],Te=0,ot=xt.length;Te<ot-1;Te++)vt=gr(xt[Te],xt[Te+1],se,Te,!0),vt&&(he[He]=he[He]||[],he[He].push(vt[0]),(vt[1]!==xt[Te+1]||Te===ot-2)&&(he[He].push(vt[1]),He++))}},_simplifyPoints:function(){for(var se=this._parts,he=this.options.smoothFactor,we=0,Te=se.length;we<Te;we++)se[we]=pr(se[we],he)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(se,he){var we,Te,He,Ye,ot,vt,xt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(se))return!1;for(we=0,Ye=this._parts.length;we<Ye;we++)for(vt=this._parts[we],Te=0,ot=vt.length,He=ot-1;Te<ot;He=Te++)if(!(!he&&Te===0)&&br(se,vt[He],vt[Te])<=xt)return!0;return!1}});function xo(se,he){return new Sn(se,he)}Sn._flat=$r;var Gn=Sn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return mr(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(se){var he=Sn.prototype._convertLatLngs.call(this,se),we=he.length;return we>=2&&he[0]instanceof Xe&&he[0].equals(he[we-1])&&he.pop(),he},_setLatLngs:function(se){Sn.prototype._setLatLngs.call(this,se),vn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return vn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var se=this._renderer._bounds,he=this.options.weight,we=new xe(he,he);if(se=new Re(se.min.subtract(we),se.max.add(we)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(se))){if(this.options.noClip){this._parts=this._rings;return}for(var Te=0,He=this._rings.length,Ye;Te<He;Te++)Ye=hr(this._rings[Te],se,!0),Ye.length&&this._parts.push(Ye)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(se){var he=!1,we,Te,He,Ye,ot,vt,xt,At;if(!this._pxBounds||!this._pxBounds.contains(se))return!1;for(Ye=0,xt=this._parts.length;Ye<xt;Ye++)for(we=this._parts[Ye],ot=0,At=we.length,vt=At-1;ot<At;vt=ot++)Te=we[ot],He=we[vt],Te.y>se.y!=He.y>se.y&&se.x<(He.x-Te.x)*(se.y-Te.y)/(He.y-Te.y)+Te.x&&(he=!he);return he||Sn.prototype._containsPoint.call(this,se,!0)}});function wo(se,he){return new Gn(se,he)}var Bn=Cn.extend({initialize:function(se,he){pe(this,he),this._layers={},se&&this.addData(se)},addData:function(se){var he=$e(se)?se:se.features,we,Te,He;if(he){for(we=0,Te=he.length;we<Te;we++)He=he[we],(He.geometries||He.geometry||He.features||He.coordinates)&&this.addData(He);return this}var Ye=this.options;if(Ye.filter&&!Ye.filter(se))return this;var ot=$a(se,Ye);return ot?(ot.feature=_a(se),ot.defaultOptions=ot.options,this.resetStyle(ot),Ye.onEachFeature&&Ye.onEachFeature(se,ot),this.addLayer(ot)):this},resetStyle:function(se){return se===void 0?this.eachLayer(this.resetStyle,this):(se.options=re({},se.defaultOptions),this._setLayerStyle(se,this.options.style),this)},setStyle:function(se){return this.eachLayer(function(he){this._setLayerStyle(he,se)},this)},_setLayerStyle:function(se,he){se.setStyle&&(typeof he=="function"&&(he=he(se.feature)),se.setStyle(he))}});function $a(se,he){var we=se.type==="Feature"?se.geometry:se,Te=we?we.coordinates:null,He=[],Ye=he&&he.pointToLayer,ot=he&&he.coordsToLatLng||Ka,vt,xt,At,zt;if(!Te&&!we)return null;switch(we.type){case"Point":return vt=ot(Te),xr(Ye,se,vt,he);case"MultiPoint":for(At=0,zt=Te.length;At<zt;At++)vt=ot(Te[At]),He.push(xr(Ye,se,vt,he));return new Cn(He);case"LineString":case"MultiLineString":return xt=ya(Te,we.type==="LineString"?0:1,ot),new Sn(xt,he);case"Polygon":case"MultiPolygon":return xt=ya(Te,we.type==="Polygon"?1:2,ot),new Gn(xt,he);case"GeometryCollection":for(At=0,zt=we.geometries.length;At<zt;At++){var jt=$a({geometry:we.geometries[At],type:"Feature",properties:se.properties},he);jt&&He.push(jt)}return new Cn(He);case"FeatureCollection":for(At=0,zt=we.features.length;At<zt;At++){var Ut=$a(we.features[At],he);Ut&&He.push(Ut)}return new Cn(He);default:throw new Error("Invalid GeoJSON object.")}}function xr(se,he,we,Te){return se?se(he,we):new va(we,Te&&Te.markersInheritOptions&&Te)}function Ka(se){return new Xe(se[1],se[0],se[2])}function ya(se,he,we){for(var Te=[],He=0,Ye=se.length,ot;He<Ye;He++)ot=he?ya(se[He],he-1,we):(we||Ka)(se[He]),Te.push(ot);return Te}function Ja(se,he){return se=Ue(se),se.alt!==void 0?[fe(se.lng,he),fe(se.lat,he),fe(se.alt,he)]:[fe(se.lng,he),fe(se.lat,he)]}function ka(se,he,we,Te){for(var He=[],Ye=0,ot=se.length;Ye<ot;Ye++)He.push(he?ka(se[Ye],vn(se[Ye])?0:he-1,we,Te):Ja(se[Ye],Te));return!he&&we&&He.length>0&&He.push(He[0].slice()),He}function Zn(se,he){return se.feature?re({},se.feature,{geometry:he}):_a(he)}function _a(se){return se.type==="Feature"||se.type==="FeatureCollection"?se:{type:"Feature",properties:{},geometry:se}}var Qa={toGeoJSON:function(se){return Zn(this,{type:"Point",coordinates:Ja(this.getLatLng(),se)})}};va.include(Qa),Xa.include(Qa),ga.include(Qa),Sn.include({toGeoJSON:function(se){var he=!vn(this._latlngs),we=ka(this._latlngs,he?1:0,!1,se);return Zn(this,{type:(he?"Multi":"")+"LineString",coordinates:we})}}),Gn.include({toGeoJSON:function(se){var he=!vn(this._latlngs),we=he&&!vn(this._latlngs[0]),Te=ka(this._latlngs,we?2:he?1:0,!0,se);return he||(Te=[Te]),Zn(this,{type:(we?"Multi":"")+"Polygon",coordinates:Te})}}),Hn.include({toMultiPoint:function(se){var he=[];return this.eachLayer(function(we){he.push(we.toGeoJSON(se).geometry.coordinates)}),Zn(this,{type:"MultiPoint",coordinates:he})},toGeoJSON:function(se){var he=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(he==="MultiPoint")return this.toMultiPoint(se);var we=he==="GeometryCollection",Te=[];return this.eachLayer(function(He){if(He.toGeoJSON){var Ye=He.toGeoJSON(se);if(we)Te.push(Ye.geometry);else{var ot=_a(Ye);ot.type==="FeatureCollection"?Te.push.apply(Te,ot.features):Te.push(ot)}}}),we?Zn(this,{geometries:Te,type:"GeometryCollection"}):{type:"FeatureCollection",features:Te}}});function wr(se,he){return new Bn(se,he)}var Eo=wr,xa=kn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(se,he,we){this._url=se,this._bounds=Ze(he),pe(this,we)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Wt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){tn(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(se){return this.options.opacity=se,this._image&&this._updateOpacity(),this},setStyle:function(se){return se.opacity&&this.setOpacity(se.opacity),this},bringToFront:function(){return this._map&&Rn(this._image),this},bringToBack:function(){return this._map&&On(this._image),this},setUrl:function(se){return this._url=se,this._image&&(this._image.src=se),this},setBounds:function(se){return this._bounds=Ze(se),this._map&&this._reset(),this},getEvents:function(){var se={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(se.zoomanim=this._animateZoom),se},setZIndex:function(se){return this.options.zIndex=se,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var se=this._url.tagName==="IMG",he=this._image=se?this._url:Qt("img");if(Wt(he,"leaflet-image-layer"),this._zoomAnimated&&Wt(he,"leaflet-zoom-animated"),this.options.className&&Wt(he,this.options.className),he.onselectstart=be,he.onmousemove=be,he.onload=ie(this.fire,this,"load"),he.onerror=ie(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(he.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),se){this._url=he.src;return}he.src=this._url,he.alt=this.options.alt},_animateZoom:function(se){var he=this._map.getZoomScale(se.zoom),we=this._map._latLngBoundsToNewLayerBounds(this._bounds,se.zoom,se.center).min;Pn(this._image,we,he)},_reset:function(){var se=this._image,he=new Re(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),we=he.getSize();ln(se,he.min),se.style.width=we.x+"px",se.style.height=we.y+"px"},_updateOpacity:function(){bn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var se=this.options.errorOverlayUrl;se&&this._url!==se&&(this._url=se,this._image.src=se)},getCenter:function(){return this._bounds.getCenter()}}),Co=function(se,he,we){return new xa(se,he,we)},Er=xa.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var se=this._url.tagName==="VIDEO",he=this._image=se?this._url:Qt("video");if(Wt(he,"leaflet-image-layer"),this._zoomAnimated&&Wt(he,"leaflet-zoom-animated"),this.options.className&&Wt(he,this.options.className),he.onselectstart=be,he.onmousemove=be,he.onloadeddata=ie(this.fire,this,"load"),se){for(var we=he.getElementsByTagName("source"),Te=[],He=0;He<we.length;He++)Te.push(we[He].src);this._url=we.length>0?Te:[he.src];return}$e(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(he.style,"objectFit")&&(he.style.objectFit="fill"),he.autoplay=!!this.options.autoplay,he.loop=!!this.options.loop,he.muted=!!this.options.muted,he.playsInline=!!this.options.playsInline;for(var Ye=0;Ye<this._url.length;Ye++){var ot=Qt("source");ot.src=this._url[Ye],he.appendChild(ot)}}});function So(se,he,we){return new Er(se,he,we)}var Cr=xa.extend({_initImage:function(){var se=this._image=this._url;Wt(se,"leaflet-image-layer"),this._zoomAnimated&&Wt(se,"leaflet-zoom-animated"),this.options.className&&Wt(se,this.options.className),se.onselectstart=be,se.onmousemove=be}});function Bo(se,he,we){return new Cr(se,he,we)}var wn=kn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(se,he){se&&(se instanceof Xe||$e(se))?(this._latlng=Ue(se),pe(this,he)):(pe(this,se),this._source=he),this.options.content&&(this._content=this.options.content)},openOn:function(se){return se=arguments.length?se:this._source._map,se.hasLayer(this)||se.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(se){return this._map?this.close():(arguments.length?this._source=se:se=this._source,this._prepareOpen(),this.openOn(se._map)),this},onAdd:function(se){this._zoomAnimated=se._zoomAnimated,this._container||this._initLayout(),se._fadeAnimated&&bn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),se._fadeAnimated&&bn(this._container,1),this.bringToFront(),this.options.interactive&&(Wt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(se){se._fadeAnimated?(bn(this._container,0),this._removeTimeout=setTimeout(ie(tn,void 0,this._container),200)):tn(this._container),this.options.interactive&&(nn(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(se){return this._latlng=Ue(se),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(se){return this._content=se,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var se={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(se.zoomanim=this._animateZoom),se},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Rn(this._container),this},bringToBack:function(){return this._map&&On(this._container),this},_prepareOpen:function(se){var he=this._source;if(!he._map)return!1;if(he instanceof Cn){he=null;var we=this._source._layers;for(var Te in we)if(we[Te]._map){he=we[Te];break}if(!he)return!1;this._source=he}if(!se)if(he.getCenter)se=he.getCenter();else if(he.getLatLng)se=he.getLatLng();else if(he.getBounds)se=he.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(se),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var se=this._contentNode,he=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof he=="string")se.innerHTML=he;else{for(;se.hasChildNodes();)se.removeChild(se.firstChild);se.appendChild(he)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var se=this._map.latLngToLayerPoint(this._latlng),he=Fe(this.options.offset),we=this._getAnchor();this._zoomAnimated?ln(this._container,se.add(we)):he=he.add(se).add(we);var Te=this._containerBottom=-he.y,He=this._containerLeft=-Math.round(this._containerWidth/2)+he.x;this._container.style.bottom=Te+"px",this._container.style.left=He+"px"}},_getAnchor:function(){return[0,0]}});Kt.include({_initOverlay:function(se,he,we,Te){var He=he;return He instanceof se||(He=new se(Te).setContent(he)),we&&He.setLatLng(we),He}}),kn.include({_initOverlay:function(se,he,we,Te){var He=we;return He instanceof se?(pe(He,Te),He._source=this):(He=he&&!Te?he:new se(Te,this),He.setContent(we)),He}});var wa=wn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(se){return se=arguments.length?se:this._source._map,!se.hasLayer(this)&&se._popup&&se._popup.options.autoClose&&se.removeLayer(se._popup),se._popup=this,wn.prototype.openOn.call(this,se)},onAdd:function(se){wn.prototype.onAdd.call(this,se),se.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Tn||this._source.on("preclick",Fn))},onRemove:function(se){wn.prototype.onRemove.call(this,se),se.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Tn||this._source.off("preclick",Fn))},getEvents:function(){var se=wn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(se.preclick=this.close),this.options.keepInView&&(se.moveend=this._adjustPan),se},_initLayout:function(){var se="leaflet-popup",he=this._container=Qt("div",se+" "+(this.options.className||"")+" leaflet-zoom-animated"),we=this._wrapper=Qt("div",se+"-content-wrapper",he);if(this._contentNode=Qt("div",se+"-content",we),na(he),Ha(this._contentNode),qt(he,"contextmenu",Fn),this._tipContainer=Qt("div",se+"-tip-container",he),this._tip=Qt("div",se+"-tip",this._tipContainer),this.options.closeButton){var Te=this._closeButton=Qt("a",se+"-close-button",he);Te.setAttribute("role","button"),Te.setAttribute("aria-label","Close popup"),Te.href="#close",Te.innerHTML='<span aria-hidden="true">×</span>',qt(Te,"click",function(He){un(He),this.close()},this)}},_updateLayout:function(){var se=this._contentNode,he=se.style;he.width="",he.whiteSpace="nowrap";var we=se.offsetWidth;we=Math.min(we,this.options.maxWidth),we=Math.max(we,this.options.minWidth),he.width=we+1+"px",he.whiteSpace="",he.height="";var Te=se.offsetHeight,He=this.options.maxHeight,Ye="leaflet-popup-scrolled";He&&Te>He?(he.height=He+"px",Wt(se,Ye)):nn(se,Ye),this._containerWidth=this._container.offsetWidth},_animateZoom:function(se){var he=this._map._latLngToNewLayerPoint(this._latlng,se.zoom,se.center),we=this._getAnchor();ln(this._container,he.add(we))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var se=this._map,he=parseInt(Jn(this._container,"marginBottom"),10)||0,we=this._container.offsetHeight+he,Te=this._containerWidth,He=new xe(this._containerLeft,-we-this._containerBottom);He._add(Ln(this._container));var Ye=se.layerPointToContainerPoint(He),ot=Fe(this.options.autoPanPadding),vt=Fe(this.options.autoPanPaddingTopLeft||ot),xt=Fe(this.options.autoPanPaddingBottomRight||ot),At=se.getSize(),zt=0,jt=0;Ye.x+Te+xt.x>At.x&&(zt=Ye.x+Te-At.x+xt.x),Ye.x-zt-vt.x<0&&(zt=Ye.x-vt.x),Ye.y+we+xt.y>At.y&&(jt=Ye.y+we-At.y+xt.y),Ye.y-jt-vt.y<0&&(jt=Ye.y-vt.y),(zt||jt)&&(this.options.keepInView&&(this._autopanning=!0),se.fire("autopanstart").panBy([zt,jt]))}},_getAnchor:function(){return Fe(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),No=function(se,he){return new wa(se,he)};Kt.mergeOptions({closePopupOnClick:!0}),Kt.include({openPopup:function(se,he,we){return this._initOverlay(wa,se,he,we).openOn(this),this},closePopup:function(se){return se=arguments.length?se:this._popup,se&&se.close(),this}}),kn.include({bindPopup:function(se,he){return this._popup=this._initOverlay(wa,this._popup,se,he),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(se){return this._popup&&(this instanceof Cn||(this._popup._source=this),this._popup._prepareOpen(se||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(se){return this._popup&&this._popup.setContent(se),this},getPopup:function(){return this._popup},_openPopup:function(se){if(!(!this._popup||!this._map)){Dn(se);var he=se.layer||se.target;if(this._popup._source===he&&!(he instanceof Tn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(se.latlng);return}this._popup._source=he,this.openPopup(se.latlng)}},_movePopup:function(se){this._popup.setLatLng(se.latlng)},_onKeyPress:function(se){se.originalEvent.keyCode===13&&this._openPopup(se)}});var Ea=wn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(se){wn.prototype.onAdd.call(this,se),this.setOpacity(this.options.opacity),se.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(se){wn.prototype.onRemove.call(this,se),se.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var se=wn.prototype.getEvents.call(this);return this.options.permanent||(se.preclick=this.close),se},_initLayout:function(){var se="leaflet-tooltip",he=se+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Qt("div",he),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+ce(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(se){var he,we,Te=this._map,He=this._container,Ye=Te.latLngToContainerPoint(Te.getCenter()),ot=Te.layerPointToContainerPoint(se),vt=this.options.direction,xt=He.offsetWidth,At=He.offsetHeight,zt=Fe(this.options.offset),jt=this._getAnchor();vt==="top"?(he=xt/2,we=At):vt==="bottom"?(he=xt/2,we=0):vt==="center"?(he=xt/2,we=At/2):vt==="right"?(he=0,we=At/2):vt==="left"?(he=xt,we=At/2):ot.x<Ye.x?(vt="right",he=0,we=At/2):(vt="left",he=xt+(zt.x+jt.x)*2,we=At/2),se=se.subtract(Fe(he,we,!0)).add(zt).add(jt),nn(He,"leaflet-tooltip-right"),nn(He,"leaflet-tooltip-left"),nn(He,"leaflet-tooltip-top"),nn(He,"leaflet-tooltip-bottom"),Wt(He,"leaflet-tooltip-"+vt),ln(He,se)},_updatePosition:function(){var se=this._map.latLngToLayerPoint(this._latlng);this._setPosition(se)},setOpacity:function(se){this.options.opacity=se,this._container&&bn(this._container,se)},_animateZoom:function(se){var he=this._map._latLngToNewLayerPoint(this._latlng,se.zoom,se.center);this._setPosition(he)},_getAnchor:function(){return Fe(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Vo=function(se,he){return new Ea(se,he)};Kt.include({openTooltip:function(se,he,we){return this._initOverlay(Ea,se,he,we).openOn(this),this},closeTooltip:function(se){return se.close(),this}}),kn.include({bindTooltip:function(se,he){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ea,this._tooltip,se,he),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(se){if(!(!se&&this._tooltipHandlersAdded)){var he=se?"off":"on",we={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?we.add=this._openTooltip:(we.mouseover=this._openTooltip,we.mouseout=this.closeTooltip,we.click=this._openTooltip,this._map?this._addFocusListeners():we.add=this._addFocusListeners),this._tooltip.options.sticky&&(we.mousemove=this._moveTooltip),this[he](we),this._tooltipHandlersAdded=!se}},openTooltip:function(se){return this._tooltip&&(this instanceof Cn||(this._tooltip._source=this),this._tooltip._prepareOpen(se)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(se){return this._tooltip&&this._tooltip.setContent(se),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(se){var he=typeof se.getElement=="function"&&se.getElement();he&&(qt(he,"focus",function(){this._tooltip._source=se,this.openTooltip()},this),qt(he,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(se){var he=typeof se.getElement=="function"&&se.getElement();he&&he.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(se){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var he=this;this._map.once("moveend",function(){he._openOnceFlag=!1,he._openTooltip(se)});return}this._tooltip._source=se.layer||se.target,this.openTooltip(this._tooltip.options.sticky?se.latlng:void 0)}},_moveTooltip:function(se){var he=se.latlng,we,Te;this._tooltip.options.sticky&&se.originalEvent&&(we=this._map.mouseEventToContainerPoint(se.originalEvent),Te=this._map.containerPointToLayerPoint(we),he=this._map.layerPointToLatLng(Te)),this._tooltip.setLatLng(he)}});var Sr=jn.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(se){var he=se&&se.tagName==="DIV"?se:document.createElement("div"),we=this.options;if(we.html instanceof Element?(ua(he),he.appendChild(we.html)):he.innerHTML=we.html!==!1?we.html:"",we.bgPos){var Te=Fe(we.bgPos);he.style.backgroundPosition=-Te.x+"px "+-Te.y+"px"}return this._setIconStyles(he,"icon"),he},createShadow:function(){return null}});function Mo(se){return new Sr(se)}jn.Default=oa;var ia=kn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Mt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(se){pe(this,se)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(se){se._addZoomLimit(this)},onRemove:function(se){this._removeAllTiles(),tn(this._container),se._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Rn(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(On(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(se){return this.options.opacity=se,this._updateOpacity(),this},setZIndex:function(se){return this.options.zIndex=se,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var se=this._clampZoom(this._map.getZoom());se!==this._tileZoom&&(this._tileZoom=se,this._updateLevels()),this._update()}return this},getEvents:function(){var se={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=de(this._onMoveEnd,this.options.updateInterval,this)),se.move=this._onMove),this._zoomAnimated&&(se.zoomanim=this._animateZoom),se},createTile:function(){return document.createElement("div")},getTileSize:function(){var se=this.options.tileSize;return se instanceof xe?se:new xe(se,se)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(se){for(var he=this.getPane().children,we=-se(-1/0,1/0),Te=0,He=he.length,Ye;Te<He;Te++)Ye=he[Te].style.zIndex,he[Te]!==this._container&&Ye&&(we=se(we,+Ye));isFinite(we)&&(this.options.zIndex=we+se(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Mt.ielt9){bn(this._container,this.options.opacity);var se=+new Date,he=!1,we=!1;for(var Te in this._tiles){var He=this._tiles[Te];if(!(!He.current||!He.loaded)){var Ye=Math.min(1,(se-He.loaded)/200);bn(He.el,Ye),Ye<1?he=!0:(He.active?we=!0:this._onOpaqueTile(He),He.active=!0)}}we&&!this._noPrune&&this._pruneTiles(),he&&(ze(this._fadeFrame),this._fadeFrame=Ie(this._updateOpacity,this))}},_onOpaqueTile:be,_initContainer:function(){this._container||(this._container=Qt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var se=this._tileZoom,he=this.options.maxZoom;if(se!==void 0){for(var we in this._levels)we=Number(we),this._levels[we].el.children.length||we===se?(this._levels[we].el.style.zIndex=he-Math.abs(se-we),this._onUpdateLevel(we)):(tn(this._levels[we].el),this._removeTilesAtZoom(we),this._onRemoveLevel(we),delete this._levels[we]);var Te=this._levels[se],He=this._map;return Te||(Te=this._levels[se]={},Te.el=Qt("div","leaflet-tile-container leaflet-zoom-animated",this._container),Te.el.style.zIndex=he,Te.origin=He.project(He.unproject(He.getPixelOrigin()),se).round(),Te.zoom=se,this._setZoomTransform(Te,He.getCenter(),He.getZoom()),be(Te.el.offsetWidth),this._onCreateLevel(Te)),this._level=Te,Te}},_onUpdateLevel:be,_onRemoveLevel:be,_onCreateLevel:be,_pruneTiles:function(){if(this._map){var se,he,we=this._map.getZoom();if(we>this.options.maxZoom||we<this.options.minZoom){this._removeAllTiles();return}for(se in this._tiles)he=this._tiles[se],he.retain=he.current;for(se in this._tiles)if(he=this._tiles[se],he.current&&!he.active){var Te=he.coords;this._retainParent(Te.x,Te.y,Te.z,Te.z-5)||this._retainChildren(Te.x,Te.y,Te.z,Te.z+2)}for(se in this._tiles)this._tiles[se].retain||this._removeTile(se)}},_removeTilesAtZoom:function(se){for(var he in this._tiles)this._tiles[he].coords.z===se&&this._removeTile(he)},_removeAllTiles:function(){for(var se in this._tiles)this._removeTile(se)},_invalidateAll:function(){for(var se in this._levels)tn(this._levels[se].el),this._onRemoveLevel(Number(se)),delete this._levels[se];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(se,he,we,Te){var He=Math.floor(se/2),Ye=Math.floor(he/2),ot=we-1,vt=new xe(+He,+Ye);vt.z=+ot;var xt=this._tileCoordsToKey(vt),At=this._tiles[xt];return At&&At.active?(At.retain=!0,!0):(At&&At.loaded&&(At.retain=!0),ot>Te?this._retainParent(He,Ye,ot,Te):!1)},_retainChildren:function(se,he,we,Te){for(var He=2*se;He<2*se+2;He++)for(var Ye=2*he;Ye<2*he+2;Ye++){var ot=new xe(He,Ye);ot.z=we+1;var vt=this._tileCoordsToKey(ot),xt=this._tiles[vt];if(xt&&xt.active){xt.retain=!0;continue}else xt&&xt.loaded&&(xt.retain=!0);we+1<Te&&this._retainChildren(He,Ye,we+1,Te)}},_resetView:function(se){var he=se&&(se.pinch||se.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),he,he)},_animateZoom:function(se){this._setView(se.center,se.zoom,!0,se.noUpdate)},_clampZoom:function(se){var he=this.options;return he.minNativeZoom!==void 0&&se<he.minNativeZoom?he.minNativeZoom:he.maxNativeZoom!==void 0&&he.maxNativeZoom<se?he.maxNativeZoom:se},_setView:function(se,he,we,Te){var He=Math.round(he);this.options.maxZoom!==void 0&&He>this.options.maxZoom||this.options.minZoom!==void 0&&He<this.options.minZoom?He=void 0:He=this._clampZoom(He);var Ye=this.options.updateWhenZooming&&He!==this._tileZoom;(!Te||Ye)&&(this._tileZoom=He,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),He!==void 0&&this._update(se),we||this._pruneTiles(),this._noPrune=!!we),this._setZoomTransforms(se,he)},_setZoomTransforms:function(se,he){for(var we in this._levels)this._setZoomTransform(this._levels[we],se,he)},_setZoomTransform:function(se,he,we){var Te=this._map.getZoomScale(we,se.zoom),He=se.origin.multiplyBy(Te).subtract(this._map._getNewPixelOrigin(he,we)).round();Mt.any3d?Pn(se.el,He,Te):ln(se.el,He)},_resetGrid:function(){var se=this._map,he=se.options.crs,we=this._tileSize=this.getTileSize(),Te=this._tileZoom,He=this._map.getPixelWorldBounds(this._tileZoom);He&&(this._globalTileRange=this._pxBoundsToTileRange(He)),this._wrapX=he.wrapLng&&!this.options.noWrap&&[Math.floor(se.project([0,he.wrapLng[0]],Te).x/we.x),Math.ceil(se.project([0,he.wrapLng[1]],Te).x/we.y)],this._wrapY=he.wrapLat&&!this.options.noWrap&&[Math.floor(se.project([he.wrapLat[0],0],Te).y/we.x),Math.ceil(se.project([he.wrapLat[1],0],Te).y/we.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(se){var he=this._map,we=he._animatingZoom?Math.max(he._animateToZoom,he.getZoom()):he.getZoom(),Te=he.getZoomScale(we,this._tileZoom),He=he.project(se,this._tileZoom).floor(),Ye=he.getSize().divideBy(Te*2);return new Re(He.subtract(Ye),He.add(Ye))},_update:function(se){var he=this._map;if(he){var we=this._clampZoom(he.getZoom());if(se===void 0&&(se=he.getCenter()),this._tileZoom!==void 0){var Te=this._getTiledPixelBounds(se),He=this._pxBoundsToTileRange(Te),Ye=He.getCenter(),ot=[],vt=this.options.keepBuffer,xt=new Re(He.getBottomLeft().subtract([vt,-vt]),He.getTopRight().add([vt,-vt]));if(!(isFinite(He.min.x)&&isFinite(He.min.y)&&isFinite(He.max.x)&&isFinite(He.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var At in this._tiles){var zt=this._tiles[At].coords;(zt.z!==this._tileZoom||!xt.contains(new xe(zt.x,zt.y)))&&(this._tiles[At].current=!1)}if(Math.abs(we-this._tileZoom)>1){this._setView(se,we);return}for(var jt=He.min.y;jt<=He.max.y;jt++)for(var Ut=He.min.x;Ut<=He.max.x;Ut++){var mn=new xe(Ut,jt);if(mn.z=this._tileZoom,!!this._isValidTile(mn)){var dn=this._tiles[this._tileCoordsToKey(mn)];dn?dn.current=!0:ot.push(mn)}}if(ot.sort(function(fn,Wn){return fn.distanceTo(Ye)-Wn.distanceTo(Ye)}),ot.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var gn=document.createDocumentFragment();for(Ut=0;Ut<ot.length;Ut++)this._addTile(ot[Ut],gn);this._level.el.appendChild(gn)}}}},_isValidTile:function(se){var he=this._map.options.crs;if(!he.infinite){var we=this._globalTileRange;if(!he.wrapLng&&(se.x<we.min.x||se.x>we.max.x)||!he.wrapLat&&(se.y<we.min.y||se.y>we.max.y))return!1}if(!this.options.bounds)return!0;var Te=this._tileCoordsToBounds(se);return Ze(this.options.bounds).overlaps(Te)},_keyToBounds:function(se){return this._tileCoordsToBounds(this._keyToTileCoords(se))},_tileCoordsToNwSe:function(se){var he=this._map,we=this.getTileSize(),Te=se.scaleBy(we),He=Te.add(we),Ye=he.unproject(Te,se.z),ot=he.unproject(He,se.z);return[Ye,ot]},_tileCoordsToBounds:function(se){var he=this._tileCoordsToNwSe(se),we=new Ge(he[0],he[1]);return this.options.noWrap||(we=this._map.wrapLatLngBounds(we)),we},_tileCoordsToKey:function(se){return se.x+":"+se.y+":"+se.z},_keyToTileCoords:function(se){var he=se.split(":"),we=new xe(+he[0],+he[1]);return we.z=+he[2],we},_removeTile:function(se){var he=this._tiles[se];he&&(tn(he.el),delete this._tiles[se],this.fire("tileunload",{tile:he.el,coords:this._keyToTileCoords(se)}))},_initTile:function(se){Wt(se,"leaflet-tile");var he=this.getTileSize();se.style.width=he.x+"px",se.style.height=he.y+"px",se.onselectstart=be,se.onmousemove=be,Mt.ielt9&&this.options.opacity<1&&bn(se,this.options.opacity)},_addTile:function(se,he){var we=this._getTilePos(se),Te=this._tileCoordsToKey(se),He=this.createTile(this._wrapCoords(se),ie(this._tileReady,this,se));this._initTile(He),this.createTile.length<2&&Ie(ie(this._tileReady,this,se,null,He)),ln(He,we),this._tiles[Te]={el:He,coords:se,current:!0},he.appendChild(He),this.fire("tileloadstart",{tile:He,coords:se})},_tileReady:function(se,he,we){he&&this.fire("tileerror",{error:he,tile:we,coords:se});var Te=this._tileCoordsToKey(se);we=this._tiles[Te],we&&(we.loaded=+new Date,this._map._fadeAnimated?(bn(we.el,0),ze(this._fadeFrame),this._fadeFrame=Ie(this._updateOpacity,this)):(we.active=!0,this._pruneTiles()),he||(Wt(we.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:we.el,coords:se})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Mt.ielt9||!this._map._fadeAnimated?Ie(this._pruneTiles,this):setTimeout(ie(this._pruneTiles,this),250)))},_getTilePos:function(se){return se.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(se){var he=new xe(this._wrapX?ue(se.x,this._wrapX):se.x,this._wrapY?ue(se.y,this._wrapY):se.y);return he.z=se.z,he},_pxBoundsToTileRange:function(se){var he=this.getTileSize();return new Re(se.min.unscaleBy(he).floor(),se.max.unscaleBy(he).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var se in this._tiles)if(!this._tiles[se].loaded)return!1;return!0}});function Ao(se){return new ia(se)}var qn=ia.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(se,he){this._url=se,he=pe(this,he),he.detectRetina&&Mt.retina&&he.maxZoom>0?(he.tileSize=Math.floor(he.tileSize/2),he.zoomReverse?(he.zoomOffset--,he.minZoom=Math.min(he.maxZoom,he.minZoom+1)):(he.zoomOffset++,he.maxZoom=Math.max(he.minZoom,he.maxZoom-1)),he.minZoom=Math.max(0,he.minZoom)):he.zoomReverse?he.minZoom=Math.min(he.maxZoom,he.minZoom):he.maxZoom=Math.max(he.minZoom,he.maxZoom),typeof he.subdomains=="string"&&(he.subdomains=he.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(se,he){return this._url===se&&he===void 0&&(he=!0),this._url=se,he||this.redraw(),this},createTile:function(se,he){var we=document.createElement("img");return qt(we,"load",ie(this._tileOnLoad,this,he,we)),qt(we,"error",ie(this._tileOnError,this,he,we)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(we.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(we.referrerPolicy=this.options.referrerPolicy),we.alt="",we.src=this.getTileUrl(se),we},getTileUrl:function(se){var he={r:Mt.retina?"@2x":"",s:this._getSubdomain(se),x:se.x,y:se.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var we=this._globalTileRange.max.y-se.y;this.options.tms&&(he.y=we),he["-y"]=we}return _e(this._url,re(he,this.options))},_tileOnLoad:function(se,he){Mt.ielt9?setTimeout(ie(se,this,null,he),0):se(null,he)},_tileOnError:function(se,he,we){var Te=this.options.errorTileUrl;Te&&he.getAttribute("src")!==Te&&(he.src=Te),se(we,he)},_onTileRemove:function(se){se.tile.onload=null},_getZoomForUrl:function(){var se=this._tileZoom,he=this.options.maxZoom,we=this.options.zoomReverse,Te=this.options.zoomOffset;return we&&(se=he-se),se+Te},_getSubdomain:function(se){var he=Math.abs(se.x+se.y)%this.options.subdomains.length;return this.options.subdomains[he]},_abortLoading:function(){var se,he;for(se in this._tiles)if(this._tiles[se].coords.z!==this._tileZoom&&(he=this._tiles[se].el,he.onload=be,he.onerror=be,!he.complete)){he.src=Ee;var we=this._tiles[se].coords;tn(he),delete this._tiles[se],this.fire("tileabort",{tile:he,coords:we})}},_removeTile:function(se){var he=this._tiles[se];if(he)return he.el.setAttribute("src",Ee),ia.prototype._removeTile.call(this,se)},_tileReady:function(se,he,we){if(!(!this._map||we&&we.getAttribute("src")===Ee))return ia.prototype._tileReady.call(this,se,he,we)}});function Br(se,he){return new qn(se,he)}var Nr=qn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(se,he){this._url=se;var we=re({},this.defaultWmsParams);for(var Te in he)Te in this.options||(we[Te]=he[Te]);he=pe(this,he);var He=he.detectRetina&&Mt.retina?2:1,Ye=this.getTileSize();we.width=Ye.x*He,we.height=Ye.y*He,this.wmsParams=we},onAdd:function(se){this._crs=this.options.crs||se.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var he=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[he]=this._crs.code,qn.prototype.onAdd.call(this,se)},getTileUrl:function(se){var he=this._tileCoordsToNwSe(se),we=this._crs,Te=qe(we.project(he[0]),we.project(he[1])),He=Te.min,Ye=Te.max,ot=(this._wmsVersion>=1.3&&this._crs===kr?[He.y,He.x,Ye.y,Ye.x]:[He.x,He.y,Ye.x,Ye.y]).join(","),vt=qn.prototype.getTileUrl.call(this,se);return vt+ke(this.wmsParams,vt,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ot},setParams:function(se,he){return re(this.wmsParams,se),he||this.redraw(),this}});function To(se,he){return new Nr(se,he)}qn.WMS=Nr,Br.wms=To;var Nn=kn.extend({options:{padding:.1},initialize:function(se){pe(this,se),ce(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Wt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var se={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(se.zoomanim=this._onAnimZoom),se},_onAnimZoom:function(se){this._updateTransform(se.center,se.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(se,he){var we=this._map.getZoomScale(he,this._zoom),Te=this._map.getSize().multiplyBy(.5+this.options.padding),He=this._map.project(this._center,he),Ye=Te.multiplyBy(-we).add(He).subtract(this._map._getNewPixelOrigin(se,he));Mt.any3d?Pn(this._container,Ye,we):ln(this._container,Ye)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var se in this._layers)this._layers[se]._reset()},_onZoomEnd:function(){for(var se in this._layers)this._layers[se]._project()},_updatePaths:function(){for(var se in this._layers)this._layers[se]._update()},_update:function(){var se=this.options.padding,he=this._map.getSize(),we=this._map.containerPointToLayerPoint(he.multiplyBy(-se)).round();this._bounds=new Re(we,we.add(he.multiplyBy(1+se*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Vr=Nn.extend({options:{tolerance:0},getEvents:function(){var se=Nn.prototype.getEvents.call(this);return se.viewprereset=this._onViewPreReset,se},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Nn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var se=this._container=document.createElement("canvas");qt(se,"mousemove",this._onMouseMove,this),qt(se,"click dblclick mousedown mouseup contextmenu",this._onClick,this),qt(se,"mouseout",this._handleMouseOut,this),se._leaflet_disable_events=!0,this._ctx=se.getContext("2d")},_destroyContainer:function(){ze(this._redrawRequest),delete this._ctx,tn(this._container),en(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var se;this._redrawBounds=null;for(var he in this._layers)se=this._layers[he],se._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Nn.prototype._update.call(this);var se=this._bounds,he=this._container,we=se.getSize(),Te=Mt.retina?2:1;ln(he,se.min),he.width=Te*we.x,he.height=Te*we.y,he.style.width=we.x+"px",he.style.height=we.y+"px",Mt.retina&&this._ctx.scale(2,2),this._ctx.translate(-se.min.x,-se.min.y),this.fire("update")}},_reset:function(){Nn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(se){this._updateDashArray(se),this._layers[ce(se)]=se;var he=se._order={layer:se,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=he),this._drawLast=he,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(se){this._requestRedraw(se)},_removePath:function(se){var he=se._order,we=he.next,Te=he.prev;we?we.prev=Te:this._drawLast=Te,Te?Te.next=we:this._drawFirst=we,delete se._order,delete this._layers[ce(se)],this._requestRedraw(se)},_updatePath:function(se){this._extendRedrawBounds(se),se._project(),se._update(),this._requestRedraw(se)},_updateStyle:function(se){this._updateDashArray(se),this._requestRedraw(se)},_updateDashArray:function(se){if(typeof se.options.dashArray=="string"){var he=se.options.dashArray.split(/[, ]+/),we=[],Te,He;for(He=0;He<he.length;He++){if(Te=Number(he[He]),isNaN(Te))return;we.push(Te)}se.options._dashArray=we}else se.options._dashArray=se.options.dashArray},_requestRedraw:function(se){this._map&&(this._extendRedrawBounds(se),this._redrawRequest=this._redrawRequest||Ie(this._redraw,this))},_extendRedrawBounds:function(se){if(se._pxBounds){var he=(se.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Re,this._redrawBounds.extend(se._pxBounds.min.subtract([he,he])),this._redrawBounds.extend(se._pxBounds.max.add([he,he]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var se=this._redrawBounds;if(se){var he=se.getSize();this._ctx.clearRect(se.min.x,se.min.y,he.x,he.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var se,he=this._redrawBounds;if(this._ctx.save(),he){var we=he.getSize();this._ctx.beginPath(),this._ctx.rect(he.min.x,he.min.y,we.x,we.y),this._ctx.clip()}this._drawing=!0;for(var Te=this._drawFirst;Te;Te=Te.next)se=Te.layer,(!he||se._pxBounds&&se._pxBounds.intersects(he))&&se._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(se,he){if(this._drawing){var we,Te,He,Ye,ot=se._parts,vt=ot.length,xt=this._ctx;if(vt){for(xt.beginPath(),we=0;we<vt;we++){for(Te=0,He=ot[we].length;Te<He;Te++)Ye=ot[we][Te],xt[Te?"lineTo":"moveTo"](Ye.x,Ye.y);he&&xt.closePath()}this._fillStroke(xt,se)}}},_updateCircle:function(se){if(!(!this._drawing||se._empty())){var he=se._point,we=this._ctx,Te=Math.max(Math.round(se._radius),1),He=(Math.max(Math.round(se._radiusY),1)||Te)/Te;He!==1&&(we.save(),we.scale(1,He)),we.beginPath(),we.arc(he.x,he.y/He,Te,0,Math.PI*2,!1),He!==1&&we.restore(),this._fillStroke(we,se)}},_fillStroke:function(se,he){var we=he.options;we.fill&&(se.globalAlpha=we.fillOpacity,se.fillStyle=we.fillColor||we.color,se.fill(we.fillRule||"evenodd")),we.stroke&&we.weight!==0&&(se.setLineDash&&se.setLineDash(he.options&&he.options._dashArray||[]),se.globalAlpha=we.opacity,se.lineWidth=we.weight,se.strokeStyle=we.color,se.lineCap=we.lineCap,se.lineJoin=we.lineJoin,se.stroke())},_onClick:function(se){for(var he=this._map.mouseEventToLayerPoint(se),we,Te,He=this._drawFirst;He;He=He.next)we=He.layer,we.options.interactive&&we._containsPoint(he)&&(!(se.type==="click"||se.type==="preclick")||!this._map._draggableMoved(we))&&(Te=we);this._fireEvent(Te?[Te]:!1,se)},_onMouseMove:function(se){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var he=this._map.mouseEventToLayerPoint(se);this._handleMouseHover(se,he)}},_handleMouseOut:function(se){var he=this._hoveredLayer;he&&(nn(this._container,"leaflet-interactive"),this._fireEvent([he],se,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(se,he){if(!this._mouseHoverThrottled){for(var we,Te,He=this._drawFirst;He;He=He.next)we=He.layer,we.options.interactive&&we._containsPoint(he)&&(Te=we);Te!==this._hoveredLayer&&(this._handleMouseOut(se),Te&&(Wt(this._container,"leaflet-interactive"),this._fireEvent([Te],se,"mouseover"),this._hoveredLayer=Te)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,se),this._mouseHoverThrottled=!0,setTimeout(ie(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(se,he,we){this._map._fireDOMEvent(he,we||he.type,se)},_bringToFront:function(se){var he=se._order;if(he){var we=he.next,Te=he.prev;if(we)we.prev=Te;else return;Te?Te.next=we:we&&(this._drawFirst=we),he.prev=this._drawLast,this._drawLast.next=he,he.next=null,this._drawLast=he,this._requestRedraw(se)}},_bringToBack:function(se){var he=se._order;if(he){var we=he.next,Te=he.prev;if(Te)Te.next=we;else return;we?we.prev=Te:Te&&(this._drawLast=Te),he.prev=null,he.next=this._drawFirst,this._drawFirst.prev=he,this._drawFirst=he,this._requestRedraw(se)}}});function Mr(se){return Mt.canvas?new Vr(se):null}var sa=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(se){return document.createElement("<lvml:"+se+' class="lvml">')}}catch{}return function(se){return document.createElement("<"+se+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Po={_initContainer:function(){this._container=Qt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Nn.prototype._update.call(this),this.fire("update"))},_initPath:function(se){var he=se._container=sa("shape");Wt(he,"leaflet-vml-shape "+(this.options.className||"")),he.coordsize="1 1",se._path=sa("path"),he.appendChild(se._path),this._updateStyle(se),this._layers[ce(se)]=se},_addPath:function(se){var he=se._container;this._container.appendChild(he),se.options.interactive&&se.addInteractiveTarget(he)},_removePath:function(se){var he=se._container;tn(he),se.removeInteractiveTarget(he),delete this._layers[ce(se)]},_updateStyle:function(se){var he=se._stroke,we=se._fill,Te=se.options,He=se._container;He.stroked=!!Te.stroke,He.filled=!!Te.fill,Te.stroke?(he||(he=se._stroke=sa("stroke")),He.appendChild(he),he.weight=Te.weight+"px",he.color=Te.color,he.opacity=Te.opacity,Te.dashArray?he.dashStyle=$e(Te.dashArray)?Te.dashArray.join(" "):Te.dashArray.replace(/( *, *)/g," "):he.dashStyle="",he.endcap=Te.lineCap.replace("butt","flat"),he.joinstyle=Te.lineJoin):he&&(He.removeChild(he),se._stroke=null),Te.fill?(we||(we=se._fill=sa("fill")),He.appendChild(we),we.color=Te.fillColor||Te.color,we.opacity=Te.fillOpacity):we&&(He.removeChild(we),se._fill=null)},_updateCircle:function(se){var he=se._point.round(),we=Math.round(se._radius),Te=Math.round(se._radiusY||we);this._setPath(se,se._empty()?"M0 0":"AL "+he.x+","+he.y+" "+we+","+Te+" 0,"+65535*360)},_setPath:function(se,he){se._path.v=he},_bringToFront:function(se){Rn(se._container)},_bringToBack:function(se){On(se._container)}},Ca=Mt.vml?sa:Qe,la=Nn.extend({_initContainer:function(){this._container=Ca("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ca("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){tn(this._container),en(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Nn.prototype._update.call(this);var se=this._bounds,he=se.getSize(),we=this._container;(!this._svgSize||!this._svgSize.equals(he))&&(this._svgSize=he,we.setAttribute("width",he.x),we.setAttribute("height",he.y)),ln(we,se.min),we.setAttribute("viewBox",[se.min.x,se.min.y,he.x,he.y].join(" ")),this.fire("update")}},_initPath:function(se){var he=se._path=Ca("path");se.options.className&&Wt(he,se.options.className),se.options.interactive&&Wt(he,"leaflet-interactive"),this._updateStyle(se),this._layers[ce(se)]=se},_addPath:function(se){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(se._path),se.addInteractiveTarget(se._path)},_removePath:function(se){tn(se._path),se.removeInteractiveTarget(se._path),delete this._layers[ce(se)]},_updatePath:function(se){se._project(),se._update()},_updateStyle:function(se){var he=se._path,we=se.options;he&&(we.stroke?(he.setAttribute("stroke",we.color),he.setAttribute("stroke-opacity",we.opacity),he.setAttribute("stroke-width",we.weight),he.setAttribute("stroke-linecap",we.lineCap),he.setAttribute("stroke-linejoin",we.lineJoin),we.dashArray?he.setAttribute("stroke-dasharray",we.dashArray):he.removeAttribute("stroke-dasharray"),we.dashOffset?he.setAttribute("stroke-dashoffset",we.dashOffset):he.removeAttribute("stroke-dashoffset")):he.setAttribute("stroke","none"),we.fill?(he.setAttribute("fill",we.fillColor||we.color),he.setAttribute("fill-opacity",we.fillOpacity),he.setAttribute("fill-rule",we.fillRule||"evenodd")):he.setAttribute("fill","none"))},_updatePoly:function(se,he){this._setPath(se,ut(se._parts,he))},_updateCircle:function(se){var he=se._point,we=Math.max(Math.round(se._radius),1),Te=Math.max(Math.round(se._radiusY),1)||we,He="a"+we+","+Te+" 0 1,0 ",Ye=se._empty()?"M0 0":"M"+(he.x-we)+","+he.y+He+we*2+",0 "+He+-we*2+",0 ";this._setPath(se,Ye)},_setPath:function(se,he){se._path.setAttribute("d",he)},_bringToFront:function(se){Rn(se._path)},_bringToBack:function(se){On(se._path)}});Mt.vml&&la.include(Po);function Ar(se){return Mt.svg||Mt.vml?new la(se):null}Kt.include({getRenderer:function(se){var he=se.options.renderer||this._getPaneRenderer(se.options.pane)||this.options.renderer||this._renderer;return he||(he=this._renderer=this._createRenderer()),this.hasLayer(he)||this.addLayer(he),he},_getPaneRenderer:function(se){if(se==="overlayPane"||se===void 0)return!1;var he=this._paneRenderers[se];return he===void 0&&(he=this._createRenderer({pane:se}),this._paneRenderers[se]=he),he},_createRenderer:function(se){return this.options.preferCanvas&&Mr(se)||Ar(se)}});var Tr=Gn.extend({initialize:function(se,he){Gn.prototype.initialize.call(this,this._boundsToLatLngs(se),he)},setBounds:function(se){return this.setLatLngs(this._boundsToLatLngs(se))},_boundsToLatLngs:function(se){return se=Ze(se),[se.getSouthWest(),se.getNorthWest(),se.getNorthEast(),se.getSouthEast()]}});function Lo(se,he){return new Tr(se,he)}la.create=Ca,la.pointsToPath=ut,Bn.geometryToLayer=$a,Bn.coordsToLatLng=Ka,Bn.coordsToLatLngs=ya,Bn.latLngToCoords=Ja,Bn.latLngsToCoords=ka,Bn.getFeature=Zn,Bn.asFeature=_a,Kt.mergeOptions({boxZoom:!0});var Pr=xn.extend({initialize:function(se){this._map=se,this._container=se._container,this._pane=se._panes.overlayPane,this._resetStateTimeout=0,se.on("unload",this._destroy,this)},addHooks:function(){qt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){en(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){tn(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(se){if(!se.shiftKey||se.which!==1&&se.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Qn(),Pa(),this._startPoint=this._map.mouseEventToContainerPoint(se),qt(document,{contextmenu:Dn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(se){this._moved||(this._moved=!0,this._box=Qt("div","leaflet-zoom-box",this._container),Wt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(se);var he=new Re(this._point,this._startPoint),we=he.getSize();ln(this._box,he.min),this._box.style.width=we.x+"px",this._box.style.height=we.y+"px"},_finish:function(){this._moved&&(tn(this._box),nn(this._container,"leaflet-crosshair")),ea(),La(),en(document,{contextmenu:Dn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(se){if(!(se.which!==1&&se.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(ie(this._resetState,this),0);var he=new Ge(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(he).fire("boxzoomend",{boxZoomBounds:he})}},_onKeyDown:function(se){se.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Kt.addInitHook("addHandler","boxZoom",Pr),Kt.mergeOptions({doubleClickZoom:!0});var Lr=xn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(se){var he=this._map,we=he.getZoom(),Te=he.options.zoomDelta,He=se.originalEvent.shiftKey?we-Te:we+Te;he.options.doubleClickZoom==="center"?he.setZoom(He):he.setZoomAround(se.containerPoint,He)}});Kt.addInitHook("addHandler","doubleClickZoom",Lr),Kt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Fr=xn.extend({addHooks:function(){if(!this._draggable){var se=this._map;this._draggable=new An(se._mapPane,se._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),se.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),se.on("zoomend",this._onZoomEnd,this),se.whenReady(this._onZoomEnd,this))}Wt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){nn(this._map._container,"leaflet-grab"),nn(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var se=this._map;if(se._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var he=Ze(this._map.options.maxBounds);this._offsetLimit=qe(this._map.latLngToContainerPoint(he.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(he.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;se.fire("movestart").fire("dragstart"),se.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(se){if(this._map.options.inertia){var he=this._lastTime=+new Date,we=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(we),this._times.push(he),this._prunePositions(he)}this._map.fire("move",se).fire("drag",se)},_prunePositions:function(se){for(;this._positions.length>1&&se-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var se=this._map.getSize().divideBy(2),he=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=he.subtract(se).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(se,he){return se-(se-he)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var se=this._draggable._newPos.subtract(this._draggable._startPos),he=this._offsetLimit;se.x<he.min.x&&(se.x=this._viscousLimit(se.x,he.min.x)),se.y<he.min.y&&(se.y=this._viscousLimit(se.y,he.min.y)),se.x>he.max.x&&(se.x=this._viscousLimit(se.x,he.max.x)),se.y>he.max.y&&(se.y=this._viscousLimit(se.y,he.max.y)),this._draggable._newPos=this._draggable._startPos.add(se)}},_onPreDragWrap:function(){var se=this._worldWidth,he=Math.round(se/2),we=this._initialWorldOffset,Te=this._draggable._newPos.x,He=(Te-he+we)%se+he-we,Ye=(Te+he+we)%se-he-we,ot=Math.abs(He+we)<Math.abs(Ye+we)?He:Ye;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ot},_onDragEnd:function(se){var he=this._map,we=he.options,Te=!we.inertia||se.noInertia||this._times.length<2;if(he.fire("dragend",se),Te)he.fire("moveend");else{this._prunePositions(+new Date);var He=this._lastPos.subtract(this._positions[0]),Ye=(this._lastTime-this._times[0])/1e3,ot=we.easeLinearity,vt=He.multiplyBy(ot/Ye),xt=vt.distanceTo([0,0]),At=Math.min(we.inertiaMaxSpeed,xt),zt=vt.multiplyBy(At/xt),jt=At/(we.inertiaDeceleration*ot),Ut=zt.multiplyBy(-jt/2).round();!Ut.x&&!Ut.y?he.fire("moveend"):(Ut=he._limitOffset(Ut,he.options.maxBounds),Ie(function(){he.panBy(Ut,{duration:jt,easeLinearity:ot,noMoveStart:!0,animate:!0})}))}}});Kt.addInitHook("addHandler","dragging",Fr),Kt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Dr=xn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(se){this._map=se,this._setPanDelta(se.options.keyboardPanDelta),this._setZoomDelta(se.options.zoomDelta)},addHooks:function(){var se=this._map._container;se.tabIndex<=0&&(se.tabIndex="0"),qt(se,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),en(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var se=document.body,he=document.documentElement,we=se.scrollTop||he.scrollTop,Te=se.scrollLeft||he.scrollLeft;this._map._container.focus(),window.scrollTo(Te,we)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(se){var he=this._panKeys={},we=this.keyCodes,Te,He;for(Te=0,He=we.left.length;Te<He;Te++)he[we.left[Te]]=[-1*se,0];for(Te=0,He=we.right.length;Te<He;Te++)he[we.right[Te]]=[se,0];for(Te=0,He=we.down.length;Te<He;Te++)he[we.down[Te]]=[0,se];for(Te=0,He=we.up.length;Te<He;Te++)he[we.up[Te]]=[0,-1*se]},_setZoomDelta:function(se){var he=this._zoomKeys={},we=this.keyCodes,Te,He;for(Te=0,He=we.zoomIn.length;Te<He;Te++)he[we.zoomIn[Te]]=se;for(Te=0,He=we.zoomOut.length;Te<He;Te++)he[we.zoomOut[Te]]=-se},_addHooks:function(){qt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){en(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(se){if(!(se.altKey||se.ctrlKey||se.metaKey)){var he=se.keyCode,we=this._map,Te;if(he in this._panKeys){if(!we._panAnim||!we._panAnim._inProgress)if(Te=this._panKeys[he],se.shiftKey&&(Te=Fe(Te).multiplyBy(3)),we.options.maxBounds&&(Te=we._limitOffset(Fe(Te),we.options.maxBounds)),we.options.worldCopyJump){var He=we.wrapLatLng(we.unproject(we.project(we.getCenter()).add(Te)));we.panTo(He)}else we.panBy(Te)}else if(he in this._zoomKeys)we.setZoom(we.getZoom()+(se.shiftKey?3:1)*this._zoomKeys[he]);else if(he===27&&we._popup&&we._popup.options.closeOnEscapeKey)we.closePopup();else return;Dn(se)}}});Kt.addInitHook("addHandler","keyboard",Dr),Kt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var zr=xn.extend({addHooks:function(){qt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){en(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(se){var he=sr(se),we=this._map.options.wheelDebounceTime;this._delta+=he,this._lastMousePos=this._map.mouseEventToContainerPoint(se),this._startTime||(this._startTime=+new Date);var Te=Math.max(we-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(ie(this._performZoom,this),Te),Dn(se)},_performZoom:function(){var se=this._map,he=se.getZoom(),we=this._map.options.zoomSnap||0;se._stop();var Te=this._delta/(this._map.options.wheelPxPerZoomLevel*4),He=4*Math.log(2/(1+Math.exp(-Math.abs(Te))))/Math.LN2,Ye=we?Math.ceil(He/we)*we:He,ot=se._limitZoom(he+(this._delta>0?Ye:-Ye))-he;this._delta=0,this._startTime=null,ot&&(se.options.scrollWheelZoom==="center"?se.setZoom(he+ot):se.setZoomAround(this._lastMousePos,he+ot))}});Kt.addInitHook("addHandler","scrollWheelZoom",zr);var Fo=600;Kt.mergeOptions({tapHold:Mt.touchNative&&Mt.safari&&Mt.mobile,tapTolerance:15});var Ir=xn.extend({addHooks:function(){qt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){en(this._map._container,"touchstart",this._onDown,this)},_onDown:function(se){if(clearTimeout(this._holdTimeout),se.touches.length===1){var he=se.touches[0];this._startPos=this._newPos=new xe(he.clientX,he.clientY),this._holdTimeout=setTimeout(ie(function(){this._cancel(),this._isTapValid()&&(qt(document,"touchend",un),qt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",he))},this),Fo),qt(document,"touchend touchcancel contextmenu",this._cancel,this),qt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function se(){en(document,"touchend",un),en(document,"touchend touchcancel",se)},_cancel:function(){clearTimeout(this._holdTimeout),en(document,"touchend touchcancel contextmenu",this._cancel,this),en(document,"touchmove",this._onMove,this)},_onMove:function(se){var he=se.touches[0];this._newPos=new xe(he.clientX,he.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(se,he){var we=new MouseEvent(se,{bubbles:!0,cancelable:!0,view:window,screenX:he.screenX,screenY:he.screenY,clientX:he.clientX,clientY:he.clientY});we._simulated=!0,he.target.dispatchEvent(we)}});Kt.addInitHook("addHandler","tapHold",Ir),Kt.mergeOptions({touchZoom:Mt.touch,bounceAtZoomLimits:!0});var Rr=xn.extend({addHooks:function(){Wt(this._map._container,"leaflet-touch-zoom"),qt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){nn(this._map._container,"leaflet-touch-zoom"),en(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(se){var he=this._map;if(!(!se.touches||se.touches.length!==2||he._animatingZoom||this._zooming)){var we=he.mouseEventToContainerPoint(se.touches[0]),Te=he.mouseEventToContainerPoint(se.touches[1]);this._centerPoint=he.getSize()._divideBy(2),this._startLatLng=he.containerPointToLatLng(this._centerPoint),he.options.touchZoom!=="center"&&(this._pinchStartLatLng=he.containerPointToLatLng(we.add(Te)._divideBy(2))),this._startDist=we.distanceTo(Te),this._startZoom=he.getZoom(),this._moved=!1,this._zooming=!0,he._stop(),qt(document,"touchmove",this._onTouchMove,this),qt(document,"touchend touchcancel",this._onTouchEnd,this),un(se)}},_onTouchMove:function(se){if(!(!se.touches||se.touches.length!==2||!this._zooming)){var he=this._map,we=he.mouseEventToContainerPoint(se.touches[0]),Te=he.mouseEventToContainerPoint(se.touches[1]),He=we.distanceTo(Te)/this._startDist;if(this._zoom=he.getScaleZoom(He,this._startZoom),!he.options.bounceAtZoomLimits&&(this._zoom<he.getMinZoom()&&He<1||this._zoom>he.getMaxZoom()&&He>1)&&(this._zoom=he._limitZoom(this._zoom)),he.options.touchZoom==="center"){if(this._center=this._startLatLng,He===1)return}else{var Ye=we._add(Te)._divideBy(2)._subtract(this._centerPoint);if(He===1&&Ye.x===0&&Ye.y===0)return;this._center=he.unproject(he.project(this._pinchStartLatLng,this._zoom).subtract(Ye),this._zoom)}this._moved||(he._moveStart(!0,!1),this._moved=!0),ze(this._animRequest);var ot=ie(he._move,he,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Ie(ot,this,!0),un(se)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ze(this._animRequest),en(document,"touchmove",this._onTouchMove,this),en(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Kt.addInitHook("addHandler","touchZoom",Rr),Kt.BoxZoom=Pr,Kt.DoubleClickZoom=Lr,Kt.Drag=Fr,Kt.Keyboard=Dr,Kt.ScrollWheelZoom=zr,Kt.TapHold=Ir,Kt.TouchZoom=Rr,ne.Bounds=Re,ne.Browser=Mt,ne.CRS=at,ne.Canvas=Vr,ne.Circle=Xa,ne.CircleMarker=ga,ne.Class=Ne,ne.Control=yn,ne.DivIcon=Sr,ne.DivOverlay=wn,ne.DomEvent=Qr,ne.DomUtil=Kr,ne.Draggable=An,ne.Evented=Me,ne.FeatureGroup=Cn,ne.GeoJSON=Bn,ne.GridLayer=ia,ne.Handler=xn,ne.Icon=jn,ne.ImageOverlay=xa,ne.LatLng=Xe,ne.LatLngBounds=Ge,ne.Layer=kn,ne.LayerGroup=Hn,ne.LineUtil=mo,ne.Map=Kt,ne.Marker=va,ne.Mixin=io,ne.Path=Tn,ne.Point=xe,ne.PolyUtil=so,ne.Polygon=Gn,ne.Polyline=Sn,ne.Popup=wa,ne.PosAnimation=lr,ne.Projection=fo,ne.Rectangle=Tr,ne.Renderer=Nn,ne.SVG=la,ne.SVGOverlay=Cr,ne.TileLayer=qn,ne.Tooltip=Ea,ne.Transformation=gt,ne.Util=Ve,ne.VideoOverlay=Er,ne.bind=ie,ne.bounds=qe,ne.canvas=Mr,ne.circle=_o,ne.circleMarker=ko,ne.control=aa,ne.divIcon=Mo,ne.extend=re,ne.featureGroup=go,ne.geoJSON=wr,ne.geoJson=Eo,ne.gridLayer=Ao,ne.icon=$o,ne.imageOverlay=Co,ne.latLng=Ue,ne.latLngBounds=Ze,ne.layerGroup=vo,ne.map=eo,ne.marker=yo,ne.point=Fe,ne.polygon=wo,ne.polyline=xo,ne.popup=No,ne.rectangle=Lo,ne.setOptions=pe,ne.stamp=ce,ne.svg=Ar,ne.svgOverlay=Bo,ne.tileLayer=Br,ne.tooltip=Vo,ne.transformation=Et,ne.version=ae,ne.videoOverlay=So;var Do=window.L;ne.noConflict=function(){return window.L=Do,this},window.L=ne})})(leafletSrc,leafletSrc.exports);var leafletSrcExports=leafletSrc.exports;const L$2=getDefaultExportFromCjs(leafletSrcExports);async function copyToClipboard(ee){var ae;if(!ee||!ee.trim())return!1;if((ae=navigator==null?void 0:navigator.clipboard)!=null&&ae.writeText)try{return await navigator.clipboard.writeText(ee),!0}catch{}const te=document.createElement("textarea");te.value=ee,te.setAttribute("readonly",""),te.style.position="fixed",te.style.left="-9999px",document.body.appendChild(te),te.select();const ne=document.execCommand("copy");return document.body.removeChild(te),ne}const _hoisted_1$y={class:"sm-map"},_hoisted_2$v={class:"sm-map-surface"},_hoisted_3$s=["id"],_hoisted_4$r={key:0,class:"sm-map-empty"},_hoisted_5$p={key:1,class:"sm-map-hint"},_hoisted_6$l={key:0,class:"sm-map-zoom"},_hoisted_7$j=["disabled"],_hoisted_8$g=["disabled"],_hoisted_9$d={key:0,class:"sm-map-info"},_hoisted_10$c=["title"],_hoisted_11$b={key:0,class:"sm-map-subtitle"},_hoisted_12$9={class:"sm-map-actions"},_hoisted_13$7=["href"],_hoisted_14$7={class:"size-3.5",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_15$6={key:0,d:"M9.6 17.2 4.8 12.4l1.4-1.4 3.4 3.4 8-8 1.4 1.4-9.4 9.4Z"},_hoisted_16$5={key:1,d:"M8 3h8a2 2 0 0 1 2 2v1h-2V5H8v10h1v2H8a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm4 5h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2Zm0 2v9h7v-9h-7Z"},PREVIEW_ZOOM=15,_sfc_main$D={__name:"MessageLocationMap",props:{map:{type:Object,required:!0},mapId:{type:String,default:null},pinUrl:{type:String,default:"/image/location-pin.png"},tileTheme:{type:String,default:"auto",validator:ee=>["auto","dark","light"].includes(ee)}},setup(ee){const te=ee,ne={dark:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",light:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png"},ae=[11,19],re=e$b.ref(null),oe=e$b.ref(!1),ie=e$b.ref(PREVIEW_ZOOM),le=e$b.ref(!1);let ce=null,de=null,ue=null,be=null,fe=null,ge=null;const me=()=>{var Oe,Ie,ze;const Ae=Number((Oe=te.map)==null?void 0:Oe.latitude),De=Number(((Ie=te.map)==null?void 0:Ie.longitude)??((ze=te.map)==null?void 0:ze.length));return Number.isFinite(Ae)&&Number.isFinite(De)?[Ae,De]:null},pe=e$b.computed(()=>{var Ae,De;return((Ae=te.map)==null?void 0:Ae.name)||((De=te.map)==null?void 0:De.address)||"Localização compartilhada"}),ke=e$b.computed(()=>{var Oe,Ie;const Ae=me();return Ae?((Oe=te.map)!=null&&Oe.name?(Ie=te.map)==null?void 0:Ie.address:null)||Ae.map(ze=>ze.toFixed(5)).join(", "):""}),ve=e$b.computed(()=>{var Ae;return((Ae=me())==null?void 0:Ae.join(", "))??""}),_e=e$b.computed(()=>`https://www.google.com/maps/dir/?api=1&destination=${ve.value}`);function $e(Ae){const De=Math.min(ae[1],Math.max(ae[0],ie.value+Ae));De!==ie.value&&(ie.value=De,ce==null||ce.setZoom(De))}async function ye(){await copyToClipboard(ve.value)&&(le.value=!0,clearTimeout(ge),ge=setTimeout(()=>le.value=!1,1600))}function Ee(){return te.tileTheme!=="auto"?ne[te.tileTheme]:document.documentElement.classList.contains("dark")?ne.light:ne.dark}function Se(){const Ae=me();if(!Ae)return;const[De,Oe]=Ae;N$3.show([{src:`https://www.google.com/maps?q=${De},${Oe}&z=19&output=embed`,type:"iframe",caption:pe.value}],{Toolbar:{display:{left:["infobar"],right:["close"]}},iframe:{preload:!1,css:{width:"90%",height:"80vh",borderRadius:"12px"}}})}function Le(){const Ae=me();!re.value||ce||!Ae||(ce=L$2.map(re.value,{zoomControl:!1,attributionControl:!0,dragging:!1,touchZoom:!1,scrollWheelZoom:!1,doubleClickZoom:!1,boxZoom:!1,keyboard:!1,tap:!1,inertia:!1}).setView(Ae,ie.value),de=L$2.tileLayer(Ee(),{maxZoom:19,detectRetina:!0}),de.addTo(ce),L$2.marker(Ae,{icon:L$2.icon({iconUrl:te.pinUrl,iconSize:[40,40],iconAnchor:[20,36]}),keyboard:!1,interactive:!1}).addTo(ce),ce.attributionControl.setPrefix(""),oe.value=!0,typeof ResizeObserver=="function"?(fe=new ResizeObserver(()=>ce==null?void 0:ce.invalidateSize(!1)),fe.observe(re.value)):requestAnimationFrame(()=>ce==null?void 0:ce.invalidateSize(!1)),te.tileTheme==="auto"&&(be=new MutationObserver(()=>{de==null||de.setUrl(Ee())}),be.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})))}return e$b.onMounted(()=>{if(typeof IntersectionObserver!="function"){Le();return}ue=new IntersectionObserver(Ae=>{Ae.some(De=>De.isIntersecting)&&(ue.disconnect(),ue=null,Le())},{rootMargin:"200px"}),ue.observe(re.value)}),e$b.onBeforeUnmount(()=>{clearTimeout(ge),ue==null||ue.disconnect(),be==null||be.disconnect(),fe==null||fe.disconnect(),ue=null,be=null,fe=null,ce==null||ce.remove(),ce=null,de=null}),(Ae,De)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$y,[e$b.createElementVNode("div",_hoisted_2$v,[e$b.createElementVNode("button",{type:"button",class:"sm-map-open",title:"Abrir no Google Maps",onClick:Se},[e$b.createElementVNode("span",{id:ee.mapId||void 0,ref_key:"container",ref:re,class:"sm-map-canvas"},null,8,_hoisted_3$s),me()?oe.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$p,[...De[2]||(De[2]=[e$b.createElementVNode("svg",{class:"size-3.5",viewBox:"0 0 24 24",fill:"currentColor"},[e$b.createElementVNode("path",{d:"M12 2a7 7 0 0 0-7 7c0 5.1 6.1 12.2 6.4 12.5a.8.8 0 0 0 1.2 0C13 21.2 19 14.1 19 9a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6a2.5 2.5 0 0 1 0 5.5Z"})],-1),e$b.createTextVNode(" Ver no mapa ",-1)])])):e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_4$r,"Localização indisponível"))]),oe.value&&me()?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$l,[e$b.createElementVNode("button",{type:"button",title:"Aproximar",disabled:ie.value>=19,onClick:De[0]||(De[0]=Oe=>$e(1))}," + ",8,_hoisted_7$j),e$b.createElementVNode("button",{type:"button",title:"Afastar",disabled:ie.value<=11,onClick:De[1]||(De[1]=Oe=>$e(-1))}," − ",8,_hoisted_8$g)])):e$b.createCommentVNode("",!0)]),me()?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$d,[e$b.createElementVNode("p",{class:"sm-map-title",title:pe.value},e$b.toDisplayString(pe.value),9,_hoisted_10$c),ke.value?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_11$b,e$b.toDisplayString(ke.value),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_12$9,[e$b.createElementVNode("a",{class:"sm-map-action",href:_e.value,target:"_blank",rel:"noopener noreferrer"},[...De[3]||(De[3]=[e$b.createElementVNode("svg",{class:"size-3.5",viewBox:"0 0 24 24",fill:"currentColor"},[e$b.createElementVNode("path",{d:"M11.3 2.3a1 1 0 0 1 1.4 0l9 9a1 1 0 0 1 0 1.4l-9 9a1 1 0 0 1-1.4 0l-9-9a1 1 0 0 1 0-1.4l9-9Zm1.2 4.4v3H9a2.5 2.5 0 0 0-2.5 2.5V15h2v-2.8c0-.3.2-.5.5-.5h3.5v3l4-3.5-4-3.5Z"})],-1),e$b.createTextVNode(" Rota ",-1)])],8,_hoisted_13$7),e$b.createElementVNode("button",{type:"button",class:"sm-map-action",onClick:ye},[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_14$7,[le.value?(e$b.openBlock(),e$b.createElementBlock("path",_hoisted_15$6)):(e$b.openBlock(),e$b.createElementBlock("path",_hoisted_16$5))])),e$b.createTextVNode(" "+e$b.toDisplayString(le.value?"Copiado":"Copiar"),1)])])])):e$b.createCommentVNode("",!0)]))}},MessageLocationMap=_export_sfc$1(_sfc_main$D,[["__scopeId","data-v-01f542ea"]]),RECENT_STORAGE_KEY="smClickEmojiRecent",SKIN_TONE_STORAGE_KEY="smClickEmojiSkinTone",MAX_RECENT=32;function readStorage(ee,te){try{const ne=window.localStorage.getItem(ee);return ne!==null?JSON.parse(ne):te}catch{return te}}function writeStorage(ee,te){try{window.localStorage.setItem(ee,JSON.stringify(te))}catch{}}const useEmojiPickerStore=pinia.defineStore("smClickEmojiPicker",{state:()=>({recent:readStorage(RECENT_STORAGE_KEY,[]),skinTone:readStorage(SKIN_TONE_STORAGE_KEY,"default")}),actions:{addRecent(ee){const te=this.recent.filter(ne=>ne!==ee);this.recent=[ee,...te].slice(0,MAX_RECENT),writeStorage(RECENT_STORAGE_KEY,this.recent)},setSkinTone(ee){this.skinTone=ee,writeStorage(SKIN_TONE_STORAGE_KEY,ee)}}}),segmenter=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter("en",{granularity:"grapheme"}):null,ZWJ="",VARIATION_SELECTOR_16="️",COMBINING_ENCLOSING_KEYCAP="⃣",REGIONAL_INDICATOR_MIN=127462,REGIONAL_INDICATOR_MAX=127487,SKIN_TONE_MIN=127995,SKIN_TONE_MAX=127999;function isRegionalIndicator(ee){return ee>=REGIONAL_INDICATOR_MIN&&ee<=REGIONAL_INDICATOR_MAX}function isSkinToneModifier(ee){return ee>=SKIN_TONE_MIN&&ee<=SKIN_TONE_MAX}function splitGraphemesFallback(ee){const te=Array.from(ee),ne=[];let ae="",re=0;function oe(){ae&&ne.push(ae),ae="",re=0}for(const ie of te){const le=ie.codePointAt(0),ce=isRegionalIndicator(le),de=ae[ae.length-1];if(!ae){ae=ie,re=ce?1:0;continue}if(ie===ZWJ||de===ZWJ||ie===VARIATION_SELECTOR_16||ie===COMBINING_ENCLOSING_KEYCAP||isSkinToneModifier(le)){ae+=ie;continue}if(ce&&re===1){ae+=ie,re=2;continue}oe(),ae=ie,re=ce?1:0}return oe(),ne}function splitGraphemes(ee){return ee?segmenter?Array.from(segmenter.segment(ee),te=>te.segment):splitGraphemesFallback(ee):[]}function countGraphemes(ee){return splitGraphemes(ee).length}const SKIN_TONES=[{id:"default",modifier:"",label:"Padrão",swatch:"#ffd225"},{id:"light",modifier:String.fromCodePoint(127995),label:"Claro",swatch:"#ffdfbd"},{id:"medium-light",modifier:String.fromCodePoint(127996),label:"Médio-claro",swatch:"#e9c197"},{id:"medium",modifier:String.fromCodePoint(127997),label:"Médio",swatch:"#c88e62"},{id:"medium-dark",modifier:String.fromCodePoint(127998),label:"Médio-escuro",swatch:"#a86637"},{id:"dark",modifier:String.fromCodePoint(127999),label:"Escuro",swatch:"#60463a"}],SKIN_TONE_BASE_CHARS=new Set(["👋","🤚","🖐️","✋","🖖","👌","🤌","🤏","✌️","🤞","🫰","🤟","🤘","👈","👉","👆","🖕","👇","☝️","👍","👎","✊","👊","🤛","🤜","👏","🙌","🫶","👐","🤲","🙏","💪","🦵","🦶","👂","👃","👶","🧒","🧑","👦","👧","👨","👩","🧓","👴","👵"]);function stripSkinTone(ee){return Array.from(ee).filter(te=>{const ne=te.codePointAt(0);return!(ne>=127995&&ne<=127999)}).join("")}function applySkinTone(ee,te){return splitGraphemes(ee).map(ne=>{const ae=stripSkinTone(ne);return SKIN_TONE_BASE_CHARS.has(ae)?ae+te:ne}).join("")}const EMOJI_CATEGORIES=[{id:"smileys",label:"Smileys e pessoas",icon:"😀",emojis:[{char:"😀",name:"rosto sorrindo"},{char:"😃",name:"rosto sorrindo boca aberta"},{char:"😄",name:"rosto sorrindo olhos fechados"},{char:"😁",name:"rosto sorrindo grande"},{char:"😆",name:"rindo"},{char:"😅",name:"sorriso amarelo"},{char:"🤣",name:"rolando de rir"},{char:"😂",name:"chorando de rir"},{char:"🙂",name:"sorriso leve"},{char:"🙃",name:"rosto de cabeça pra baixo"},{char:"😉",name:"piscando"},{char:"😊",name:"sorrindo com olhos fechados"},{char:"😇",name:"anjinho"},{char:"🥰",name:"apaixonado"},{char:"😍",name:"olhos de coração"},{char:"😘",name:"mandando beijo"},{char:"😋",name:"saboreando comida"},{char:"😜",name:"língua de fora piscando"},{char:"🤪",name:"doidão"},{char:"🤔",name:"pensando"},{char:"🤨",name:"sobrancelha levantada"},{char:"😐",name:"rosto neutro"},{char:"😴",name:"dormindo"},{char:"🥱",name:"bocejando"},{char:"😢",name:"chorando"},{char:"😭",name:"chorando muito"},{char:"😡",name:"com raiva"},{char:"🤯",name:"cabeça explodindo"},{char:"😱",name:"gritando de medo"},{char:"🥳",name:"festejando"},{char:"🤗",name:"abraço"},{char:"🤝",name:"aperto de mão",tone:!0},{char:"👍",name:"polegar pra cima",tone:!0},{char:"👎",name:"polegar pra baixo",tone:!0},{char:"👏",name:"palmas",tone:!0},{char:"🙌",name:"mãos levantadas",tone:!0},{char:"🙏",name:"mãos em oração",tone:!0},{char:"💪",name:"braço forte",tone:!0},{char:"👋",name:"acenando",tone:!0},{char:"✍️",name:"escrevendo",tone:!0},{char:"👶",name:"bebê",tone:!0},{char:"🧑",name:"pessoa",tone:!0},{char:"👨",name:"homem",tone:!0},{char:"👩",name:"mulher",tone:!0},{char:"🧑💻",name:"pessoa programando",tone:!0},{char:"👩⚕️",name:"profissional de saúde"},{char:"👨👩👧👦",name:"família"},{char:"🏳️🌈",name:"bandeira arco-íris"}]},{id:"animals",label:"Animais e natureza",icon:"🐶",emojis:[{char:"🐶",name:"cachorro"},{char:"🐱",name:"gato"},{char:"🐭",name:"camundongo"},{char:"🐹",name:"hamster"},{char:"🐰",name:"coelho"},{char:"🦊",name:"raposa"},{char:"🐻",name:"urso"},{char:"🐼",name:"panda"},{char:"🐨",name:"coala"},{char:"🐯",name:"tigre"},{char:"🦁",name:"leão"},{char:"🐮",name:"vaca"},{char:"🐷",name:"porco"},{char:"🐸",name:"sapo"},{char:"🐵",name:"macaco"},{char:"🐔",name:"galinha"},{char:"🐧",name:"pinguim"},{char:"🐦",name:"pássaro"},{char:"🦅",name:"águia"},{char:"🦉",name:"coruja"},{char:"🐺",name:"lobo"},{char:"🐴",name:"cavalo"},{char:"🦄",name:"unicórnio"},{char:"🐝",name:"abelha"},{char:"🦋",name:"borboleta"},{char:"🐢",name:"tartaruga"},{char:"🐍",name:"cobra"},{char:"🐳",name:"baleia"},{char:"🐬",name:"delfim"},{char:"🐙",name:"polvo"},{char:"🌵",name:"cacto"},{char:"🌲",name:"árvore"},{char:"🌸",name:"flor de cerejeira"},{char:"🌈",name:"arco-íris"},{char:"☀️",name:"sol"},{char:"⭐",name:"estrela"},{char:"🔥",name:"fogo"},{char:"💧",name:"gota"}]},{id:"food",label:"Comida e bebidas",icon:"🍕",emojis:[{char:"🍏",name:"maçã verde"},{char:"🍎",name:"maçã"},{char:"🍊",name:"tangerina"},{char:"🍋",name:"limão"},{char:"🍌",name:"banana"},{char:"🍉",name:"melancia"},{char:"🍇",name:"uva"},{char:"🍓",name:"morango"},{char:"🍒",name:"cereja"},{char:"🍑",name:"pêssego"},{char:"🥝",name:"kiwi"},{char:"🍅",name:"tomate"},{char:"🥑",name:"abacate"},{char:"🍕",name:"pizza"},{char:"🍔",name:"hambúrguer"},{char:"🍟",name:"batata frita"},{char:"🌮",name:"taco"},{char:"🍣",name:"sushi"},{char:"🍜",name:"macarrão"},{char:"🍦",name:"sorvete"},{char:"🍩",name:"donut"},{char:"🍰",name:"bolo"},{char:"🎂",name:"bolo de aniversário"},{char:"☕",name:"café"},{char:"🍺",name:"cerveja"},{char:"🍷",name:"vinho"},{char:"🥤",name:"bebida com canudo"}]},{id:"activities",label:"Atividades",icon:"⚽",emojis:[{char:"⚽",name:"futebol"},{char:"🏀",name:"basquete"},{char:"🏈",name:"futebol americano"},{char:"⚾",name:"baseball"},{char:"🎾",name:"tênis"},{char:"🏐",name:"vôlei"},{char:"🎱",name:"bilhar"},{char:"🏓",name:"ping pong"},{char:"🏸",name:"badminton"},{char:"🥊",name:"boxe"},{char:"🎮",name:"videogame"},{char:"🎲",name:"dado"},{char:"🎯",name:"dardo"},{char:"🎳",name:"boliche"},{char:"🎸",name:"guitarra"},{char:"🎨",name:"paleta de arte"},{char:"🎬",name:"cinema"},{char:"🎤",name:"microfone"},{char:"🎧",name:"fone de ouvido"},{char:"🏆",name:"troféu"},{char:"🥇",name:"medalha de ouro"}]},{id:"travel",label:"Viagens e lugares",icon:"✈️",emojis:[{char:"✈️",name:"avião"},{char:"🚗",name:"carro"},{char:"🚕",name:"taxi"},{char:"🚌",name:"ônibus"},{char:"🚓",name:"carro de polícia"},{char:"🚑",name:"ambulância"},{char:"🚒",name:"bombeiros"},{char:"🚲",name:"bicicleta"},{char:"🛵",name:"moto"},{char:"🚀",name:"foguete"},{char:"🚁",name:"helicóptero"},{char:"⛵",name:"veleiro"},{char:"🚢",name:"navio"},{char:"🗽",name:"estátua da liberdade"},{char:"🗼",name:"torre"},{char:"🏝️",name:"ilha"},{char:"🏔️",name:"montanha"},{char:"🌋",name:"vulcão"},{char:"🏕️",name:"acampamento"},{char:"🏠",name:"casa"},{char:"🏢",name:"prédio"}]},{id:"objects",label:"Objetos",icon:"💡",emojis:[{char:"💡",name:"lâmpada"},{char:"🔦",name:"lanterna"},{char:"📱",name:"celular"},{char:"💻",name:"notebook"},{char:"⌨️",name:"teclado"},{char:"🖥️",name:"computador"},{char:"🖨️",name:"impressora"},{char:"📷",name:"câmera"},{char:"📺",name:"televisão"},{char:"🎥",name:"câmera de filmagem"},{char:"⏰",name:"despertador"},{char:"📚",name:"livros"},{char:"✏️",name:"lápis"},{char:"📌",name:"pin"},{char:"📎",name:"clipe"},{char:"✂️",name:"tesoura"},{char:"🔒",name:"cadeado fechado"},{char:"🔑",name:"chave"},{char:"💰",name:"saco de dinheiro"},{char:"💳",name:"cartão de crédito"},{char:"🎁",name:"presente"}]},{id:"symbols",label:"Símbolos",icon:"❤️",emojis:[{char:"❤️",name:"coração vermelho"},{char:"🧡",name:"coração laranja"},{char:"💛",name:"coração amarelo"},{char:"💚",name:"coração verde"},{char:"💙",name:"coração azul"},{char:"💜",name:"coração roxo"},{char:"🖤",name:"coração preto"},{char:"🤍",name:"coração branco"},{char:"🤎",name:"coração marrom"},{char:"💔",name:"coração partido"},{char:"✨",name:"brilho"},{char:"💯",name:"cem pontos"},{char:"✅",name:"check"},{char:"❌",name:"x"},{char:"❓",name:"interrogação"},{char:"❗",name:"exclamação"},{char:"♻️",name:"reciclagem"},{char:"⚠️",name:"alerta"},{char:"🆗",name:"ok"},{char:"🆕",name:"novo"}]},{id:"flags",label:"Bandeiras",icon:"🏳️",emojis:[{char:"🇧🇷",name:"brasil"},{char:"🇺🇸",name:"estados unidos"},{char:"🇵🇹",name:"portugal"},{char:"🇪🇸",name:"espanha"},{char:"🇫🇷",name:"frança"},{char:"🇩🇪",name:"alemanha"},{char:"🇮🇹",name:"itália"},{char:"🇬🇧",name:"reino unido"},{char:"🇯🇵",name:"japão"},{char:"🇨🇳",name:"china"},{char:"🇦🇷",name:"argentina"},{char:"🇨🇦",name:"canadá"},{char:"🇲🇽",name:"méxico"},{char:"🇨🇱",name:"chile"},{char:"🇺🇾",name:"uruguai"},{char:"🇵🇾",name:"paraguai"}]}],_hoisted_1$x={key:0,class:"sm-emoji-picker__tabs",role:"tablist","aria-label":"Categorias de emoji"},_hoisted_2$u=["aria-selected","title","onClick"],_hoisted_3$r={"aria-hidden":"true"},_hoisted_4$q={class:"sm-emoji-picker__search"},_hoisted_5$o={class:"sm-emoji-picker__search-box"},_hoisted_6$k={class:"sm-emoji-picker__body"},_hoisted_7$i={class:"sm-emoji-picker__group-label"},_hoisted_8$f={key:0,class:"sm-emoji-picker__empty"},_hoisted_9$c={key:1,class:"sm-emoji-picker__grid"},_hoisted_10$b=["title","onClick"],_hoisted_11$a={class:"sm-emoji-picker__footer"},_hoisted_12$8=["aria-expanded","title"],_hoisted_13$6={class:"sm-emoji-picker__tone-swatch sm-emoji-picker__tone-swatch--current","aria-hidden":"true"},_hoisted_14$6={key:0,class:"sm-emoji-picker__tone-menu"},_hoisted_15$5=["aria-label","onClick"],TONE_PREVIEW_CHAR="👍",_sfc_main$C={__name:"EmojiPicker",props:{theme:{type:String,default:"light"},categories:{type:Array,default:()=>EMOJI_CATEGORIES}},emits:["select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useEmojiPickerStore(),oe=e$b.ref(""),ie=e$b.ref(!1),le=e$b.ref("recent"),ce={id:"recent",label:"Usados recentemente",icon:"🕘"},de=e$b.computed(()=>[ce,...ne.categories]),ue=e$b.computed(()=>le.value==="recent"?ce:ne.categories.find($e=>$e.id===le.value)),be=e$b.computed(()=>oe.value.trim().length>0),fe=e$b.computed(()=>re.skinTone),ge=e$b.computed(()=>SKIN_TONES.find($e=>$e.id===fe.value)||SKIN_TONES[0]),me=e$b.computed(()=>{const $e=oe.value.trim().toLowerCase();return $e?ne.categories.flatMap(ye=>ye.emojis).filter(ye=>ye.name.includes($e)||ye.char===$e).slice(0,60):[]}),pe=e$b.computed(()=>{var $e;return be.value?me.value:le.value==="recent"?re.recent.map(ye=>({char:ye,name:"recente",tone:!1})):(($e=ue.value)==null?void 0:$e.emojis)||[]});function ke($e){return $e.tone?applySkinTone($e.char,ge.value.modifier):$e.char}function ve($e){const ye=ke($e);re.addRecent(ye),ae("select",ye)}function _e($e){re.setSkinTone($e),ie.value=!1}return($e,ye)=>{var Ee;return e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["sm-emoji-picker",{"sm-emoji-picker--dark":ee.theme==="dark"}])},[be.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$x,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(de.value,Se=>(e$b.openBlock(),e$b.createElementBlock("button",{key:Se.id,type:"button",role:"tab","aria-selected":le.value===Se.id,title:Se.label,class:e$b.normalizeClass(["sm-emoji-picker__tab",{"sm-emoji-picker__tab--active":le.value===Se.id}]),onClick:Le=>le.value=Se.id},[e$b.createElementVNode("span",_hoisted_3$r,e$b.toDisplayString(Se.icon),1)],10,_hoisted_2$u))),128))])),e$b.createElementVNode("div",_hoisted_4$q,[e$b.createElementVNode("div",_hoisted_5$o,[ye[2]||(ye[2]=e$b.createElementVNode("svg",{class:"sm-emoji-picker__search-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z","clip-rule":"evenodd"})],-1)),e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":ye[0]||(ye[0]=Se=>oe.value=Se),type:"text",class:"sm-emoji-picker__search-input",placeholder:"Procure emojis","aria-label":"Buscar emoji"},null,512),[[e$b.vModelText,oe.value]])])]),e$b.createElementVNode("div",_hoisted_6$k,[e$b.createElementVNode("p",_hoisted_7$i,e$b.toDisplayString(be.value?"Resultados":(Ee=ue.value)==null?void 0:Ee.label),1),pe.value.length?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$c,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(pe.value,Se=>(e$b.openBlock(),e$b.createElementBlock("button",{key:Se.char+Se.name,type:"button",class:"sm-emoji-picker__emoji",title:Se.name,onClick:Le=>ve(Se)},e$b.toDisplayString(ke(Se)),9,_hoisted_10$b))),128))])):(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_8$f,e$b.toDisplayString(be.value?"Nenhum emoji encontrado":"Nenhum emoji recente ainda"),1))]),e$b.createElementVNode("div",_hoisted_11$a,[e$b.createElementVNode("button",{type:"button",class:"sm-emoji-picker__tone-toggle","aria-expanded":ie.value,"aria-label":"Alterar aparência do emoji",title:ge.value.label,onClick:ye[1]||(ye[1]=Se=>ie.value=!ie.value)},[e$b.createElementVNode("span",_hoisted_13$6,e$b.toDisplayString(TONE_PREVIEW_CHAR)+e$b.toDisplayString(ge.value.modifier),1),ye[3]||(ye[3]=e$b.createElementVNode("svg",{class:"sm-emoji-picker__tone-caret","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",fill:"none"},[e$b.createElementVNode("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],8,_hoisted_12$8),ie.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_14$6,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(e$b.unref(SKIN_TONES),Se=>(e$b.openBlock(),e$b.createElementBlock("button",{key:Se.id,type:"button",class:e$b.normalizeClass(["sm-emoji-picker__tone-swatch",{"sm-emoji-picker__tone-swatch--active":Se.id===fe.value}]),"aria-label":Se.label,onClick:Le=>_e(Se.id)},e$b.toDisplayString(TONE_PREVIEW_CHAR)+e$b.toDisplayString(Se.modifier),11,_hoisted_15$5))),128))])):e$b.createCommentVNode("",!0)])],2)}}},EmojiPicker=_export_sfc$1(_sfc_main$C,[["__scopeId","data-v-44a5a69e"]]),PICKER_WIDTH=320,PICKER_HEIGHT=380,VIEWPORT_GAP=8,_sfc_main$B={__name:"EmojiPickerPopover",props:{show:{type:Boolean,default:!1},theme:{type:String,default:"light"},categories:{type:Array,default:()=>EMOJI_CATEGORIES},anchorEl:{type:Object,default:null}},emits:["close","select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.ref(null),oe=e$b.ref({position:"fixed",top:"-9999px",left:"-9999px"});function ie(){const ue=ne.anchorEl;if(!ue){oe.value={position:"fixed",right:`${VIEWPORT_GAP}px`,bottom:`${VIEWPORT_GAP}px`,width:`${PICKER_WIDTH}px`,height:`${PICKER_HEIGHT}px`};return}const be=ue.getBoundingClientRect();let fe=be.top-PICKER_HEIGHT-VIEWPORT_GAP;fe<VIEWPORT_GAP&&(fe=be.bottom+VIEWPORT_GAP),fe=Math.min(fe,window.innerHeight-PICKER_HEIGHT-VIEWPORT_GAP),fe=Math.max(fe,VIEWPORT_GAP);let ge=be.left;ge=Math.min(ge,window.innerWidth-PICKER_WIDTH-VIEWPORT_GAP),ge=Math.max(ge,VIEWPORT_GAP),oe.value={position:"fixed",top:`${fe}px`,left:`${ge}px`,width:`${PICKER_WIDTH}px`,height:`${PICKER_HEIGHT}px`}}function le(ue){ae("select",ue)}function ce(ue){var fe,ge;if(!ne.show)return;const be=re.value;be&&!be.contains(ue.target)&&ue.target!==ne.anchorEl&&!((ge=(fe=ne.anchorEl)==null?void 0:fe.contains)!=null&&ge.call(fe,ue.target))&&ae("close")}function de(ue){ue.key==="Escape"&&ne.show&&ae("close")}return e$b.watch(()=>ne.show,ue=>{ue?(e$b.nextTick(ie),window.addEventListener("resize",ie),window.addEventListener("scroll",ie,!0)):(window.removeEventListener("resize",ie),window.removeEventListener("scroll",ie,!0))},{immediate:!0}),e$b.onMounted(()=>{document.addEventListener("mousedown",ce,!0),document.addEventListener("keydown",de)}),e$b.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ce,!0),document.removeEventListener("keydown",de),window.removeEventListener("resize",ie),window.removeEventListener("scroll",ie,!0)}),(ue,be)=>(e$b.openBlock(),e$b.createBlock(e$b.Teleport,{to:"body"},[e$b.createVNode(e$b.Transition,{name:"sm-emoji-popover-fade"},{default:e$b.withCtx(()=>[ee.show?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"rootEl",ref:re,class:e$b.normalizeClass(["sm-emoji-popover",{"sm-emoji-popover--dark":ee.theme==="dark"}]),role:"dialog","aria-label":"Seletor de emojis",style:e$b.normalizeStyle(oe.value)},[e$b.createVNode(EmojiPicker,{theme:ee.theme,categories:ee.categories,onSelect:le},null,8,["theme","categories"])],6)):e$b.createCommentVNode("",!0)]),_:1})]))}},EmojiPickerPopover=_export_sfc$1(_sfc_main$B,[["__scopeId","data-v-813b79e0"]]),_hoisted_1$w={class:"relative flex w-full items-center justify-center gap-1"},_hoisted_2$t=["onClick"],_hoisted_3$q={class:"text-base"},_hoisted_4$p=["aria-expanded"],_hoisted_5$n=["onClick"],_hoisted_6$j={class:"whitespace-nowrap text-base leading-none"},_sfc_main$A={__name:"MessageEmojiPicker",props:["isOwner"],emits:["emoji"],setup(ee,{emit:te}){const ne=te,ae=useMessageUiStore(),re=e$b.computed(()=>{var ve,_e;return((_e=(ve=ae.currentChat)==null?void 0:ve.instance)==null?void 0:_e.type)==="instagram"}),oe=e$b.computed(()=>{var ve,_e;return((_e=(ve=ae.currentChat)==null?void 0:ve.instance)==null?void 0:_e.type)==="telegram"}),ie=["❤","👍","👎","🔥","🥰","👏","😁","🤔","🤯","😱","🤬","😢","🎉","🤩","🤮","💩","🙏","👌","🕊","🤡","🥱","🥴","😍","🐳","❤🔥","🌚","🌭","💯","🤣","⚡","🍌","🏆","💔","🤨","😐","🍓","🍾","💋","🖕","😈","😴","😭","🤓","👻","👨💻","👀","🎃","🙈","😇","😨","🤝","✍","🤗","🫡","🎅","🎄","☃","💅","🤪","🗿","🆒","💘","🙉","🦄","😘","💊","🙊","😎","👾","🤷♂","🤷","🤷♀","😡"],le=e$b.computed(()=>re.value?["❤️","😂","😲","😢","😡","👍","👎"]:oe.value?["👍","👎","❤","🔥","🥰","👏"]:["👍","❤️","😂","😲","😢","🙏"]),ce=e$b.ref(!1),de=e$b.ref(null),ue=e$b.ref(null);function be(ve){ne("emoji",ve)}function fe(ve){ne("emoji",ve),ce.value=!1}function ge(ve){ne("emoji",ve),ce.value=!1}function me(ve){if(!oe.value||!ce.value)return;const _e=de.value;_e&&!_e.contains(ve.target)&&(ce.value=!1)}e$b.onMounted(()=>{document.addEventListener("mousedown",me,!0)}),e$b.onBeforeUnmount(()=>{document.removeEventListener("mousedown",me,!0)});function pe(ve){ve.stopPropagation(),ue.value=ve.currentTarget,ce.value=!ce.value}function ke(){ce.value=!1}return(ve,_e)=>(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_1$w,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(le.value,($e,ye)=>(e$b.openBlock(),e$b.createElementBlock("button",{key:ye,class:e$b.normalizeClass([e$b.unref(ae).themeMode?"hover:bg-white/10":"hover:bg-black/10","text-lg px-[5px] py-1 rounded-lg"]),type:"button",onClick:Ee=>be($e)},[e$b.createElementVNode("span",_hoisted_3$q,e$b.toDisplayString($e),1)],10,_hoisted_2$t))),128)),re.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("button",{key:0,class:e$b.normalizeClass([e$b.unref(ae).themeMode?"hover:bg-white/10":"hover:bg-black/10","px-2 py-1 rounded text-lg"]),type:"button","aria-haspopup":"dialog","aria-expanded":ce.value,onClick:pe}," + ",10,_hoisted_4$p)),oe.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,ref_key:"telegramPopoverEl",ref:de,class:e$b.normalizeClass(["absolute",ee.isOwner?"right-0":"left-0"]),style:e$b.normalizeStyle({bottom:"40px",zIndex:4e3,pointerEvents:ce.value?"auto":"none"})},[e$b.withDirectives(e$b.createElementVNode("div",{class:"relative",onMouseleave:ke},[_e[1]||(_e[1]=e$b.createElementVNode("div",{"aria-hidden":"true",class:"absolute -inset-x-0 mx-auto -left-10 w-[45vh] h-[50vh] rounded-lg",style:{"pointer-events":"auto"}},null,-1)),e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[e$b.withDirectives(e$b.createElementVNode("div",{class:e$b.normalizeClass(["grid max-h-[40vh] grid-cols-8 gap-1 overflow-y-auto rounded-lg p-2 shadow-lg",e$b.unref(ae).themeMode?"bg-neutral-800":"bg-white"])},[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie,($e,ye)=>e$b.createElementVNode("button",{key:ye,class:e$b.normalizeClass([e$b.unref(ae).themeMode?"hover:bg-white/10":"hover:bg-black/10","flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-lg"]),type:"button",onClick:Ee=>ge($e)},[e$b.createElementVNode("span",_hoisted_6$j,e$b.toDisplayString($e),1)],10,_hoisted_5$n)),64))],2),[[e$b.vShow,ce.value]])]),_:1})],544),[[e$b.vShow,ce.value]])],6)):(e$b.openBlock(),e$b.createBlock(EmojiPickerPopover,{key:2,show:ce.value,theme:e$b.unref(ae).themeMode?"dark":"light","anchor-el":ue.value,onClose:_e[0]||(_e[0]=$e=>ce.value=!1),onSelect:fe},null,8,["show","theme","anchor-el"]))]))}},MessageEmojiPicker=_export_sfc$1(_sfc_main$A,[["__scopeId","data-v-23288b29"]]),EDIT_WINDOW_MINUTES=15,DELETE_WINDOW_MINUTES=2880;function minutesSince(ee){const te=new Date(ee||0).getTime();return(Date.now()-te)/6e4}function normalizedStage(ee){return String((ee==null?void 0:ee.stage)||(ee==null?void 0:ee.status)||"").toLowerCase()}function isExcludedMessage(ee){const te=normalizedStage(ee);return te==="excluded"||te==="exclused"}function isProcessingMessage(ee){return normalizedStage(ee)==="processing"}function isFailedMessage(ee){return(ee==null?void 0:ee.stage)==="failed"}function hasMessagePackage(ee){return Array.isArray(ee==null?void 0:ee.items)&&ee.items.length>1}function hasSingleFileUrl(ee){if(hasMessagePackage(ee))return!1;const te=(ee==null?void 0:ee.content)||{};return["file","audio","image"].includes(ee==null?void 0:ee.type)&&!!te.url}function hasMessageText(ee){var te;return!!((te=ee==null?void 0:ee.content)!=null&&te.text)&&ee.content.text.trim().length>0}function resolveMessageActionRules(ee,te={}){var Oe,Ie,ze,Ve,Ne;const{chatActive:ne=!1,chatInstanceId:ae=null,attendant:re=null}=te,oe=isProcessingMessage(ee),ie=isExcludedMessage(ee),le=isFailedMessage(ee),ce=!!(ee!=null&&ee.from_me),de=!!(ee!=null&&ee.internal),ue=ee==null?void 0:ee.type,be=((Oe=ee==null?void 0:ee.instance)==null?void 0:Oe.type)||"",fe=["whatsapp-qrcode","telegram","webchat"].includes(be),ge=de?((Ie=ee==null?void 0:ee.sent_by)==null?void 0:Ie.id)===(re==null?void 0:re.id):!0,me=!!((ze=re==null?void 0:re.permissions)!=null&&ze.can_edit_message),pe=!!((Ve=re==null?void 0:re.permissions)!=null&&Ve.can_delete_message),ke=()=>{const Pe=[];return oe&&Pe.push("Ação indisponível para mensagens processando."),ie&&Pe.push("Mensagem excluída."),le&&Pe.push("A mensagem falhou no envio."),Pe},ve=ke();fe||ve.push("Disponível apenas para WhatsApp QR Code, Telegram e Webchat."),me||ve.push("Você não tem permissão para editar."),ce||ve.push("Só é possível editar mensagens enviadas por você."),ue!=="text"&&ve.push("Apenas mensagens de texto podem ser editadas."),de&&!ge&&ve.push("Mensagem interna só pode ser editada pelo mesmo autor."),ne||ve.push("A conversa precisa estar ativa."),minutesSince(ee==null?void 0:ee.sent_at)>EDIT_WINDOW_MINUTES&&ve.push("Janela de edição expirada (15 minutos).");const _e=ke();ie&&(_e[_e.indexOf("Mensagem excluída.")]="Mensagem já excluída."),fe||_e.push("Disponível apenas para WhatsApp QR Code, Telegram e Webchat."),pe||_e.push("Você não tem permissão para excluir."),ce||_e.push("Só é possível excluir mensagens enviadas por você."),de&&!ge&&_e.push("Mensagem interna só pode ser excluída pelo mesmo autor."),ne||_e.push("A conversa precisa estar ativa."),minutesSince(ee==null?void 0:ee.sent_at)>DELETE_WINDOW_MINUTES&&_e.push("Janela de exclusão expirada (48 horas)."),ue==="sms"&&_e.push("Não é possível excluir mensagens SMS.");const $e=ke();ee!=null&&ee.items&&$e.push("Não é possível responder a pacote de mensagens."),ne||$e.push("A conversa precisa estar ativa."),ue==="call"&&$e.push("Não é possível responder a mensagens de ligação."),ue==="ciphertext"&&$e.push("Não é possível responder a mensagens aguardando sincronização."),ue==="sms"&&$e.push("Não é possível responder a mensagens SMS.");const ye=(Ne=ee==null?void 0:ee.instance)==null?void 0:Ne.id;ye&&ae&&ye!==ae&&$e.push("Não é possível citar mensagens de outra instância.");const Ee=[];oe&&Ee.push("Ação indisponível para mensagens processando."),ie&&Ee.push("Mensagem excluída."),hasSingleFileUrl(ee)||Ee.push("Não há arquivo único disponível para download."),le&&Ee.push("A mensagem falhou no envio.");const Se=ke();de&&Se.push("Não é possível encaminhar mensagens internas.");const Le={call:"Não é possível encaminhar mensagens de ligação.",location:"Não é possível encaminhar mensagens de localização.",ciphertext:"Não é possível encaminhar mensagens aguardando sincronização.",template:"Não é possível encaminhar mensagens de template.",list:"Não é possível encaminhar mensagens de lista.",button:"Não é possível encaminhar mensagens com botão.",sms:"Não é possível encaminhar mensagens SMS."};Le[ue]&&Se.push(Le[ue]),be==="webchat"&&Se.push("Não é possível encaminhar mensagens do Webchat.");const Ae=hasMessageText(ee)?[]:["Mensagem sem texto para copiar."],De=[];return oe?De.push("Ação indisponível para mensagens processando."):le||De.push("Essa mensagem já foi enviada com sucesso."),{edit:ve,delete:_e,reply:$e,download:Ee,forward:Se,copy:Ae,resend:De}}function canForwardMessage(ee){var te;return!ee||isExcludedMessage(ee)||isProcessingMessage(ee)||isFailedMessage(ee)||ee.internal||((te=ee==null?void 0:ee.instance)==null?void 0:te.type)==="webchat"?!1:!["call","ciphertext","template","list","button","location"].includes(ee==null?void 0:ee.type)}function failure(ee,te){var ne,ae;return{ok:!1,error:((ae=(ne=ee==null?void 0:ee.response)==null?void 0:ne.data)==null?void 0:ae.message)||te}}async function deleteMessage(ee){try{const{data:te}=await api.delete(`${messageUrl}${ee}/`);return{ok:!0,data:te}}catch(te){return failure(te,"Não foi possível excluir a mensagem.")}}async function resendMessage(ee){try{const{data:te}=await api.post(messageResend(ee));return{ok:!0,data:te}}catch(te){return failure(te,"Não foi possível reenviar a mensagem.")}}async function reactToMessage(ee,te){if(!ee)return{ok:!1,error:"Mensagem ausente."};ee.metadata||(ee.metadata={});const ne=ee.metadata.reaction;ee.metadata.reaction=te;try{const{data:ae}=await api.post(messageReaction(ee.id),{reaction:te});return{ok:!0,data:ae}}catch(ae){return ee.metadata.reaction=ne,failure(ae,"Erro ao adicionar reação.")}}async function transcriptAudio(ee){if(!ee)return{ok:!1,error:"Mensagem ausente."};ee.isTranscripting=!0;try{const{data:te}=await api.get(messageTranscript(ee.id));return ee.metadata||(ee.metadata={}),ee.metadata.transcripted_text=te.transcript_text,{ok:!0,data:te}}catch(te){return failure(te,"Erro ao transcrever o áudio.")}finally{ee.isTranscripting=!1}}const _hoisted_1$v=["disabled"],_hoisted_2$s={class:"relative flex h-6 items-center justify-center uppercase"},_hoisted_3$p={key:0},_hoisted_4$o={key:1,class:"flex items-center justify-center"},_hoisted_5$m={class:"flex items-center gap-2"},_hoisted_6$i=["disabled"],_hoisted_7$h={class:"relative flex h-5 items-center justify-center text-[12px] uppercase"},_hoisted_8$e={key:0},_hoisted_9$b={key:1,class:"flex items-center justify-center"},_sfc_main$z={__name:"MessageActionsMenu",emits:["info","download","download-package","copy-native","deleted","resent"],setup(ee,{emit:te}){const ne=te,ae=useMessageUiStore(),re=e$b.computed(()=>ae.loggedAttendant),oe=e$b.computed(()=>!ae.themeMode),ie=e$b.ref(!1),le=e$b.ref(!1),ce=e$b.ref(!1),de=e$b.ref(!1),ue=e$b.computed(()=>ae.actionsMenu.message||{}),be=e$b.computed(()=>resolveMessageActionRules(ue.value,{chatActive:ae.chatActive,chatInstanceId:ae.chatInstanceId,attendant:re.value})),fe=e$b.computed(()=>isExcludedMessage(ue.value)),ge=e$b.computed(()=>!fe.value&&ae.chatActive&&be.value.reply.length===0),me=e$b.computed(()=>!fe.value&&hasMessagePackage(ue.value)),pe=e$b.computed(()=>!fe.value&&!hasMessagePackage(ue.value)&&be.value.download.length===0);function ke(){ae.closeActions()}function ve(){le.value=!1}function _e(xe,Ce){if(!xe)return{};const{top:Fe,left:Re,width:qe}=Ce(xe,260,130);return{top:`${Fe}px`,left:`${Re}px`,width:`${qe}px`}}const $e={edit:"Não é possível editar",delete:"Não é possível excluir",download:"Não é possível baixar",saveas:"Não é possível baixar",reply:"Não é possível responder","re-send":"Não é possível reenviar mensagem"};function ye(xe){(xe.ctrlKey||xe.metaKey)&&xe.key.toLowerCase()==="c"&&(xe.preventDefault(),hasMessageText(ue.value)&&ze())}function Ee(){ve(),!(be.value.reply.length||fe.value)&&(ae.setQuote(ue.value.content,ue.value.sent_by,ue.value.id),ke())}function Se(){ve(),!(be.value.edit.length||fe.value)&&(ae.startEdit(ue.value),ke())}function Le(){ve(),!be.value.forward.length&&(ae.startForward(ue.value),ke())}function Ae(){be.value.delete.length||fe.value||(le.value=!le.value)}async function De(){if(be.value.delete.length)return;ce.value=!0;const xe=await deleteMessage(ue.value.id);if(ce.value=!1,!xe.ok){notiwind.notify({group:"error",title:"Erro",text:xe.error},2e3);return}ne("deleted",ue.value),notiwind.notify({group:"success",title:"Sucesso",text:"Mensagem Apagada"},2e3),le.value=!1,ke()}async function Oe(){var Ce;ve(),ie.value=!0;const xe=await resendMessage(ue.value.id);if(ie.value=!1,!xe.ok){notiwind.notify({group:"error",title:"Erro",text:xe.error},4e3),ke();return}ne("resent",ue.value),notiwind.notify({group:"success",title:"Sucesso",text:((Ce=xe.data)==null?void 0:Ce.message)||"Mensagem reenviada com sucesso"},2e3),ke()}async function Ie(xe){ve();const Ce=await reactToMessage(ue.value,xe);if(!Ce.ok){notiwind.notify({group:"error",title:"Erro",text:Ce.error},4e3);return}ke()}async function ze(){var Fe,Re;ve();const xe=((Re=(Fe=ue.value)==null?void 0:Fe.content)==null?void 0:Re.text)||"";if(!ae.isWebDevice){ne("copy-native",xe),ke();return}if(!await copyToClipboard(xe)){notiwind.notify({group:"error",title:"Erro",text:"Não foi possível copiar o texto. Tente novamente."},2e3),ke();return}notiwind.notify({group:"success",title:"Copiado",text:"Texto copiado para a área de transferência."},2e3),de.value=!0,setTimeout(()=>{de.value=!1,ke()},900)}function Ve(){ve(),ne("info",ue.value),ke()}function Ne(){ve(),ne("download",ue.value),ke()}function Pe(){ve(),ne("download-package",ue.value),ke()}const Be={reply:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path d="M14.502 7.046h-2.5v-.928a2.122 2.122 0 0 0-1.199-1.954 1.827 1.827 0 0 0-1.984.311L3.71 8.965a2.2 2.2 0 0 0 0 3.24L8.82 16.7a1.829 1.829 0 0 0 1.985.31 2.121 2.121 0 0 0 1.199-1.959v-.928h1a2.025 2.025 0 0 1 1.999 2.047V19a1 1 0 0 0 1.275.961 6.59 6.59 0 0 0 4.662-7.22 6.593 6.593 0 0 0-6.437-5.695Z"/> </svg>',copy:'<svg class="size-4" viewBox="0 0 24 24" fill="currentColor"><path d="M16 1H4a2 2 0 0 0-2 2v12h2V3h12V1zm3 4H8a2 2 0 0 0-2 2v14h11a2 2 0 0 0 2-2V5z"/></svg>',check:'<svg class="size-4 text-emerald-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>',forward:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path d="M5.027 10.9a8.729 8.729 0 0 1 6.422-3.62v-1.2A2.061 2.061 0 0 1 12.61 4.2a1.986 1.986 0 0 1 2.104.23l5.491 4.308a2.11 2.11 0 0 1 .588 2.566 2.109 2.109 0 0 1-.588.734l-5.489 4.308a1.983 1.983 0 0 1-2.104.228 2.065 2.065 0 0 1-1.16-1.876v-.942c-5.33 1.284-6.212 5.251-6.25 5.441a1 1 0 0 1-.923.806h-.06a1.003 1.003 0 0 1-.955-.7A10.221 10.221 0 0 1 5.027 10.9Z"/> </svg>',trash:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z" clip-rule="evenodd"/> </svg>',edit:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z" clip-rule="evenodd"/> </svg>',info:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z" clip-rule="evenodd"/></svg>',package:'<svg class="size-4" viewBox="0 0 24 24" fill="currentColor"><path d="M21 16V8l-9-5-9 5v8l9 5 9-5zM12 4.15 18.53 7.5 12 10.85 5.47 7.5z"/></svg>',download:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z" clip-rule="evenodd"/></svg>',resend:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.651 7.65a7.131 7.131 0 0 0-12.68 3.15M18.001 4v4h-4m-7.652 8.35a7.13 7.13 0 0 0 12.68-3.15M6 20v-4h4"/> </svg>'},Me=e$b.computed(()=>{const xe=be.value,Ce=[{key:"reply",label:"Responder",icon:Be.reply,enabled:!xe.reply.length,reasons:xe.reply,handler:Ee},{key:"copy",label:de.value?"Copiado!":"Copiar",icon:de.value?Be.check:Be.copy,enabled:!xe.copy.length,reasons:xe.copy,handler:ze,trailing:de.value?"":"Ctrl+C"},{key:"forward",label:"Encaminhar",icon:Be.forward,enabled:!xe.forward.length,reasons:xe.forward,handler:Le},{key:"re-send",label:"Reenviar",icon:Be.resend,enabled:!xe.resend.length,reasons:xe.resend,loading:ie.value,handler:Oe},{key:"__divider__"},{key:"delete",label:"Apagar",icon:Be.trash,enabled:!xe.delete.length,reasons:xe.delete,handler:Ae},{key:"__divider__"},{key:"edit",label:"Editar",icon:Be.edit,enabled:!xe.edit.length,reasons:xe.edit,handler:Se},{key:"info",label:"Informações",icon:Be.info,enabled:!0,reasons:[],handler:Ve}];return me.value?Ce.push({key:"download_pkg",label:"Baixar pacote",icon:Be.package,enabled:!0,reasons:[],handler:Pe}):pe.value&&Ce.push({key:"download",label:"Salvar como...",icon:Be.download,enabled:!0,reasons:[],handler:Ne}),Ce});return(xe,Ce)=>(e$b.openBlock(),e$b.createBlock(ActionMenu,{items:Me.value,x:e$b.unref(ae).actionsMenu.x,y:e$b.unref(ae).actionsMenu.y,light:oe.value,"sheet-safe-area":140,"reason-titles":$e,onClose:ke,onKeydown:ye},e$b.createSlots({extra:e$b.withCtx(({anchorRect:Fe,veryNarrow:Re,positionBeside:qe})=>[e$b.createVNode(e$b.Transition,{name:"sheet"},{default:e$b.withCtx(()=>[le.value&&Re?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["fixed inset-x-0 bottom-0 z-[2002] select-none rounded-t-2xl p-3 shadow-2xl",oe.value?"bg-white text-black/90 ring-1 ring-black/20":"bg-base-200 text-white/90 ring-1 ring-black/50"])},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["mx-auto mb-3 h-1.5 w-10 rounded-full opacity-40",oe.value?"bg-black/40":"bg-white/40"]),onClick:Ce[0]||(Ce[0]=Ge=>ve())},null,2),Ce[4]||(Ce[4]=e$b.createElementVNode("p",{class:"mb-3 text-center text-[12px] font-medium uppercase"}," Realmente deseja excluir essa mensagem? ",-1)),e$b.createElementVNode("button",{disabled:ce.value,class:"confirm-delete-btn group",onClick:De},[Ce[3]||(Ce[3]=e$b.createElementVNode("span",{class:"confirm-delete-shine"},null,-1)),e$b.createElementVNode("span",_hoisted_2$s,[ce.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_4$o,[...Ce[2]||(Ce[2]=[e$b.createElementVNode("svg",{class:"size-5 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})],-1)])])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$p,"Excluir mensagem"))])],8,_hoisted_1$v)],2)):le.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(["fixed z-[2002] min-w-[220px] rounded-xl p-2 shadow-2xl",oe.value?"bg-white text-black/90 ring-1 ring-black/20":"bg-base-200 text-white/90 ring-1 ring-black/50"]),style:e$b.normalizeStyle(_e(Fe,qe))},[Ce[7]||(Ce[7]=e$b.createElementVNode("p",{class:"mb-2 text-center text-[12px] font-medium uppercase"}," Realmente deseja excluir essa mensagem? ",-1)),e$b.createElementVNode("div",_hoisted_5$m,[e$b.createElementVNode("button",{type:"button",class:e$b.normalizeClass(["flex-1 rounded-xl px-3 py-2 text-[12px] uppercase",oe.value?"bg-black/10 text-black/70 hover:bg-black/15":"bg-white/10 text-white/70 hover:bg-white/15"]),onClick:Ce[1]||(Ce[1]=Ge=>ve())}," Cancelar ",2),e$b.createElementVNode("button",{disabled:ce.value,class:"confirm-delete-btn group flex-1",onClick:De},[Ce[6]||(Ce[6]=e$b.createElementVNode("span",{class:"confirm-delete-shine"},null,-1)),e$b.createElementVNode("span",_hoisted_7$h,[ce.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_9$b,[...Ce[5]||(Ce[5]=[e$b.createElementVNode("svg",{class:"size-4 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})],-1)])])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_8$e,"Excluir"))])],8,_hoisted_6$i)])],6)):e$b.createCommentVNode("",!0)]),_:2},1024)]),_:2},[ge.value?{name:"footer",fn:e$b.withCtx(()=>[e$b.createVNode(MessageEmojiPicker,{onEmoji:Ie})]),key:"0"}:void 0]),1032,["items","x","y","light"]))}},MessageActionsMenu=_export_sfc$1(_sfc_main$z,[["__scopeId","data-v-4beff81c"]]),_hoisted_1$u={class:"audio-player hover:bg-base-100"},_hoisted_2$r=["disabled"],_hoisted_3$o={class:"audio-player-info"},_hoisted_4$n={class:"audio-progress-container"},_hoisted_5$l=["max","value","disabled"],_hoisted_6$h={class:"audio-duration"},_hoisted_7$g={key:0,class:"align-middle"},_hoisted_8$d=["src"],_sfc_main$y={__name:"AudioPlayer",props:{src:{type:String,required:!0},label:{type:String,required:!0},type:{type:String,required:!0,validator:ee=>["client","attendant","general"].includes(ee)},activeSrc:{type:String,required:!1}},emits:["play-start","play-pause"],setup(ee,{emit:te}){const ne=te,ae=ee,re=e$b.ref(null),oe=e$b.ref(!1),ie=e$b.ref(0),le=e$b.ref(0),ce=e$b.ref(!1),de=e$b.ref(!1);function ue(){if(re.value)if(oe.value)re.value.pause(),oe.value=!1,De();else{if(Ae(),!re.value)return;de.value=!0;const Oe=re.value.play();Oe&&typeof Oe.then=="function"?Oe.then(()=>{de.value=!1,oe.value=!0}).catch(Ie=>{console.error("Audio play failed:",Ie),de.value=!1,oe.value=!1}):(de.value=!1,oe.value=!0)}}function be(Oe){re.value&&(re.value.currentTime=Oe.target.value)}function fe(){re.value&&(le.value=re.value.duration||0)}function ge(){ce.value=!0}function me(){ce.value=!1}function pe(){de.value=!1,oe.value=!0}function ke(){de.value=!0}function ve(Oe){console.error("Audio error:",Oe),ce.value=!1,de.value=!1,oe.value=!1}function _e(){re.value&&(ie.value=re.value.currentTime)}function $e(){oe.value=!1,ie.value=0,De()}function ye(){window.open(ae.src,"_blank")}function Ee(Oe){if(!Oe||isNaN(Oe))return"0:00";const Ie=Math.floor(Oe/60),ze=Math.floor(Oe%60);return`${Ie}:${ze.toString().padStart(2,"0")}`}function Se(){switch(ae.type){case"client":return"#22d3ee";case"attendant":return"#14b8a6";case"general":return"#0ea5e9";default:return"#9ca3af"}}function Le(){return{backgroundColor:`${Se()}20`,color:Se()}}function Ae(){ne("play-start",ae.src)}function De(){ne("play-pause",ae.src)}return e$b.watch(()=>ae.activeSrc,Oe=>{Oe&&Oe!==ae.src&&oe.value&&re.value&&(re.value.pause(),oe.value=!1)}),e$b.onUnmounted(()=>{re.value&&(re.value.pause(),re.value.src="")}),(Oe,Ie)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$u,[e$b.createElementVNode("button",{onClick:e$b.withModifiers(ue,["stop"]),class:"audio-play-btn hover:bg-base-100",title:"Reproduzir",disabled:ce.value||de.value,style:e$b.normalizeStyle(Le())},[ce.value||de.value?(e$b.openBlock(),e$b.createElementBlock("svg",{key:0,class:"audio-play-spinner",style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...Ie[0]||(Ie[0]=[e$b.createElementVNode("circle",{cx:"12",cy:"12",r:"10","stroke-width":"4","stroke-opacity":"0.2"},null,-1),e$b.createElementVNode("path",{d:"M4 12a8 8 0 018-8","stroke-width":"4","stroke-linecap":"round"},null,-1)])],4)):oe.value?(e$b.openBlock(),e$b.createElementBlock("svg",{key:2,style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Ie[2]||(Ie[2]=[e$b.createElementVNode("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])],4)):(e$b.openBlock(),e$b.createElementBlock("svg",{key:1,style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Ie[1]||(Ie[1]=[e$b.createElementVNode("path",{d:"M8 5v14l11-7z"},null,-1)])],4))],12,_hoisted_2$r),e$b.createElementVNode("div",_hoisted_3$o,[e$b.createElementVNode("div",{class:"audio-player-title",style:e$b.normalizeStyle({color:Se()})},e$b.toDisplayString(ee.label),5),e$b.createElementVNode("div",_hoisted_4$n,[e$b.createElementVNode("div",{class:"audio-progress-track",style:e$b.normalizeStyle({backgroundColor:`${Se()}20`})},[e$b.createElementVNode("div",{class:"audio-progress-fill",style:e$b.normalizeStyle({width:le.value>0?`${ie.value/le.value*100}%`:"0%",backgroundColor:Se()})},null,4),e$b.createElementVNode("input",{type:"range",class:"audio-progress-input",min:"0",max:le.value,value:ie.value,onInput:e$b.withModifiers(be,["stop"]),disabled:ce.value||de.value},null,40,_hoisted_5$l)],4)])]),e$b.createElementVNode("span",_hoisted_6$h,[ce.value||de.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_7$g,"-- : --")):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(Ee(ie.value))+" : "+e$b.toDisplayString(Ee(le.value)),1)],64))]),e$b.createElementVNode("button",{onClick:e$b.withModifiers(ye,["stop"]),class:"audio-download-btn hover:bg-base-300",title:"Baixar"},[(e$b.openBlock(),e$b.createElementBlock("svg",{style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[...Ie[3]||(Ie[3]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"},null,-1)])],4))]),e$b.createElementVNode("audio",{ref_key:"audioElement",ref:re,src:ee.src,onLoadstart:ge,onLoadedmetadata:fe,onCanplay:me,onPlaying:pe,onWaiting:ke,onTimeupdate:_e,onEnded:$e,onError:ve,preload:"metadata"},null,40,_hoisted_8$d)]))}},AudioPlayer=_export_sfc$1(_sfc_main$y,[["__scopeId","data-v-fbc276d0"]]),_sfc_main$x={__name:"CallRecordPlayer",props:{recordMetadata:{type:Object,required:!0}},emits:["close"],setup(ee){const te=e$b.ref(null);function ne(re){te.value=re}function ae(re){te.value===re&&(te.value=null)}return(re,oe)=>{var ie,le;return e$b.openBlock(),e$b.createElementBlock("div",{onClick:e$b.withModifiers(ce=>null,["stop"]),class:"call-record-player bg-base-200"},[(le=(ie=ee.recordMetadata)==null?void 0:ie.urls)!=null&&le.general?(e$b.openBlock(),e$b.createBlock(AudioPlayer,{key:0,src:ee.recordMetadata.urls.general,label:"Conversa",type:"general","active-src":te.value,onPlayStart:ne,onPlayPause:ae},null,8,["src","active-src"])):e$b.createCommentVNode("",!0)])}}},CallRecordPlayer=_export_sfc$1(_sfc_main$x,[["__scopeId","data-v-b2bf056b"]]),_hoisted_1$t={class:"call-card-header"},_hoisted_2$q={class:"call-card-header-left"},_hoisted_3$n={class:"call-card-content"},_hoisted_4$m={class:"call-card-title"},_hoisted_5$k={key:0,class:"opacity-70"},_hoisted_6$g={key:0,class:"call-card-text"},_hoisted_7$f={class:"call-card-actions"},_hoisted_8$c={key:0,class:"call-card-expanded"},_hoisted_9$a={class:"call-events"},_hoisted_10$a={class:"call-event-left"},_hoisted_11$9={class:"call-event-time"},_sfc_main$w={__name:"CallCard",props:{call:{type:Object,required:!0},hideMessageButton:{type:Boolean,default:!1},onMessageClick:{type:Function,required:!1,default:null}},setup(ee){const te=ee,ne=e$b.ref([]),ae=e$b.ref({});function re(ye){const Ee=ne.value.indexOf(ye);Ee>-1?ne.value.splice(Ee,1):ne.value.push(ye)}function oe(ye){return _e(ye).length>0}function ie(ye){oe(ye)&&re(ye.id)}function le(ye){ae.value[ye]=!ae.value[ye]}function ce(ye){le(ye)}function de(ye){te.onMessageClick&&te.onMessageClick(ye)}function ue(ye){return ye.events&&ye.events.length>0?ye.events[0].event_type:ye.historical&&ye.historical.length>0?ye.historical[ye.historical.length-1].status:""}function be(ye){switch(ye){case"offer":return"event-status-offer";case"answer":return"event-status-answer";case"accepted":return"event-status-accepted";case"ringing":return"event-status-ringing";case"rejected":case"error":return"event-status-rejected";case"terminated":return"event-status-terminated";case"update":return"event-status-update";default:return"event-status-unknown"}}function fe(ye){switch(ye){case"offer":return"event-bg-offer";case"answer":return"event-bg-answer";case"accepted":return"event-bg-accepted";case"ringing":return"event-bg-ringing";case"rejected":case"error":return"event-bg-rejected";case"terminated":return"bg-primary";case"update":return"event-bg-update";default:return"event-bg-unknown"}}function ge(ye){switch(ye){case"offer":return"event-dot-offer";case"answer":return"event-dot-answer";case"accepted":return"event-dot-accepted";case"ringing":return"event-dot-ringing";case"rejected":case"error":return"event-dot-rejected";case"terminated":return"event-dot-terminated";case"update":return"event-dot-update";default:return"event-dot-unknown"}}function me(ye){switch(ye){case"offer":return"Chamada recebida";case"answer":return"Chamada iniciada";case"ringing":return"Tocando...";case"accepted":return"Chamada atendida";case"rejected":return"Chamada rejeitada";case"terminated":return"Chamada terminada";case"error":return"Erro na chamada";case"update":return"Chamada atualizada";default:return"Evento desconhecido"}}function pe(ye){if(!ye)return"";const Ee=new Date(ye),Le=new Date-Ee,Ae=Math.floor(Le/(1e3*60*60*24));return Ae===0?"Hoje":Ae===1?"Ontem":Ae<7?`${Ae}d atrás`:Ee.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"})}function ke(ye){return ye?new Date(ye).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"}):""}function ve(ye){var Ee,Se,Le,Ae,De,Oe;return((Se=(Ee=ye.record_metadata)==null?void 0:Ee.urls)==null?void 0:Se.client)||((Ae=(Le=ye.record_metadata)==null?void 0:Le.urls)==null?void 0:Ae.attendant)||((Oe=(De=ye.record_metadata)==null?void 0:De.urls)==null?void 0:Oe.general)}function _e(ye){return ye.events&&ye.events.length>0?[...ye.events].reverse():ye.historical&&ye.historical.length>0?ye.historical:[]}function $e(ye){return ye.event_type||ye.status}return(ye,Ee)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ee.call.id,"data-test":"call-card",onClick:Ee[4]||(Ee[4]=e$b.withModifiers(Se=>ie(ee.call),["stop"])),class:"call-card bg-base-300 border hover:bg-base-300 border-base-300"},[e$b.createElementVNode("div",_hoisted_1$t,[e$b.createElementVNode("div",_hoisted_2$q,[e$b.createElementVNode("div",{class:e$b.normalizeClass(["call-icon bg-primary",fe(ue(ee.call))])},[(e$b.openBlock(),e$b.createElementBlock("svg",{style:e$b.normalizeStyle(ee.hideMessageButton?{width:"2.2rem",height:"2.2rem"}:{width:"1.3rem",height:"1.3rem"}),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Ee[5]||(Ee[5]=[e$b.createElementVNode("path",{d:"M7.978 4a2.553 2.553 0 0 0-1.926.877C4.233 6.7 3.699 8.751 4.153 10.814c.44 1.995 1.778 3.893 3.456 5.572 1.68 1.679 3.577 3.018 5.57 3.459 2.062.456 4.115-.073 5.94-1.885a2.556 2.556 0 0 0 .001-3.861l-1.21-1.21a2.689 2.689 0 0 0-3.802 0l-.617.618a.806.806 0 0 1-1.14 0l-1.854-1.855a.807.807 0 0 1 0-1.14l.618-.62a2.692 2.692 0 0 0 0-3.803l-1.21-1.211A2.555 2.555 0 0 0 7.978 4Z"},null,-1)])],4))],2),e$b.createElementVNode("div",_hoisted_3$n,[e$b.createElementVNode("div",_hoisted_4$m,[e$b.createTextVNode(e$b.toDisplayString(ee.call.direction==="outbound"?"Efetuada":"Recebida")+" ",1),ee.call.started_at?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$k," • "+e$b.toDisplayString(pe(ee.call.started_at)),1)):e$b.createCommentVNode("",!0)]),ee.hideMessageButton?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$g,e$b.toDisplayString(ee.call.direction==="outbound"?"Uma ligação foi efetuada":"Uma ligação foi recebida"),1)):e$b.createCommentVNode("",!0),_e(ee.call).length>0?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(["call-card-status",be(ue(ee.call))])},e$b.toDisplayString(me(ue(ee.call))),3)):e$b.createCommentVNode("",!0)])]),e$b.createElementVNode("div",_hoisted_7$f,[!ee.hideMessageButton&&ee.call.external_id?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,onClick:Ee[0]||(Ee[0]=e$b.withModifiers(Se=>de(ee.call),["stop"])),title:"Ver mensagem",class:"hover:bg-base-100"},[...Ee[6]||(Ee[6]=[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7l5 5m0 0l-5 5m5-5H6"})],-1)])])):e$b.createCommentVNode("",!0),ve(ee.call)?(e$b.openBlock(),e$b.createElementBlock("button",{key:1,class:e$b.normalizeClass({"bg-base-100":ae.value[ee.call.id],"hover:bg-base-100":!0}),onClick:Ee[1]||(Ee[1]=e$b.withModifiers(Se=>ce(ee.call.id),["stop"])),title:"Ver gravações"},[(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(ae.value[ee.call.id]?"text-primary":"opacity-70"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[...Ee[7]||(Ee[7]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M17.316 4.052a.99.99 0 0 0-.9.14c-.262.19-.416.495-.416.82v8.566a4.573 4.573 0 0 0-2-.464c-1.99 0-4 1.342-4 3.443 0 2.1 2.01 3.443 4 3.443 1.99 0 4-1.342 4-3.443V6.801c.538.5 1 1.219 1 2.262 0 .56.448 1.013 1 1.013s1-.453 1-1.013c0-1.905-.956-3.18-1.86-3.942a6.391 6.391 0 0 0-1.636-.998 4 4 0 0 0-.166-.063l-.013-.005-.005-.002h-.002l-.002-.001ZM4 5.012c-.552 0-1 .454-1 1.013 0 .56.448 1.013 1 1.013h9c.552 0 1-.453 1-1.013 0-.559-.448-1.012-1-1.012H4Zm0 4.051c-.552 0-1 .454-1 1.013 0 .56.448 1.013 1 1.013h9c.552 0 1-.454 1-1.013 0-.56-.448-1.013-1-1.013H4Zm0 4.05c-.552 0-1 .454-1 1.014 0 .559.448 1.012 1 1.012h4c.552 0 1-.453 1-1.012 0-.56-.448-1.013-1-1.013H4Z","clip-rule":"evenodd"},null,-1)])],2))],2)):e$b.createCommentVNode("",!0),oe(ee.call)?(e$b.openBlock(),e$b.createElementBlock("button",{key:2,onClick:Ee[2]||(Ee[2]=e$b.withModifiers(Se=>ie(ee.call),["stop"])),class:e$b.normalizeClass(["call-expand-btn hover:bg-base-100",{rotated:ne.value.includes(ee.call.id)}])},[...Ee[8]||(Ee[8]=[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)])],2)):e$b.createCommentVNode("",!0)])]),e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[ne.value.includes(ee.call.id)?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$c,[ae.value[ee.call.id]&&ve(ee.call)?(e$b.openBlock(),e$b.createBlock(CallRecordPlayer,{key:0,"record-metadata":ee.call.record_metadata,onClose:Ee[3]||(Ee[3]=Se=>le(ee.call.id))},null,8,["record-metadata"])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_9$a,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(_e(ee.call),(Se,Le)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:Le,class:"call-event-item"},[e$b.createElementVNode("div",_hoisted_10$a,[e$b.createElementVNode("div",{class:e$b.normalizeClass(["call-event-dot",ge($e(Se))])},null,2),e$b.createElementVNode("span",{class:e$b.normalizeClass(["call-event-text",be($e(Se))])},e$b.toDisplayString(me($e(Se))),3)]),e$b.createElementVNode("span",_hoisted_11$9,e$b.toDisplayString(ke(Se.created_at)),1)]))),128))])])):e$b.createCommentVNode("",!0)]),_:1})]))}},CallCard=_export_sfc$1(_sfc_main$w,[["__scopeId","data-v-7de9d6c1"]]),_hoisted_1$s={class:"call-message-container"},_sfc_main$v=e$b.defineComponent({__name:"CallMessage",props:{content:{type:Object,required:!0}},setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$s,[e$b.createVNode(CallCard,{call:ee.content,"hide-message-button":!0},null,8,["call"])]))}}),CallMessage=_export_sfc$1(_sfc_main$v,[["__scopeId","data-v-f368f432"]]);function normalizeVcardContent(ee){const te=(ee==null?void 0:ee.vcard_info)??ee??{},ne=ae=>ae==null?[]:Array.isArray(ae)?ae:[ae];return{name:te.name||"Contato",title:te.title||"",org:te.org||te.organization||"",photo:te.photo||null,birthday:te.birthday||"",phones:ne(te.telephones??te.phones??te.phone??te.telephone).filter(Boolean),emails:ne(te.emails??te.email).map(ae=>typeof ae=="string"?{email:ae,type:""}:ae).filter(ae=>ae&&ae.email),urls:ne(te.urls??te.url).map(ae=>typeof ae=="string"?{url:ae,type:""}:ae).filter(ae=>ae&&ae.url),addresses:ne(te.addresses??te.address).filter(Boolean)}}function normalizeVcardContents(ee){const te=ee==null?void 0:ee.contacts;return Array.isArray(te)&&te.length?te.map(ne=>normalizeVcardContent(ne)):[normalizeVcardContent(ee)]}const _hoisted_1$r={key:0,class:"size-3.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_hoisted_2$p=["id"],_hoisted_3$m={key:0,class:"flex select-none text-gray-400 opacity-70 dark:text-blue-800"},_hoisted_4$l={key:1,class:"mb-1.5 flex items-center gap-1.5 text-xs opacity-80"},_hoisted_5$j={key:5,class:"flex flex-col"},_hoisted_6$f={key:9},_hoisted_7$e={key:12,class:"relative flex w-full flex-col px-1"},_hoisted_8$b={key:0,class:"flex items-center justify-center space-x-1 italic"},_hoisted_9$9=["id"],_hoisted_10$9={key:0,class:"flex items-center gap-1"},_hoisted_11$8=["disabled"],_hoisted_12$7={class:"tabular-nums opacity-80"},_hoisted_13$5={class:"flex items-center gap-1"},_hoisted_14$5={class:"flex items-center space-x-1"},_hoisted_15$4={class:"flex items-center gap-1 opacity-80"},_hoisted_16$4={key:0},_hoisted_17$2={key:0},_hoisted_18$2={class:"message-reaction-emoji"},_hoisted_19$2={key:3,class:"shrink-0"},_hoisted_20$2={key:4,class:"w-12 shrink-0"},BOT_AVATAR="https://sm-click.s3.amazonaws.com/static/bot-attendance.png",_sfc_main$u={__name:"MessageBubble",props:{message:{type:Object,default:()=>({})},nextMessage:{type:Object,default:()=>({})},isInfo:{type:Boolean,default:!1},chat:{type:Object,default:null},readonly:{type:Boolean,default:!1}},emits:["go-to-message","start-chat","expand","open-native-pdf","update-proposal-status","download","download-package","copy-native","info","deleted","resent","error"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useMessageUiStore(),oe=e$b.ref(!1),ie=e$b.ref(!1),le=e$b.computed(()=>re.isActionsTarget(ne.message.id));function ce(at){ne.readonly||re.openActions(ne.message,at)}const de=e$b.computed(()=>ne.message.from_me),ue=e$b.computed(()=>{var at;return/https?:\/\/[^\s<]*(?:youtube\.com|youtu\.be)\/[^\s<]*/i.test(((at=ne.message.content)==null?void 0:at.text)||"")}),be=e$b.computed(()=>["file","image","video","document"].includes(ne.message.type)||Array.isArray(ne.message.items)&&ne.message.items.length>0),fe=e$b.computed(()=>ne.chat?!!ne.chat.group:re.isGroupChat),ge=e$b.computed(()=>fe.value?"shrink-0":"hidden shrink-0 md:block"),me=e$b.computed(()=>{var at;return ne.chat?((at=ne.chat.contact)==null?void 0:at.photo)??"":re.contactPhoto}),pe=e$b.computed(()=>{var at;return ne.chat?((at=ne.chat.contact)==null?void 0:at.name)??"":re.contactName}),ke=e$b.computed(()=>{var at;return((at=re.loggedAttendant)==null?void 0:at.id)??null}),ve=e$b.computed(()=>!!ne.message.sent_by&&ne.message.sent_by.id!==ke.value),_e=e$b.computed(()=>{var at,Je,lt;return{title:pe.value||"Áudio",subtitle:de.value?"Você":((at=ne.message.sent_by)==null?void 0:at.name)||pe.value||"",chatId:((Je=ne.chat)==null?void 0:Je.id)??((lt=re.currentChat)==null?void 0:lt.id)??null,messageId:ne.message.id}}),$e=e$b.computed(()=>{var at,Je;return!!((at=ne.message.quoted)!=null&&at.content)||!!ne.message.isTranscripting||!!((Je=ne.message.metadata)!=null&&Je.transcripted_text)}),ye=e$b.computed(()=>ne.message.type==="sms"?"icon-sms":ne.message.from_me?ne.message.internal?"icon-internal":"icon-owner":"icon-received"),Ee=e$b.computed(()=>ne.message.type==="sms"?"-right-[8px] message-dot-sms reflex":de.value?"-right-[8px] message-dot-owner reflex":"message-dot-received -left-[8px]"),Se=e$b.computed(()=>{const at=(ne.message.items||[]).map(Je=>Je==null?void 0:Je.id).filter(Boolean);return at.length?at.some(Je=>re.isMessageSelected(Je)):re.isMessageSelected(ne.message.id)}),Le=e$b.computed(()=>canForwardMessage(ne.message));function Ae(){if(!Le.value)return;const at=(ne.message.items||[]).map(Je=>Je==null?void 0:Je.id).filter(Boolean);at.length?re.togglePackageSelection(at):re.toggleMessageSelection(ne.message.id)}function De(at,Je){var gt,Et,mt,je,Qe,ut,dt,pt,tt,We,Ke,nt;if(!at||!at.sent_by&&!((gt=at.content)!=null&>.sender))return!1;if(!Je||!Je.sent_by&&!((Et=Je.content)!=null&&Et.sender))return!0;const lt=((mt=at.sent_by)==null?void 0:mt.id)||((Qe=(je=at.content)==null?void 0:je.sender)==null?void 0:Qe.id)||((dt=(ut=at.content)==null?void 0:ut.sender)==null?void 0:dt.name),it=((pt=Je.sent_by)==null?void 0:pt.id)||((We=(tt=Je.content)==null?void 0:tt.sender)==null?void 0:We.id)||((nt=(Ke=Je.content)==null?void 0:Ke.sender)==null?void 0:nt.name);return lt&&it?lt!==it:!1}const Oe=e$b.computed(()=>De(ne.message,ne.nextMessage)),Ie=e$b.computed(()=>isSticker(ne.message)||isTgSticker(ne.message)),ze=e$b.computed(()=>isPtv(ne.message)),Ve=e$b.computed(()=>Ie.value||ze.value),Ne=e$b.computed(()=>{var at;return(!de.value||ve.value)&&Oe.value&&!!((at=ne.message.content)!=null&&at.sender)}),Pe=e$b.computed(()=>{var at,Je,lt;return ve.value?(at=ne.message.sent_by)==null?void 0:at.name:(lt=(Je=ne.message.content)==null?void 0:Je.sender)==null?void 0:lt.name}),Be=["file","image","audio","text","sms","button","document","proposal","template","video"],Me=e$b.computed(()=>!ne.readonly&&ne.message.stage!=="excluded"&&Be.includes(ne.message.type)&&(ne.message.whatsapp_id!=="waiting to create"||ne.message.fail_reason||ne.message.stage==="processing")),xe=e$b.computed(()=>normalizeVcardContents(ne.message.content));function Ce(at){return Object.keys(at||{}).length!==0}function Fe(at){const Je=Math.floor(at/60),lt=(at%60).toFixed(0);return`${String(Je).padStart(2,"0")}:${String(lt).padStart(2,"0")}`}function Re(at){ne.message.content.currentTime=at}let qe;function Ge(at){var it;if(ne.readonly)return;const Je=(it=at.touches)==null?void 0:it[0],lt={clientX:(Je==null?void 0:Je.clientX)??0,clientY:(Je==null?void 0:Je.clientY)??0};qe=setTimeout(()=>{oe.value=!0,re.openActions(ne.message,lt)},550)}function Ze(){clearTimeout(qe)}e$b.onBeforeUnmount(()=>clearTimeout(qe));async function Xe(){const at=await transcriptAudio(ne.message);at.ok||notiwind.notify({group:"error",title:"Erro",text:at.error},4e3)}async function Ue(){const at=await reactToMessage(ne.message,"");at.ok||notiwind.notify({group:"error",title:"Erro",text:at.error},4e3)}return(at,Je)=>{var lt,it,gt,Et,mt,je,Qe,ut,dt,pt,tt,We,Ke,nt,ht,st,ft;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.renderSlot(at.$slots,"default",{class:"w-full"}),(Ce(ee.message.content)||ee.message.type==="ciphertext"||ee.message.type==="call")&&!ee.message.special?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["flex w-full rounded-lg transition-colors duration-200 lg:px-2",{"justify-end":de.value,"justify-start":!de.value,"z-20":oe.value,"pt-1.5":Oe.value,"pt-0.5":!Oe.value,"pt-4":ee.nextMessage&&ee.nextMessage.metadata&&ee.nextMessage.metadata.reaction,"bg-gray-400/5 py-1 dark:bg-primary/20":Se.value}])},[e$b.unref(re).forwardMode.active&&!ee.message.internal&&Le.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,"data-test":"forward-message-checkbox",type:"button",class:"mr-2 flex items-center focus:outline-none",onClick:e$b.withModifiers(Ae,["stop"])},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["flex size-5 cursor-pointer items-center justify-center rounded border-2 transition-colors",Se.value?"bg-primary border-primary":"border-gray-400 dark:bg-gray-500/60 dark:border-gray-600 hover:border-primary"])},[Se.value?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_1$r,[...Je[22]||(Je[22]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):e$b.createCommentVNode("",!0)],2)])):e$b.createCommentVNode("",!0),!de.value&&Oe.value&&ee.message.content.sender?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(ge.value)},[e$b.createVNode(Avatar,{photo:fe.value?(gt=(it=(lt=ee.message)==null?void 0:lt.content)==null?void 0:it.sender)==null?void 0:gt.photo:me.value,name:fe.value?(je=(mt=(Et=ee.message)==null?void 0:Et.content)==null?void 0:mt.sender)==null?void 0:je.name:pe.value,size:"fill",class:"mr-4 mt-1 size-8 select-none"},null,8,["photo","name"])],2)):ee.isInfo?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",{key:2,class:e$b.normalizeClass(["w-12",ge.value])},null,2)),e$b.createElementVNode("div",{id:ee.message.id,class:e$b.normalizeClass(["bubble-rise relative rounded-[7.5px] text-sm",{"bubble-rise-owner":de.value,"min-w-[100px] p-1.5 px-2 pb-0":!Ve.value,"message-media-bubble":be.value&&!ze.value,"internal-owner":ee.message.internal&&!Ve.value,"message-sms":ee.message.type==="sms"&&!Ve.value,"message-owner":de.value&&ee.message.type!=="sms"&&!Ve.value,"message-received":!de.value&&ee.message.type!=="sms"&&!Ve.value,"w-[320px]":ue.value,"transition duration-150 ease-in-out":ee.message.type==="text","max-w-[80%] md:max-w-[60%]":!ee.isInfo}]),onMouseenter:Je[20]||(Je[20]=yt=>oe.value=!0),onMouseleave:Je[21]||(Je[21]=yt=>oe.value=!1),onTouchstart:Ge,onTouchend:Ze,onContextmenu:e$b.withModifiers(ce,["prevent"])},[Oe.value&&!Ve.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["absolute top-[18px] z-0 h-3 w-2.5",Ee.value])},[(e$b.openBlock(),e$b.createElementBlock("svg",{width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",class:e$b.normalizeClass(ye.value)},[...Je[23]||(Je[23]=[e$b.createElementVNode("path",{d:"M2.08716 0.990608C6.96945 3.99222 14.3729 -1.53342 13.0005 3.49993C11.9288 7.43005 15.5661 14.0304 12.5 13.5001C11.2754 13.2882 7.30071 12.6987 4.10282 9.18332C1.80094 6.65292 0.995844 3.64548 0.812781 1.59225C0.755256 0.947065 1.53536 0.651363 2.08716 0.990608Z",fill:"currentColor"},null,-1)])],2))],2)):e$b.createCommentVNode("",!0),Ne.value?(e$b.openBlock(),e$b.createElementBlock("header",{key:1,class:e$b.normalizeClass(["message-sender-name text-left",Ve.value?"sticker-name":""]),style:e$b.normalizeStyle(e$b.unref(senderColorStyle)(Pe.value))},e$b.toDisplayString(Pe.value),7)):e$b.createCommentVNode("",!0),e$b.createElementVNode("main",{class:e$b.normalizeClass(["flex w-full",Ve.value?["items-end gap-1",de.value?"flex-row-reverse":"flex-row"]:"flex-col"])},[ee.message.stage==="excluded"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_3$m,[...Je[24]||(Je[24]=[e$b.createElementVNode("section",{class:"flex items-center justify-center"},[e$b.createElementVNode("svg",{class:"mb-0.3 size-4",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:"100",height:"100"},[e$b.createElementVNode("path",{d:"M25,2C12.317,2,2,12.318,2,25s10.317,23,23,23s23-10.318,23-23S37.683,2,25,2z M7,25c0-4.062,1.371-7.8,3.65-10.815 L35.815,39.35C32.8,41.629,29.062,43,25,43C15.075,43,7,34.925,7,25z M39.35,35.815L14.185,10.65C17.2,8.371,20.938,7,25,7 c9.925,0,18,8.075,18,18C43,29.062,41.629,32.8,39.35,35.815z"})]),e$b.createElementVNode("p",{class:"p-1 italic"},"Mensagem apagada")],-1)])])):e$b.createCommentVNode("",!0),ee.message.is_forward?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_4$l,[...Je[25]||(Je[25]=[e$b.createElementVNode("svg",{class:"size-3.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{d:"M5.027 10.9a8.729 8.729 0 0 1 6.422-3.62v-1.2A2.061 2.061 0 0 1 12.61 4.2a1.986 1.986 0 0 1 2.104.23l5.491 4.308a2.11 2.11 0 0 1 .588 2.566 2.109 2.109 0 0 1-.588.734l-5.489 4.308a1.983 1.983 0 0 1-2.104.228 2.065 2.065 0 0 1-1.16-1.876v-.942c-5.33 1.284-6.212 5.251-6.25 5.441a1 1 0 0 1-.923.806h-.06a1.003 1.003 0 0 1-.955-.7A10.221 10.221 0 0 1 5.027 10.9Z"})],-1),e$b.createElementVNode("span",null,"Encaminhada",-1)])])):e$b.createCommentVNode("",!0),ee.message.quoted&&ee.message.quoted.content?(e$b.openBlock(),e$b.createBlock(MessageQuote,{key:2,"chat-id":ee.message.quoted.chat,attendant:ee.message.quoted.sent_by,"is-message":!0,"message-id":ee.message.quoted.id,message:ee.message.quoted.content,onGo:Je[0]||(Je[0]=(yt,wt)=>ae("go-to-message",yt,wt))},null,8,["chat-id","attendant","message-id","message"])):e$b.createCommentVNode("",!0),ee.message.content.is_ad?(e$b.openBlock(),e$b.createBlock(_sfc_main$I,{key:3,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):e$b.createCommentVNode("",!0),(Qe=ee.message.content)!=null&&Qe.post_info?(e$b.openBlock(),e$b.createBlock(_sfc_main$H,{key:4,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):e$b.createCommentVNode("",!0),ee.message.type==="sms"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5$j,[Je[26]||(Je[26]=e$b.createElementVNode("span",{class:"inline-flex items-center gap-1 self-end rounded-full bg-violet-100/15 px-2 text-[9px] font-bold uppercase tracking-widest text-violet-100 dark:bg-violet-600/15 dark:text-violet-600"}," SMS ",-1)),e$b.createVNode(YouTubePreview,{content:ee.message.content.text},null,8,["content"]),e$b.createVNode(MessageMarkdown,{class:"text-left",content:ee.message.content.text},null,8,["content"])])):ee.message.type==="text"&&!ee.message.content.is_ad&&!((ut=ee.message.content)!=null&&ut.post_info)?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:6},[e$b.createVNode(YouTubePreview,{content:ee.message.content.text},null,8,["content"]),e$b.createVNode(MessageMarkdown,{class:e$b.normalizeClass(["text-left",ee.message.stage==="excluded"?"opacity-70 text-gray-400":""]),content:ee.message.content.text},null,8,["class","content"])],64)):ee.message.type==="list"?(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:7,class:"text-left",content:ee.message.content.description},null,8,["content"])):ee.message.type==="call"?(e$b.openBlock(),e$b.createBlock(CallMessage,{key:8,content:ee.message.content},null,8,["content"])):ee.message.type==="location"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$f,[e$b.createVNode(MessageLocationMap,{map:ee.message.content,"map-id":`${ee.message.id}-map`},null,8,["map","map-id"])])):ee.message.type==="ciphertext"?(e$b.openBlock(),e$b.createBlock(MessageCiphertext,{key:10})):ee.message.whatsapp_id==="waiting to create"&&ee.message.type!=="text"&&ee.message.content&&!ee.message.content.url?(e$b.openBlock(),e$b.createBlock(_sfc_main$F,{key:11,message:ee.message},null,8,["message"])):e$b.unref(isAudio)(ee.message)?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$e,[e$b.createVNode(MessageAudio,{audio:ee.message.content.data64?ee.message.content.data64:ee.message.content.url,"is-owner":de.value,"full-width":$e.value,"track-id":ee.message.id,"track-meta":_e.value,onCurrentTime:Re},null,8,["audio","is-owner","full-width","track-id","track-meta"]),ee.message.isTranscripting?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$b,[...Je[27]||(Je[27]=[e$b.createElementVNode("svg",{fill:"none",class:"size-7 animate-spin",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},[e$b.createElementVNode("path",{"clip-rule":"evenodd",d:"M15.165 8.53a.5.5 0 01-.404.58A7 7 0 1023 16a.5.5 0 011 0 8 8 0 11-9.416-7.874.5.5 0 01.58.404z",fill:"currentColor","fill-rule":"evenodd"})],-1),e$b.createElementVNode("div",null,"Transcrevendo...",-1)])])):e$b.createCommentVNode("",!0),(dt=ee.message.metadata)!=null&&dt.transcripted_text&&!ee.message.isTranscripting?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,id:`transcriptedMessage${ee.message.id}`,class:"max-h-[200px] overflow-auto pb-1 pr-2 text-left opacity-90"},[e$b.createElementVNode("em",null,'"'+e$b.toDisplayString((pt=ee.message.metadata)==null?void 0:pt.transcripted_text)+'"',1)],8,_hoisted_9$9)):e$b.createCommentVNode("",!0)])):ee.message.items&&ee.message.items.length>1?(e$b.openBlock(),e$b.createBlock(_sfc_main$E,{key:13,message:ee.message,onExpand:Je[1]||(Je[1]=yt=>ae("expand",ee.message,!0,yt))},null,8,["message"])):["file","image","video","document"].includes(ee.message.type)&&!ee.message.items?(e$b.openBlock(),e$b.createBlock(MessageFileRenderer,{key:14,message:ee.message,onExpand:Je[2]||(Je[2]=(yt,wt)=>ae("expand",yt,wt)),onOpenNativePdf:Je[3]||(Je[3]=yt=>ae("open-native-pdf",yt)),onDownload:Je[4]||(Je[4]=()=>ae("download",ee.message)),onError:Je[5]||(Je[5]=yt=>ae("error",yt))},null,8,["message"])):ee.message.type==="proposal"?(e$b.openBlock(),e$b.createBlock(ProposalMessageCard,{key:15,message:ee.message,interactive:!ee.readonly,onUpdateStatus:Je[6]||(Je[6]=(yt,wt)=>ae("update-proposal-status",ee.message,yt,wt)),onOpenNativePdf:Je[7]||(Je[7]=yt=>ae("open-native-pdf",yt))},null,8,["message","interactive"])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",{class:e$b.normalizeClass([[Ve.value?"sticker-meta":ee.message.content.duration?"justify-between":"justify-end pl-2"],"flex select-none items-center space-x-1 text-[10px]"])},[ee.message.content.duration&&!ze.value?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_10$9,[e$b.unref(isAudio)(ee.message)&&!((tt=ee.message.metadata)!=null&&tt.transcripted_text)?(e$b.openBlock(),e$b.createBlock(e$b.unref(entry_esm),{key:0,"offset-distance":"2",hover:!0,content:"Transcrever áudio",placement:"top",class:"text-[14px]"},{default:e$b.withCtx(()=>[e$b.createElementVNode("button",{disabled:ee.message.isTranscripting,class:"stage-mark mt-[6px] hover:text-primary",onClick:e$b.withModifiers(Xe,["stop"])},[...Je[28]||(Je[28]=[e$b.createElementVNode("svg",{class:"size-5.5","clip-rule":"evenodd","fill-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"2",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e$b.createElementVNode("path",{fill:"currentColor",d:"m11.239 15.533c-1.045 3.004-1.238 3.451-1.238 3.84 0 .441.385.627.627.627.272 0 1.108-.301 3.829-1.249zm.888-.888 3.22 3.22 6.408-6.401c.163-.163.245-.376.245-.591 0-.213-.082-.427-.245-.591-.58-.579-1.458-1.457-2.039-2.036-.163-.163-.377-.245-.591-.245-.213 0-.428.082-.592.245zm-3.127-.895c0-.402-.356-.75-.75-.75-2.561 0-2.939 0-5.5 0-.394 0-.75.348-.75.75s.356.75.75.75h5.5c.394 0 .75-.348.75-.75zm5-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75zm0-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75zm0-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75z","fill-rule":"nonzero"})],-1)])],8,_hoisted_11$8)]),_:1})):e$b.createCommentVNode("",!0),e$b.createElementVNode("p",_hoisted_12$7,e$b.toDisplayString(Fe(ee.message.content.currentTime||ee.message.content.duration)),1)])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_13$5,[ee.message.internal?(e$b.openBlock(),e$b.createBlock(e$b.unref(entry_esm),{key:0,arrow:!0,hover:"",placement:"top"},{content:e$b.withCtx(()=>[...Je[29]||(Je[29]=[e$b.createElementVNode("div",{class:"w-32 text-center"},"Mensagem visível apenas para outros atendentes",-1)])]),default:e$b.withCtx(()=>[Je[30]||(Je[30]=e$b.createElementVNode("svg",{class:"size-3.5 text-white/50 dark:text-black/40","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 6a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm-1.5 8a4 4 0 0 0-4 4 2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-3Zm6.82-3.096a5.51 5.51 0 0 0-2.797-6.293 3.5 3.5 0 1 1 2.796 6.292ZM19.5 18h.5a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-1.1a5.503 5.503 0 0 1-.471.762A5.998 5.998 0 0 1 19.5 18ZM4 7.5a3.5 3.5 0 0 1 5.477-2.889 5.5 5.5 0 0 0-2.796 6.293A3.501 3.501 0 0 1 4 7.5ZM7.1 12H6a4 4 0 0 0-4 4 2 2 0 0 0 2 2h.5a5.998 5.998 0 0 1 3.071-5.238A5.505 5.505 0 0 1 7.1 12Z","clip-rule":"evenodd"})],-1))]),_:1})):e$b.createCommentVNode("",!0),e$b.createElementVNode("main",_hoisted_14$5,[e$b.createElementVNode("p",_hoisted_15$4,[((Ke=(We=ee.message.content)==null?void 0:We.history)==null?void 0:Ke.length)>0?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_16$4,"Editada")):e$b.createCommentVNode("",!0),e$b.createTextVNode(" "+e$b.toDisplayString(((ht=(nt=ee.message)==null?void 0:nt.sent_at)==null?void 0:ht.split("T")[1].slice(0,5))||"--:--"),1)]),de.value?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_17$2,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,"failed-size":12,class:e$b.normalizeClass(ee.message.stage==="failed"?"size-4":"")},null,8,["stage","class"])])):e$b.createCommentVNode("",!0)])])],2)],2),ee.message.type==="list"?(e$b.openBlock(),e$b.createBlock(_sfc_main$U,{key:2,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):ee.message.type==="template"?(e$b.openBlock(),e$b.createBlock(_sfc_main$R,{key:3,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):ee.message.type==="vcard"?(e$b.openBlock(),e$b.createBlock(ContactMessageCard,{key:4,contacts:xe.value,"show-start-chat":!0,onStartChat:Je[8]||(Je[8]=yt=>ae("start-chat",yt))},null,8,["contacts"])):ee.message.type==="button"?(e$b.openBlock(),e$b.createBlock(_sfc_main$Q,{key:5,content:ee.message.content},null,8,["content"])):e$b.createCommentVNode("",!0),e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[Me.value?e$b.withDirectives((e$b.openBlock(),e$b.createElementBlock("button",{key:0,type:"button","aria-label":"Ações da mensagem",class:"absolute right-[1.5px] top-0 ml-3 flex items-center justify-center pr-1 pt-1",onClick:e$b.withModifiers(ce,["stop"])},[...Je[31]||(Je[31]=[e$b.createElementVNode("svg",{fill:"currentColor",viewBox:"0 0 20 20",class:"size-5 rounded bg-gray-800/80 text-white transition-transform duration-200 dark:bg-gray-400"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])],512)),[[e$b.vShow,oe.value]]):e$b.createCommentVNode("",!0)]),_:1}),le.value?(e$b.openBlock(),e$b.createBlock(MessageActionsMenu,{key:6,onInfo:Je[9]||(Je[9]=yt=>ae("info",yt)),onDownload:Je[10]||(Je[10]=yt=>ae("download",yt)),onDownloadPackage:Je[11]||(Je[11]=yt=>ae("download-package",yt)),onCopyNative:Je[12]||(Je[12]=yt=>ae("copy-native",yt)),onDeleted:Je[13]||(Je[13]=yt=>ae("deleted",yt)),onResent:Je[14]||(Je[14]=yt=>ae("resent",yt))})):e$b.createCommentVNode("",!0),(st=ee.message.metadata)!=null&&st.reaction?(e$b.openBlock(),e$b.createElementBlock("footer",{key:7,class:e$b.normalizeClass(["message-reaction",{"message-reaction-sticker":Ve.value&&de.value}]),onMouseenter:Je[15]||(Je[15]=yt=>ie.value=!0),onMouseleave:Je[16]||(Je[16]=yt=>ie.value=!1),onTouchstart:Je[17]||(Je[17]=yt=>ie.value=!0),onTouchend:Je[18]||(Je[18]=yt=>ie.value=!1),onTouchcancel:Je[19]||(Je[19]=yt=>ie.value=!1)},[e$b.createElementVNode("button",{type:"button",class:"message-reaction-slot","aria-label":"Remover reação",onClick:e$b.withModifiers(Ue,["stop"])},[e$b.createElementVNode("span",_hoisted_18$2,e$b.toDisplayString((ft=ee.message.metadata)==null?void 0:ft.reaction),1),(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(["message-reaction-remove",{"is-visible":ie.value}]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...Je[32]||(Je[32]=[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M6 18 17.94 6M18 18 6.06 6"},null,-1)])],2))])],34)):e$b.createCommentVNode("",!0)],42,_hoisted_2$p),de.value&&Oe.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_19$2,[ee.message.sent_by?(e$b.openBlock(),e$b.createBlock(Avatar,{key:0,attendant:ee.message.sent_by,size:"fill","show-level":!1,"effect-level":"border",class:"ml-4 mt-1 size-8 select-none"},null,8,["attendant"])):(e$b.openBlock(),e$b.createBlock(Avatar,{key:1,photo:BOT_AVATAR,size:"fill",class:"ml-4 mt-1 size-8 select-none"}))])):ee.isInfo?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_20$2))],2)):e$b.createCommentVNode("",!0)],64)}}},_hoisted_1$q={class:"flex w-full justify-center py-1.5"},_hoisted_2$o={class:"inline-flex max-w-[85%] items-center gap-2 rounded-full bg-base-200 py-1.5 pl-1.5 pr-3.5 text-xs font-semibold text-base-content/80 shadow-sm ring-1 ring-base-300/60"},_hoisted_3$l={class:"flex size-5 shrink-0 items-center justify-center rounded-full bg-base-100 text-primary shadow-sm"},_hoisted_4$k={class:"min-w-0 truncate"},_hoisted_5$i={key:0,class:"shrink-0 text-[10px] font-normal opacity-60"},_sfc_main$t={__name:"SystemMessage",props:{message:{type:Object,required:!0},time:{type:String,default:""}},setup(ee){return(te,ne)=>{var ae;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.renderSlot(te.$slots,"default"),e$b.createElementVNode("div",_hoisted_1$q,[e$b.createElementVNode("span",_hoisted_2$o,[e$b.createElementVNode("span",_hoisted_3$l,[e$b.renderSlot(te.$slots,"icon",{},()=>[ne[0]||(ne[0]=e$b.createElementVNode("svg",{class:"size-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.586 2.586A2 2 0 0 1 11 2h2a2 2 0 0 1 2 2v.089l.473.196.063-.063a2.002 2.002 0 0 1 2.828 0l1.414 1.414a2 2 0 0 1 0 2.827l-.063.064.196.473H20a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-.089l-.196.473.063.063a2.002 2.002 0 0 1 0 2.828l-1.414 1.414a2 2 0 0 1-2.828 0l-.063-.063-.473.196V20a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-.089l-.473-.196-.063.063a2.002 2.002 0 0 1-2.828 0l-1.414-1.414a2 2 0 0 1 0-2.827l.063-.064L4.089 15H4a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2h.09l.195-.473-.063-.063a2 2 0 0 1 0-2.828l1.414-1.414a2 2 0 0 1 2.827 0l.064.063L9 4.089V4a2 2 0 0 1 .586-1.414ZM8 12a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z","clip-rule":"evenodd"})],-1))])]),e$b.createElementVNode("span",_hoisted_4$k,e$b.toDisplayString((ae=ee.message.content)==null?void 0:ae.text),1),ee.time?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$i,e$b.toDisplayString(ee.time),1)):e$b.createCommentVNode("",!0)])])],64)}}},_hoisted_1$p={class:"history-shell relative min-h-0 w-full flex-1 overflow-hidden"},_hoisted_2$n={class:"history-infinite-spinner",role:"status"},_hoisted_3$k={class:"history-pixel-bar","aria-hidden":"true"},_hoisted_4$j={class:"smplay-pixel-label"},_hoisted_5$h=["aria-hidden","inert","data-history-key"],_hoisted_6$e={key:0,class:"history-separator my-4"},_hoisted_7$d={class:"history-protocol-label"},_hoisted_8$a={class:"min-w-0 truncate"},_hoisted_9$8={key:0,class:"history-separator history-separator-unread"},_hoisted_10$8={class:"history-unread-label"},_hoisted_11$7={class:"history-unread-count"},_hoisted_12$6={key:1,class:"history-separator history-separator-day"},_hoisted_13$4={class:"day-badge history-separator-chip"},_hoisted_14$4={class:"history-overlay"},_hoisted_15$3={key:0,class:"history-overlay-banner"},_hoisted_16$3={key:0,class:"history-loader-layer"},INFINITE_PRERENDER_MIN_DELAY_MS=64,INFINITE_MEDIA_WARMUP_TIMEOUT_MS=80,HISTORY_ITEM_BLEED=8,NAV_HYSTERESIS_PX=48,_sfc_main$s={__name:"ChatHistory",props:{messages:{type:Array,default:()=>[]},chat:{type:Object,default:null},chatKey:{type:[String,Number],default:null},hasMore:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreText:{type:String,default:"Carregando mais..."},unreadCount:{type:Number,default:0},readonly:{type:Boolean,default:!1},messageHandlers:{type:Object,default:()=>({})},loadMore:{type:Function,default:null},dateFormatter:{type:Function,default:null}},setup(ee,{expose:te}){const ne={},ae=ee,re=useMessageUiStore(),oe=e$b.ref(null),ie=e$b.ref(null),le=e$b.computed(()=>re.forwardMode.selectedMessages.length),ce=new Intl.DateTimeFormat("pt-BR",{timeZone:"America/Sao_Paulo",year:"numeric",month:"2-digit",day:"2-digit"});function de(je){if(!je)return null;const Qe=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(je)&&!/[zZ]|[+-]\d{2}:\d{2}$/.test(je),ut=new Date(Qe?je+"Z":je);return isNaN(ut.getTime())?null:ut}function ue(je){const Qe=de(je);if(!Qe)return"";const ut=new Date,dt=new Date(ut);return dt.setDate(dt.getDate()-1),isSameWeek(Qe,ut,{weekStartsOn:1})?be(Qe,ut)?"Hoje":be(Qe,dt)?"Ontem":format(Qe,"iiii",{locale:ptBR}):format(Qe,Qe.getFullYear()===ut.getFullYear()?"dd/MM":"dd/MM/yyyy",{locale:ptBR})}function be(je,Qe){return je.getDate()===Qe.getDate()&&je.getMonth()===Qe.getMonth()&&je.getFullYear()===Qe.getFullYear()}function fe(je){return ae.dateFormatter?ae.dateFormatter(je):ue(je)}function ge(je){var Qe;return je.sent_by?`internal:${je.sent_by.id}`:(Qe=je.content)!=null&&Qe.sender?`external:${je.content.sender.name||""}`:"unknown"}const me=new WeakMap,pe=e$b.ref(!1),ke=e$b.ref(new Set),ve=e$b.ref({});function _e(){return new Promise(je=>window.setTimeout(je,INFINITE_PRERENDER_MIN_DELAY_MS))}function $e(){var Qe;const je=(Qe=oe.value)==null?void 0:Qe.getBoundingClientRect();ke.value=new Set(ae.messages.map(Me)),ve.value=je?{"--history-prerender-left":`${je.left}px`,"--history-prerender-top":`${je.top}px`,"--history-prerender-width":`${je.width}px`,"--history-prerender-height":`${je.height}px`}:{},pe.value=!0}function ye(){pe.value=!1,ke.value=new Set,ve.value={}}function Ee(je){return pe.value&&!ke.value.has(je)}function Se(je){var dt,pt;const Qe=[((pt=(dt=ae.chat)==null?void 0:dt.contact)==null?void 0:pt.photo)||re.contactPhoto],ut=tt=>{var Ke;if(!tt||tt.special)return;const We=tt.content||{};Qe.push((Ke=We.sender)==null?void 0:Ke.photo),(isImage(tt)||isGif(tt)||isSticker(tt))&&Qe.push(We.data64,We.url,We.blobUrl),Array.isArray(tt.items)&&tt.items.forEach(ut)};return je.forEach(ut),Qe}function Le(je){var st,ft,yt,wt,Tt,Dt,Lt,Gt,Rt,Xt;const Qe=je&&typeof je=="object"?me.get(je):null,ut=((st=je==null?void 0:je.sent_by)==null?void 0:st.id)||((yt=(ft=je==null?void 0:je.content)==null?void 0:ft.sender)==null?void 0:yt.id)||((Tt=(wt=je==null?void 0:je.content)==null?void 0:wt.sender)==null?void 0:Tt.name)||"",dt=(Dt=je==null?void 0:je.content)==null?void 0:Dt.caption,pt=(Lt=je==null?void 0:je.content)==null?void 0:Lt.text,tt=(Gt=je==null?void 0:je.content)==null?void 0:Gt.type,We=((Rt=je==null?void 0:je.content)==null?void 0:Rt.url)||((Xt=je==null?void 0:je.content)==null?void 0:Xt.data64),Ke=(je==null?void 0:je.stage)||null;if(Qe&&Qe.sentAt===(je==null?void 0:je.sent_at)&&Qe.type===(je==null?void 0:je.type)&&Qe.contentType===tt&&Qe.caption===dt&&Qe.text===pt&&Qe.senderKey===ut&&Qe.stage===Ke&&Qe.url===We)return Qe;const nt=de(je==null?void 0:je.sent_at),ht={author:ge(je||{}),caption:dt,contentType:tt,dayKey:nt?ce.format(nt):"",hasCaption:!!(dt||pt),internal:(je==null?void 0:je.internal)||!1,isMedia:(isVideo(je)||isImage(je))&&!isPtv(je),senderKey:ut,sentAt:je==null?void 0:je.sent_at,sentAtMs:nt?nt.getTime():NaN,stage:Ke,text:pt,type:je==null?void 0:je.type,url:We};return je&&typeof je=="object"&&me.set(je,ht),ht}function Ae(je,Qe,ut,dt){return dt.isMedia&&Qe.isMedia&&je.from_me===ut.from_me&&dt.sentAtMs-Qe.sentAtMs<=12e4&&Qe.internal===dt.internal&&!dt.hasCaption&&!Qe.hasCaption&&Qe.author===dt.author&&Qe.stage===dt.stage}let De={messages:[],groups:[],collapsed:!1};const Oe=e$b.computed(()=>{const je=ae.messages,Qe=[];let ut=!1,dt=null,pt=null;for(let We=0;We<je.length;We++){const Ke=je[We],nt=Le(Ke);We===0||!Ae(dt,pt,Ke,nt)?Qe.push(We):ut=!0,dt=Ke,pt=nt}if(!ut&&!De.collapsed&&sameList(De.messages,je))return De.groups;const tt=[];for(let We=0;We<Qe.length;We++){const Ke=Qe[We],nt=We+1<Qe.length?Qe[We+1]:je.length;tt.push(nt-Ke===1?je[Ke]:{...je[Ke],items:je.slice(Ke,nt)})}return De={messages:je.slice(),groups:tt,collapsed:ut},tt}),Ie=stableList(()=>Oe.value.map(Me)),ze=stableList(()=>{const je=[];let Qe=null;return Oe.value.forEach((ut,dt)=>{const{dayKey:pt}=Le(ut),tt=dt===0||pt!==Qe;je.push(!ut.special&&tt?fe(ut.sent_at):null),Qe=pt}),je});let Ve=new Map,Ne=null;const Pe=e$b.computed(()=>{const je=Oe.value,Qe=Ie.value,ut=ze.value,{chat:dt,readonly:pt}=ae;(!Ne||Ne.chat!==dt||Ne.readonly!==pt)&&(Ve=new Map,Ne={chat:dt,readonly:pt});const tt=new Map,We=je.map((Ke,nt)=>{const ht=Qe[nt],st=ut[nt],ft=je[nt-1],yt=Ve.get(ht);if(yt&&yt.message===Ke&&yt.nextMessage===ft&&yt.dayLabel===st)return tt.set(ht,yt),yt.row;const wt=Ke.type==="system",Tt={message:Ke,nextMessage:ft,dayLabel:st,row:{key:ht,dayLabel:st,message:Ke,isSystem:wt,component:wt?_sfc_main$t:_sfc_main$u,props:wt?{message:Ke,time:Be(Ke)}:{message:Ke,nextMessage:ft,chat:dt,readonly:pt}}};return tt.set(ht,Tt),Tt.row});return Ve=tt,We});function Be(je){var Qe,ut;return((ut=(Qe=je==null?void 0:je.sent_at)==null?void 0:Qe.split("T")[1])==null?void 0:ut.slice(0,5))||""}function Me(je){var Qe,ut;return(je==null?void 0:je.id)!==void 0&&(je==null?void 0:je.id)!==null&&(je==null?void 0:je.id)!==""?String(je.id):je!=null&&je.special?`special:${je.content}`:`${(je==null?void 0:je.type)||"message"}:${(je==null?void 0:je.sent_at)||""}:${((Qe=je==null?void 0:je.content)==null?void 0:Qe.url)||((ut=je==null?void 0:je.content)==null?void 0:ut.text)||""}`}const xe=e$b.computed(()=>{const je=Oe.value.findIndex(Qe=>!Qe.special&&Qe.opened===!1&&(ae.chatKey==null||Qe.chat==null||Qe.chat===ae.chatKey));return je===-1?null:Ie.value[je]});function Ce(je){var dt;const Qe=String(je||""),ut=Qe.match(/PROTOCOLO\s+(.+)$/i);return(dt=ut==null?void 0:ut[1])!=null&&dt.trim()?`Protocolo ${ut[1].trim()}`:Qe}const Fe=e$b.ref(!1),Re=e$b.ref(!1);function qe(){var ut;const je=(ut=ie.value)==null?void 0:ut.querySelectorAll("[data-history-key]:not([data-history-measured])");if(!(je!=null&&je.length))return;const Qe=Array.from(je,dt=>dt.offsetHeight);je.forEach((dt,pt)=>{const tt=Qe[pt];tt<=0||(dt.style.containIntrinsicSize=`auto ${Math.max(1,tt-HISTORY_ITEM_BLEED*2)}px`,dt.dataset.historyMeasured="1")})}function Ge(je,Qe){let ut=null;const dt=(...pt)=>{ut&&window.clearTimeout(ut),ut=window.setTimeout(()=>{ut=null,je(...pt)},Qe)};return dt.cancel=()=>{ut&&window.clearTimeout(ut),ut=null},dt}const Ze=Ge(async je=>{if(ae.loading||!ae.loadMore){je.loaded();return}const Qe=ae.chatKey,ut=new Set(ae.messages.map(Me));try{if(!ae.hasMore){je.complete();return}if($e(),await ae.loadMore(),Qe!==ae.chatKey){ye(),je.loaded();return}const dt=ae.messages.filter(tt=>!ut.has(Me(tt))),pt=Se(dt);await e$b.nextTick(),await Promise.all([warmImageSources(pt,INFINITE_MEDIA_WARMUP_TIMEOUT_MS),_e()]),ye(),await e$b.nextTick(()=>{oe.value&&(qe(),lt())}),ae.hasMore?je.loaded():je.complete()}catch(dt){ye(),console.error("Erro durante o carregamento da rolagem infinita:",dt),je.complete()}},500);function Xe(){oe.value&&oe.value.scrollTo({top:0,behavior:"instant"})}function Ue(){if(!oe.value)return;const je=Math.max(oe.value.scrollHeight-oe.value.clientHeight,0);oe.value.scrollTo({top:-je,behavior:"smooth"})}let at={max:0,threshold:0},Je=null;function lt(){if(!oe.value)return;const je=oe.value.clientHeight;at={max:Math.max(oe.value.scrollHeight-je,0),threshold:Math.min(Math.max(je*.25,96),220)}}function it(je,Qe,ut){return je?Qe>ut-NAV_HYSTERESIS_PX:Qe>ut}function gt(){if(!oe.value)return;const{max:je,threshold:Qe}=at,ut=Math.min(Math.max(-oe.value.scrollTop,0),je);Fe.value=it(Fe.value,je-ut,Qe),Re.value=it(Re.value,ut,Qe)}let Et=null;function mt(){Et===null&&(Et=requestAnimationFrame(()=>{Et=null,gt()}))}return e$b.onMounted(async()=>{var je;await e$b.nextTick(),(je=oe.value)==null||je.addEventListener("scroll",mt,{passive:!0}),Je=new ResizeObserver(()=>{lt(),gt()}),oe.value&&Je.observe(oe.value),ie.value&&Je.observe(ie.value),requestAnimationFrame(()=>{qe(),lt(),gt()})}),e$b.onUnmounted(()=>{var je;ye(),(je=oe.value)==null||je.removeEventListener("scroll",mt),Je==null||Je.disconnect(),Je=null,Et!==null&&cancelAnimationFrame(Et)}),e$b.watch(()=>Oe.value.length,async()=>{await e$b.nextTick(),qe(),lt(),gt()}),e$b.watch(()=>ae.chatKey,async()=>{Ze.cancel(),ye(),Ve.clear(),re.forwardMode.active&&(re.forwardMode.active=!1,re.forwardMode.selectedMessages=[]),await e$b.nextTick(),qe(),lt(),gt()}),te({scrollToTop:Ue,scrollToBottom:Xe}),(je,Qe)=>(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_1$p,[e$b.createElementVNode("main",{ref_key:"chatContainer",ref:oe,class:e$b.normalizeClass([ee.loadingMore?"overflow-hidden":"overflow-y-auto","history-scroll scroll relative size-full"]),style:e$b.normalizeStyle(ve.value)},[e$b.createElementVNode("div",{ref_key:"chatContent",ref:ie,class:"history-content chat-column relative flex min-h-full w-full flex-none flex-col justify-end px-[10.5px] py-3"},[e$b.withDirectives(e$b.createVNode(e$b.unref(Y$1),{top:!0,direction:"top",class:"z-50 mb-2 py-1",onInfinite:e$b.unref(Ze)},{complete:e$b.withCtx(()=>[...Qe[0]||(Qe[0]=[e$b.createElementVNode("span",null,null,-1)])]),spinner:e$b.withCtx(()=>[e$b.createElementVNode("div",_hoisted_2$n,[e$b.createElementVNode("span",_hoisted_3$k,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(6,ut=>e$b.createElementVNode("i",{key:ut,class:"history-pixel-cell",style:e$b.normalizeStyle({"--cell":ut-1})},null,4)),64))]),e$b.createElementVNode("span",_hoisted_4$j,e$b.toDisplayString(ee.loadingMoreText),1)])]),_:1},8,["onInfinite"]),[[e$b.vShow,!ee.loading&&ee.hasMore]]),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(Pe.value,ut=>{var dt;return e$b.openBlock(),e$b.createElementBlock("div",{key:ut.key,class:e$b.normalizeClass(["history-item",{"history-item-prerender":Ee(ut.key),"history-item-overflowing":!!((dt=ut.message.metadata)!=null&&dt.reaction)}]),"aria-hidden":Ee(ut.key)?"true":void 0,inert:Ee(ut.key),"data-history-key":ut.key},[(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ut.component),e$b.mergeProps({ref_for:!0},ut.props,e$b.toHandlers(ut.isSystem?ne:ee.messageHandlers)),{default:e$b.withCtx(()=>[ut.message.special?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$e,[e$b.createElementVNode("div",_hoisted_7$d,[Qe[1]||(Qe[1]=e$b.createElementVNode("span",null,"Conversa anterior",-1)),e$b.createElementVNode("span",_hoisted_8$a,e$b.toDisplayString(Ce(ut.message.content)),1)])])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[ee.unreadCount>0&&ut.key===xe.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$8,[e$b.createElementVNode("div",_hoisted_10$8,[e$b.createElementVNode("span",_hoisted_11$7,e$b.toDisplayString(ee.unreadCount),1),e$b.createElementVNode("span",null,e$b.toDisplayString(ee.unreadCount===1?"mensagem não lida":"mensagens não lidas"),1)])])):e$b.createCommentVNode("",!0),ut.dayLabel?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_12$6,[e$b.createElementVNode("div",_hoisted_13$4,e$b.toDisplayString(ut.dayLabel),1)])):e$b.createCommentVNode("",!0),Qe[2]||(Qe[2]=e$b.createElementVNode("div",{class:"message"},null,-1))],64))]),_:2},1040))],10,_hoisted_5$h)}),128))],512)],6),e$b.createElementVNode("div",_hoisted_14$4,[e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[e$b.unref(re).forwardMode.active&&je.$slots.banner?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_15$3,[e$b.renderSlot(je.$slots,"banner",{selectedCount:le.value})])):e$b.createCommentVNode("",!0)]),_:3})]),e$b.createVNode(e$b.Transition,{name:"history-loader"},{default:e$b.withCtx(()=>[ee.loading&&je.$slots.loading?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$3,[e$b.renderSlot(je.$slots,"loading")])):e$b.createCommentVNode("",!0)]),_:3}),e$b.createVNode(e$b.TransitionGroup,{name:"history-nav",tag:"div",class:"history-navigation"},{default:e$b.withCtx(()=>[Fe.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:"top",type:"button",class:"history-navigation-button","aria-label":"Ir para o início da conversa",title:"Ir para o início da conversa",onClick:Ue},[...Qe[3]||(Qe[3]=[e$b.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none"},[e$b.createElementVNode("path",{d:"m6.75 14.25 5.25-5.25 5.25 5.25"})],-1)])])):e$b.createCommentVNode("",!0),Re.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:"bottom",type:"button",class:"history-navigation-button","aria-label":"Ir para as mensagens mais recentes",title:"Ir para as mensagens mais recentes",onClick:Xe},[...Qe[4]||(Qe[4]=[e$b.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none"},[e$b.createElementVNode("path",{d:"m6.75 9.75 5.25 5.25 5.25-5.25"})],-1)])])):e$b.createCommentVNode("",!0)]),_:1})]))}},_hoisted_1$o=["aria-label"],_hoisted_2$m={key:0,class:"size-4 translate-x-px","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_3$j={key:1,class:"size-4","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_4$i={class:"apb-body"},_hoisted_5$g={class:"apb-head"},_hoisted_6$d={class:"apb-title"},_hoisted_7$c={class:"apb-time"},_hoisted_8$9={class:"apb-wave-slot"},_hoisted_9$7={key:0,class:"apb-equalizer","aria-hidden":"true"},_hoisted_10$7=["aria-label"],BAR_COUNT=28,_sfc_main$r={__name:"AudioPlaybackBar",props:{variant:{type:String,default:"inline",validator:ee=>["inline","floating"].includes(ee)},waveHeight:{type:Number,default:26}},emits:["open"],setup(ee,{emit:te}){const ne=te,ae=ee,re=useAudioPlaybackStore(),oe=e$b.ref(null),ie=e$b.ref(null),le=e$b.ref(!1);let ce=null,de=null,ue=null;const be=e$b.computed(()=>{var $e;return(($e=re.meta)==null?void 0:$e.title)||"Áudio"}),fe=e$b.computed(()=>me(re.currentTime)),ge=e$b.computed(()=>me(re.duration));function me($e){if(!$e||Number.isNaN($e))return"0:00";const ye=Math.floor($e/60),Ee=Math.floor($e%60);return`${ye}:${String(Ee).padStart(2,"0")}`}function pe($e){return{animationDelay:`-${(1.2-$e%8*.1).toFixed(2)}s`}}function ke(){var ye;const $e=re.rate>=2?1:+(re.rate+.5).toFixed(1);re.setRate($e),(ye=ce==null?void 0:ce.setPlaybackRate)==null||ye.call(ce,$e)}function ve(){var $e,ye;detachSharedMedia(ce,de,re);try{($e=ce==null?void 0:ce.unAll)==null||$e.call(ce)}catch{}try{(ye=ce==null?void 0:ce.destroy)==null||ye.call(ce)}catch{}ce=null,de=null}async function _e(){if(ve(),le.value=!1,await e$b.nextTick(),!ie.value)return;const $e=re.activeElement();if(!$e)return;const ye=readWaveColors(oe.value);ce=w$5.create({container:ie.value,media:new Audio,waveColor:ye.wave,progressColor:ye.progress,cursorColor:ye.cursor,cursorWidth:10,height:ae.waveHeight,barWidth:2,barRadius:2,barHeight:.9,barGap:2,hideScrollbar:!0});const Ee=ce,Se=re.activePeaks(),Le=re.activeSrc();try{Se?await ce.load(Le,Se.peaks,Se.duration):await ce.load(Le)}catch(Ae){console.error("Falha ao desenhar a onda do mini player:",Ae)}ce===Ee&&(de=$e,attachSharedMedia(ce,de,{rate:re.rate}),le.value=!0)}return e$b.watch(()=>re.isFloating&&re.trackId,$e=>{if(!$e){ve(),le.value=!1;return}_e()},{immediate:!0}),e$b.watch(oe,$e=>{if(ue==null||ue.disconnect(),ue=null,!$e||typeof ResizeObserver>"u")return;let ye=$e.clientWidth;ue=new ResizeObserver(()=>{!ce||Math.abs($e.clientWidth-ye)<8||(ye=$e.clientWidth,_e())}),ue.observe($e)}),e$b.onBeforeUnmount(()=>{ue==null||ue.disconnect(),ue=null,ve()}),($e,ye)=>(e$b.openBlock(),e$b.createBlock(e$b.Transition,{name:ee.variant==="floating"?"apb-float":"apb"},{default:e$b.withCtx(()=>[e$b.unref(re).isFloating?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"rootEl",ref:oe,class:e$b.normalizeClass(["apb-root",`apb-${ee.variant}`])},[e$b.createElementVNode("button",{type:"button",class:"apb-play","aria-label":e$b.unref(re).isPlaying?"Pausar":"Tocar",onClick:ye[0]||(ye[0]=Ee=>e$b.unref(re).toggle())},[e$b.unref(re).isPlaying?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$j,[...ye[4]||(ye[4]=[e$b.createElementVNode("path",{d:"M8 5h3v14H8V5Zm5 0h3v14h-3V5Z"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$m,[...ye[3]||(ye[3]=[e$b.createElementVNode("path",{d:"M8.6 5.2A1 1 0 0 0 7 6v12a1 1 0 0 0 1.6.8l8-6a1 1 0 0 0 0-1.6l-8-6Z"},null,-1)])]))],8,_hoisted_1$o),e$b.createElementVNode("div",_hoisted_4$i,[e$b.createElementVNode("div",_hoisted_5$g,[e$b.createElementVNode("button",{type:"button",class:"apb-info",title:"Ir para a mensagem",onClick:ye[1]||(ye[1]=Ee=>ne("open",e$b.unref(re).meta))},[e$b.createElementVNode("span",_hoisted_6$d,e$b.toDisplayString(be.value),1)]),e$b.createElementVNode("span",_hoisted_7$c,e$b.toDisplayString(fe.value)+" / "+e$b.toDisplayString(ge.value),1)]),e$b.createElementVNode("div",_hoisted_8$9,[le.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$7,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(BAR_COUNT,Ee=>e$b.createElementVNode("span",{key:Ee,style:e$b.normalizeStyle(pe(Ee))},null,4)),64))])),e$b.withDirectives(e$b.createElementVNode("div",{ref_key:"waveEl",ref:ie,class:"apb-wave"},null,512),[[e$b.vShow,le.value]])])]),e$b.createElementVNode("button",{type:"button",class:"apb-rate","aria-label":`Velocidade ${e$b.unref(re).rate.toFixed(1)}x. Clique para mudar`,onClick:ke},e$b.toDisplayString(e$b.unref(re).rate.toFixed(1))+"x ",9,_hoisted_10$7),e$b.createElementVNode("button",{type:"button",class:"apb-close","aria-label":"Fechar",onClick:ye[2]||(ye[2]=Ee=>e$b.unref(re).clear())},[...ye[5]||(ye[5]=[e$b.createElementVNode("svg",{class:"size-4","aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e$b.createElementVNode("path",{"stroke-linecap":"round",d:"M6 6l12 12M18 6L6 18"})],-1)])])],2)):e$b.createCommentVNode("",!0)]),_:1},8,["name"]))}},AudioPlaybackBar=_export_sfc$1(_sfc_main$r,[["__scopeId","data-v-b40822ed"]]),_hoisted_1$n={class:"modal-head"},_hoisted_2$l={class:"modal_responsive"},_hoisted_3$i={class:"flex min-h-full items-center justify-center"},_hoisted_4$h={class:"modal-size w-full max-w-md"},_hoisted_5$f={class:"modal-background sidebar"},_hoisted_6$c={class:"modal-title items-center"},_hoisted_7$b={class:"flex items-center"},_hoisted_8$8={class:"pb-3"},_hoisted_9$6={class:"sidebar p-2 font-semibold lg:text-base"},_hoisted_10$6=["for"],_hoisted_11$6={class:"text-base"},_hoisted_12$5={class:"opacity-70"},_sfc_main$q={__name:"MessageListModal",setup(ee){const te=useMessageUiStore(),ne=e$b.computed(()=>te.list.message);return(ae,re)=>{var oe;return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$n,[re[3]||(re[3]=e$b.createElementVNode("div",{class:"modal-overlay"},null,-1)),e$b.createElementVNode("div",_hoisted_2$l,[e$b.createElementVNode("div",_hoisted_3$i,[e$b.createElementVNode("div",_hoisted_4$h,[e$b.createElementVNode("div",_hoisted_5$f,[e$b.createElementVNode("div",_hoisted_6$c,[re[2]||(re[2]=e$b.createElementVNode("div",{class:"flex items-center"},[e$b.createElementVNode("h3",{class:"text-base lg:text-xl"},"Lista")],-1)),e$b.createElementVNode("div",_hoisted_7$b,[e$b.createElementVNode("button",{type:"button","aria-label":"Fechar",class:"inline-flex items-center rounded-lg bg-transparent p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900",onClick:re[0]||(re[0]=ie=>e$b.unref(te).closeList())},[...re[1]||(re[1]=[e$b.createElementVNode("svg",{class:"size-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])])])]),e$b.createElementVNode("div",_hoisted_8$8,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(((oe=ne.value)==null?void 0:oe.sections)||[],(ie,le)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:le},[e$b.createElementVNode("p",_hoisted_9$6,e$b.toDisplayString(ie.title),1),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie.rows,ce=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ce.rowId,class:"hover:header flex items-center justify-between px-2 py-1"},[e$b.createElementVNode("label",{class:"mt-px w-full select-none",for:`${le}${ce.rowId}`},[e$b.createElementVNode("div",_hoisted_11$6,e$b.toDisplayString(ce.title),1),e$b.createElementVNode("p",_hoisted_12$5,e$b.toDisplayString(ce.description),1)],8,_hoisted_10$6)]))),128))]))),128))])])])])])])}}};var t={207:(ee,te,ne)=>{ee.exports=ne(452)},452:ee=>{var te=function(ne){var ae,re=Object.prototype,oe=re.hasOwnProperty,ie=typeof Symbol=="function"?Symbol:{},le=ie.iterator||"@@iterator",ce=ie.asyncIterator||"@@asyncIterator",de=ie.toStringTag||"@@toStringTag";function ue(Me,xe,Ce){return Object.defineProperty(Me,xe,{value:Ce,enumerable:!0,configurable:!0,writable:!0}),Me[xe]}try{ue({},"")}catch{ue=function(xe,Ce,Fe){return xe[Ce]=Fe}}function be(Me,xe,Ce,Fe){var Re=xe&&xe.prototype instanceof _e?xe:_e,qe=Object.create(Re.prototype),Ge=new Ne(Fe||[]);return qe._invoke=function(Ze,Xe,Ue){var at=ge;return function(Je,lt){if(at===pe)throw new Error("Generator is already running");if(at===ke){if(Je==="throw")throw lt;return Be()}for(Ue.method=Je,Ue.arg=lt;;){var it=Ue.delegate;if(it){var gt=Ie(it,Ue);if(gt){if(gt===ve)continue;return gt}}if(Ue.method==="next")Ue.sent=Ue._sent=Ue.arg;else if(Ue.method==="throw"){if(at===ge)throw at=ke,Ue.arg;Ue.dispatchException(Ue.arg)}else Ue.method==="return"&&Ue.abrupt("return",Ue.arg);at=pe;var Et=fe(Ze,Xe,Ue);if(Et.type==="normal"){if(at=Ue.done?ke:me,Et.arg===ve)continue;return{value:Et.arg,done:Ue.done}}Et.type==="throw"&&(at=ke,Ue.method="throw",Ue.arg=Et.arg)}}}(Me,Ce,Ge),qe}function fe(Me,xe,Ce){try{return{type:"normal",arg:Me.call(xe,Ce)}}catch(Fe){return{type:"throw",arg:Fe}}}ne.wrap=be;var ge="suspendedStart",me="suspendedYield",pe="executing",ke="completed",ve={};function _e(){}function $e(){}function ye(){}var Ee={};ue(Ee,le,function(){return this});var Se=Object.getPrototypeOf,Le=Se&&Se(Se(Pe([])));Le&&Le!==re&&oe.call(Le,le)&&(Ee=Le);var Ae=ye.prototype=_e.prototype=Object.create(Ee);function De(Me){["next","throw","return"].forEach(function(xe){ue(Me,xe,function(Ce){return this._invoke(xe,Ce)})})}function Oe(Me,xe){function Ce(Re,qe,Ge,Ze){var Xe=fe(Me[Re],Me,qe);if(Xe.type!=="throw"){var Ue=Xe.arg,at=Ue.value;return at&&typeof at=="object"&&oe.call(at,"__await")?xe.resolve(at.__await).then(function(Je){Ce("next",Je,Ge,Ze)},function(Je){Ce("throw",Je,Ge,Ze)}):xe.resolve(at).then(function(Je){Ue.value=Je,Ge(Ue)},function(Je){return Ce("throw",Je,Ge,Ze)})}Ze(Xe.arg)}var Fe;this._invoke=function(Re,qe){function Ge(){return new xe(function(Ze,Xe){Ce(Re,qe,Ze,Xe)})}return Fe=Fe?Fe.then(Ge,Ge):Ge()}}function Ie(Me,xe){var Ce=Me.iterator[xe.method];if(Ce===ae){if(xe.delegate=null,xe.method==="throw"){if(Me.iterator.return&&(xe.method="return",xe.arg=ae,Ie(Me,xe),xe.method==="throw"))return ve;xe.method="throw",xe.arg=new TypeError("The iterator does not provide a 'throw' method")}return ve}var Fe=fe(Ce,Me.iterator,xe.arg);if(Fe.type==="throw")return xe.method="throw",xe.arg=Fe.arg,xe.delegate=null,ve;var Re=Fe.arg;return Re?Re.done?(xe[Me.resultName]=Re.value,xe.next=Me.nextLoc,xe.method!=="return"&&(xe.method="next",xe.arg=ae),xe.delegate=null,ve):Re:(xe.method="throw",xe.arg=new TypeError("iterator result is not an object"),xe.delegate=null,ve)}function ze(Me){var xe={tryLoc:Me[0]};1 in Me&&(xe.catchLoc=Me[1]),2 in Me&&(xe.finallyLoc=Me[2],xe.afterLoc=Me[3]),this.tryEntries.push(xe)}function Ve(Me){var xe=Me.completion||{};xe.type="normal",delete xe.arg,Me.completion=xe}function Ne(Me){this.tryEntries=[{tryLoc:"root"}],Me.forEach(ze,this),this.reset(!0)}function Pe(Me){if(Me){var xe=Me[le];if(xe)return xe.call(Me);if(typeof Me.next=="function")return Me;if(!isNaN(Me.length)){var Ce=-1,Fe=function Re(){for(;++Ce<Me.length;)if(oe.call(Me,Ce))return Re.value=Me[Ce],Re.done=!1,Re;return Re.value=ae,Re.done=!0,Re};return Fe.next=Fe}}return{next:Be}}function Be(){return{value:ae,done:!0}}return $e.prototype=ye,ue(Ae,"constructor",ye),ue(ye,"constructor",$e),$e.displayName=ue(ye,de,"GeneratorFunction"),ne.isGeneratorFunction=function(Me){var xe=typeof Me=="function"&&Me.constructor;return!!xe&&(xe===$e||(xe.displayName||xe.name)==="GeneratorFunction")},ne.mark=function(Me){return Object.setPrototypeOf?Object.setPrototypeOf(Me,ye):(Me.__proto__=ye,ue(Me,de,"GeneratorFunction")),Me.prototype=Object.create(Ae),Me},ne.awrap=function(Me){return{__await:Me}},De(Oe.prototype),ue(Oe.prototype,ce,function(){return this}),ne.AsyncIterator=Oe,ne.async=function(Me,xe,Ce,Fe,Re){Re===void 0&&(Re=Promise);var qe=new Oe(be(Me,xe,Ce,Fe),Re);return ne.isGeneratorFunction(xe)?qe:qe.next().then(function(Ge){return Ge.done?Ge.value:qe.next()})},De(Ae),ue(Ae,de,"Generator"),ue(Ae,le,function(){return this}),ue(Ae,"toString",function(){return"[object Generator]"}),ne.keys=function(Me){var xe=[];for(var Ce in Me)xe.push(Ce);return xe.reverse(),function Fe(){for(;xe.length;){var Re=xe.pop();if(Re in Me)return Fe.value=Re,Fe.done=!1,Fe}return Fe.done=!0,Fe}},ne.values=Pe,Ne.prototype={constructor:Ne,reset:function(Me){if(this.prev=0,this.next=0,this.sent=this._sent=ae,this.done=!1,this.delegate=null,this.method="next",this.arg=ae,this.tryEntries.forEach(Ve),!Me)for(var xe in this)xe.charAt(0)==="t"&&oe.call(this,xe)&&!isNaN(+xe.slice(1))&&(this[xe]=ae)},stop:function(){this.done=!0;var Me=this.tryEntries[0].completion;if(Me.type==="throw")throw Me.arg;return this.rval},dispatchException:function(Me){if(this.done)throw Me;var xe=this;function Ce(Xe,Ue){return qe.type="throw",qe.arg=Me,xe.next=Xe,Ue&&(xe.method="next",xe.arg=ae),!!Ue}for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Re=this.tryEntries[Fe],qe=Re.completion;if(Re.tryLoc==="root")return Ce("end");if(Re.tryLoc<=this.prev){var Ge=oe.call(Re,"catchLoc"),Ze=oe.call(Re,"finallyLoc");if(Ge&&Ze){if(this.prev<Re.catchLoc)return Ce(Re.catchLoc,!0);if(this.prev<Re.finallyLoc)return Ce(Re.finallyLoc)}else if(Ge){if(this.prev<Re.catchLoc)return Ce(Re.catchLoc,!0)}else{if(!Ze)throw new Error("try statement without catch or finally");if(this.prev<Re.finallyLoc)return Ce(Re.finallyLoc)}}}},abrupt:function(Me,xe){for(var Ce=this.tryEntries.length-1;Ce>=0;--Ce){var Fe=this.tryEntries[Ce];if(Fe.tryLoc<=this.prev&&oe.call(Fe,"finallyLoc")&&this.prev<Fe.finallyLoc){var Re=Fe;break}}Re&&(Me==="break"||Me==="continue")&&Re.tryLoc<=xe&&xe<=Re.finallyLoc&&(Re=null);var qe=Re?Re.completion:{};return qe.type=Me,qe.arg=xe,Re?(this.method="next",this.next=Re.finallyLoc,ve):this.complete(qe)},complete:function(Me,xe){if(Me.type==="throw")throw Me.arg;return Me.type==="break"||Me.type==="continue"?this.next=Me.arg:Me.type==="return"?(this.rval=this.arg=Me.arg,this.method="return",this.next="end"):Me.type==="normal"&&xe&&(this.next=xe),ve},finish:function(Me){for(var xe=this.tryEntries.length-1;xe>=0;--xe){var Ce=this.tryEntries[xe];if(Ce.finallyLoc===Me)return this.complete(Ce.completion,Ce.afterLoc),Ve(Ce),ve}},catch:function(Me){for(var xe=this.tryEntries.length-1;xe>=0;--xe){var Ce=this.tryEntries[xe];if(Ce.tryLoc===Me){var Fe=Ce.completion;if(Fe.type==="throw"){var Re=Fe.arg;Ve(Ce)}return Re}}throw new Error("illegal catch attempt")},delegateYield:function(Me,xe,Ce){return this.delegate={iterator:Pe(Me),resultName:xe,nextLoc:Ce},this.method==="next"&&(this.arg=ae),ve}},ne}(ee.exports);try{regeneratorRuntime=te}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=te:Function("r","regeneratorRuntime = r")(te)}}},n={};function r(ee){var te=n[ee];if(te!==void 0)return te.exports;var ne=n[ee]={exports:{}};return t[ee](ne,ne.exports,r),ne.exports}r.n=ee=>{var te=ee&&ee.__esModule?()=>ee.default:()=>ee;return r.d(te,{a:te}),te},r.d=(ee,te)=>{for(var ne in te)r.o(te,ne)&&!r.o(ee,ne)&&Object.defineProperty(ee,ne,{enumerable:!0,get:te[ne]})},r.o=(ee,te)=>Object.prototype.hasOwnProperty.call(ee,te);var o={};function a(ee,te){(te==null||te>ee.length)&&(te=ee.length);for(var ne=0,ae=new Array(te);ne<te;ne++)ae[ne]=ee[ne];return ae}function i(ee,te){if(ee){if(typeof ee=="string")return a(ee,te);var ne=Object.prototype.toString.call(ee).slice(8,-1);return ne==="Object"&&ee.constructor&&(ne=ee.constructor.name),ne==="Map"||ne==="Set"?Array.from(ee):ne==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne)?a(ee,te):void 0}}function c(ee){return function(te){if(Array.isArray(te))return a(te)}(ee)||function(te){if(typeof Symbol<"u"&&te[Symbol.iterator]!=null||te["@@iterator"]!=null)return Array.from(te)}(ee)||i(ee)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
281
|
+
*/(function(ee,te){(function(ne,ae){ae(te)})(commonjsGlobal,function(ne){var ae="1.9.4";function re(se){var he,we,Te,He;for(we=1,Te=arguments.length;we<Te;we++){He=arguments[we];for(he in He)se[he]=He[he]}return se}var oe=Object.create||function(){function se(){}return function(he){return se.prototype=he,new se}}();function ie(se,he){var we=Array.prototype.slice;if(se.bind)return se.bind.apply(se,we.call(arguments,1));var Te=we.call(arguments,2);return function(){return se.apply(he,Te.length?Te.concat(we.call(arguments)):arguments)}}var le=0;function ce(se){return"_leaflet_id"in se||(se._leaflet_id=++le),se._leaflet_id}function de(se,he,we){var Te,He,Ye,ot;return ot=function(){Te=!1,He&&(Ye.apply(we,He),He=!1)},Ye=function(){Te?He=arguments:(se.apply(we,arguments),setTimeout(ot,he),Te=!0)},Ye}function ue(se,he,we){var Te=he[1],He=he[0],Ye=Te-He;return se===Te&&we?se:((se-He)%Ye+Ye)%Ye+He}function be(){return!1}function fe(se,he){if(he===!1)return se;var we=Math.pow(10,he===void 0?6:he);return Math.round(se*we)/we}function ge(se){return se.trim?se.trim():se.replace(/^\s+|\s+$/g,"")}function me(se){return ge(se).split(/\s+/)}function pe(se,he){Object.prototype.hasOwnProperty.call(se,"options")||(se.options=se.options?oe(se.options):{});for(var we in he)se.options[we]=he[we];return se.options}function ke(se,he,we){var Te=[];for(var He in se)Te.push(encodeURIComponent(we?He.toUpperCase():He)+"="+encodeURIComponent(se[He]));return(!he||he.indexOf("?")===-1?"?":"&")+Te.join("&")}var ve=/\{ *([\w_ -]+) *\}/g;function _e(se,he){return se.replace(ve,function(we,Te){var He=he[Te];if(He===void 0)throw new Error("No value provided for variable "+we);return typeof He=="function"&&(He=He(he)),He})}var $e=Array.isArray||function(se){return Object.prototype.toString.call(se)==="[object Array]"};function ye(se,he){for(var we=0;we<se.length;we++)if(se[we]===he)return we;return-1}var Ee="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Se(se){return window["webkit"+se]||window["moz"+se]||window["ms"+se]}var Le=0;function Ae(se){var he=+new Date,we=Math.max(0,16-(he-Le));return Le=he+we,window.setTimeout(se,we)}var De=window.requestAnimationFrame||Se("RequestAnimationFrame")||Ae,Oe=window.cancelAnimationFrame||Se("CancelAnimationFrame")||Se("CancelRequestAnimationFrame")||function(se){window.clearTimeout(se)};function Ie(se,he,we){if(we&&De===Ae)se.call(he);else return De.call(window,ie(se,he))}function ze(se){se&&Oe.call(window,se)}var Ve={__proto__:null,extend:re,create:oe,bind:ie,get lastId(){return le},stamp:ce,throttle:de,wrapNum:ue,falseFn:be,formatNum:fe,trim:ge,splitWords:me,setOptions:pe,getParamString:ke,template:_e,isArray:$e,indexOf:ye,emptyImageUrl:Ee,requestFn:De,cancelFn:Oe,requestAnimFrame:Ie,cancelAnimFrame:ze};function Ne(){}Ne.extend=function(se){var he=function(){pe(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},we=he.__super__=this.prototype,Te=oe(we);Te.constructor=he,he.prototype=Te;for(var He in this)Object.prototype.hasOwnProperty.call(this,He)&&He!=="prototype"&&He!=="__super__"&&(he[He]=this[He]);return se.statics&&re(he,se.statics),se.includes&&(Pe(se.includes),re.apply(null,[Te].concat(se.includes))),re(Te,se),delete Te.statics,delete Te.includes,Te.options&&(Te.options=we.options?oe(we.options):{},re(Te.options,se.options)),Te._initHooks=[],Te.callInitHooks=function(){if(!this._initHooksCalled){we.callInitHooks&&we.callInitHooks.call(this),this._initHooksCalled=!0;for(var Ye=0,ot=Te._initHooks.length;Ye<ot;Ye++)Te._initHooks[Ye].call(this)}},he},Ne.include=function(se){var he=this.prototype.options;return re(this.prototype,se),se.options&&(this.prototype.options=he,this.mergeOptions(se.options)),this},Ne.mergeOptions=function(se){return re(this.prototype.options,se),this},Ne.addInitHook=function(se){var he=Array.prototype.slice.call(arguments,1),we=typeof se=="function"?se:function(){this[se].apply(this,he)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(we),this};function Pe(se){if(!(typeof L>"u"||!L||!L.Mixin)){se=$e(se)?se:[se];for(var he=0;he<se.length;he++)se[he]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Be={on:function(se,he,we){if(typeof se=="object")for(var Te in se)this._on(Te,se[Te],he);else{se=me(se);for(var He=0,Ye=se.length;He<Ye;He++)this._on(se[He],he,we)}return this},off:function(se,he,we){if(!arguments.length)delete this._events;else if(typeof se=="object")for(var Te in se)this._off(Te,se[Te],he);else{se=me(se);for(var He=arguments.length===1,Ye=0,ot=se.length;Ye<ot;Ye++)He?this._off(se[Ye]):this._off(se[Ye],he,we)}return this},_on:function(se,he,we,Te){if(typeof he!="function"){console.warn("wrong listener type: "+typeof he);return}if(this._listens(se,he,we)===!1){we===this&&(we=void 0);var He={fn:he,ctx:we};Te&&(He.once=!0),this._events=this._events||{},this._events[se]=this._events[se]||[],this._events[se].push(He)}},_off:function(se,he,we){var Te,He,Ye;if(this._events&&(Te=this._events[se],!!Te)){if(arguments.length===1){if(this._firingCount)for(He=0,Ye=Te.length;He<Ye;He++)Te[He].fn=be;delete this._events[se];return}if(typeof he!="function"){console.warn("wrong listener type: "+typeof he);return}var ot=this._listens(se,he,we);if(ot!==!1){var vt=Te[ot];this._firingCount&&(vt.fn=be,this._events[se]=Te=Te.slice()),Te.splice(ot,1)}}},fire:function(se,he,we){if(!this.listens(se,we))return this;var Te=re({},he,{type:se,target:this,sourceTarget:he&&he.sourceTarget||this});if(this._events){var He=this._events[se];if(He){this._firingCount=this._firingCount+1||1;for(var Ye=0,ot=He.length;Ye<ot;Ye++){var vt=He[Ye],xt=vt.fn;vt.once&&this.off(se,xt,vt.ctx),xt.call(vt.ctx||this,Te)}this._firingCount--}}return we&&this._propagateEvent(Te),this},listens:function(se,he,we,Te){typeof se!="string"&&console.warn('"string" type argument expected');var He=he;typeof he!="function"&&(Te=!!he,He=void 0,we=void 0);var Ye=this._events&&this._events[se];if(Ye&&Ye.length&&this._listens(se,He,we)!==!1)return!0;if(Te){for(var ot in this._eventParents)if(this._eventParents[ot].listens(se,he,we,Te))return!0}return!1},_listens:function(se,he,we){if(!this._events)return!1;var Te=this._events[se]||[];if(!he)return!!Te.length;we===this&&(we=void 0);for(var He=0,Ye=Te.length;He<Ye;He++)if(Te[He].fn===he&&Te[He].ctx===we)return He;return!1},once:function(se,he,we){if(typeof se=="object")for(var Te in se)this._on(Te,se[Te],he,!0);else{se=me(se);for(var He=0,Ye=se.length;He<Ye;He++)this._on(se[He],he,we,!0)}return this},addEventParent:function(se){return this._eventParents=this._eventParents||{},this._eventParents[ce(se)]=se,this},removeEventParent:function(se){return this._eventParents&&delete this._eventParents[ce(se)],this},_propagateEvent:function(se){for(var he in this._eventParents)this._eventParents[he].fire(se.type,re({layer:se.target,propagatedFrom:se.target},se),!0)}};Be.addEventListener=Be.on,Be.removeEventListener=Be.clearAllEventListeners=Be.off,Be.addOneTimeEventListener=Be.once,Be.fireEvent=Be.fire,Be.hasEventListeners=Be.listens;var Me=Ne.extend(Be);function xe(se,he,we){this.x=we?Math.round(se):se,this.y=we?Math.round(he):he}var Ce=Math.trunc||function(se){return se>0?Math.floor(se):Math.ceil(se)};xe.prototype={clone:function(){return new xe(this.x,this.y)},add:function(se){return this.clone()._add(Fe(se))},_add:function(se){return this.x+=se.x,this.y+=se.y,this},subtract:function(se){return this.clone()._subtract(Fe(se))},_subtract:function(se){return this.x-=se.x,this.y-=se.y,this},divideBy:function(se){return this.clone()._divideBy(se)},_divideBy:function(se){return this.x/=se,this.y/=se,this},multiplyBy:function(se){return this.clone()._multiplyBy(se)},_multiplyBy:function(se){return this.x*=se,this.y*=se,this},scaleBy:function(se){return new xe(this.x*se.x,this.y*se.y)},unscaleBy:function(se){return new xe(this.x/se.x,this.y/se.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Ce(this.x),this.y=Ce(this.y),this},distanceTo:function(se){se=Fe(se);var he=se.x-this.x,we=se.y-this.y;return Math.sqrt(he*he+we*we)},equals:function(se){return se=Fe(se),se.x===this.x&&se.y===this.y},contains:function(se){return se=Fe(se),Math.abs(se.x)<=Math.abs(this.x)&&Math.abs(se.y)<=Math.abs(this.y)},toString:function(){return"Point("+fe(this.x)+", "+fe(this.y)+")"}};function Fe(se,he,we){return se instanceof xe?se:$e(se)?new xe(se[0],se[1]):se==null?se:typeof se=="object"&&"x"in se&&"y"in se?new xe(se.x,se.y):new xe(se,he,we)}function Re(se,he){if(se)for(var we=he?[se,he]:se,Te=0,He=we.length;Te<He;Te++)this.extend(we[Te])}Re.prototype={extend:function(se){var he,we;if(!se)return this;if(se instanceof xe||typeof se[0]=="number"||"x"in se)he=we=Fe(se);else if(se=qe(se),he=se.min,we=se.max,!he||!we)return this;return!this.min&&!this.max?(this.min=he.clone(),this.max=we.clone()):(this.min.x=Math.min(he.x,this.min.x),this.max.x=Math.max(we.x,this.max.x),this.min.y=Math.min(he.y,this.min.y),this.max.y=Math.max(we.y,this.max.y)),this},getCenter:function(se){return Fe((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,se)},getBottomLeft:function(){return Fe(this.min.x,this.max.y)},getTopRight:function(){return Fe(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(se){var he,we;return typeof se[0]=="number"||se instanceof xe?se=Fe(se):se=qe(se),se instanceof Re?(he=se.min,we=se.max):he=we=se,he.x>=this.min.x&&we.x<=this.max.x&&he.y>=this.min.y&&we.y<=this.max.y},intersects:function(se){se=qe(se);var he=this.min,we=this.max,Te=se.min,He=se.max,Ye=He.x>=he.x&&Te.x<=we.x,ot=He.y>=he.y&&Te.y<=we.y;return Ye&&ot},overlaps:function(se){se=qe(se);var he=this.min,we=this.max,Te=se.min,He=se.max,Ye=He.x>he.x&&Te.x<we.x,ot=He.y>he.y&&Te.y<we.y;return Ye&&ot},isValid:function(){return!!(this.min&&this.max)},pad:function(se){var he=this.min,we=this.max,Te=Math.abs(he.x-we.x)*se,He=Math.abs(he.y-we.y)*se;return qe(Fe(he.x-Te,he.y-He),Fe(we.x+Te,we.y+He))},equals:function(se){return se?(se=qe(se),this.min.equals(se.getTopLeft())&&this.max.equals(se.getBottomRight())):!1}};function qe(se,he){return!se||se instanceof Re?se:new Re(se,he)}function Ge(se,he){if(se)for(var we=he?[se,he]:se,Te=0,He=we.length;Te<He;Te++)this.extend(we[Te])}Ge.prototype={extend:function(se){var he=this._southWest,we=this._northEast,Te,He;if(se instanceof Xe)Te=se,He=se;else if(se instanceof Ge){if(Te=se._southWest,He=se._northEast,!Te||!He)return this}else return se?this.extend(Ue(se)||Ze(se)):this;return!he&&!we?(this._southWest=new Xe(Te.lat,Te.lng),this._northEast=new Xe(He.lat,He.lng)):(he.lat=Math.min(Te.lat,he.lat),he.lng=Math.min(Te.lng,he.lng),we.lat=Math.max(He.lat,we.lat),we.lng=Math.max(He.lng,we.lng)),this},pad:function(se){var he=this._southWest,we=this._northEast,Te=Math.abs(he.lat-we.lat)*se,He=Math.abs(he.lng-we.lng)*se;return new Ge(new Xe(he.lat-Te,he.lng-He),new Xe(we.lat+Te,we.lng+He))},getCenter:function(){return new Xe((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Xe(this.getNorth(),this.getWest())},getSouthEast:function(){return new Xe(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(se){typeof se[0]=="number"||se instanceof Xe||"lat"in se?se=Ue(se):se=Ze(se);var he=this._southWest,we=this._northEast,Te,He;return se instanceof Ge?(Te=se.getSouthWest(),He=se.getNorthEast()):Te=He=se,Te.lat>=he.lat&&He.lat<=we.lat&&Te.lng>=he.lng&&He.lng<=we.lng},intersects:function(se){se=Ze(se);var he=this._southWest,we=this._northEast,Te=se.getSouthWest(),He=se.getNorthEast(),Ye=He.lat>=he.lat&&Te.lat<=we.lat,ot=He.lng>=he.lng&&Te.lng<=we.lng;return Ye&&ot},overlaps:function(se){se=Ze(se);var he=this._southWest,we=this._northEast,Te=se.getSouthWest(),He=se.getNorthEast(),Ye=He.lat>he.lat&&Te.lat<we.lat,ot=He.lng>he.lng&&Te.lng<we.lng;return Ye&&ot},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(se,he){return se?(se=Ze(se),this._southWest.equals(se.getSouthWest(),he)&&this._northEast.equals(se.getNorthEast(),he)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Ze(se,he){return se instanceof Ge?se:new Ge(se,he)}function Xe(se,he,we){if(isNaN(se)||isNaN(he))throw new Error("Invalid LatLng object: ("+se+", "+he+")");this.lat=+se,this.lng=+he,we!==void 0&&(this.alt=+we)}Xe.prototype={equals:function(se,he){if(!se)return!1;se=Ue(se);var we=Math.max(Math.abs(this.lat-se.lat),Math.abs(this.lng-se.lng));return we<=(he===void 0?1e-9:he)},toString:function(se){return"LatLng("+fe(this.lat,se)+", "+fe(this.lng,se)+")"},distanceTo:function(se){return Je.distance(this,Ue(se))},wrap:function(){return Je.wrapLatLng(this)},toBounds:function(se){var he=180*se/40075017,we=he/Math.cos(Math.PI/180*this.lat);return Ze([this.lat-he,this.lng-we],[this.lat+he,this.lng+we])},clone:function(){return new Xe(this.lat,this.lng,this.alt)}};function Ue(se,he,we){return se instanceof Xe?se:$e(se)&&typeof se[0]!="object"?se.length===3?new Xe(se[0],se[1],se[2]):se.length===2?new Xe(se[0],se[1]):null:se==null?se:typeof se=="object"&&"lat"in se?new Xe(se.lat,"lng"in se?se.lng:se.lon,se.alt):he===void 0?null:new Xe(se,he,we)}var at={latLngToPoint:function(se,he){var we=this.projection.project(se),Te=this.scale(he);return this.transformation._transform(we,Te)},pointToLatLng:function(se,he){var we=this.scale(he),Te=this.transformation.untransform(se,we);return this.projection.unproject(Te)},project:function(se){return this.projection.project(se)},unproject:function(se){return this.projection.unproject(se)},scale:function(se){return 256*Math.pow(2,se)},zoom:function(se){return Math.log(se/256)/Math.LN2},getProjectedBounds:function(se){if(this.infinite)return null;var he=this.projection.bounds,we=this.scale(se),Te=this.transformation.transform(he.min,we),He=this.transformation.transform(he.max,we);return new Re(Te,He)},infinite:!1,wrapLatLng:function(se){var he=this.wrapLng?ue(se.lng,this.wrapLng,!0):se.lng,we=this.wrapLat?ue(se.lat,this.wrapLat,!0):se.lat,Te=se.alt;return new Xe(we,he,Te)},wrapLatLngBounds:function(se){var he=se.getCenter(),we=this.wrapLatLng(he),Te=he.lat-we.lat,He=he.lng-we.lng;if(Te===0&&He===0)return se;var Ye=se.getSouthWest(),ot=se.getNorthEast(),vt=new Xe(Ye.lat-Te,Ye.lng-He),xt=new Xe(ot.lat-Te,ot.lng-He);return new Ge(vt,xt)}},Je=re({},at,{wrapLng:[-180,180],R:6371e3,distance:function(se,he){var we=Math.PI/180,Te=se.lat*we,He=he.lat*we,Ye=Math.sin((he.lat-se.lat)*we/2),ot=Math.sin((he.lng-se.lng)*we/2),vt=Ye*Ye+Math.cos(Te)*Math.cos(He)*ot*ot,xt=2*Math.atan2(Math.sqrt(vt),Math.sqrt(1-vt));return this.R*xt}}),lt=6378137,it={R:lt,MAX_LATITUDE:85.0511287798,project:function(se){var he=Math.PI/180,we=this.MAX_LATITUDE,Te=Math.max(Math.min(we,se.lat),-we),He=Math.sin(Te*he);return new xe(this.R*se.lng*he,this.R*Math.log((1+He)/(1-He))/2)},unproject:function(se){var he=180/Math.PI;return new Xe((2*Math.atan(Math.exp(se.y/this.R))-Math.PI/2)*he,se.x*he/this.R)},bounds:function(){var se=lt*Math.PI;return new Re([-se,-se],[se,se])}()};function gt(se,he,we,Te){if($e(se)){this._a=se[0],this._b=se[1],this._c=se[2],this._d=se[3];return}this._a=se,this._b=he,this._c=we,this._d=Te}gt.prototype={transform:function(se,he){return this._transform(se.clone(),he)},_transform:function(se,he){return he=he||1,se.x=he*(this._a*se.x+this._b),se.y=he*(this._c*se.y+this._d),se},untransform:function(se,he){return he=he||1,new xe((se.x/he-this._b)/this._a,(se.y/he-this._d)/this._c)}};function Et(se,he,we,Te){return new gt(se,he,we,Te)}var mt=re({},Je,{code:"EPSG:3857",projection:it,transformation:function(){var se=.5/(Math.PI*it.R);return Et(se,.5,-se,.5)}()}),je=re({},mt,{code:"EPSG:900913"});function Qe(se){return document.createElementNS("http://www.w3.org/2000/svg",se)}function ut(se,he){var we="",Te,He,Ye,ot,vt,xt;for(Te=0,Ye=se.length;Te<Ye;Te++){for(vt=se[Te],He=0,ot=vt.length;He<ot;He++)xt=vt[He],we+=(He?"L":"M")+xt.x+" "+xt.y;we+=he?Mt.svg?"z":"x":""}return we||"M0 0"}var dt=document.documentElement.style,pt="ActiveXObject"in window,tt=pt&&!document.addEventListener,We="msLaunchUri"in navigator&&!("documentMode"in document),Ke=Bt("webkit"),nt=Bt("android"),ht=Bt("android 2")||Bt("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ft=nt&&Bt("Google")&&st<537&&!("AudioNode"in window),yt=!!window.opera,wt=!We&&Bt("chrome"),Tt=Bt("gecko")&&!Ke&&!yt&&!pt,Dt=!wt&&Bt("safari"),Lt=Bt("phantom"),Gt="OTransition"in dt,Rt=navigator.platform.indexOf("Win")===0,Xt=pt&&"transition"in dt,It="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ht,et="MozPerspective"in dt,ct=!window.L_DISABLE_3D&&(Xt||It||et)&&!Gt&&!Lt,bt=typeof orientation<"u"||Bt("mobile"),_t=bt&&Ke,St=bt&&It,Ct=!window.PointerEvent&&window.MSPointerEvent,Nt=!!(window.PointerEvent||Ct),rt="ontouchstart"in window||!!window.TouchEvent,kt=!window.L_NO_TOUCH&&(rt||Nt),$t=bt&&yt,Pt=bt&&Tt,Ft=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ot=function(){var se=!1;try{var he=Object.defineProperty({},"passive",{get:function(){se=!0}});window.addEventListener("testPassiveEventSupport",be,he),window.removeEventListener("testPassiveEventSupport",be,he)}catch{}return se}(),Ht=function(){return!!document.createElement("canvas").getContext}(),Zt=!!(document.createElementNS&&Qe("svg").createSVGRect),an=!!Zt&&function(){var se=document.createElement("div");return se.innerHTML="<svg/>",(se.firstChild&&se.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),rn=!Zt&&function(){try{var se=document.createElement("div");se.innerHTML='<v:shape adj="1"/>';var he=se.firstChild;return he.style.behavior="url(#default#VML)",he&&typeof he.adj=="object"}catch{return!1}}(),on=navigator.platform.indexOf("Mac")===0,Vt=navigator.platform.indexOf("Linux")===0;function Bt(se){return navigator.userAgent.toLowerCase().indexOf(se)>=0}var Mt={ie:pt,ielt9:tt,edge:We,webkit:Ke,android:nt,android23:ht,androidStock:ft,opera:yt,chrome:wt,gecko:Tt,safari:Dt,phantom:Lt,opera12:Gt,win:Rt,ie3d:Xt,webkit3d:It,gecko3d:et,any3d:ct,mobile:bt,mobileWebkit:_t,mobileWebkit3d:St,msPointer:Ct,pointer:Nt,touch:kt,touchNative:rt,mobileOpera:$t,mobileGecko:Pt,retina:Ft,passiveEvents:Ot,canvas:Ht,svg:Zt,vml:rn,inlineSvg:an,mac:on,linux:Vt},Jt=Mt.msPointer?"MSPointerDown":"pointerdown",Yt=Mt.msPointer?"MSPointerMove":"pointermove",sn=Mt.msPointer?"MSPointerUp":"pointerup",pn=Mt.msPointer?"MSPointerCancel":"pointercancel",$n={touchstart:Jt,touchmove:Yt,touchend:sn,touchcancel:pn},Vn={touchstart:Na,touchmove:In,touchend:In,touchcancel:In},En={},Un=!1;function ca(se,he,we){return he==="touchstart"&&Ba(),Vn[he]?(we=Vn[he].bind(this,we),se.addEventListener($n[he],we,!1),we):(console.warn("wrong event specified:",he),be)}function Yn(se,he,we){if(!$n[he]){console.warn("wrong event specified:",he);return}se.removeEventListener($n[he],we,!1)}function Mn(se){En[se.pointerId]=se}function da(se){En[se.pointerId]&&(En[se.pointerId]=se)}function Xn(se){delete En[se.pointerId]}function Ba(){Un||(document.addEventListener(Jt,Mn,!0),document.addEventListener(Yt,da,!0),document.addEventListener(sn,Xn,!0),document.addEventListener(pn,Xn,!0),Un=!0)}function In(se,he){if(he.pointerType!==(he.MSPOINTER_TYPE_MOUSE||"mouse")){he.touches=[];for(var we in En)he.touches.push(En[we]);he.changedTouches=[he],se(he)}}function Na(se,he){he.MSPOINTER_TYPE_TOUCH&&he.pointerType===he.MSPOINTER_TYPE_TOUCH&&un(he),In(se,he)}function qr(se){var he={},we,Te;for(Te in se)we=se[Te],he[Te]=we&&we.bind?we.bind(se):we;return se=he,he.type="dblclick",he.detail=2,he.isTrusted=!1,he._simulated=!0,he}var Wr=200;function Ur(se,he){se.addEventListener("dblclick",he);var we=0,Te;function He(Ye){if(Ye.detail!==1){Te=Ye.detail;return}if(!(Ye.pointerType==="mouse"||Ye.sourceCapabilities&&!Ye.sourceCapabilities.firesTouchEvents)){var ot=or(Ye);if(!(ot.some(function(xt){return xt instanceof HTMLLabelElement&&xt.attributes.for})&&!ot.some(function(xt){return xt instanceof HTMLInputElement||xt instanceof HTMLSelectElement}))){var vt=Date.now();vt-we<=Wr?(Te++,Te===2&&he(qr(Ye))):Te=1,we=vt}}}return se.addEventListener("click",He),{dblclick:he,simDblclick:He}}function Yr(se,he){se.removeEventListener("dblclick",he.dblclick),se.removeEventListener("click",he.simDblclick)}var Va=ma(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Kn=ma(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),tr=Kn==="webkitTransition"||Kn==="OTransition"?Kn+"End":"transitionend";function nr(se){return typeof se=="string"?document.getElementById(se):se}function Jn(se,he){var we=se.style[he]||se.currentStyle&&se.currentStyle[he];if((!we||we==="auto")&&document.defaultView){var Te=document.defaultView.getComputedStyle(se,null);we=Te?Te[he]:null}return we==="auto"?null:we}function Qt(se,he,we){var Te=document.createElement(se);return Te.className=he||"",we&&we.appendChild(Te),Te}function tn(se){var he=se.parentNode;he&&he.removeChild(se)}function ua(se){for(;se.firstChild;)se.removeChild(se.firstChild)}function Rn(se){var he=se.parentNode;he&&he.lastChild!==se&&he.appendChild(se)}function On(se){var he=se.parentNode;he&&he.firstChild!==se&&he.insertBefore(se,he.firstChild)}function Ma(se,he){if(se.classList!==void 0)return se.classList.contains(he);var we=ha(se);return we.length>0&&new RegExp("(^|\\s)"+he+"(\\s|$)").test(we)}function Wt(se,he){if(se.classList!==void 0)for(var we=me(he),Te=0,He=we.length;Te<He;Te++)se.classList.add(we[Te]);else if(!Ma(se,he)){var Ye=ha(se);Aa(se,(Ye?Ye+" ":"")+he)}}function nn(se,he){se.classList!==void 0?se.classList.remove(he):Aa(se,ge((" "+ha(se)+" ").replace(" "+he+" "," ")))}function Aa(se,he){se.className.baseVal===void 0?se.className=he:se.className.baseVal=he}function ha(se){return se.correspondingElement&&(se=se.correspondingElement),se.className.baseVal===void 0?se.className:se.className.baseVal}function bn(se,he){"opacity"in se.style?se.style.opacity=he:"filter"in se.style&&Xr(se,he)}function Xr(se,he){var we=!1,Te="DXImageTransform.Microsoft.Alpha";try{we=se.filters.item(Te)}catch{if(he===1)return}he=Math.round(he*100),we?(we.Enabled=he!==100,we.Opacity=he):se.style.filter+=" progid:"+Te+"(opacity="+he+")"}function ma(se){for(var he=document.documentElement.style,we=0;we<se.length;we++)if(se[we]in he)return se[we];return!1}function Pn(se,he,we){var Te=he||new xe(0,0);se.style[Va]=(Mt.ie3d?"translate("+Te.x+"px,"+Te.y+"px)":"translate3d("+Te.x+"px,"+Te.y+"px,0)")+(we?" scale("+we+")":"")}function ln(se,he){se._leaflet_pos=he,Mt.any3d?Pn(se,he):(se.style.left=he.x+"px",se.style.top=he.y+"px")}function Ln(se){return se._leaflet_pos||new xe(0,0)}var Qn,ea,Ta;if("onselectstart"in document)Qn=function(){qt(window,"selectstart",un)},ea=function(){en(window,"selectstart",un)};else{var ta=ma(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Qn=function(){if(ta){var se=document.documentElement.style;Ta=se[ta],se[ta]="none"}},ea=function(){ta&&(document.documentElement.style[ta]=Ta,Ta=void 0)}}function Pa(){qt(window,"dragstart",un)}function La(){en(window,"dragstart",un)}var fa,Fa;function Da(se){for(;se.tabIndex===-1;)se=se.parentNode;se.style&&(pa(),fa=se,Fa=se.style.outlineStyle,se.style.outlineStyle="none",qt(window,"keydown",pa))}function pa(){fa&&(fa.style.outlineStyle=Fa,fa=void 0,Fa=void 0,en(window,"keydown",pa))}function ar(se){do se=se.parentNode;while((!se.offsetWidth||!se.offsetHeight)&&se!==document.body);return se}function za(se){var he=se.getBoundingClientRect();return{x:he.width/se.offsetWidth||1,y:he.height/se.offsetHeight||1,boundingClientRect:he}}var Kr={__proto__:null,TRANSFORM:Va,TRANSITION:Kn,TRANSITION_END:tr,get:nr,getStyle:Jn,create:Qt,remove:tn,empty:ua,toFront:Rn,toBack:On,hasClass:Ma,addClass:Wt,removeClass:nn,setClass:Aa,getClass:ha,setOpacity:bn,testProp:ma,setTransform:Pn,setPosition:ln,getPosition:Ln,get disableTextSelection(){return Qn},get enableTextSelection(){return ea},disableImageDrag:Pa,enableImageDrag:La,preventOutline:Da,restoreOutline:pa,getSizedParentNode:ar,getScale:za};function qt(se,he,we,Te){if(he&&typeof he=="object")for(var He in he)Ra(se,He,he[He],we);else{he=me(he);for(var Ye=0,ot=he.length;Ye<ot;Ye++)Ra(se,he[Ye],we,Te)}return this}var _n="_leaflet_events";function en(se,he,we,Te){if(arguments.length===1)rr(se),delete se[_n];else if(he&&typeof he=="object")for(var He in he)Oa(se,He,he[He],we);else if(he=me(he),arguments.length===2)rr(se,function(vt){return ye(he,vt)!==-1});else for(var Ye=0,ot=he.length;Ye<ot;Ye++)Oa(se,he[Ye],we,Te);return this}function rr(se,he){for(var we in se[_n]){var Te=we.split(/\d/)[0];(!he||he(Te))&&Oa(se,Te,null,null,we)}}var Ia={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ra(se,he,we,Te){var He=he+ce(we)+(Te?"_"+ce(Te):"");if(se[_n]&&se[_n][He])return this;var Ye=function(vt){return we.call(Te||se,vt||window.event)},ot=Ye;!Mt.touchNative&&Mt.pointer&&he.indexOf("touch")===0?Ye=ca(se,he,Ye):Mt.touch&&he==="dblclick"?Ye=Ur(se,Ye):"addEventListener"in se?he==="touchstart"||he==="touchmove"||he==="wheel"||he==="mousewheel"?se.addEventListener(Ia[he]||he,Ye,Mt.passiveEvents?{passive:!1}:!1):he==="mouseenter"||he==="mouseleave"?(Ye=function(vt){vt=vt||window.event,ja(se,vt)&&ot(vt)},se.addEventListener(Ia[he],Ye,!1)):se.addEventListener(he,ot,!1):se.attachEvent("on"+he,Ye),se[_n]=se[_n]||{},se[_n][He]=Ye}function Oa(se,he,we,Te,He){He=He||he+ce(we)+(Te?"_"+ce(Te):"");var Ye=se[_n]&&se[_n][He];if(!Ye)return this;!Mt.touchNative&&Mt.pointer&&he.indexOf("touch")===0?Yn(se,he,Ye):Mt.touch&&he==="dblclick"?Yr(se,Ye):"removeEventListener"in se?se.removeEventListener(Ia[he]||he,Ye,!1):se.detachEvent("on"+he,Ye),se[_n][He]=null}function Fn(se){return se.stopPropagation?se.stopPropagation():se.originalEvent?se.originalEvent._stopped=!0:se.cancelBubble=!0,this}function Ha(se){return Ra(se,"wheel",Fn),this}function na(se){return qt(se,"mousedown touchstart dblclick contextmenu",Fn),se._leaflet_disable_click=!0,this}function un(se){return se.preventDefault?se.preventDefault():se.returnValue=!1,this}function Dn(se){return un(se),Fn(se),this}function or(se){if(se.composedPath)return se.composedPath();for(var he=[],we=se.target;we;)he.push(we),we=we.parentNode;return he}function ir(se,he){if(!he)return new xe(se.clientX,se.clientY);var we=za(he),Te=we.boundingClientRect;return new xe((se.clientX-Te.left)/we.x-he.clientLeft,(se.clientY-Te.top)/we.y-he.clientTop)}var Jr=Mt.linux&&Mt.chrome?window.devicePixelRatio:Mt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function sr(se){return Mt.edge?se.wheelDeltaY/2:se.deltaY&&se.deltaMode===0?-se.deltaY/Jr:se.deltaY&&se.deltaMode===1?-se.deltaY*20:se.deltaY&&se.deltaMode===2?-se.deltaY*60:se.deltaX||se.deltaZ?0:se.wheelDelta?(se.wheelDeltaY||se.wheelDelta)/2:se.detail&&Math.abs(se.detail)<32765?-se.detail*20:se.detail?se.detail/-32765*60:0}function ja(se,he){var we=he.relatedTarget;if(!we)return!0;try{for(;we&&we!==se;)we=we.parentNode}catch{return!1}return we!==se}var Qr={__proto__:null,on:qt,off:en,stopPropagation:Fn,disableScrollPropagation:Ha,disableClickPropagation:na,preventDefault:un,stop:Dn,getPropagationPath:or,getMousePosition:ir,getWheelDelta:sr,isExternalTarget:ja,addListener:qt,removeListener:en},lr=Me.extend({run:function(se,he,we,Te){this.stop(),this._el=se,this._inProgress=!0,this._duration=we||.25,this._easeOutPower=1/Math.max(Te||.5,.2),this._startPos=Ln(se),this._offset=he.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Ie(this._animate,this),this._step()},_step:function(se){var he=+new Date-this._startTime,we=this._duration*1e3;he<we?this._runFrame(this._easeOut(he/we),se):(this._runFrame(1),this._complete())},_runFrame:function(se,he){var we=this._startPos.add(this._offset.multiplyBy(se));he&&we._round(),ln(this._el,we),this.fire("step")},_complete:function(){ze(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(se){return 1-Math.pow(1-se,this._easeOutPower)}}),Kt=Me.extend({options:{crs:mt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(se,he){he=pe(this,he),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(se),this._initLayout(),this._onResize=ie(this._onResize,this),this._initEvents(),he.maxBounds&&this.setMaxBounds(he.maxBounds),he.zoom!==void 0&&(this._zoom=this._limitZoom(he.zoom)),he.center&&he.zoom!==void 0&&this.setView(Ue(he.center),he.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Kn&&Mt.any3d&&!Mt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),qt(this._proxy,tr,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(se,he,we){if(he=he===void 0?this._zoom:this._limitZoom(he),se=this._limitCenter(Ue(se),he,this.options.maxBounds),we=we||{},this._stop(),this._loaded&&!we.reset&&we!==!0){we.animate!==void 0&&(we.zoom=re({animate:we.animate},we.zoom),we.pan=re({animate:we.animate,duration:we.duration},we.pan));var Te=this._zoom!==he?this._tryAnimatedZoom&&this._tryAnimatedZoom(se,he,we.zoom):this._tryAnimatedPan(se,we.pan);if(Te)return clearTimeout(this._sizeTimer),this}return this._resetView(se,he,we.pan&&we.pan.noMoveStart),this},setZoom:function(se,he){return this._loaded?this.setView(this.getCenter(),se,{zoom:he}):(this._zoom=se,this)},zoomIn:function(se,he){return se=se||(Mt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+se,he)},zoomOut:function(se,he){return se=se||(Mt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-se,he)},setZoomAround:function(se,he,we){var Te=this.getZoomScale(he),He=this.getSize().divideBy(2),Ye=se instanceof xe?se:this.latLngToContainerPoint(se),ot=Ye.subtract(He).multiplyBy(1-1/Te),vt=this.containerPointToLatLng(He.add(ot));return this.setView(vt,he,{zoom:we})},_getBoundsCenterZoom:function(se,he){he=he||{},se=se.getBounds?se.getBounds():Ze(se);var we=Fe(he.paddingTopLeft||he.padding||[0,0]),Te=Fe(he.paddingBottomRight||he.padding||[0,0]),He=this.getBoundsZoom(se,!1,we.add(Te));if(He=typeof he.maxZoom=="number"?Math.min(he.maxZoom,He):He,He===1/0)return{center:se.getCenter(),zoom:He};var Ye=Te.subtract(we).divideBy(2),ot=this.project(se.getSouthWest(),He),vt=this.project(se.getNorthEast(),He),xt=this.unproject(ot.add(vt).divideBy(2).add(Ye),He);return{center:xt,zoom:He}},fitBounds:function(se,he){if(se=Ze(se),!se.isValid())throw new Error("Bounds are not valid.");var we=this._getBoundsCenterZoom(se,he);return this.setView(we.center,we.zoom,he)},fitWorld:function(se){return this.fitBounds([[-90,-180],[90,180]],se)},panTo:function(se,he){return this.setView(se,this._zoom,{pan:he})},panBy:function(se,he){if(se=Fe(se).round(),he=he||{},!se.x&&!se.y)return this.fire("moveend");if(he.animate!==!0&&!this.getSize().contains(se))return this._resetView(this.unproject(this.project(this.getCenter()).add(se)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new lr,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),he.noMoveStart||this.fire("movestart"),he.animate!==!1){Wt(this._mapPane,"leaflet-pan-anim");var we=this._getMapPanePos().subtract(se).round();this._panAnim.run(this._mapPane,we,he.duration||.25,he.easeLinearity)}else this._rawPanBy(se),this.fire("move").fire("moveend");return this},flyTo:function(se,he,we){if(we=we||{},we.animate===!1||!Mt.any3d)return this.setView(se,he,we);this._stop();var Te=this.project(this.getCenter()),He=this.project(se),Ye=this.getSize(),ot=this._zoom;se=Ue(se),he=he===void 0?ot:he;var vt=Math.max(Ye.x,Ye.y),xt=vt*this.getZoomScale(ot,he),At=He.distanceTo(Te)||1,zt=1.42,jt=zt*zt;function Ut(cn){var Sa=cn?-1:1,Ho=cn?xt:vt,jo=xt*xt-vt*vt+Sa*jt*jt*At*At,Go=2*Ho*jt*At,er=jo/Go,jr=Math.sqrt(er*er+1)-er,Zo=jr<1e-9?-18:Math.log(jr);return Zo}function mn(cn){return(Math.exp(cn)-Math.exp(-cn))/2}function dn(cn){return(Math.exp(cn)+Math.exp(-cn))/2}function gn(cn){return mn(cn)/dn(cn)}var fn=Ut(0);function Wn(cn){return vt*(dn(fn)/dn(fn+zt*cn))}function zo(cn){return vt*(dn(fn)*gn(fn+zt*cn)-mn(fn))/jt}function Io(cn){return 1-Math.pow(1-cn,1.5)}var Ro=Date.now(),Or=(Ut(1)-fn)/zt,Oo=we.duration?1e3*we.duration:1e3*Or*.8;function Hr(){var cn=(Date.now()-Ro)/Oo,Sa=Io(cn)*Or;cn<=1?(this._flyToFrame=Ie(Hr,this),this._move(this.unproject(Te.add(He.subtract(Te).multiplyBy(zo(Sa)/At)),ot),this.getScaleZoom(vt/Wn(Sa),ot),{flyTo:!0})):this._move(se,he)._moveEnd(!0)}return this._moveStart(!0,we.noMoveStart),Hr.call(this),this},flyToBounds:function(se,he){var we=this._getBoundsCenterZoom(se,he);return this.flyTo(we.center,we.zoom,he)},setMaxBounds:function(se){return se=Ze(se),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),se.isValid()?(this.options.maxBounds=se,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(se){var he=this.options.minZoom;return this.options.minZoom=se,this._loaded&&he!==se&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(se):this},setMaxZoom:function(se){var he=this.options.maxZoom;return this.options.maxZoom=se,this._loaded&&he!==se&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(se):this},panInsideBounds:function(se,he){this._enforcingBounds=!0;var we=this.getCenter(),Te=this._limitCenter(we,this._zoom,Ze(se));return we.equals(Te)||this.panTo(Te,he),this._enforcingBounds=!1,this},panInside:function(se,he){he=he||{};var we=Fe(he.paddingTopLeft||he.padding||[0,0]),Te=Fe(he.paddingBottomRight||he.padding||[0,0]),He=this.project(this.getCenter()),Ye=this.project(se),ot=this.getPixelBounds(),vt=qe([ot.min.add(we),ot.max.subtract(Te)]),xt=vt.getSize();if(!vt.contains(Ye)){this._enforcingBounds=!0;var At=Ye.subtract(vt.getCenter()),zt=vt.extend(Ye).getSize().subtract(xt);He.x+=At.x<0?-zt.x:zt.x,He.y+=At.y<0?-zt.y:zt.y,this.panTo(this.unproject(He),he),this._enforcingBounds=!1}return this},invalidateSize:function(se){if(!this._loaded)return this;se=re({animate:!1,pan:!0},se===!0?{animate:!0}:se);var he=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var we=this.getSize(),Te=he.divideBy(2).round(),He=we.divideBy(2).round(),Ye=Te.subtract(He);return!Ye.x&&!Ye.y?this:(se.animate&&se.pan?this.panBy(Ye):(se.pan&&this._rawPanBy(Ye),this.fire("move"),se.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(ie(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:he,newSize:we}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(se){if(se=this._locateOptions=re({timeout:1e4,watch:!1},se),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var he=ie(this._handleGeolocationResponse,this),we=ie(this._handleGeolocationError,this);return se.watch?this._locationWatchId=navigator.geolocation.watchPosition(he,we,se):navigator.geolocation.getCurrentPosition(he,we,se),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(se){if(this._container._leaflet_id){var he=se.code,we=se.message||(he===1?"permission denied":he===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:he,message:"Geolocation error: "+we+"."})}},_handleGeolocationResponse:function(se){if(this._container._leaflet_id){var he=se.coords.latitude,we=se.coords.longitude,Te=new Xe(he,we),He=Te.toBounds(se.coords.accuracy*2),Ye=this._locateOptions;if(Ye.setView){var ot=this.getBoundsZoom(He);this.setView(Te,Ye.maxZoom?Math.min(ot,Ye.maxZoom):ot)}var vt={latlng:Te,bounds:He,timestamp:se.timestamp};for(var xt in se.coords)typeof se.coords[xt]=="number"&&(vt[xt]=se.coords[xt]);this.fire("locationfound",vt)}},addHandler:function(se,he){if(!he)return this;var we=this[se]=new he(this);return this._handlers.push(we),this.options[se]&&we.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),tn(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ze(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var se;for(se in this._layers)this._layers[se].remove();for(se in this._panes)tn(this._panes[se]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(se,he){var we="leaflet-pane"+(se?" leaflet-"+se.replace("Pane","")+"-pane":""),Te=Qt("div",we,he||this._mapPane);return se&&(this._panes[se]=Te),Te},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var se=this.getPixelBounds(),he=this.unproject(se.getBottomLeft()),we=this.unproject(se.getTopRight());return new Ge(he,we)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(se,he,we){se=Ze(se),we=Fe(we||[0,0]);var Te=this.getZoom()||0,He=this.getMinZoom(),Ye=this.getMaxZoom(),ot=se.getNorthWest(),vt=se.getSouthEast(),xt=this.getSize().subtract(we),At=qe(this.project(vt,Te),this.project(ot,Te)).getSize(),zt=Mt.any3d?this.options.zoomSnap:1,jt=xt.x/At.x,Ut=xt.y/At.y,mn=he?Math.max(jt,Ut):Math.min(jt,Ut);return Te=this.getScaleZoom(mn,Te),zt&&(Te=Math.round(Te/(zt/100))*(zt/100),Te=he?Math.ceil(Te/zt)*zt:Math.floor(Te/zt)*zt),Math.max(He,Math.min(Ye,Te))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new xe(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(se,he){var we=this._getTopLeftPoint(se,he);return new Re(we,we.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(se){return this.options.crs.getProjectedBounds(se===void 0?this.getZoom():se)},getPane:function(se){return typeof se=="string"?this._panes[se]:se},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(se,he){var we=this.options.crs;return he=he===void 0?this._zoom:he,we.scale(se)/we.scale(he)},getScaleZoom:function(se,he){var we=this.options.crs;he=he===void 0?this._zoom:he;var Te=we.zoom(se*we.scale(he));return isNaN(Te)?1/0:Te},project:function(se,he){return he=he===void 0?this._zoom:he,this.options.crs.latLngToPoint(Ue(se),he)},unproject:function(se,he){return he=he===void 0?this._zoom:he,this.options.crs.pointToLatLng(Fe(se),he)},layerPointToLatLng:function(se){var he=Fe(se).add(this.getPixelOrigin());return this.unproject(he)},latLngToLayerPoint:function(se){var he=this.project(Ue(se))._round();return he._subtract(this.getPixelOrigin())},wrapLatLng:function(se){return this.options.crs.wrapLatLng(Ue(se))},wrapLatLngBounds:function(se){return this.options.crs.wrapLatLngBounds(Ze(se))},distance:function(se,he){return this.options.crs.distance(Ue(se),Ue(he))},containerPointToLayerPoint:function(se){return Fe(se).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(se){return Fe(se).add(this._getMapPanePos())},containerPointToLatLng:function(se){var he=this.containerPointToLayerPoint(Fe(se));return this.layerPointToLatLng(he)},latLngToContainerPoint:function(se){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Ue(se)))},mouseEventToContainerPoint:function(se){return ir(se,this._container)},mouseEventToLayerPoint:function(se){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(se))},mouseEventToLatLng:function(se){return this.layerPointToLatLng(this.mouseEventToLayerPoint(se))},_initContainer:function(se){var he=this._container=nr(se);if(he){if(he._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");qt(he,"scroll",this._onScroll,this),this._containerId=ce(he)},_initLayout:function(){var se=this._container;this._fadeAnimated=this.options.fadeAnimation&&Mt.any3d,Wt(se,"leaflet-container"+(Mt.touch?" leaflet-touch":"")+(Mt.retina?" leaflet-retina":"")+(Mt.ielt9?" leaflet-oldie":"")+(Mt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var he=Jn(se,"position");he!=="absolute"&&he!=="relative"&&he!=="fixed"&&he!=="sticky"&&(se.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var se=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ln(this._mapPane,new xe(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Wt(se.markerPane,"leaflet-zoom-hide"),Wt(se.shadowPane,"leaflet-zoom-hide"))},_resetView:function(se,he,we){ln(this._mapPane,new xe(0,0));var Te=!this._loaded;this._loaded=!0,he=this._limitZoom(he),this.fire("viewprereset");var He=this._zoom!==he;this._moveStart(He,we)._move(se,he)._moveEnd(He),this.fire("viewreset"),Te&&this.fire("load")},_moveStart:function(se,he){return se&&this.fire("zoomstart"),he||this.fire("movestart"),this},_move:function(se,he,we,Te){he===void 0&&(he=this._zoom);var He=this._zoom!==he;return this._zoom=he,this._lastCenter=se,this._pixelOrigin=this._getNewPixelOrigin(se),Te?we&&we.pinch&&this.fire("zoom",we):((He||we&&we.pinch)&&this.fire("zoom",we),this.fire("move",we)),this},_moveEnd:function(se){return se&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ze(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(se){ln(this._mapPane,this._getMapPanePos().subtract(se))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(se){this._targets={},this._targets[ce(this._container)]=this;var he=se?en:qt;he(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&he(window,"resize",this._onResize,this),Mt.any3d&&this.options.transform3DLimit&&(se?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ze(this._resizeRequest),this._resizeRequest=Ie(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var se=this._getMapPanePos();Math.max(Math.abs(se.x),Math.abs(se.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(se,he){for(var we=[],Te,He=he==="mouseout"||he==="mouseover",Ye=se.target||se.srcElement,ot=!1;Ye;){if(Te=this._targets[ce(Ye)],Te&&(he==="click"||he==="preclick")&&this._draggableMoved(Te)){ot=!0;break}if(Te&&Te.listens(he,!0)&&(He&&!ja(Ye,se)||(we.push(Te),He))||Ye===this._container)break;Ye=Ye.parentNode}return!we.length&&!ot&&!He&&this.listens(he,!0)&&(we=[this]),we},_isClickDisabled:function(se){for(;se&&se!==this._container;){if(se._leaflet_disable_click)return!0;se=se.parentNode}},_handleDOMEvent:function(se){var he=se.target||se.srcElement;if(!(!this._loaded||he._leaflet_disable_events||se.type==="click"&&this._isClickDisabled(he))){var we=se.type;we==="mousedown"&&Da(he),this._fireDOMEvent(se,we)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(se,he,we){if(se.type==="click"){var Te=re({},se);Te.type="preclick",this._fireDOMEvent(Te,Te.type,we)}var He=this._findEventTargets(se,he);if(we){for(var Ye=[],ot=0;ot<we.length;ot++)we[ot].listens(he,!0)&&Ye.push(we[ot]);He=Ye.concat(He)}if(He.length){he==="contextmenu"&&un(se);var vt=He[0],xt={originalEvent:se};if(se.type!=="keypress"&&se.type!=="keydown"&&se.type!=="keyup"){var At=vt.getLatLng&&(!vt._radius||vt._radius<=10);xt.containerPoint=At?this.latLngToContainerPoint(vt.getLatLng()):this.mouseEventToContainerPoint(se),xt.layerPoint=this.containerPointToLayerPoint(xt.containerPoint),xt.latlng=At?vt.getLatLng():this.layerPointToLatLng(xt.layerPoint)}for(ot=0;ot<He.length;ot++)if(He[ot].fire(he,xt,!0),xt.originalEvent._stopped||He[ot].options.bubblingMouseEvents===!1&&ye(this._mouseEvents,he)!==-1)return}},_draggableMoved:function(se){return se=se.dragging&&se.dragging.enabled()?se:this,se.dragging&&se.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var se=0,he=this._handlers.length;se<he;se++)this._handlers[se].disable()},whenReady:function(se,he){return this._loaded?se.call(he||this,{target:this}):this.on("load",se,he),this},_getMapPanePos:function(){return Ln(this._mapPane)||new xe(0,0)},_moved:function(){var se=this._getMapPanePos();return se&&!se.equals([0,0])},_getTopLeftPoint:function(se,he){var we=se&&he!==void 0?this._getNewPixelOrigin(se,he):this.getPixelOrigin();return we.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(se,he){var we=this.getSize()._divideBy(2);return this.project(se,he)._subtract(we)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(se,he,we){var Te=this._getNewPixelOrigin(we,he);return this.project(se,he)._subtract(Te)},_latLngBoundsToNewLayerBounds:function(se,he,we){var Te=this._getNewPixelOrigin(we,he);return qe([this.project(se.getSouthWest(),he)._subtract(Te),this.project(se.getNorthWest(),he)._subtract(Te),this.project(se.getSouthEast(),he)._subtract(Te),this.project(se.getNorthEast(),he)._subtract(Te)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(se){return this.latLngToLayerPoint(se).subtract(this._getCenterLayerPoint())},_limitCenter:function(se,he,we){if(!we)return se;var Te=this.project(se,he),He=this.getSize().divideBy(2),Ye=new Re(Te.subtract(He),Te.add(He)),ot=this._getBoundsOffset(Ye,we,he);return Math.abs(ot.x)<=1&&Math.abs(ot.y)<=1?se:this.unproject(Te.add(ot),he)},_limitOffset:function(se,he){if(!he)return se;var we=this.getPixelBounds(),Te=new Re(we.min.add(se),we.max.add(se));return se.add(this._getBoundsOffset(Te,he))},_getBoundsOffset:function(se,he,we){var Te=qe(this.project(he.getNorthEast(),we),this.project(he.getSouthWest(),we)),He=Te.min.subtract(se.min),Ye=Te.max.subtract(se.max),ot=this._rebound(He.x,-Ye.x),vt=this._rebound(He.y,-Ye.y);return new xe(ot,vt)},_rebound:function(se,he){return se+he>0?Math.round(se-he)/2:Math.max(0,Math.ceil(se))-Math.max(0,Math.floor(he))},_limitZoom:function(se){var he=this.getMinZoom(),we=this.getMaxZoom(),Te=Mt.any3d?this.options.zoomSnap:1;return Te&&(se=Math.round(se/Te)*Te),Math.max(he,Math.min(we,se))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){nn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(se,he){var we=this._getCenterOffset(se)._trunc();return(he&&he.animate)!==!0&&!this.getSize().contains(we)?!1:(this.panBy(we,he),!0)},_createAnimProxy:function(){var se=this._proxy=Qt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(se),this.on("zoomanim",function(he){var we=Va,Te=this._proxy.style[we];Pn(this._proxy,this.project(he.center,he.zoom),this.getZoomScale(he.zoom,1)),Te===this._proxy.style[we]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){tn(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var se=this.getCenter(),he=this.getZoom();Pn(this._proxy,this.project(se,he),this.getZoomScale(he,1))},_catchTransitionEnd:function(se){this._animatingZoom&&se.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(se,he,we){if(this._animatingZoom)return!0;if(we=we||{},!this._zoomAnimated||we.animate===!1||this._nothingToAnimate()||Math.abs(he-this._zoom)>this.options.zoomAnimationThreshold)return!1;var Te=this.getZoomScale(he),He=this._getCenterOffset(se)._divideBy(1-1/Te);return we.animate!==!0&&!this.getSize().contains(He)?!1:(Ie(function(){this._moveStart(!0,we.noMoveStart||!1)._animateZoom(se,he,!0)},this),!0)},_animateZoom:function(se,he,we,Te){this._mapPane&&(we&&(this._animatingZoom=!0,this._animateToCenter=se,this._animateToZoom=he,Wt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:se,zoom:he,noUpdate:Te}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(ie(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&nn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function eo(se,he){return new Kt(se,he)}var yn=Ne.extend({options:{position:"topright"},initialize:function(se){pe(this,se)},getPosition:function(){return this.options.position},setPosition:function(se){var he=this._map;return he&&he.removeControl(this),this.options.position=se,he&&he.addControl(this),this},getContainer:function(){return this._container},addTo:function(se){this.remove(),this._map=se;var he=this._container=this.onAdd(se),we=this.getPosition(),Te=se._controlCorners[we];return Wt(he,"leaflet-control"),we.indexOf("bottom")!==-1?Te.insertBefore(he,Te.firstChild):Te.appendChild(he),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(tn(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(se){this._map&&se&&se.screenX>0&&se.screenY>0&&this._map.getContainer().focus()}}),aa=function(se){return new yn(se)};Kt.include({addControl:function(se){return se.addTo(this),this},removeControl:function(se){return se.remove(),this},_initControlPos:function(){var se=this._controlCorners={},he="leaflet-",we=this._controlContainer=Qt("div",he+"control-container",this._container);function Te(He,Ye){var ot=he+He+" "+he+Ye;se[He+Ye]=Qt("div",ot,we)}Te("top","left"),Te("top","right"),Te("bottom","left"),Te("bottom","right")},_clearControlPos:function(){for(var se in this._controlCorners)tn(this._controlCorners[se]);tn(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var cr=yn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(se,he,we,Te){return we<Te?-1:Te<we?1:0}},initialize:function(se,he,we){pe(this,we),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var Te in se)this._addLayer(se[Te],Te);for(Te in he)this._addLayer(he[Te],Te,!0)},onAdd:function(se){this._initLayout(),this._update(),this._map=se,se.on("zoomend",this._checkDisabledLayers,this);for(var he=0;he<this._layers.length;he++)this._layers[he].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(se){return yn.prototype.addTo.call(this,se),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var se=0;se<this._layers.length;se++)this._layers[se].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(se,he){return this._addLayer(se,he),this._map?this._update():this},addOverlay:function(se,he){return this._addLayer(se,he,!0),this._map?this._update():this},removeLayer:function(se){se.off("add remove",this._onLayerChange,this);var he=this._getLayer(ce(se));return he&&this._layers.splice(this._layers.indexOf(he),1),this._map?this._update():this},expand:function(){Wt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var se=this._map.getSize().y-(this._container.offsetTop+50);return se<this._section.clientHeight?(Wt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=se+"px"):nn(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return nn(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var se="leaflet-control-layers",he=this._container=Qt("div",se),we=this.options.collapsed;he.setAttribute("aria-haspopup",!0),na(he),Ha(he);var Te=this._section=Qt("section",se+"-list");we&&(this._map.on("click",this.collapse,this),qt(he,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var He=this._layersLink=Qt("a",se+"-toggle",he);He.href="#",He.title="Layers",He.setAttribute("role","button"),qt(He,{keydown:function(Ye){Ye.keyCode===13&&this._expandSafely()},click:function(Ye){un(Ye),this._expandSafely()}},this),we||this.expand(),this._baseLayersList=Qt("div",se+"-base",Te),this._separator=Qt("div",se+"-separator",Te),this._overlaysList=Qt("div",se+"-overlays",Te),he.appendChild(Te)},_getLayer:function(se){for(var he=0;he<this._layers.length;he++)if(this._layers[he]&&ce(this._layers[he].layer)===se)return this._layers[he]},_addLayer:function(se,he,we){this._map&&se.on("add remove",this._onLayerChange,this),this._layers.push({layer:se,name:he,overlay:we}),this.options.sortLayers&&this._layers.sort(ie(function(Te,He){return this.options.sortFunction(Te.layer,He.layer,Te.name,He.name)},this)),this.options.autoZIndex&&se.setZIndex&&(this._lastZIndex++,se.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ua(this._baseLayersList),ua(this._overlaysList),this._layerControlInputs=[];var se,he,we,Te,He=0;for(we=0;we<this._layers.length;we++)Te=this._layers[we],this._addItem(Te),he=he||Te.overlay,se=se||!Te.overlay,He+=Te.overlay?0:1;return this.options.hideSingleBase&&(se=se&&He>1,this._baseLayersList.style.display=se?"":"none"),this._separator.style.display=he&&se?"":"none",this},_onLayerChange:function(se){this._handlingClick||this._update();var he=this._getLayer(ce(se.target)),we=he.overlay?se.type==="add"?"overlayadd":"overlayremove":se.type==="add"?"baselayerchange":null;we&&this._map.fire(we,he)},_createRadioElement:function(se,he){var we='<input type="radio" class="leaflet-control-layers-selector" name="'+se+'"'+(he?' checked="checked"':"")+"/>",Te=document.createElement("div");return Te.innerHTML=we,Te.firstChild},_addItem:function(se){var he=document.createElement("label"),we=this._map.hasLayer(se.layer),Te;se.overlay?(Te=document.createElement("input"),Te.type="checkbox",Te.className="leaflet-control-layers-selector",Te.defaultChecked=we):Te=this._createRadioElement("leaflet-base-layers_"+ce(this),we),this._layerControlInputs.push(Te),Te.layerId=ce(se.layer),qt(Te,"click",this._onInputClick,this);var He=document.createElement("span");He.innerHTML=" "+se.name;var Ye=document.createElement("span");he.appendChild(Ye),Ye.appendChild(Te),Ye.appendChild(He);var ot=se.overlay?this._overlaysList:this._baseLayersList;return ot.appendChild(he),this._checkDisabledLayers(),he},_onInputClick:function(){if(!this._preventClick){var se=this._layerControlInputs,he,we,Te=[],He=[];this._handlingClick=!0;for(var Ye=se.length-1;Ye>=0;Ye--)he=se[Ye],we=this._getLayer(he.layerId).layer,he.checked?Te.push(we):he.checked||He.push(we);for(Ye=0;Ye<He.length;Ye++)this._map.hasLayer(He[Ye])&&this._map.removeLayer(He[Ye]);for(Ye=0;Ye<Te.length;Ye++)this._map.hasLayer(Te[Ye])||this._map.addLayer(Te[Ye]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var se=this._layerControlInputs,he,we,Te=this._map.getZoom(),He=se.length-1;He>=0;He--)he=se[He],we=this._getLayer(he.layerId).layer,he.disabled=we.options.minZoom!==void 0&&Te<we.options.minZoom||we.options.maxZoom!==void 0&&Te>we.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var se=this._section;this._preventClick=!0,qt(se,"click",un),this.expand();var he=this;setTimeout(function(){en(se,"click",un),he._preventClick=!1})}}),to=function(se,he,we){return new cr(se,he,we)},Ga=yn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(se){var he="leaflet-control-zoom",we=Qt("div",he+" leaflet-bar"),Te=this.options;return this._zoomInButton=this._createButton(Te.zoomInText,Te.zoomInTitle,he+"-in",we,this._zoomIn),this._zoomOutButton=this._createButton(Te.zoomOutText,Te.zoomOutTitle,he+"-out",we,this._zoomOut),this._updateDisabled(),se.on("zoomend zoomlevelschange",this._updateDisabled,this),we},onRemove:function(se){se.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(se){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(se.shiftKey?3:1))},_zoomOut:function(se){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(se.shiftKey?3:1))},_createButton:function(se,he,we,Te,He){var Ye=Qt("a",we,Te);return Ye.innerHTML=se,Ye.href="#",Ye.title=he,Ye.setAttribute("role","button"),Ye.setAttribute("aria-label",he),na(Ye),qt(Ye,"click",Dn),qt(Ye,"click",He,this),qt(Ye,"click",this._refocusOnMap,this),Ye},_updateDisabled:function(){var se=this._map,he="leaflet-disabled";nn(this._zoomInButton,he),nn(this._zoomOutButton,he),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||se._zoom===se.getMinZoom())&&(Wt(this._zoomOutButton,he),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||se._zoom===se.getMaxZoom())&&(Wt(this._zoomInButton,he),this._zoomInButton.setAttribute("aria-disabled","true"))}});Kt.mergeOptions({zoomControl:!0}),Kt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ga,this.addControl(this.zoomControl))});var no=function(se){return new Ga(se)},dr=yn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(se){var he="leaflet-control-scale",we=Qt("div",he),Te=this.options;return this._addScales(Te,he+"-line",we),se.on(Te.updateWhenIdle?"moveend":"move",this._update,this),se.whenReady(this._update,this),we},onRemove:function(se){se.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(se,he,we){se.metric&&(this._mScale=Qt("div",he,we)),se.imperial&&(this._iScale=Qt("div",he,we))},_update:function(){var se=this._map,he=se.getSize().y/2,we=se.distance(se.containerPointToLatLng([0,he]),se.containerPointToLatLng([this.options.maxWidth,he]));this._updateScales(we)},_updateScales:function(se){this.options.metric&&se&&this._updateMetric(se),this.options.imperial&&se&&this._updateImperial(se)},_updateMetric:function(se){var he=this._getRoundNum(se),we=he<1e3?he+" m":he/1e3+" km";this._updateScale(this._mScale,we,he/se)},_updateImperial:function(se){var he=se*3.2808399,we,Te,He;he>5280?(we=he/5280,Te=this._getRoundNum(we),this._updateScale(this._iScale,Te+" mi",Te/we)):(He=this._getRoundNum(he),this._updateScale(this._iScale,He+" ft",He/he))},_updateScale:function(se,he,we){se.style.width=Math.round(this.options.maxWidth*we)+"px",se.innerHTML=he},_getRoundNum:function(se){var he=Math.pow(10,(Math.floor(se)+"").length-1),we=se/he;return we=we>=10?10:we>=5?5:we>=3?3:we>=2?2:1,he*we}}),ao=function(se){return new dr(se)},ro='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Za=yn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Mt.inlineSvg?ro+" ":"")+"Leaflet</a>"},initialize:function(se){pe(this,se),this._attributions={}},onAdd:function(se){se.attributionControl=this,this._container=Qt("div","leaflet-control-attribution"),na(this._container);for(var he in se._layers)se._layers[he].getAttribution&&this.addAttribution(se._layers[he].getAttribution());return this._update(),se.on("layeradd",this._addAttribution,this),this._container},onRemove:function(se){se.off("layeradd",this._addAttribution,this)},_addAttribution:function(se){se.layer.getAttribution&&(this.addAttribution(se.layer.getAttribution()),se.layer.once("remove",function(){this.removeAttribution(se.layer.getAttribution())},this))},setPrefix:function(se){return this.options.prefix=se,this._update(),this},addAttribution:function(se){return se?(this._attributions[se]||(this._attributions[se]=0),this._attributions[se]++,this._update(),this):this},removeAttribution:function(se){return se?(this._attributions[se]&&(this._attributions[se]--,this._update()),this):this},_update:function(){if(this._map){var se=[];for(var he in this._attributions)this._attributions[he]&&se.push(he);var we=[];this.options.prefix&&we.push(this.options.prefix),se.length&&we.push(se.join(", ")),this._container.innerHTML=we.join(' <span aria-hidden="true">|</span> ')}}});Kt.mergeOptions({attributionControl:!0}),Kt.addInitHook(function(){this.options.attributionControl&&new Za().addTo(this)});var oo=function(se){return new Za(se)};yn.Layers=cr,yn.Zoom=Ga,yn.Scale=dr,yn.Attribution=Za,aa.layers=to,aa.zoom=no,aa.scale=ao,aa.attribution=oo;var xn=Ne.extend({initialize:function(se){this._map=se},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});xn.addTo=function(se,he){return se.addHandler(he,this),this};var io={Events:Be},ur=Mt.touch?"touchstart mousedown":"mousedown",An=Me.extend({options:{clickTolerance:3},initialize:function(se,he,we,Te){pe(this,Te),this._element=se,this._dragStartTarget=he||se,this._preventOutline=we},enable:function(){this._enabled||(qt(this._dragStartTarget,ur,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(An._dragging===this&&this.finishDrag(!0),en(this._dragStartTarget,ur,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(se){if(this._enabled&&(this._moved=!1,!Ma(this._element,"leaflet-zoom-anim"))){if(se.touches&&se.touches.length!==1){An._dragging===this&&this.finishDrag();return}if(!(An._dragging||se.shiftKey||se.which!==1&&se.button!==1&&!se.touches)&&(An._dragging=this,this._preventOutline&&Da(this._element),Pa(),Qn(),!this._moving)){this.fire("down");var he=se.touches?se.touches[0]:se,we=ar(this._element);this._startPoint=new xe(he.clientX,he.clientY),this._startPos=Ln(this._element),this._parentScale=za(we);var Te=se.type==="mousedown";qt(document,Te?"mousemove":"touchmove",this._onMove,this),qt(document,Te?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(se){if(this._enabled){if(se.touches&&se.touches.length>1){this._moved=!0;return}var he=se.touches&&se.touches.length===1?se.touches[0]:se,we=new xe(he.clientX,he.clientY)._subtract(this._startPoint);!we.x&&!we.y||Math.abs(we.x)+Math.abs(we.y)<this.options.clickTolerance||(we.x/=this._parentScale.x,we.y/=this._parentScale.y,un(se),this._moved||(this.fire("dragstart"),this._moved=!0,Wt(document.body,"leaflet-dragging"),this._lastTarget=se.target||se.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Wt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(we),this._moving=!0,this._lastEvent=se,this._updatePosition())}},_updatePosition:function(){var se={originalEvent:this._lastEvent};this.fire("predrag",se),ln(this._element,this._newPos),this.fire("drag",se)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(se){nn(document.body,"leaflet-dragging"),this._lastTarget&&(nn(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),en(document,"mousemove touchmove",this._onMove,this),en(document,"mouseup touchend touchcancel",this._onUp,this),La(),ea();var he=this._moved&&this._moving;this._moving=!1,An._dragging=!1,he&&this.fire("dragend",{noInertia:se,distance:this._newPos.distanceTo(this._startPos)})}});function hr(se,he,we){var Te,He=[1,4,2,8],Ye,ot,vt,xt,At,zt,jt,Ut;for(Ye=0,zt=se.length;Ye<zt;Ye++)se[Ye]._code=zn(se[Ye],he);for(vt=0;vt<4;vt++){for(jt=He[vt],Te=[],Ye=0,zt=se.length,ot=zt-1;Ye<zt;ot=Ye++)xt=se[Ye],At=se[ot],xt._code&jt?At._code&jt||(Ut=ba(At,xt,jt,he,we),Ut._code=zn(Ut,he),Te.push(Ut)):(At._code&jt&&(Ut=ba(At,xt,jt,he,we),Ut._code=zn(Ut,he),Te.push(Ut)),Te.push(xt));se=Te}return se}function mr(se,he){var we,Te,He,Ye,ot,vt,xt,At,zt;if(!se||se.length===0)throw new Error("latlngs not passed");vn(se)||(console.warn("latlngs are not flat! Only the first ring will be used"),se=se[0]);var jt=Ue([0,0]),Ut=Ze(se),mn=Ut.getNorthWest().distanceTo(Ut.getSouthWest())*Ut.getNorthEast().distanceTo(Ut.getNorthWest());mn<1700&&(jt=qa(se));var dn=se.length,gn=[];for(we=0;we<dn;we++){var fn=Ue(se[we]);gn.push(he.project(Ue([fn.lat-jt.lat,fn.lng-jt.lng])))}for(vt=xt=At=0,we=0,Te=dn-1;we<dn;Te=we++)He=gn[we],Ye=gn[Te],ot=He.y*Ye.x-Ye.y*He.x,xt+=(He.x+Ye.x)*ot,At+=(He.y+Ye.y)*ot,vt+=ot*3;vt===0?zt=gn[0]:zt=[xt/vt,At/vt];var Wn=he.unproject(Fe(zt));return Ue([Wn.lat+jt.lat,Wn.lng+jt.lng])}function qa(se){for(var he=0,we=0,Te=0,He=0;He<se.length;He++){var Ye=Ue(se[He]);he+=Ye.lat,we+=Ye.lng,Te++}return Ue([he/Te,we/Te])}var so={__proto__:null,clipPolygon:hr,polygonCenter:mr,centroid:qa};function pr(se,he){if(!he||!se.length)return se.slice();var we=he*he;return se=uo(se,we),se=co(se,we),se}function br(se,he,we){return Math.sqrt(ra(se,he,we,!0))}function lo(se,he,we){return ra(se,he,we)}function co(se,he){var we=se.length,Te=typeof Uint8Array<"u"?Uint8Array:Array,He=new Te(we);He[0]=He[we-1]=1,Wa(se,He,he,0,we-1);var Ye,ot=[];for(Ye=0;Ye<we;Ye++)He[Ye]&&ot.push(se[Ye]);return ot}function Wa(se,he,we,Te,He){var Ye=0,ot,vt,xt;for(vt=Te+1;vt<=He-1;vt++)xt=ra(se[vt],se[Te],se[He],!0),xt>Ye&&(ot=vt,Ye=xt);Ye>we&&(he[ot]=1,Wa(se,he,we,Te,ot),Wa(se,he,we,ot,He))}function uo(se,he){for(var we=[se[0]],Te=1,He=0,Ye=se.length;Te<Ye;Te++)ho(se[Te],se[He])>he&&(we.push(se[Te]),He=Te);return He<Ye-1&&we.push(se[Ye-1]),we}var vr;function gr(se,he,we,Te,He){var Ye=Te?vr:zn(se,we),ot=zn(he,we),vt,xt,At;for(vr=ot;;){if(!(Ye|ot))return[se,he];if(Ye&ot)return!1;vt=Ye||ot,xt=ba(se,he,vt,we,He),At=zn(xt,we),vt===Ye?(se=xt,Ye=At):(he=xt,ot=At)}}function ba(se,he,we,Te,He){var Ye=he.x-se.x,ot=he.y-se.y,vt=Te.min,xt=Te.max,At,zt;return we&8?(At=se.x+Ye*(xt.y-se.y)/ot,zt=xt.y):we&4?(At=se.x+Ye*(vt.y-se.y)/ot,zt=vt.y):we&2?(At=xt.x,zt=se.y+ot*(xt.x-se.x)/Ye):we&1&&(At=vt.x,zt=se.y+ot*(vt.x-se.x)/Ye),new xe(At,zt,He)}function zn(se,he){var we=0;return se.x<he.min.x?we|=1:se.x>he.max.x&&(we|=2),se.y<he.min.y?we|=4:se.y>he.max.y&&(we|=8),we}function ho(se,he){var we=he.x-se.x,Te=he.y-se.y;return we*we+Te*Te}function ra(se,he,we,Te){var He=he.x,Ye=he.y,ot=we.x-He,vt=we.y-Ye,xt=ot*ot+vt*vt,At;return xt>0&&(At=((se.x-He)*ot+(se.y-Ye)*vt)/xt,At>1?(He=we.x,Ye=we.y):At>0&&(He+=ot*At,Ye+=vt*At)),ot=se.x-He,vt=se.y-Ye,Te?ot*ot+vt*vt:new xe(He,Ye)}function vn(se){return!$e(se[0])||typeof se[0][0]!="object"&&typeof se[0][0]<"u"}function $r(se){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),vn(se)}function yr(se,he){var we,Te,He,Ye,ot,vt,xt,At;if(!se||se.length===0)throw new Error("latlngs not passed");vn(se)||(console.warn("latlngs are not flat! Only the first ring will be used"),se=se[0]);var zt=Ue([0,0]),jt=Ze(se),Ut=jt.getNorthWest().distanceTo(jt.getSouthWest())*jt.getNorthEast().distanceTo(jt.getNorthWest());Ut<1700&&(zt=qa(se));var mn=se.length,dn=[];for(we=0;we<mn;we++){var gn=Ue(se[we]);dn.push(he.project(Ue([gn.lat-zt.lat,gn.lng-zt.lng])))}for(we=0,Te=0;we<mn-1;we++)Te+=dn[we].distanceTo(dn[we+1])/2;if(Te===0)At=dn[0];else for(we=0,Ye=0;we<mn-1;we++)if(ot=dn[we],vt=dn[we+1],He=ot.distanceTo(vt),Ye+=He,Ye>Te){xt=(Ye-Te)/He,At=[vt.x-xt*(vt.x-ot.x),vt.y-xt*(vt.y-ot.y)];break}var fn=he.unproject(Fe(At));return Ue([fn.lat+zt.lat,fn.lng+zt.lng])}var mo={__proto__:null,simplify:pr,pointToSegmentDistance:br,closestPointOnSegment:lo,clipSegment:gr,_getEdgeIntersection:ba,_getBitCode:zn,_sqClosestPointOnSegment:ra,isFlat:vn,_flat:$r,polylineCenter:yr},Ua={project:function(se){return new xe(se.lng,se.lat)},unproject:function(se){return new Xe(se.y,se.x)},bounds:new Re([-180,-90],[180,90])},Ya={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Re([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(se){var he=Math.PI/180,we=this.R,Te=se.lat*he,He=this.R_MINOR/we,Ye=Math.sqrt(1-He*He),ot=Ye*Math.sin(Te),vt=Math.tan(Math.PI/4-Te/2)/Math.pow((1-ot)/(1+ot),Ye/2);return Te=-we*Math.log(Math.max(vt,1e-10)),new xe(se.lng*he*we,Te)},unproject:function(se){for(var he=180/Math.PI,we=this.R,Te=this.R_MINOR/we,He=Math.sqrt(1-Te*Te),Ye=Math.exp(-se.y/we),ot=Math.PI/2-2*Math.atan(Ye),vt=0,xt=.1,At;vt<15&&Math.abs(xt)>1e-7;vt++)At=He*Math.sin(ot),At=Math.pow((1-At)/(1+At),He/2),xt=Math.PI/2-2*Math.atan(Ye*At)-ot,ot+=xt;return new Xe(ot*he,se.x*he/we)}},fo={__proto__:null,LonLat:Ua,Mercator:Ya,SphericalMercator:it},po=re({},Je,{code:"EPSG:3395",projection:Ya,transformation:function(){var se=.5/(Math.PI*Ya.R);return Et(se,.5,-se,.5)}()}),kr=re({},Je,{code:"EPSG:4326",projection:Ua,transformation:Et(1/180,1,-1/180,.5)}),bo=re({},at,{projection:Ua,transformation:Et(1,0,-1,0),scale:function(se){return Math.pow(2,se)},zoom:function(se){return Math.log(se)/Math.LN2},distance:function(se,he){var we=he.lng-se.lng,Te=he.lat-se.lat;return Math.sqrt(we*we+Te*Te)},infinite:!0});at.Earth=Je,at.EPSG3395=po,at.EPSG3857=mt,at.EPSG900913=je,at.EPSG4326=kr,at.Simple=bo;var kn=Me.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(se){return se.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(se){return se&&se.removeLayer(this),this},getPane:function(se){return this._map.getPane(se?this.options[se]||se:this.options.pane)},addInteractiveTarget:function(se){return this._map._targets[ce(se)]=this,this},removeInteractiveTarget:function(se){return delete this._map._targets[ce(se)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(se){var he=se.target;if(he.hasLayer(this)){if(this._map=he,this._zoomAnimated=he._zoomAnimated,this.getEvents){var we=this.getEvents();he.on(we,this),this.once("remove",function(){he.off(we,this)},this)}this.onAdd(he),this.fire("add"),he.fire("layeradd",{layer:this})}}});Kt.include({addLayer:function(se){if(!se._layerAdd)throw new Error("The provided object is not a Layer.");var he=ce(se);return this._layers[he]?this:(this._layers[he]=se,se._mapToAdd=this,se.beforeAdd&&se.beforeAdd(this),this.whenReady(se._layerAdd,se),this)},removeLayer:function(se){var he=ce(se);return this._layers[he]?(this._loaded&&se.onRemove(this),delete this._layers[he],this._loaded&&(this.fire("layerremove",{layer:se}),se.fire("remove")),se._map=se._mapToAdd=null,this):this},hasLayer:function(se){return ce(se)in this._layers},eachLayer:function(se,he){for(var we in this._layers)se.call(he,this._layers[we]);return this},_addLayers:function(se){se=se?$e(se)?se:[se]:[];for(var he=0,we=se.length;he<we;he++)this.addLayer(se[he])},_addZoomLimit:function(se){(!isNaN(se.options.maxZoom)||!isNaN(se.options.minZoom))&&(this._zoomBoundLayers[ce(se)]=se,this._updateZoomLevels())},_removeZoomLimit:function(se){var he=ce(se);this._zoomBoundLayers[he]&&(delete this._zoomBoundLayers[he],this._updateZoomLevels())},_updateZoomLevels:function(){var se=1/0,he=-1/0,we=this._getZoomSpan();for(var Te in this._zoomBoundLayers){var He=this._zoomBoundLayers[Te].options;se=He.minZoom===void 0?se:Math.min(se,He.minZoom),he=He.maxZoom===void 0?he:Math.max(he,He.maxZoom)}this._layersMaxZoom=he===-1/0?void 0:he,this._layersMinZoom=se===1/0?void 0:se,we!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Hn=kn.extend({initialize:function(se,he){pe(this,he),this._layers={};var we,Te;if(se)for(we=0,Te=se.length;we<Te;we++)this.addLayer(se[we])},addLayer:function(se){var he=this.getLayerId(se);return this._layers[he]=se,this._map&&this._map.addLayer(se),this},removeLayer:function(se){var he=se in this._layers?se:this.getLayerId(se);return this._map&&this._layers[he]&&this._map.removeLayer(this._layers[he]),delete this._layers[he],this},hasLayer:function(se){var he=typeof se=="number"?se:this.getLayerId(se);return he in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(se){var he=Array.prototype.slice.call(arguments,1),we,Te;for(we in this._layers)Te=this._layers[we],Te[se]&&Te[se].apply(Te,he);return this},onAdd:function(se){this.eachLayer(se.addLayer,se)},onRemove:function(se){this.eachLayer(se.removeLayer,se)},eachLayer:function(se,he){for(var we in this._layers)se.call(he,this._layers[we]);return this},getLayer:function(se){return this._layers[se]},getLayers:function(){var se=[];return this.eachLayer(se.push,se),se},setZIndex:function(se){return this.invoke("setZIndex",se)},getLayerId:function(se){return ce(se)}}),vo=function(se,he){return new Hn(se,he)},Cn=Hn.extend({addLayer:function(se){return this.hasLayer(se)?this:(se.addEventParent(this),Hn.prototype.addLayer.call(this,se),this.fire("layeradd",{layer:se}))},removeLayer:function(se){return this.hasLayer(se)?(se in this._layers&&(se=this._layers[se]),se.removeEventParent(this),Hn.prototype.removeLayer.call(this,se),this.fire("layerremove",{layer:se})):this},setStyle:function(se){return this.invoke("setStyle",se)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var se=new Ge;for(var he in this._layers){var we=this._layers[he];se.extend(we.getBounds?we.getBounds():we.getLatLng())}return se}}),go=function(se,he){return new Cn(se,he)},jn=Ne.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(se){pe(this,se)},createIcon:function(se){return this._createIcon("icon",se)},createShadow:function(se){return this._createIcon("shadow",se)},_createIcon:function(se,he){var we=this._getIconUrl(se);if(!we){if(se==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var Te=this._createImg(we,he&&he.tagName==="IMG"?he:null);return this._setIconStyles(Te,se),(this.options.crossOrigin||this.options.crossOrigin==="")&&(Te.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),Te},_setIconStyles:function(se,he){var we=this.options,Te=we[he+"Size"];typeof Te=="number"&&(Te=[Te,Te]);var He=Fe(Te),Ye=Fe(he==="shadow"&&we.shadowAnchor||we.iconAnchor||He&&He.divideBy(2,!0));se.className="leaflet-marker-"+he+" "+(we.className||""),Ye&&(se.style.marginLeft=-Ye.x+"px",se.style.marginTop=-Ye.y+"px"),He&&(se.style.width=He.x+"px",se.style.height=He.y+"px")},_createImg:function(se,he){return he=he||document.createElement("img"),he.src=se,he},_getIconUrl:function(se){return Mt.retina&&this.options[se+"RetinaUrl"]||this.options[se+"Url"]}});function $o(se){return new jn(se)}var oa=jn.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(se){return typeof oa.imagePath!="string"&&(oa.imagePath=this._detectIconPath()),(this.options.imagePath||oa.imagePath)+jn.prototype._getIconUrl.call(this,se)},_stripUrl:function(se){var he=function(we,Te,He){var Ye=Te.exec(we);return Ye&&Ye[He]};return se=he(se,/^url\((['"])?(.+)\1\)$/,2),se&&he(se,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var se=Qt("div","leaflet-default-icon-path",document.body),he=Jn(se,"background-image")||Jn(se,"backgroundImage");if(document.body.removeChild(se),he=this._stripUrl(he),he)return he;var we=document.querySelector('link[href$="leaflet.css"]');return we?we.href.substring(0,we.href.length-11-1):""}}),_r=xn.extend({initialize:function(se){this._marker=se},addHooks:function(){var se=this._marker._icon;this._draggable||(this._draggable=new An(se,se,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Wt(se,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&nn(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(se){var he=this._marker,we=he._map,Te=this._marker.options.autoPanSpeed,He=this._marker.options.autoPanPadding,Ye=Ln(he._icon),ot=we.getPixelBounds(),vt=we.getPixelOrigin(),xt=qe(ot.min._subtract(vt).add(He),ot.max._subtract(vt).subtract(He));if(!xt.contains(Ye)){var At=Fe((Math.max(xt.max.x,Ye.x)-xt.max.x)/(ot.max.x-xt.max.x)-(Math.min(xt.min.x,Ye.x)-xt.min.x)/(ot.min.x-xt.min.x),(Math.max(xt.max.y,Ye.y)-xt.max.y)/(ot.max.y-xt.max.y)-(Math.min(xt.min.y,Ye.y)-xt.min.y)/(ot.min.y-xt.min.y)).multiplyBy(Te);we.panBy(At,{animate:!1}),this._draggable._newPos._add(At),this._draggable._startPos._add(At),ln(he._icon,this._draggable._newPos),this._onDrag(se),this._panRequest=Ie(this._adjustPan.bind(this,se))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(se){this._marker.options.autoPan&&(ze(this._panRequest),this._panRequest=Ie(this._adjustPan.bind(this,se)))},_onDrag:function(se){var he=this._marker,we=he._shadow,Te=Ln(he._icon),He=he._map.layerPointToLatLng(Te);we&&ln(we,Te),he._latlng=He,se.latlng=He,se.oldLatLng=this._oldLatLng,he.fire("move",se).fire("drag",se)},_onDragEnd:function(se){ze(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",se)}}),va=kn.extend({options:{icon:new oa,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(se,he){pe(this,he),this._latlng=Ue(se)},onAdd:function(se){this._zoomAnimated=this._zoomAnimated&&se.options.markerZoomAnimation,this._zoomAnimated&&se.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(se){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&se.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(se){var he=this._latlng;return this._latlng=Ue(se),this.update(),this.fire("move",{oldLatLng:he,latlng:this._latlng})},setZIndexOffset:function(se){return this.options.zIndexOffset=se,this.update()},getIcon:function(){return this.options.icon},setIcon:function(se){return this.options.icon=se,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var se=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(se)}return this},_initIcon:function(){var se=this.options,he="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),we=se.icon.createIcon(this._icon),Te=!1;we!==this._icon&&(this._icon&&this._removeIcon(),Te=!0,se.title&&(we.title=se.title),we.tagName==="IMG"&&(we.alt=se.alt||"")),Wt(we,he),se.keyboard&&(we.tabIndex="0",we.setAttribute("role","button")),this._icon=we,se.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&qt(we,"focus",this._panOnFocus,this);var He=se.icon.createShadow(this._shadow),Ye=!1;He!==this._shadow&&(this._removeShadow(),Ye=!0),He&&(Wt(He,he),He.alt=""),this._shadow=He,se.opacity<1&&this._updateOpacity(),Te&&this.getPane().appendChild(this._icon),this._initInteraction(),He&&Ye&&this.getPane(se.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&en(this._icon,"focus",this._panOnFocus,this),tn(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&tn(this._shadow),this._shadow=null},_setPos:function(se){this._icon&&ln(this._icon,se),this._shadow&&ln(this._shadow,se),this._zIndex=se.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(se){this._icon&&(this._icon.style.zIndex=this._zIndex+se)},_animateZoom:function(se){var he=this._map._latLngToNewLayerPoint(this._latlng,se.zoom,se.center).round();this._setPos(he)},_initInteraction:function(){if(this.options.interactive&&(Wt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),_r)){var se=this.options.draggable;this.dragging&&(se=this.dragging.enabled(),this.dragging.disable()),this.dragging=new _r(this),se&&this.dragging.enable()}},setOpacity:function(se){return this.options.opacity=se,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var se=this.options.opacity;this._icon&&bn(this._icon,se),this._shadow&&bn(this._shadow,se)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var se=this._map;if(se){var he=this.options.icon.options,we=he.iconSize?Fe(he.iconSize):Fe(0,0),Te=he.iconAnchor?Fe(he.iconAnchor):Fe(0,0);se.panInside(this._latlng,{paddingTopLeft:Te,paddingBottomRight:we.subtract(Te)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function yo(se,he){return new va(se,he)}var Tn=kn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(se){this._renderer=se.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(se){return pe(this,se),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&se&&Object.prototype.hasOwnProperty.call(se,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ga=Tn.extend({options:{fill:!0,radius:10},initialize:function(se,he){pe(this,he),this._latlng=Ue(se),this._radius=this.options.radius},setLatLng:function(se){var he=this._latlng;return this._latlng=Ue(se),this.redraw(),this.fire("move",{oldLatLng:he,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(se){return this.options.radius=this._radius=se,this.redraw()},getRadius:function(){return this._radius},setStyle:function(se){var he=se&&se.radius||this._radius;return Tn.prototype.setStyle.call(this,se),this.setRadius(he),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var se=this._radius,he=this._radiusY||se,we=this._clickTolerance(),Te=[se+we,he+we];this._pxBounds=new Re(this._point.subtract(Te),this._point.add(Te))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(se){return se.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ko(se,he){return new ga(se,he)}var Xa=ga.extend({initialize:function(se,he,we){if(typeof he=="number"&&(he=re({},we,{radius:he})),pe(this,he),this._latlng=Ue(se),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(se){return this._mRadius=se,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var se=[this._radius,this._radiusY||this._radius];return new Ge(this._map.layerPointToLatLng(this._point.subtract(se)),this._map.layerPointToLatLng(this._point.add(se)))},setStyle:Tn.prototype.setStyle,_project:function(){var se=this._latlng.lng,he=this._latlng.lat,we=this._map,Te=we.options.crs;if(Te.distance===Je.distance){var He=Math.PI/180,Ye=this._mRadius/Je.R/He,ot=we.project([he+Ye,se]),vt=we.project([he-Ye,se]),xt=ot.add(vt).divideBy(2),At=we.unproject(xt).lat,zt=Math.acos((Math.cos(Ye*He)-Math.sin(he*He)*Math.sin(At*He))/(Math.cos(he*He)*Math.cos(At*He)))/He;(isNaN(zt)||zt===0)&&(zt=Ye/Math.cos(Math.PI/180*he)),this._point=xt.subtract(we.getPixelOrigin()),this._radius=isNaN(zt)?0:xt.x-we.project([At,se-zt]).x,this._radiusY=xt.y-ot.y}else{var jt=Te.unproject(Te.project(this._latlng).subtract([this._mRadius,0]));this._point=we.latLngToLayerPoint(this._latlng),this._radius=this._point.x-we.latLngToLayerPoint(jt).x}this._updateBounds()}});function _o(se,he,we){return new Xa(se,he,we)}var Sn=Tn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(se,he){pe(this,he),this._setLatLngs(se)},getLatLngs:function(){return this._latlngs},setLatLngs:function(se){return this._setLatLngs(se),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(se){for(var he=1/0,we=null,Te=ra,He,Ye,ot=0,vt=this._parts.length;ot<vt;ot++)for(var xt=this._parts[ot],At=1,zt=xt.length;At<zt;At++){He=xt[At-1],Ye=xt[At];var jt=Te(se,He,Ye,!0);jt<he&&(he=jt,we=Te(se,He,Ye))}return we&&(we.distance=Math.sqrt(he)),we},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return yr(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(se,he){return he=he||this._defaultShape(),se=Ue(se),he.push(se),this._bounds.extend(se),this.redraw()},_setLatLngs:function(se){this._bounds=new Ge,this._latlngs=this._convertLatLngs(se)},_defaultShape:function(){return vn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(se){for(var he=[],we=vn(se),Te=0,He=se.length;Te<He;Te++)we?(he[Te]=Ue(se[Te]),this._bounds.extend(he[Te])):he[Te]=this._convertLatLngs(se[Te]);return he},_project:function(){var se=new Re;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,se),this._bounds.isValid()&&se.isValid()&&(this._rawPxBounds=se,this._updateBounds())},_updateBounds:function(){var se=this._clickTolerance(),he=new xe(se,se);this._rawPxBounds&&(this._pxBounds=new Re([this._rawPxBounds.min.subtract(he),this._rawPxBounds.max.add(he)]))},_projectLatlngs:function(se,he,we){var Te=se[0]instanceof Xe,He=se.length,Ye,ot;if(Te){for(ot=[],Ye=0;Ye<He;Ye++)ot[Ye]=this._map.latLngToLayerPoint(se[Ye]),we.extend(ot[Ye]);he.push(ot)}else for(Ye=0;Ye<He;Ye++)this._projectLatlngs(se[Ye],he,we)},_clipPoints:function(){var se=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(se))){if(this.options.noClip){this._parts=this._rings;return}var he=this._parts,we,Te,He,Ye,ot,vt,xt;for(we=0,He=0,Ye=this._rings.length;we<Ye;we++)for(xt=this._rings[we],Te=0,ot=xt.length;Te<ot-1;Te++)vt=gr(xt[Te],xt[Te+1],se,Te,!0),vt&&(he[He]=he[He]||[],he[He].push(vt[0]),(vt[1]!==xt[Te+1]||Te===ot-2)&&(he[He].push(vt[1]),He++))}},_simplifyPoints:function(){for(var se=this._parts,he=this.options.smoothFactor,we=0,Te=se.length;we<Te;we++)se[we]=pr(se[we],he)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(se,he){var we,Te,He,Ye,ot,vt,xt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(se))return!1;for(we=0,Ye=this._parts.length;we<Ye;we++)for(vt=this._parts[we],Te=0,ot=vt.length,He=ot-1;Te<ot;He=Te++)if(!(!he&&Te===0)&&br(se,vt[He],vt[Te])<=xt)return!0;return!1}});function xo(se,he){return new Sn(se,he)}Sn._flat=$r;var Gn=Sn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return mr(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(se){var he=Sn.prototype._convertLatLngs.call(this,se),we=he.length;return we>=2&&he[0]instanceof Xe&&he[0].equals(he[we-1])&&he.pop(),he},_setLatLngs:function(se){Sn.prototype._setLatLngs.call(this,se),vn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return vn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var se=this._renderer._bounds,he=this.options.weight,we=new xe(he,he);if(se=new Re(se.min.subtract(we),se.max.add(we)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(se))){if(this.options.noClip){this._parts=this._rings;return}for(var Te=0,He=this._rings.length,Ye;Te<He;Te++)Ye=hr(this._rings[Te],se,!0),Ye.length&&this._parts.push(Ye)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(se){var he=!1,we,Te,He,Ye,ot,vt,xt,At;if(!this._pxBounds||!this._pxBounds.contains(se))return!1;for(Ye=0,xt=this._parts.length;Ye<xt;Ye++)for(we=this._parts[Ye],ot=0,At=we.length,vt=At-1;ot<At;vt=ot++)Te=we[ot],He=we[vt],Te.y>se.y!=He.y>se.y&&se.x<(He.x-Te.x)*(se.y-Te.y)/(He.y-Te.y)+Te.x&&(he=!he);return he||Sn.prototype._containsPoint.call(this,se,!0)}});function wo(se,he){return new Gn(se,he)}var Bn=Cn.extend({initialize:function(se,he){pe(this,he),this._layers={},se&&this.addData(se)},addData:function(se){var he=$e(se)?se:se.features,we,Te,He;if(he){for(we=0,Te=he.length;we<Te;we++)He=he[we],(He.geometries||He.geometry||He.features||He.coordinates)&&this.addData(He);return this}var Ye=this.options;if(Ye.filter&&!Ye.filter(se))return this;var ot=$a(se,Ye);return ot?(ot.feature=_a(se),ot.defaultOptions=ot.options,this.resetStyle(ot),Ye.onEachFeature&&Ye.onEachFeature(se,ot),this.addLayer(ot)):this},resetStyle:function(se){return se===void 0?this.eachLayer(this.resetStyle,this):(se.options=re({},se.defaultOptions),this._setLayerStyle(se,this.options.style),this)},setStyle:function(se){return this.eachLayer(function(he){this._setLayerStyle(he,se)},this)},_setLayerStyle:function(se,he){se.setStyle&&(typeof he=="function"&&(he=he(se.feature)),se.setStyle(he))}});function $a(se,he){var we=se.type==="Feature"?se.geometry:se,Te=we?we.coordinates:null,He=[],Ye=he&&he.pointToLayer,ot=he&&he.coordsToLatLng||Ka,vt,xt,At,zt;if(!Te&&!we)return null;switch(we.type){case"Point":return vt=ot(Te),xr(Ye,se,vt,he);case"MultiPoint":for(At=0,zt=Te.length;At<zt;At++)vt=ot(Te[At]),He.push(xr(Ye,se,vt,he));return new Cn(He);case"LineString":case"MultiLineString":return xt=ya(Te,we.type==="LineString"?0:1,ot),new Sn(xt,he);case"Polygon":case"MultiPolygon":return xt=ya(Te,we.type==="Polygon"?1:2,ot),new Gn(xt,he);case"GeometryCollection":for(At=0,zt=we.geometries.length;At<zt;At++){var jt=$a({geometry:we.geometries[At],type:"Feature",properties:se.properties},he);jt&&He.push(jt)}return new Cn(He);case"FeatureCollection":for(At=0,zt=we.features.length;At<zt;At++){var Ut=$a(we.features[At],he);Ut&&He.push(Ut)}return new Cn(He);default:throw new Error("Invalid GeoJSON object.")}}function xr(se,he,we,Te){return se?se(he,we):new va(we,Te&&Te.markersInheritOptions&&Te)}function Ka(se){return new Xe(se[1],se[0],se[2])}function ya(se,he,we){for(var Te=[],He=0,Ye=se.length,ot;He<Ye;He++)ot=he?ya(se[He],he-1,we):(we||Ka)(se[He]),Te.push(ot);return Te}function Ja(se,he){return se=Ue(se),se.alt!==void 0?[fe(se.lng,he),fe(se.lat,he),fe(se.alt,he)]:[fe(se.lng,he),fe(se.lat,he)]}function ka(se,he,we,Te){for(var He=[],Ye=0,ot=se.length;Ye<ot;Ye++)He.push(he?ka(se[Ye],vn(se[Ye])?0:he-1,we,Te):Ja(se[Ye],Te));return!he&&we&&He.length>0&&He.push(He[0].slice()),He}function Zn(se,he){return se.feature?re({},se.feature,{geometry:he}):_a(he)}function _a(se){return se.type==="Feature"||se.type==="FeatureCollection"?se:{type:"Feature",properties:{},geometry:se}}var Qa={toGeoJSON:function(se){return Zn(this,{type:"Point",coordinates:Ja(this.getLatLng(),se)})}};va.include(Qa),Xa.include(Qa),ga.include(Qa),Sn.include({toGeoJSON:function(se){var he=!vn(this._latlngs),we=ka(this._latlngs,he?1:0,!1,se);return Zn(this,{type:(he?"Multi":"")+"LineString",coordinates:we})}}),Gn.include({toGeoJSON:function(se){var he=!vn(this._latlngs),we=he&&!vn(this._latlngs[0]),Te=ka(this._latlngs,we?2:he?1:0,!0,se);return he||(Te=[Te]),Zn(this,{type:(we?"Multi":"")+"Polygon",coordinates:Te})}}),Hn.include({toMultiPoint:function(se){var he=[];return this.eachLayer(function(we){he.push(we.toGeoJSON(se).geometry.coordinates)}),Zn(this,{type:"MultiPoint",coordinates:he})},toGeoJSON:function(se){var he=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(he==="MultiPoint")return this.toMultiPoint(se);var we=he==="GeometryCollection",Te=[];return this.eachLayer(function(He){if(He.toGeoJSON){var Ye=He.toGeoJSON(se);if(we)Te.push(Ye.geometry);else{var ot=_a(Ye);ot.type==="FeatureCollection"?Te.push.apply(Te,ot.features):Te.push(ot)}}}),we?Zn(this,{geometries:Te,type:"GeometryCollection"}):{type:"FeatureCollection",features:Te}}});function wr(se,he){return new Bn(se,he)}var Eo=wr,xa=kn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(se,he,we){this._url=se,this._bounds=Ze(he),pe(this,we)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Wt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){tn(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(se){return this.options.opacity=se,this._image&&this._updateOpacity(),this},setStyle:function(se){return se.opacity&&this.setOpacity(se.opacity),this},bringToFront:function(){return this._map&&Rn(this._image),this},bringToBack:function(){return this._map&&On(this._image),this},setUrl:function(se){return this._url=se,this._image&&(this._image.src=se),this},setBounds:function(se){return this._bounds=Ze(se),this._map&&this._reset(),this},getEvents:function(){var se={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(se.zoomanim=this._animateZoom),se},setZIndex:function(se){return this.options.zIndex=se,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var se=this._url.tagName==="IMG",he=this._image=se?this._url:Qt("img");if(Wt(he,"leaflet-image-layer"),this._zoomAnimated&&Wt(he,"leaflet-zoom-animated"),this.options.className&&Wt(he,this.options.className),he.onselectstart=be,he.onmousemove=be,he.onload=ie(this.fire,this,"load"),he.onerror=ie(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(he.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),se){this._url=he.src;return}he.src=this._url,he.alt=this.options.alt},_animateZoom:function(se){var he=this._map.getZoomScale(se.zoom),we=this._map._latLngBoundsToNewLayerBounds(this._bounds,se.zoom,se.center).min;Pn(this._image,we,he)},_reset:function(){var se=this._image,he=new Re(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),we=he.getSize();ln(se,he.min),se.style.width=we.x+"px",se.style.height=we.y+"px"},_updateOpacity:function(){bn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var se=this.options.errorOverlayUrl;se&&this._url!==se&&(this._url=se,this._image.src=se)},getCenter:function(){return this._bounds.getCenter()}}),Co=function(se,he,we){return new xa(se,he,we)},Er=xa.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var se=this._url.tagName==="VIDEO",he=this._image=se?this._url:Qt("video");if(Wt(he,"leaflet-image-layer"),this._zoomAnimated&&Wt(he,"leaflet-zoom-animated"),this.options.className&&Wt(he,this.options.className),he.onselectstart=be,he.onmousemove=be,he.onloadeddata=ie(this.fire,this,"load"),se){for(var we=he.getElementsByTagName("source"),Te=[],He=0;He<we.length;He++)Te.push(we[He].src);this._url=we.length>0?Te:[he.src];return}$e(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(he.style,"objectFit")&&(he.style.objectFit="fill"),he.autoplay=!!this.options.autoplay,he.loop=!!this.options.loop,he.muted=!!this.options.muted,he.playsInline=!!this.options.playsInline;for(var Ye=0;Ye<this._url.length;Ye++){var ot=Qt("source");ot.src=this._url[Ye],he.appendChild(ot)}}});function So(se,he,we){return new Er(se,he,we)}var Cr=xa.extend({_initImage:function(){var se=this._image=this._url;Wt(se,"leaflet-image-layer"),this._zoomAnimated&&Wt(se,"leaflet-zoom-animated"),this.options.className&&Wt(se,this.options.className),se.onselectstart=be,se.onmousemove=be}});function Bo(se,he,we){return new Cr(se,he,we)}var wn=kn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(se,he){se&&(se instanceof Xe||$e(se))?(this._latlng=Ue(se),pe(this,he)):(pe(this,se),this._source=he),this.options.content&&(this._content=this.options.content)},openOn:function(se){return se=arguments.length?se:this._source._map,se.hasLayer(this)||se.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(se){return this._map?this.close():(arguments.length?this._source=se:se=this._source,this._prepareOpen(),this.openOn(se._map)),this},onAdd:function(se){this._zoomAnimated=se._zoomAnimated,this._container||this._initLayout(),se._fadeAnimated&&bn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),se._fadeAnimated&&bn(this._container,1),this.bringToFront(),this.options.interactive&&(Wt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(se){se._fadeAnimated?(bn(this._container,0),this._removeTimeout=setTimeout(ie(tn,void 0,this._container),200)):tn(this._container),this.options.interactive&&(nn(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(se){return this._latlng=Ue(se),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(se){return this._content=se,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var se={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(se.zoomanim=this._animateZoom),se},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Rn(this._container),this},bringToBack:function(){return this._map&&On(this._container),this},_prepareOpen:function(se){var he=this._source;if(!he._map)return!1;if(he instanceof Cn){he=null;var we=this._source._layers;for(var Te in we)if(we[Te]._map){he=we[Te];break}if(!he)return!1;this._source=he}if(!se)if(he.getCenter)se=he.getCenter();else if(he.getLatLng)se=he.getLatLng();else if(he.getBounds)se=he.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(se),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var se=this._contentNode,he=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof he=="string")se.innerHTML=he;else{for(;se.hasChildNodes();)se.removeChild(se.firstChild);se.appendChild(he)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var se=this._map.latLngToLayerPoint(this._latlng),he=Fe(this.options.offset),we=this._getAnchor();this._zoomAnimated?ln(this._container,se.add(we)):he=he.add(se).add(we);var Te=this._containerBottom=-he.y,He=this._containerLeft=-Math.round(this._containerWidth/2)+he.x;this._container.style.bottom=Te+"px",this._container.style.left=He+"px"}},_getAnchor:function(){return[0,0]}});Kt.include({_initOverlay:function(se,he,we,Te){var He=he;return He instanceof se||(He=new se(Te).setContent(he)),we&&He.setLatLng(we),He}}),kn.include({_initOverlay:function(se,he,we,Te){var He=we;return He instanceof se?(pe(He,Te),He._source=this):(He=he&&!Te?he:new se(Te,this),He.setContent(we)),He}});var wa=wn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(se){return se=arguments.length?se:this._source._map,!se.hasLayer(this)&&se._popup&&se._popup.options.autoClose&&se.removeLayer(se._popup),se._popup=this,wn.prototype.openOn.call(this,se)},onAdd:function(se){wn.prototype.onAdd.call(this,se),se.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Tn||this._source.on("preclick",Fn))},onRemove:function(se){wn.prototype.onRemove.call(this,se),se.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Tn||this._source.off("preclick",Fn))},getEvents:function(){var se=wn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(se.preclick=this.close),this.options.keepInView&&(se.moveend=this._adjustPan),se},_initLayout:function(){var se="leaflet-popup",he=this._container=Qt("div",se+" "+(this.options.className||"")+" leaflet-zoom-animated"),we=this._wrapper=Qt("div",se+"-content-wrapper",he);if(this._contentNode=Qt("div",se+"-content",we),na(he),Ha(this._contentNode),qt(he,"contextmenu",Fn),this._tipContainer=Qt("div",se+"-tip-container",he),this._tip=Qt("div",se+"-tip",this._tipContainer),this.options.closeButton){var Te=this._closeButton=Qt("a",se+"-close-button",he);Te.setAttribute("role","button"),Te.setAttribute("aria-label","Close popup"),Te.href="#close",Te.innerHTML='<span aria-hidden="true">×</span>',qt(Te,"click",function(He){un(He),this.close()},this)}},_updateLayout:function(){var se=this._contentNode,he=se.style;he.width="",he.whiteSpace="nowrap";var we=se.offsetWidth;we=Math.min(we,this.options.maxWidth),we=Math.max(we,this.options.minWidth),he.width=we+1+"px",he.whiteSpace="",he.height="";var Te=se.offsetHeight,He=this.options.maxHeight,Ye="leaflet-popup-scrolled";He&&Te>He?(he.height=He+"px",Wt(se,Ye)):nn(se,Ye),this._containerWidth=this._container.offsetWidth},_animateZoom:function(se){var he=this._map._latLngToNewLayerPoint(this._latlng,se.zoom,se.center),we=this._getAnchor();ln(this._container,he.add(we))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var se=this._map,he=parseInt(Jn(this._container,"marginBottom"),10)||0,we=this._container.offsetHeight+he,Te=this._containerWidth,He=new xe(this._containerLeft,-we-this._containerBottom);He._add(Ln(this._container));var Ye=se.layerPointToContainerPoint(He),ot=Fe(this.options.autoPanPadding),vt=Fe(this.options.autoPanPaddingTopLeft||ot),xt=Fe(this.options.autoPanPaddingBottomRight||ot),At=se.getSize(),zt=0,jt=0;Ye.x+Te+xt.x>At.x&&(zt=Ye.x+Te-At.x+xt.x),Ye.x-zt-vt.x<0&&(zt=Ye.x-vt.x),Ye.y+we+xt.y>At.y&&(jt=Ye.y+we-At.y+xt.y),Ye.y-jt-vt.y<0&&(jt=Ye.y-vt.y),(zt||jt)&&(this.options.keepInView&&(this._autopanning=!0),se.fire("autopanstart").panBy([zt,jt]))}},_getAnchor:function(){return Fe(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),No=function(se,he){return new wa(se,he)};Kt.mergeOptions({closePopupOnClick:!0}),Kt.include({openPopup:function(se,he,we){return this._initOverlay(wa,se,he,we).openOn(this),this},closePopup:function(se){return se=arguments.length?se:this._popup,se&&se.close(),this}}),kn.include({bindPopup:function(se,he){return this._popup=this._initOverlay(wa,this._popup,se,he),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(se){return this._popup&&(this instanceof Cn||(this._popup._source=this),this._popup._prepareOpen(se||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(se){return this._popup&&this._popup.setContent(se),this},getPopup:function(){return this._popup},_openPopup:function(se){if(!(!this._popup||!this._map)){Dn(se);var he=se.layer||se.target;if(this._popup._source===he&&!(he instanceof Tn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(se.latlng);return}this._popup._source=he,this.openPopup(se.latlng)}},_movePopup:function(se){this._popup.setLatLng(se.latlng)},_onKeyPress:function(se){se.originalEvent.keyCode===13&&this._openPopup(se)}});var Ea=wn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(se){wn.prototype.onAdd.call(this,se),this.setOpacity(this.options.opacity),se.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(se){wn.prototype.onRemove.call(this,se),se.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var se=wn.prototype.getEvents.call(this);return this.options.permanent||(se.preclick=this.close),se},_initLayout:function(){var se="leaflet-tooltip",he=se+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Qt("div",he),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+ce(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(se){var he,we,Te=this._map,He=this._container,Ye=Te.latLngToContainerPoint(Te.getCenter()),ot=Te.layerPointToContainerPoint(se),vt=this.options.direction,xt=He.offsetWidth,At=He.offsetHeight,zt=Fe(this.options.offset),jt=this._getAnchor();vt==="top"?(he=xt/2,we=At):vt==="bottom"?(he=xt/2,we=0):vt==="center"?(he=xt/2,we=At/2):vt==="right"?(he=0,we=At/2):vt==="left"?(he=xt,we=At/2):ot.x<Ye.x?(vt="right",he=0,we=At/2):(vt="left",he=xt+(zt.x+jt.x)*2,we=At/2),se=se.subtract(Fe(he,we,!0)).add(zt).add(jt),nn(He,"leaflet-tooltip-right"),nn(He,"leaflet-tooltip-left"),nn(He,"leaflet-tooltip-top"),nn(He,"leaflet-tooltip-bottom"),Wt(He,"leaflet-tooltip-"+vt),ln(He,se)},_updatePosition:function(){var se=this._map.latLngToLayerPoint(this._latlng);this._setPosition(se)},setOpacity:function(se){this.options.opacity=se,this._container&&bn(this._container,se)},_animateZoom:function(se){var he=this._map._latLngToNewLayerPoint(this._latlng,se.zoom,se.center);this._setPosition(he)},_getAnchor:function(){return Fe(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Vo=function(se,he){return new Ea(se,he)};Kt.include({openTooltip:function(se,he,we){return this._initOverlay(Ea,se,he,we).openOn(this),this},closeTooltip:function(se){return se.close(),this}}),kn.include({bindTooltip:function(se,he){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ea,this._tooltip,se,he),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(se){if(!(!se&&this._tooltipHandlersAdded)){var he=se?"off":"on",we={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?we.add=this._openTooltip:(we.mouseover=this._openTooltip,we.mouseout=this.closeTooltip,we.click=this._openTooltip,this._map?this._addFocusListeners():we.add=this._addFocusListeners),this._tooltip.options.sticky&&(we.mousemove=this._moveTooltip),this[he](we),this._tooltipHandlersAdded=!se}},openTooltip:function(se){return this._tooltip&&(this instanceof Cn||(this._tooltip._source=this),this._tooltip._prepareOpen(se)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(se){return this._tooltip&&this._tooltip.setContent(se),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(se){var he=typeof se.getElement=="function"&&se.getElement();he&&(qt(he,"focus",function(){this._tooltip._source=se,this.openTooltip()},this),qt(he,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(se){var he=typeof se.getElement=="function"&&se.getElement();he&&he.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(se){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var he=this;this._map.once("moveend",function(){he._openOnceFlag=!1,he._openTooltip(se)});return}this._tooltip._source=se.layer||se.target,this.openTooltip(this._tooltip.options.sticky?se.latlng:void 0)}},_moveTooltip:function(se){var he=se.latlng,we,Te;this._tooltip.options.sticky&&se.originalEvent&&(we=this._map.mouseEventToContainerPoint(se.originalEvent),Te=this._map.containerPointToLayerPoint(we),he=this._map.layerPointToLatLng(Te)),this._tooltip.setLatLng(he)}});var Sr=jn.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(se){var he=se&&se.tagName==="DIV"?se:document.createElement("div"),we=this.options;if(we.html instanceof Element?(ua(he),he.appendChild(we.html)):he.innerHTML=we.html!==!1?we.html:"",we.bgPos){var Te=Fe(we.bgPos);he.style.backgroundPosition=-Te.x+"px "+-Te.y+"px"}return this._setIconStyles(he,"icon"),he},createShadow:function(){return null}});function Mo(se){return new Sr(se)}jn.Default=oa;var ia=kn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Mt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(se){pe(this,se)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(se){se._addZoomLimit(this)},onRemove:function(se){this._removeAllTiles(),tn(this._container),se._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Rn(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(On(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(se){return this.options.opacity=se,this._updateOpacity(),this},setZIndex:function(se){return this.options.zIndex=se,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var se=this._clampZoom(this._map.getZoom());se!==this._tileZoom&&(this._tileZoom=se,this._updateLevels()),this._update()}return this},getEvents:function(){var se={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=de(this._onMoveEnd,this.options.updateInterval,this)),se.move=this._onMove),this._zoomAnimated&&(se.zoomanim=this._animateZoom),se},createTile:function(){return document.createElement("div")},getTileSize:function(){var se=this.options.tileSize;return se instanceof xe?se:new xe(se,se)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(se){for(var he=this.getPane().children,we=-se(-1/0,1/0),Te=0,He=he.length,Ye;Te<He;Te++)Ye=he[Te].style.zIndex,he[Te]!==this._container&&Ye&&(we=se(we,+Ye));isFinite(we)&&(this.options.zIndex=we+se(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Mt.ielt9){bn(this._container,this.options.opacity);var se=+new Date,he=!1,we=!1;for(var Te in this._tiles){var He=this._tiles[Te];if(!(!He.current||!He.loaded)){var Ye=Math.min(1,(se-He.loaded)/200);bn(He.el,Ye),Ye<1?he=!0:(He.active?we=!0:this._onOpaqueTile(He),He.active=!0)}}we&&!this._noPrune&&this._pruneTiles(),he&&(ze(this._fadeFrame),this._fadeFrame=Ie(this._updateOpacity,this))}},_onOpaqueTile:be,_initContainer:function(){this._container||(this._container=Qt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var se=this._tileZoom,he=this.options.maxZoom;if(se!==void 0){for(var we in this._levels)we=Number(we),this._levels[we].el.children.length||we===se?(this._levels[we].el.style.zIndex=he-Math.abs(se-we),this._onUpdateLevel(we)):(tn(this._levels[we].el),this._removeTilesAtZoom(we),this._onRemoveLevel(we),delete this._levels[we]);var Te=this._levels[se],He=this._map;return Te||(Te=this._levels[se]={},Te.el=Qt("div","leaflet-tile-container leaflet-zoom-animated",this._container),Te.el.style.zIndex=he,Te.origin=He.project(He.unproject(He.getPixelOrigin()),se).round(),Te.zoom=se,this._setZoomTransform(Te,He.getCenter(),He.getZoom()),be(Te.el.offsetWidth),this._onCreateLevel(Te)),this._level=Te,Te}},_onUpdateLevel:be,_onRemoveLevel:be,_onCreateLevel:be,_pruneTiles:function(){if(this._map){var se,he,we=this._map.getZoom();if(we>this.options.maxZoom||we<this.options.minZoom){this._removeAllTiles();return}for(se in this._tiles)he=this._tiles[se],he.retain=he.current;for(se in this._tiles)if(he=this._tiles[se],he.current&&!he.active){var Te=he.coords;this._retainParent(Te.x,Te.y,Te.z,Te.z-5)||this._retainChildren(Te.x,Te.y,Te.z,Te.z+2)}for(se in this._tiles)this._tiles[se].retain||this._removeTile(se)}},_removeTilesAtZoom:function(se){for(var he in this._tiles)this._tiles[he].coords.z===se&&this._removeTile(he)},_removeAllTiles:function(){for(var se in this._tiles)this._removeTile(se)},_invalidateAll:function(){for(var se in this._levels)tn(this._levels[se].el),this._onRemoveLevel(Number(se)),delete this._levels[se];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(se,he,we,Te){var He=Math.floor(se/2),Ye=Math.floor(he/2),ot=we-1,vt=new xe(+He,+Ye);vt.z=+ot;var xt=this._tileCoordsToKey(vt),At=this._tiles[xt];return At&&At.active?(At.retain=!0,!0):(At&&At.loaded&&(At.retain=!0),ot>Te?this._retainParent(He,Ye,ot,Te):!1)},_retainChildren:function(se,he,we,Te){for(var He=2*se;He<2*se+2;He++)for(var Ye=2*he;Ye<2*he+2;Ye++){var ot=new xe(He,Ye);ot.z=we+1;var vt=this._tileCoordsToKey(ot),xt=this._tiles[vt];if(xt&&xt.active){xt.retain=!0;continue}else xt&&xt.loaded&&(xt.retain=!0);we+1<Te&&this._retainChildren(He,Ye,we+1,Te)}},_resetView:function(se){var he=se&&(se.pinch||se.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),he,he)},_animateZoom:function(se){this._setView(se.center,se.zoom,!0,se.noUpdate)},_clampZoom:function(se){var he=this.options;return he.minNativeZoom!==void 0&&se<he.minNativeZoom?he.minNativeZoom:he.maxNativeZoom!==void 0&&he.maxNativeZoom<se?he.maxNativeZoom:se},_setView:function(se,he,we,Te){var He=Math.round(he);this.options.maxZoom!==void 0&&He>this.options.maxZoom||this.options.minZoom!==void 0&&He<this.options.minZoom?He=void 0:He=this._clampZoom(He);var Ye=this.options.updateWhenZooming&&He!==this._tileZoom;(!Te||Ye)&&(this._tileZoom=He,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),He!==void 0&&this._update(se),we||this._pruneTiles(),this._noPrune=!!we),this._setZoomTransforms(se,he)},_setZoomTransforms:function(se,he){for(var we in this._levels)this._setZoomTransform(this._levels[we],se,he)},_setZoomTransform:function(se,he,we){var Te=this._map.getZoomScale(we,se.zoom),He=se.origin.multiplyBy(Te).subtract(this._map._getNewPixelOrigin(he,we)).round();Mt.any3d?Pn(se.el,He,Te):ln(se.el,He)},_resetGrid:function(){var se=this._map,he=se.options.crs,we=this._tileSize=this.getTileSize(),Te=this._tileZoom,He=this._map.getPixelWorldBounds(this._tileZoom);He&&(this._globalTileRange=this._pxBoundsToTileRange(He)),this._wrapX=he.wrapLng&&!this.options.noWrap&&[Math.floor(se.project([0,he.wrapLng[0]],Te).x/we.x),Math.ceil(se.project([0,he.wrapLng[1]],Te).x/we.y)],this._wrapY=he.wrapLat&&!this.options.noWrap&&[Math.floor(se.project([he.wrapLat[0],0],Te).y/we.x),Math.ceil(se.project([he.wrapLat[1],0],Te).y/we.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(se){var he=this._map,we=he._animatingZoom?Math.max(he._animateToZoom,he.getZoom()):he.getZoom(),Te=he.getZoomScale(we,this._tileZoom),He=he.project(se,this._tileZoom).floor(),Ye=he.getSize().divideBy(Te*2);return new Re(He.subtract(Ye),He.add(Ye))},_update:function(se){var he=this._map;if(he){var we=this._clampZoom(he.getZoom());if(se===void 0&&(se=he.getCenter()),this._tileZoom!==void 0){var Te=this._getTiledPixelBounds(se),He=this._pxBoundsToTileRange(Te),Ye=He.getCenter(),ot=[],vt=this.options.keepBuffer,xt=new Re(He.getBottomLeft().subtract([vt,-vt]),He.getTopRight().add([vt,-vt]));if(!(isFinite(He.min.x)&&isFinite(He.min.y)&&isFinite(He.max.x)&&isFinite(He.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var At in this._tiles){var zt=this._tiles[At].coords;(zt.z!==this._tileZoom||!xt.contains(new xe(zt.x,zt.y)))&&(this._tiles[At].current=!1)}if(Math.abs(we-this._tileZoom)>1){this._setView(se,we);return}for(var jt=He.min.y;jt<=He.max.y;jt++)for(var Ut=He.min.x;Ut<=He.max.x;Ut++){var mn=new xe(Ut,jt);if(mn.z=this._tileZoom,!!this._isValidTile(mn)){var dn=this._tiles[this._tileCoordsToKey(mn)];dn?dn.current=!0:ot.push(mn)}}if(ot.sort(function(fn,Wn){return fn.distanceTo(Ye)-Wn.distanceTo(Ye)}),ot.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var gn=document.createDocumentFragment();for(Ut=0;Ut<ot.length;Ut++)this._addTile(ot[Ut],gn);this._level.el.appendChild(gn)}}}},_isValidTile:function(se){var he=this._map.options.crs;if(!he.infinite){var we=this._globalTileRange;if(!he.wrapLng&&(se.x<we.min.x||se.x>we.max.x)||!he.wrapLat&&(se.y<we.min.y||se.y>we.max.y))return!1}if(!this.options.bounds)return!0;var Te=this._tileCoordsToBounds(se);return Ze(this.options.bounds).overlaps(Te)},_keyToBounds:function(se){return this._tileCoordsToBounds(this._keyToTileCoords(se))},_tileCoordsToNwSe:function(se){var he=this._map,we=this.getTileSize(),Te=se.scaleBy(we),He=Te.add(we),Ye=he.unproject(Te,se.z),ot=he.unproject(He,se.z);return[Ye,ot]},_tileCoordsToBounds:function(se){var he=this._tileCoordsToNwSe(se),we=new Ge(he[0],he[1]);return this.options.noWrap||(we=this._map.wrapLatLngBounds(we)),we},_tileCoordsToKey:function(se){return se.x+":"+se.y+":"+se.z},_keyToTileCoords:function(se){var he=se.split(":"),we=new xe(+he[0],+he[1]);return we.z=+he[2],we},_removeTile:function(se){var he=this._tiles[se];he&&(tn(he.el),delete this._tiles[se],this.fire("tileunload",{tile:he.el,coords:this._keyToTileCoords(se)}))},_initTile:function(se){Wt(se,"leaflet-tile");var he=this.getTileSize();se.style.width=he.x+"px",se.style.height=he.y+"px",se.onselectstart=be,se.onmousemove=be,Mt.ielt9&&this.options.opacity<1&&bn(se,this.options.opacity)},_addTile:function(se,he){var we=this._getTilePos(se),Te=this._tileCoordsToKey(se),He=this.createTile(this._wrapCoords(se),ie(this._tileReady,this,se));this._initTile(He),this.createTile.length<2&&Ie(ie(this._tileReady,this,se,null,He)),ln(He,we),this._tiles[Te]={el:He,coords:se,current:!0},he.appendChild(He),this.fire("tileloadstart",{tile:He,coords:se})},_tileReady:function(se,he,we){he&&this.fire("tileerror",{error:he,tile:we,coords:se});var Te=this._tileCoordsToKey(se);we=this._tiles[Te],we&&(we.loaded=+new Date,this._map._fadeAnimated?(bn(we.el,0),ze(this._fadeFrame),this._fadeFrame=Ie(this._updateOpacity,this)):(we.active=!0,this._pruneTiles()),he||(Wt(we.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:we.el,coords:se})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Mt.ielt9||!this._map._fadeAnimated?Ie(this._pruneTiles,this):setTimeout(ie(this._pruneTiles,this),250)))},_getTilePos:function(se){return se.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(se){var he=new xe(this._wrapX?ue(se.x,this._wrapX):se.x,this._wrapY?ue(se.y,this._wrapY):se.y);return he.z=se.z,he},_pxBoundsToTileRange:function(se){var he=this.getTileSize();return new Re(se.min.unscaleBy(he).floor(),se.max.unscaleBy(he).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var se in this._tiles)if(!this._tiles[se].loaded)return!1;return!0}});function Ao(se){return new ia(se)}var qn=ia.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(se,he){this._url=se,he=pe(this,he),he.detectRetina&&Mt.retina&&he.maxZoom>0?(he.tileSize=Math.floor(he.tileSize/2),he.zoomReverse?(he.zoomOffset--,he.minZoom=Math.min(he.maxZoom,he.minZoom+1)):(he.zoomOffset++,he.maxZoom=Math.max(he.minZoom,he.maxZoom-1)),he.minZoom=Math.max(0,he.minZoom)):he.zoomReverse?he.minZoom=Math.min(he.maxZoom,he.minZoom):he.maxZoom=Math.max(he.minZoom,he.maxZoom),typeof he.subdomains=="string"&&(he.subdomains=he.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(se,he){return this._url===se&&he===void 0&&(he=!0),this._url=se,he||this.redraw(),this},createTile:function(se,he){var we=document.createElement("img");return qt(we,"load",ie(this._tileOnLoad,this,he,we)),qt(we,"error",ie(this._tileOnError,this,he,we)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(we.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(we.referrerPolicy=this.options.referrerPolicy),we.alt="",we.src=this.getTileUrl(se),we},getTileUrl:function(se){var he={r:Mt.retina?"@2x":"",s:this._getSubdomain(se),x:se.x,y:se.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var we=this._globalTileRange.max.y-se.y;this.options.tms&&(he.y=we),he["-y"]=we}return _e(this._url,re(he,this.options))},_tileOnLoad:function(se,he){Mt.ielt9?setTimeout(ie(se,this,null,he),0):se(null,he)},_tileOnError:function(se,he,we){var Te=this.options.errorTileUrl;Te&&he.getAttribute("src")!==Te&&(he.src=Te),se(we,he)},_onTileRemove:function(se){se.tile.onload=null},_getZoomForUrl:function(){var se=this._tileZoom,he=this.options.maxZoom,we=this.options.zoomReverse,Te=this.options.zoomOffset;return we&&(se=he-se),se+Te},_getSubdomain:function(se){var he=Math.abs(se.x+se.y)%this.options.subdomains.length;return this.options.subdomains[he]},_abortLoading:function(){var se,he;for(se in this._tiles)if(this._tiles[se].coords.z!==this._tileZoom&&(he=this._tiles[se].el,he.onload=be,he.onerror=be,!he.complete)){he.src=Ee;var we=this._tiles[se].coords;tn(he),delete this._tiles[se],this.fire("tileabort",{tile:he,coords:we})}},_removeTile:function(se){var he=this._tiles[se];if(he)return he.el.setAttribute("src",Ee),ia.prototype._removeTile.call(this,se)},_tileReady:function(se,he,we){if(!(!this._map||we&&we.getAttribute("src")===Ee))return ia.prototype._tileReady.call(this,se,he,we)}});function Br(se,he){return new qn(se,he)}var Nr=qn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(se,he){this._url=se;var we=re({},this.defaultWmsParams);for(var Te in he)Te in this.options||(we[Te]=he[Te]);he=pe(this,he);var He=he.detectRetina&&Mt.retina?2:1,Ye=this.getTileSize();we.width=Ye.x*He,we.height=Ye.y*He,this.wmsParams=we},onAdd:function(se){this._crs=this.options.crs||se.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var he=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[he]=this._crs.code,qn.prototype.onAdd.call(this,se)},getTileUrl:function(se){var he=this._tileCoordsToNwSe(se),we=this._crs,Te=qe(we.project(he[0]),we.project(he[1])),He=Te.min,Ye=Te.max,ot=(this._wmsVersion>=1.3&&this._crs===kr?[He.y,He.x,Ye.y,Ye.x]:[He.x,He.y,Ye.x,Ye.y]).join(","),vt=qn.prototype.getTileUrl.call(this,se);return vt+ke(this.wmsParams,vt,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ot},setParams:function(se,he){return re(this.wmsParams,se),he||this.redraw(),this}});function To(se,he){return new Nr(se,he)}qn.WMS=Nr,Br.wms=To;var Nn=kn.extend({options:{padding:.1},initialize:function(se){pe(this,se),ce(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Wt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var se={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(se.zoomanim=this._onAnimZoom),se},_onAnimZoom:function(se){this._updateTransform(se.center,se.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(se,he){var we=this._map.getZoomScale(he,this._zoom),Te=this._map.getSize().multiplyBy(.5+this.options.padding),He=this._map.project(this._center,he),Ye=Te.multiplyBy(-we).add(He).subtract(this._map._getNewPixelOrigin(se,he));Mt.any3d?Pn(this._container,Ye,we):ln(this._container,Ye)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var se in this._layers)this._layers[se]._reset()},_onZoomEnd:function(){for(var se in this._layers)this._layers[se]._project()},_updatePaths:function(){for(var se in this._layers)this._layers[se]._update()},_update:function(){var se=this.options.padding,he=this._map.getSize(),we=this._map.containerPointToLayerPoint(he.multiplyBy(-se)).round();this._bounds=new Re(we,we.add(he.multiplyBy(1+se*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Vr=Nn.extend({options:{tolerance:0},getEvents:function(){var se=Nn.prototype.getEvents.call(this);return se.viewprereset=this._onViewPreReset,se},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Nn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var se=this._container=document.createElement("canvas");qt(se,"mousemove",this._onMouseMove,this),qt(se,"click dblclick mousedown mouseup contextmenu",this._onClick,this),qt(se,"mouseout",this._handleMouseOut,this),se._leaflet_disable_events=!0,this._ctx=se.getContext("2d")},_destroyContainer:function(){ze(this._redrawRequest),delete this._ctx,tn(this._container),en(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var se;this._redrawBounds=null;for(var he in this._layers)se=this._layers[he],se._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Nn.prototype._update.call(this);var se=this._bounds,he=this._container,we=se.getSize(),Te=Mt.retina?2:1;ln(he,se.min),he.width=Te*we.x,he.height=Te*we.y,he.style.width=we.x+"px",he.style.height=we.y+"px",Mt.retina&&this._ctx.scale(2,2),this._ctx.translate(-se.min.x,-se.min.y),this.fire("update")}},_reset:function(){Nn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(se){this._updateDashArray(se),this._layers[ce(se)]=se;var he=se._order={layer:se,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=he),this._drawLast=he,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(se){this._requestRedraw(se)},_removePath:function(se){var he=se._order,we=he.next,Te=he.prev;we?we.prev=Te:this._drawLast=Te,Te?Te.next=we:this._drawFirst=we,delete se._order,delete this._layers[ce(se)],this._requestRedraw(se)},_updatePath:function(se){this._extendRedrawBounds(se),se._project(),se._update(),this._requestRedraw(se)},_updateStyle:function(se){this._updateDashArray(se),this._requestRedraw(se)},_updateDashArray:function(se){if(typeof se.options.dashArray=="string"){var he=se.options.dashArray.split(/[, ]+/),we=[],Te,He;for(He=0;He<he.length;He++){if(Te=Number(he[He]),isNaN(Te))return;we.push(Te)}se.options._dashArray=we}else se.options._dashArray=se.options.dashArray},_requestRedraw:function(se){this._map&&(this._extendRedrawBounds(se),this._redrawRequest=this._redrawRequest||Ie(this._redraw,this))},_extendRedrawBounds:function(se){if(se._pxBounds){var he=(se.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Re,this._redrawBounds.extend(se._pxBounds.min.subtract([he,he])),this._redrawBounds.extend(se._pxBounds.max.add([he,he]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var se=this._redrawBounds;if(se){var he=se.getSize();this._ctx.clearRect(se.min.x,se.min.y,he.x,he.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var se,he=this._redrawBounds;if(this._ctx.save(),he){var we=he.getSize();this._ctx.beginPath(),this._ctx.rect(he.min.x,he.min.y,we.x,we.y),this._ctx.clip()}this._drawing=!0;for(var Te=this._drawFirst;Te;Te=Te.next)se=Te.layer,(!he||se._pxBounds&&se._pxBounds.intersects(he))&&se._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(se,he){if(this._drawing){var we,Te,He,Ye,ot=se._parts,vt=ot.length,xt=this._ctx;if(vt){for(xt.beginPath(),we=0;we<vt;we++){for(Te=0,He=ot[we].length;Te<He;Te++)Ye=ot[we][Te],xt[Te?"lineTo":"moveTo"](Ye.x,Ye.y);he&&xt.closePath()}this._fillStroke(xt,se)}}},_updateCircle:function(se){if(!(!this._drawing||se._empty())){var he=se._point,we=this._ctx,Te=Math.max(Math.round(se._radius),1),He=(Math.max(Math.round(se._radiusY),1)||Te)/Te;He!==1&&(we.save(),we.scale(1,He)),we.beginPath(),we.arc(he.x,he.y/He,Te,0,Math.PI*2,!1),He!==1&&we.restore(),this._fillStroke(we,se)}},_fillStroke:function(se,he){var we=he.options;we.fill&&(se.globalAlpha=we.fillOpacity,se.fillStyle=we.fillColor||we.color,se.fill(we.fillRule||"evenodd")),we.stroke&&we.weight!==0&&(se.setLineDash&&se.setLineDash(he.options&&he.options._dashArray||[]),se.globalAlpha=we.opacity,se.lineWidth=we.weight,se.strokeStyle=we.color,se.lineCap=we.lineCap,se.lineJoin=we.lineJoin,se.stroke())},_onClick:function(se){for(var he=this._map.mouseEventToLayerPoint(se),we,Te,He=this._drawFirst;He;He=He.next)we=He.layer,we.options.interactive&&we._containsPoint(he)&&(!(se.type==="click"||se.type==="preclick")||!this._map._draggableMoved(we))&&(Te=we);this._fireEvent(Te?[Te]:!1,se)},_onMouseMove:function(se){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var he=this._map.mouseEventToLayerPoint(se);this._handleMouseHover(se,he)}},_handleMouseOut:function(se){var he=this._hoveredLayer;he&&(nn(this._container,"leaflet-interactive"),this._fireEvent([he],se,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(se,he){if(!this._mouseHoverThrottled){for(var we,Te,He=this._drawFirst;He;He=He.next)we=He.layer,we.options.interactive&&we._containsPoint(he)&&(Te=we);Te!==this._hoveredLayer&&(this._handleMouseOut(se),Te&&(Wt(this._container,"leaflet-interactive"),this._fireEvent([Te],se,"mouseover"),this._hoveredLayer=Te)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,se),this._mouseHoverThrottled=!0,setTimeout(ie(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(se,he,we){this._map._fireDOMEvent(he,we||he.type,se)},_bringToFront:function(se){var he=se._order;if(he){var we=he.next,Te=he.prev;if(we)we.prev=Te;else return;Te?Te.next=we:we&&(this._drawFirst=we),he.prev=this._drawLast,this._drawLast.next=he,he.next=null,this._drawLast=he,this._requestRedraw(se)}},_bringToBack:function(se){var he=se._order;if(he){var we=he.next,Te=he.prev;if(Te)Te.next=we;else return;we?we.prev=Te:Te&&(this._drawLast=Te),he.prev=null,he.next=this._drawFirst,this._drawFirst.prev=he,this._drawFirst=he,this._requestRedraw(se)}}});function Mr(se){return Mt.canvas?new Vr(se):null}var sa=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(se){return document.createElement("<lvml:"+se+' class="lvml">')}}catch{}return function(se){return document.createElement("<"+se+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Po={_initContainer:function(){this._container=Qt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Nn.prototype._update.call(this),this.fire("update"))},_initPath:function(se){var he=se._container=sa("shape");Wt(he,"leaflet-vml-shape "+(this.options.className||"")),he.coordsize="1 1",se._path=sa("path"),he.appendChild(se._path),this._updateStyle(se),this._layers[ce(se)]=se},_addPath:function(se){var he=se._container;this._container.appendChild(he),se.options.interactive&&se.addInteractiveTarget(he)},_removePath:function(se){var he=se._container;tn(he),se.removeInteractiveTarget(he),delete this._layers[ce(se)]},_updateStyle:function(se){var he=se._stroke,we=se._fill,Te=se.options,He=se._container;He.stroked=!!Te.stroke,He.filled=!!Te.fill,Te.stroke?(he||(he=se._stroke=sa("stroke")),He.appendChild(he),he.weight=Te.weight+"px",he.color=Te.color,he.opacity=Te.opacity,Te.dashArray?he.dashStyle=$e(Te.dashArray)?Te.dashArray.join(" "):Te.dashArray.replace(/( *, *)/g," "):he.dashStyle="",he.endcap=Te.lineCap.replace("butt","flat"),he.joinstyle=Te.lineJoin):he&&(He.removeChild(he),se._stroke=null),Te.fill?(we||(we=se._fill=sa("fill")),He.appendChild(we),we.color=Te.fillColor||Te.color,we.opacity=Te.fillOpacity):we&&(He.removeChild(we),se._fill=null)},_updateCircle:function(se){var he=se._point.round(),we=Math.round(se._radius),Te=Math.round(se._radiusY||we);this._setPath(se,se._empty()?"M0 0":"AL "+he.x+","+he.y+" "+we+","+Te+" 0,"+65535*360)},_setPath:function(se,he){se._path.v=he},_bringToFront:function(se){Rn(se._container)},_bringToBack:function(se){On(se._container)}},Ca=Mt.vml?sa:Qe,la=Nn.extend({_initContainer:function(){this._container=Ca("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ca("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){tn(this._container),en(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Nn.prototype._update.call(this);var se=this._bounds,he=se.getSize(),we=this._container;(!this._svgSize||!this._svgSize.equals(he))&&(this._svgSize=he,we.setAttribute("width",he.x),we.setAttribute("height",he.y)),ln(we,se.min),we.setAttribute("viewBox",[se.min.x,se.min.y,he.x,he.y].join(" ")),this.fire("update")}},_initPath:function(se){var he=se._path=Ca("path");se.options.className&&Wt(he,se.options.className),se.options.interactive&&Wt(he,"leaflet-interactive"),this._updateStyle(se),this._layers[ce(se)]=se},_addPath:function(se){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(se._path),se.addInteractiveTarget(se._path)},_removePath:function(se){tn(se._path),se.removeInteractiveTarget(se._path),delete this._layers[ce(se)]},_updatePath:function(se){se._project(),se._update()},_updateStyle:function(se){var he=se._path,we=se.options;he&&(we.stroke?(he.setAttribute("stroke",we.color),he.setAttribute("stroke-opacity",we.opacity),he.setAttribute("stroke-width",we.weight),he.setAttribute("stroke-linecap",we.lineCap),he.setAttribute("stroke-linejoin",we.lineJoin),we.dashArray?he.setAttribute("stroke-dasharray",we.dashArray):he.removeAttribute("stroke-dasharray"),we.dashOffset?he.setAttribute("stroke-dashoffset",we.dashOffset):he.removeAttribute("stroke-dashoffset")):he.setAttribute("stroke","none"),we.fill?(he.setAttribute("fill",we.fillColor||we.color),he.setAttribute("fill-opacity",we.fillOpacity),he.setAttribute("fill-rule",we.fillRule||"evenodd")):he.setAttribute("fill","none"))},_updatePoly:function(se,he){this._setPath(se,ut(se._parts,he))},_updateCircle:function(se){var he=se._point,we=Math.max(Math.round(se._radius),1),Te=Math.max(Math.round(se._radiusY),1)||we,He="a"+we+","+Te+" 0 1,0 ",Ye=se._empty()?"M0 0":"M"+(he.x-we)+","+he.y+He+we*2+",0 "+He+-we*2+",0 ";this._setPath(se,Ye)},_setPath:function(se,he){se._path.setAttribute("d",he)},_bringToFront:function(se){Rn(se._path)},_bringToBack:function(se){On(se._path)}});Mt.vml&&la.include(Po);function Ar(se){return Mt.svg||Mt.vml?new la(se):null}Kt.include({getRenderer:function(se){var he=se.options.renderer||this._getPaneRenderer(se.options.pane)||this.options.renderer||this._renderer;return he||(he=this._renderer=this._createRenderer()),this.hasLayer(he)||this.addLayer(he),he},_getPaneRenderer:function(se){if(se==="overlayPane"||se===void 0)return!1;var he=this._paneRenderers[se];return he===void 0&&(he=this._createRenderer({pane:se}),this._paneRenderers[se]=he),he},_createRenderer:function(se){return this.options.preferCanvas&&Mr(se)||Ar(se)}});var Tr=Gn.extend({initialize:function(se,he){Gn.prototype.initialize.call(this,this._boundsToLatLngs(se),he)},setBounds:function(se){return this.setLatLngs(this._boundsToLatLngs(se))},_boundsToLatLngs:function(se){return se=Ze(se),[se.getSouthWest(),se.getNorthWest(),se.getNorthEast(),se.getSouthEast()]}});function Lo(se,he){return new Tr(se,he)}la.create=Ca,la.pointsToPath=ut,Bn.geometryToLayer=$a,Bn.coordsToLatLng=Ka,Bn.coordsToLatLngs=ya,Bn.latLngToCoords=Ja,Bn.latLngsToCoords=ka,Bn.getFeature=Zn,Bn.asFeature=_a,Kt.mergeOptions({boxZoom:!0});var Pr=xn.extend({initialize:function(se){this._map=se,this._container=se._container,this._pane=se._panes.overlayPane,this._resetStateTimeout=0,se.on("unload",this._destroy,this)},addHooks:function(){qt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){en(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){tn(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(se){if(!se.shiftKey||se.which!==1&&se.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Qn(),Pa(),this._startPoint=this._map.mouseEventToContainerPoint(se),qt(document,{contextmenu:Dn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(se){this._moved||(this._moved=!0,this._box=Qt("div","leaflet-zoom-box",this._container),Wt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(se);var he=new Re(this._point,this._startPoint),we=he.getSize();ln(this._box,he.min),this._box.style.width=we.x+"px",this._box.style.height=we.y+"px"},_finish:function(){this._moved&&(tn(this._box),nn(this._container,"leaflet-crosshair")),ea(),La(),en(document,{contextmenu:Dn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(se){if(!(se.which!==1&&se.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(ie(this._resetState,this),0);var he=new Ge(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(he).fire("boxzoomend",{boxZoomBounds:he})}},_onKeyDown:function(se){se.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Kt.addInitHook("addHandler","boxZoom",Pr),Kt.mergeOptions({doubleClickZoom:!0});var Lr=xn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(se){var he=this._map,we=he.getZoom(),Te=he.options.zoomDelta,He=se.originalEvent.shiftKey?we-Te:we+Te;he.options.doubleClickZoom==="center"?he.setZoom(He):he.setZoomAround(se.containerPoint,He)}});Kt.addInitHook("addHandler","doubleClickZoom",Lr),Kt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Fr=xn.extend({addHooks:function(){if(!this._draggable){var se=this._map;this._draggable=new An(se._mapPane,se._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),se.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),se.on("zoomend",this._onZoomEnd,this),se.whenReady(this._onZoomEnd,this))}Wt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){nn(this._map._container,"leaflet-grab"),nn(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var se=this._map;if(se._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var he=Ze(this._map.options.maxBounds);this._offsetLimit=qe(this._map.latLngToContainerPoint(he.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(he.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;se.fire("movestart").fire("dragstart"),se.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(se){if(this._map.options.inertia){var he=this._lastTime=+new Date,we=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(we),this._times.push(he),this._prunePositions(he)}this._map.fire("move",se).fire("drag",se)},_prunePositions:function(se){for(;this._positions.length>1&&se-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var se=this._map.getSize().divideBy(2),he=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=he.subtract(se).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(se,he){return se-(se-he)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var se=this._draggable._newPos.subtract(this._draggable._startPos),he=this._offsetLimit;se.x<he.min.x&&(se.x=this._viscousLimit(se.x,he.min.x)),se.y<he.min.y&&(se.y=this._viscousLimit(se.y,he.min.y)),se.x>he.max.x&&(se.x=this._viscousLimit(se.x,he.max.x)),se.y>he.max.y&&(se.y=this._viscousLimit(se.y,he.max.y)),this._draggable._newPos=this._draggable._startPos.add(se)}},_onPreDragWrap:function(){var se=this._worldWidth,he=Math.round(se/2),we=this._initialWorldOffset,Te=this._draggable._newPos.x,He=(Te-he+we)%se+he-we,Ye=(Te+he+we)%se-he-we,ot=Math.abs(He+we)<Math.abs(Ye+we)?He:Ye;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ot},_onDragEnd:function(se){var he=this._map,we=he.options,Te=!we.inertia||se.noInertia||this._times.length<2;if(he.fire("dragend",se),Te)he.fire("moveend");else{this._prunePositions(+new Date);var He=this._lastPos.subtract(this._positions[0]),Ye=(this._lastTime-this._times[0])/1e3,ot=we.easeLinearity,vt=He.multiplyBy(ot/Ye),xt=vt.distanceTo([0,0]),At=Math.min(we.inertiaMaxSpeed,xt),zt=vt.multiplyBy(At/xt),jt=At/(we.inertiaDeceleration*ot),Ut=zt.multiplyBy(-jt/2).round();!Ut.x&&!Ut.y?he.fire("moveend"):(Ut=he._limitOffset(Ut,he.options.maxBounds),Ie(function(){he.panBy(Ut,{duration:jt,easeLinearity:ot,noMoveStart:!0,animate:!0})}))}}});Kt.addInitHook("addHandler","dragging",Fr),Kt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Dr=xn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(se){this._map=se,this._setPanDelta(se.options.keyboardPanDelta),this._setZoomDelta(se.options.zoomDelta)},addHooks:function(){var se=this._map._container;se.tabIndex<=0&&(se.tabIndex="0"),qt(se,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),en(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var se=document.body,he=document.documentElement,we=se.scrollTop||he.scrollTop,Te=se.scrollLeft||he.scrollLeft;this._map._container.focus(),window.scrollTo(Te,we)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(se){var he=this._panKeys={},we=this.keyCodes,Te,He;for(Te=0,He=we.left.length;Te<He;Te++)he[we.left[Te]]=[-1*se,0];for(Te=0,He=we.right.length;Te<He;Te++)he[we.right[Te]]=[se,0];for(Te=0,He=we.down.length;Te<He;Te++)he[we.down[Te]]=[0,se];for(Te=0,He=we.up.length;Te<He;Te++)he[we.up[Te]]=[0,-1*se]},_setZoomDelta:function(se){var he=this._zoomKeys={},we=this.keyCodes,Te,He;for(Te=0,He=we.zoomIn.length;Te<He;Te++)he[we.zoomIn[Te]]=se;for(Te=0,He=we.zoomOut.length;Te<He;Te++)he[we.zoomOut[Te]]=-se},_addHooks:function(){qt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){en(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(se){if(!(se.altKey||se.ctrlKey||se.metaKey)){var he=se.keyCode,we=this._map,Te;if(he in this._panKeys){if(!we._panAnim||!we._panAnim._inProgress)if(Te=this._panKeys[he],se.shiftKey&&(Te=Fe(Te).multiplyBy(3)),we.options.maxBounds&&(Te=we._limitOffset(Fe(Te),we.options.maxBounds)),we.options.worldCopyJump){var He=we.wrapLatLng(we.unproject(we.project(we.getCenter()).add(Te)));we.panTo(He)}else we.panBy(Te)}else if(he in this._zoomKeys)we.setZoom(we.getZoom()+(se.shiftKey?3:1)*this._zoomKeys[he]);else if(he===27&&we._popup&&we._popup.options.closeOnEscapeKey)we.closePopup();else return;Dn(se)}}});Kt.addInitHook("addHandler","keyboard",Dr),Kt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var zr=xn.extend({addHooks:function(){qt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){en(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(se){var he=sr(se),we=this._map.options.wheelDebounceTime;this._delta+=he,this._lastMousePos=this._map.mouseEventToContainerPoint(se),this._startTime||(this._startTime=+new Date);var Te=Math.max(we-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(ie(this._performZoom,this),Te),Dn(se)},_performZoom:function(){var se=this._map,he=se.getZoom(),we=this._map.options.zoomSnap||0;se._stop();var Te=this._delta/(this._map.options.wheelPxPerZoomLevel*4),He=4*Math.log(2/(1+Math.exp(-Math.abs(Te))))/Math.LN2,Ye=we?Math.ceil(He/we)*we:He,ot=se._limitZoom(he+(this._delta>0?Ye:-Ye))-he;this._delta=0,this._startTime=null,ot&&(se.options.scrollWheelZoom==="center"?se.setZoom(he+ot):se.setZoomAround(this._lastMousePos,he+ot))}});Kt.addInitHook("addHandler","scrollWheelZoom",zr);var Fo=600;Kt.mergeOptions({tapHold:Mt.touchNative&&Mt.safari&&Mt.mobile,tapTolerance:15});var Ir=xn.extend({addHooks:function(){qt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){en(this._map._container,"touchstart",this._onDown,this)},_onDown:function(se){if(clearTimeout(this._holdTimeout),se.touches.length===1){var he=se.touches[0];this._startPos=this._newPos=new xe(he.clientX,he.clientY),this._holdTimeout=setTimeout(ie(function(){this._cancel(),this._isTapValid()&&(qt(document,"touchend",un),qt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",he))},this),Fo),qt(document,"touchend touchcancel contextmenu",this._cancel,this),qt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function se(){en(document,"touchend",un),en(document,"touchend touchcancel",se)},_cancel:function(){clearTimeout(this._holdTimeout),en(document,"touchend touchcancel contextmenu",this._cancel,this),en(document,"touchmove",this._onMove,this)},_onMove:function(se){var he=se.touches[0];this._newPos=new xe(he.clientX,he.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(se,he){var we=new MouseEvent(se,{bubbles:!0,cancelable:!0,view:window,screenX:he.screenX,screenY:he.screenY,clientX:he.clientX,clientY:he.clientY});we._simulated=!0,he.target.dispatchEvent(we)}});Kt.addInitHook("addHandler","tapHold",Ir),Kt.mergeOptions({touchZoom:Mt.touch,bounceAtZoomLimits:!0});var Rr=xn.extend({addHooks:function(){Wt(this._map._container,"leaflet-touch-zoom"),qt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){nn(this._map._container,"leaflet-touch-zoom"),en(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(se){var he=this._map;if(!(!se.touches||se.touches.length!==2||he._animatingZoom||this._zooming)){var we=he.mouseEventToContainerPoint(se.touches[0]),Te=he.mouseEventToContainerPoint(se.touches[1]);this._centerPoint=he.getSize()._divideBy(2),this._startLatLng=he.containerPointToLatLng(this._centerPoint),he.options.touchZoom!=="center"&&(this._pinchStartLatLng=he.containerPointToLatLng(we.add(Te)._divideBy(2))),this._startDist=we.distanceTo(Te),this._startZoom=he.getZoom(),this._moved=!1,this._zooming=!0,he._stop(),qt(document,"touchmove",this._onTouchMove,this),qt(document,"touchend touchcancel",this._onTouchEnd,this),un(se)}},_onTouchMove:function(se){if(!(!se.touches||se.touches.length!==2||!this._zooming)){var he=this._map,we=he.mouseEventToContainerPoint(se.touches[0]),Te=he.mouseEventToContainerPoint(se.touches[1]),He=we.distanceTo(Te)/this._startDist;if(this._zoom=he.getScaleZoom(He,this._startZoom),!he.options.bounceAtZoomLimits&&(this._zoom<he.getMinZoom()&&He<1||this._zoom>he.getMaxZoom()&&He>1)&&(this._zoom=he._limitZoom(this._zoom)),he.options.touchZoom==="center"){if(this._center=this._startLatLng,He===1)return}else{var Ye=we._add(Te)._divideBy(2)._subtract(this._centerPoint);if(He===1&&Ye.x===0&&Ye.y===0)return;this._center=he.unproject(he.project(this._pinchStartLatLng,this._zoom).subtract(Ye),this._zoom)}this._moved||(he._moveStart(!0,!1),this._moved=!0),ze(this._animRequest);var ot=ie(he._move,he,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Ie(ot,this,!0),un(se)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ze(this._animRequest),en(document,"touchmove",this._onTouchMove,this),en(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Kt.addInitHook("addHandler","touchZoom",Rr),Kt.BoxZoom=Pr,Kt.DoubleClickZoom=Lr,Kt.Drag=Fr,Kt.Keyboard=Dr,Kt.ScrollWheelZoom=zr,Kt.TapHold=Ir,Kt.TouchZoom=Rr,ne.Bounds=Re,ne.Browser=Mt,ne.CRS=at,ne.Canvas=Vr,ne.Circle=Xa,ne.CircleMarker=ga,ne.Class=Ne,ne.Control=yn,ne.DivIcon=Sr,ne.DivOverlay=wn,ne.DomEvent=Qr,ne.DomUtil=Kr,ne.Draggable=An,ne.Evented=Me,ne.FeatureGroup=Cn,ne.GeoJSON=Bn,ne.GridLayer=ia,ne.Handler=xn,ne.Icon=jn,ne.ImageOverlay=xa,ne.LatLng=Xe,ne.LatLngBounds=Ge,ne.Layer=kn,ne.LayerGroup=Hn,ne.LineUtil=mo,ne.Map=Kt,ne.Marker=va,ne.Mixin=io,ne.Path=Tn,ne.Point=xe,ne.PolyUtil=so,ne.Polygon=Gn,ne.Polyline=Sn,ne.Popup=wa,ne.PosAnimation=lr,ne.Projection=fo,ne.Rectangle=Tr,ne.Renderer=Nn,ne.SVG=la,ne.SVGOverlay=Cr,ne.TileLayer=qn,ne.Tooltip=Ea,ne.Transformation=gt,ne.Util=Ve,ne.VideoOverlay=Er,ne.bind=ie,ne.bounds=qe,ne.canvas=Mr,ne.circle=_o,ne.circleMarker=ko,ne.control=aa,ne.divIcon=Mo,ne.extend=re,ne.featureGroup=go,ne.geoJSON=wr,ne.geoJson=Eo,ne.gridLayer=Ao,ne.icon=$o,ne.imageOverlay=Co,ne.latLng=Ue,ne.latLngBounds=Ze,ne.layerGroup=vo,ne.map=eo,ne.marker=yo,ne.point=Fe,ne.polygon=wo,ne.polyline=xo,ne.popup=No,ne.rectangle=Lo,ne.setOptions=pe,ne.stamp=ce,ne.svg=Ar,ne.svgOverlay=Bo,ne.tileLayer=Br,ne.tooltip=Vo,ne.transformation=Et,ne.version=ae,ne.videoOverlay=So;var Do=window.L;ne.noConflict=function(){return window.L=Do,this},window.L=ne})})(leafletSrc,leafletSrc.exports);var leafletSrcExports=leafletSrc.exports;const L$2=getDefaultExportFromCjs(leafletSrcExports);async function copyToClipboard(ee){var ae;if(!ee||!ee.trim())return!1;if((ae=navigator==null?void 0:navigator.clipboard)!=null&&ae.writeText)try{return await navigator.clipboard.writeText(ee),!0}catch{}const te=document.createElement("textarea");te.value=ee,te.setAttribute("readonly",""),te.style.position="fixed",te.style.left="-9999px",document.body.appendChild(te),te.select();const ne=document.execCommand("copy");return document.body.removeChild(te),ne}const _hoisted_1$y={class:"sm-map"},_hoisted_2$v={class:"sm-map-surface"},_hoisted_3$s=["id"],_hoisted_4$r={key:0,class:"sm-map-empty"},_hoisted_5$p={key:1,class:"sm-map-hint"},_hoisted_6$l={key:0,class:"sm-map-zoom"},_hoisted_7$j=["disabled"],_hoisted_8$g=["disabled"],_hoisted_9$d={key:0,class:"sm-map-info"},_hoisted_10$c=["title"],_hoisted_11$b={key:0,class:"sm-map-subtitle"},_hoisted_12$9={class:"sm-map-actions"},_hoisted_13$7=["href"],_hoisted_14$7={class:"size-3.5",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_15$6={key:0,d:"M9.6 17.2 4.8 12.4l1.4-1.4 3.4 3.4 8-8 1.4 1.4-9.4 9.4Z"},_hoisted_16$5={key:1,d:"M8 3h8a2 2 0 0 1 2 2v1h-2V5H8v10h1v2H8a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm4 5h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2Zm0 2v9h7v-9h-7Z"},PREVIEW_ZOOM=15,_sfc_main$D={__name:"MessageLocationMap",props:{map:{type:Object,required:!0},mapId:{type:String,default:null},pinUrl:{type:String,default:"/image/location-pin.png"},tileTheme:{type:String,default:"auto",validator:ee=>["auto","dark","light"].includes(ee)}},setup(ee){const te=ee,ne={dark:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",light:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png"},ae=[11,19],re=e$b.ref(null),oe=e$b.ref(!1),ie=e$b.ref(PREVIEW_ZOOM),le=e$b.ref(!1);let ce=null,de=null,ue=null,be=null,fe=null,ge=null;const me=()=>{var Oe,Ie,ze;const Ae=Number((Oe=te.map)==null?void 0:Oe.latitude),De=Number(((Ie=te.map)==null?void 0:Ie.longitude)??((ze=te.map)==null?void 0:ze.length));return Number.isFinite(Ae)&&Number.isFinite(De)?[Ae,De]:null},pe=e$b.computed(()=>{var Ae,De;return((Ae=te.map)==null?void 0:Ae.name)||((De=te.map)==null?void 0:De.address)||"Localização compartilhada"}),ke=e$b.computed(()=>{var Oe,Ie;const Ae=me();return Ae?((Oe=te.map)!=null&&Oe.name?(Ie=te.map)==null?void 0:Ie.address:null)||Ae.map(ze=>ze.toFixed(5)).join(", "):""}),ve=e$b.computed(()=>{var Ae;return((Ae=me())==null?void 0:Ae.join(", "))??""}),_e=e$b.computed(()=>`https://www.google.com/maps/dir/?api=1&destination=${ve.value}`);function $e(Ae){const De=Math.min(ae[1],Math.max(ae[0],ie.value+Ae));De!==ie.value&&(ie.value=De,ce==null||ce.setZoom(De))}async function ye(){await copyToClipboard(ve.value)&&(le.value=!0,clearTimeout(ge),ge=setTimeout(()=>le.value=!1,1600))}function Ee(){return te.tileTheme!=="auto"?ne[te.tileTheme]:document.documentElement.classList.contains("dark")?ne.light:ne.dark}function Se(){const Ae=me();if(!Ae)return;const[De,Oe]=Ae;N$3.show([{src:`https://www.google.com/maps?q=${De},${Oe}&z=19&output=embed`,type:"iframe",caption:pe.value}],{Toolbar:{display:{left:["infobar"],right:["close"]}},iframe:{preload:!1,css:{width:"90%",height:"80vh",borderRadius:"12px"}}})}function Le(){const Ae=me();!re.value||ce||!Ae||(ce=L$2.map(re.value,{zoomControl:!1,attributionControl:!0,dragging:!1,touchZoom:!1,scrollWheelZoom:!1,doubleClickZoom:!1,boxZoom:!1,keyboard:!1,tap:!1,inertia:!1}).setView(Ae,ie.value),de=L$2.tileLayer(Ee(),{maxZoom:19,detectRetina:!0}),de.addTo(ce),L$2.marker(Ae,{icon:L$2.icon({iconUrl:te.pinUrl,iconSize:[40,40],iconAnchor:[20,36]}),keyboard:!1,interactive:!1}).addTo(ce),ce.attributionControl.setPrefix(""),oe.value=!0,typeof ResizeObserver=="function"?(fe=new ResizeObserver(()=>ce==null?void 0:ce.invalidateSize(!1)),fe.observe(re.value)):requestAnimationFrame(()=>ce==null?void 0:ce.invalidateSize(!1)),te.tileTheme==="auto"&&(be=new MutationObserver(()=>{de==null||de.setUrl(Ee())}),be.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})))}return e$b.onMounted(()=>{if(typeof IntersectionObserver!="function"){Le();return}ue=new IntersectionObserver(Ae=>{Ae.some(De=>De.isIntersecting)&&(ue.disconnect(),ue=null,Le())},{rootMargin:"200px"}),ue.observe(re.value)}),e$b.onBeforeUnmount(()=>{clearTimeout(ge),ue==null||ue.disconnect(),be==null||be.disconnect(),fe==null||fe.disconnect(),ue=null,be=null,fe=null,ce==null||ce.remove(),ce=null,de=null}),(Ae,De)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$y,[e$b.createElementVNode("div",_hoisted_2$v,[e$b.createElementVNode("button",{type:"button",class:"sm-map-open",title:"Abrir no Google Maps",onClick:Se},[e$b.createElementVNode("span",{id:ee.mapId||void 0,ref_key:"container",ref:re,class:"sm-map-canvas"},null,8,_hoisted_3$s),me()?oe.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$p,[...De[2]||(De[2]=[e$b.createElementVNode("svg",{class:"size-3.5",viewBox:"0 0 24 24",fill:"currentColor"},[e$b.createElementVNode("path",{d:"M12 2a7 7 0 0 0-7 7c0 5.1 6.1 12.2 6.4 12.5a.8.8 0 0 0 1.2 0C13 21.2 19 14.1 19 9a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6a2.5 2.5 0 0 1 0 5.5Z"})],-1),e$b.createTextVNode(" Ver no mapa ",-1)])])):e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_4$r,"Localização indisponível"))]),oe.value&&me()?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$l,[e$b.createElementVNode("button",{type:"button",title:"Aproximar",disabled:ie.value>=19,onClick:De[0]||(De[0]=Oe=>$e(1))}," + ",8,_hoisted_7$j),e$b.createElementVNode("button",{type:"button",title:"Afastar",disabled:ie.value<=11,onClick:De[1]||(De[1]=Oe=>$e(-1))}," − ",8,_hoisted_8$g)])):e$b.createCommentVNode("",!0)]),me()?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$d,[e$b.createElementVNode("p",{class:"sm-map-title",title:pe.value},e$b.toDisplayString(pe.value),9,_hoisted_10$c),ke.value?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_11$b,e$b.toDisplayString(ke.value),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_12$9,[e$b.createElementVNode("a",{class:"sm-map-action",href:_e.value,target:"_blank",rel:"noopener noreferrer"},[...De[3]||(De[3]=[e$b.createElementVNode("svg",{class:"size-3.5",viewBox:"0 0 24 24",fill:"currentColor"},[e$b.createElementVNode("path",{d:"M11.3 2.3a1 1 0 0 1 1.4 0l9 9a1 1 0 0 1 0 1.4l-9 9a1 1 0 0 1-1.4 0l-9-9a1 1 0 0 1 0-1.4l9-9Zm1.2 4.4v3H9a2.5 2.5 0 0 0-2.5 2.5V15h2v-2.8c0-.3.2-.5.5-.5h3.5v3l4-3.5-4-3.5Z"})],-1),e$b.createTextVNode(" Rota ",-1)])],8,_hoisted_13$7),e$b.createElementVNode("button",{type:"button",class:"sm-map-action",onClick:ye},[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_14$7,[le.value?(e$b.openBlock(),e$b.createElementBlock("path",_hoisted_15$6)):(e$b.openBlock(),e$b.createElementBlock("path",_hoisted_16$5))])),e$b.createTextVNode(" "+e$b.toDisplayString(le.value?"Copiado":"Copiar"),1)])])])):e$b.createCommentVNode("",!0)]))}},MessageLocationMap=_export_sfc$1(_sfc_main$D,[["__scopeId","data-v-01f542ea"]]),RECENT_STORAGE_KEY="smClickEmojiRecent",SKIN_TONE_STORAGE_KEY="smClickEmojiSkinTone",MAX_RECENT=32;function readStorage(ee,te){try{const ne=window.localStorage.getItem(ee);return ne!==null?JSON.parse(ne):te}catch{return te}}function writeStorage(ee,te){try{window.localStorage.setItem(ee,JSON.stringify(te))}catch{}}const useEmojiPickerStore=pinia.defineStore("smClickEmojiPicker",{state:()=>({recent:readStorage(RECENT_STORAGE_KEY,[]),skinTone:readStorage(SKIN_TONE_STORAGE_KEY,"default")}),actions:{addRecent(ee){const te=this.recent.filter(ne=>ne!==ee);this.recent=[ee,...te].slice(0,MAX_RECENT),writeStorage(RECENT_STORAGE_KEY,this.recent)},setSkinTone(ee){this.skinTone=ee,writeStorage(SKIN_TONE_STORAGE_KEY,ee)}}}),segmenter=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter("en",{granularity:"grapheme"}):null,ZWJ="",VARIATION_SELECTOR_16="️",COMBINING_ENCLOSING_KEYCAP="⃣",REGIONAL_INDICATOR_MIN=127462,REGIONAL_INDICATOR_MAX=127487,SKIN_TONE_MIN=127995,SKIN_TONE_MAX=127999;function isRegionalIndicator(ee){return ee>=REGIONAL_INDICATOR_MIN&&ee<=REGIONAL_INDICATOR_MAX}function isSkinToneModifier(ee){return ee>=SKIN_TONE_MIN&&ee<=SKIN_TONE_MAX}function splitGraphemesFallback(ee){const te=Array.from(ee),ne=[];let ae="",re=0;function oe(){ae&&ne.push(ae),ae="",re=0}for(const ie of te){const le=ie.codePointAt(0),ce=isRegionalIndicator(le),de=ae[ae.length-1];if(!ae){ae=ie,re=ce?1:0;continue}if(ie===ZWJ||de===ZWJ||ie===VARIATION_SELECTOR_16||ie===COMBINING_ENCLOSING_KEYCAP||isSkinToneModifier(le)){ae+=ie;continue}if(ce&&re===1){ae+=ie,re=2;continue}oe(),ae=ie,re=ce?1:0}return oe(),ne}function splitGraphemes(ee){return ee?segmenter?Array.from(segmenter.segment(ee),te=>te.segment):splitGraphemesFallback(ee):[]}function countGraphemes(ee){return splitGraphemes(ee).length}const SKIN_TONES=[{id:"default",modifier:"",label:"Padrão",swatch:"#ffd225"},{id:"light",modifier:String.fromCodePoint(127995),label:"Claro",swatch:"#ffdfbd"},{id:"medium-light",modifier:String.fromCodePoint(127996),label:"Médio-claro",swatch:"#e9c197"},{id:"medium",modifier:String.fromCodePoint(127997),label:"Médio",swatch:"#c88e62"},{id:"medium-dark",modifier:String.fromCodePoint(127998),label:"Médio-escuro",swatch:"#a86637"},{id:"dark",modifier:String.fromCodePoint(127999),label:"Escuro",swatch:"#60463a"}],SKIN_TONE_BASE_CHARS=new Set(["👋","🤚","🖐️","✋","🖖","👌","🤌","🤏","✌️","🤞","🫰","🤟","🤘","👈","👉","👆","🖕","👇","☝️","👍","👎","✊","👊","🤛","🤜","👏","🙌","🫶","👐","🤲","🙏","💪","🦵","🦶","👂","👃","👶","🧒","🧑","👦","👧","👨","👩","🧓","👴","👵"]);function stripSkinTone(ee){return Array.from(ee).filter(te=>{const ne=te.codePointAt(0);return!(ne>=127995&&ne<=127999)}).join("")}function applySkinTone(ee,te){return splitGraphemes(ee).map(ne=>{const ae=stripSkinTone(ne);return SKIN_TONE_BASE_CHARS.has(ae)?ae+te:ne}).join("")}const EMOJI_CATEGORIES=[{id:"smileys",label:"Smileys e pessoas",icon:"😀",emojis:[{char:"😀",name:"rosto sorrindo"},{char:"😃",name:"rosto sorrindo boca aberta"},{char:"😄",name:"rosto sorrindo olhos fechados"},{char:"😁",name:"rosto sorrindo grande"},{char:"😆",name:"rindo"},{char:"😅",name:"sorriso amarelo"},{char:"🤣",name:"rolando de rir"},{char:"😂",name:"chorando de rir"},{char:"🙂",name:"sorriso leve"},{char:"🙃",name:"rosto de cabeça pra baixo"},{char:"😉",name:"piscando"},{char:"😊",name:"sorrindo com olhos fechados"},{char:"😇",name:"anjinho"},{char:"🥰",name:"apaixonado"},{char:"😍",name:"olhos de coração"},{char:"😘",name:"mandando beijo"},{char:"😋",name:"saboreando comida"},{char:"😜",name:"língua de fora piscando"},{char:"🤪",name:"doidão"},{char:"🤔",name:"pensando"},{char:"🤨",name:"sobrancelha levantada"},{char:"😐",name:"rosto neutro"},{char:"😴",name:"dormindo"},{char:"🥱",name:"bocejando"},{char:"😢",name:"chorando"},{char:"😭",name:"chorando muito"},{char:"😡",name:"com raiva"},{char:"🤯",name:"cabeça explodindo"},{char:"😱",name:"gritando de medo"},{char:"🥳",name:"festejando"},{char:"🤗",name:"abraço"},{char:"🤝",name:"aperto de mão",tone:!0},{char:"👍",name:"polegar pra cima",tone:!0},{char:"👎",name:"polegar pra baixo",tone:!0},{char:"👏",name:"palmas",tone:!0},{char:"🙌",name:"mãos levantadas",tone:!0},{char:"🙏",name:"mãos em oração",tone:!0},{char:"💪",name:"braço forte",tone:!0},{char:"👋",name:"acenando",tone:!0},{char:"✍️",name:"escrevendo",tone:!0},{char:"👶",name:"bebê",tone:!0},{char:"🧑",name:"pessoa",tone:!0},{char:"👨",name:"homem",tone:!0},{char:"👩",name:"mulher",tone:!0},{char:"🧑💻",name:"pessoa programando",tone:!0},{char:"👩⚕️",name:"profissional de saúde"},{char:"👨👩👧👦",name:"família"},{char:"🏳️🌈",name:"bandeira arco-íris"}]},{id:"animals",label:"Animais e natureza",icon:"🐶",emojis:[{char:"🐶",name:"cachorro"},{char:"🐱",name:"gato"},{char:"🐭",name:"camundongo"},{char:"🐹",name:"hamster"},{char:"🐰",name:"coelho"},{char:"🦊",name:"raposa"},{char:"🐻",name:"urso"},{char:"🐼",name:"panda"},{char:"🐨",name:"coala"},{char:"🐯",name:"tigre"},{char:"🦁",name:"leão"},{char:"🐮",name:"vaca"},{char:"🐷",name:"porco"},{char:"🐸",name:"sapo"},{char:"🐵",name:"macaco"},{char:"🐔",name:"galinha"},{char:"🐧",name:"pinguim"},{char:"🐦",name:"pássaro"},{char:"🦅",name:"águia"},{char:"🦉",name:"coruja"},{char:"🐺",name:"lobo"},{char:"🐴",name:"cavalo"},{char:"🦄",name:"unicórnio"},{char:"🐝",name:"abelha"},{char:"🦋",name:"borboleta"},{char:"🐢",name:"tartaruga"},{char:"🐍",name:"cobra"},{char:"🐳",name:"baleia"},{char:"🐬",name:"delfim"},{char:"🐙",name:"polvo"},{char:"🌵",name:"cacto"},{char:"🌲",name:"árvore"},{char:"🌸",name:"flor de cerejeira"},{char:"🌈",name:"arco-íris"},{char:"☀️",name:"sol"},{char:"⭐",name:"estrela"},{char:"🔥",name:"fogo"},{char:"💧",name:"gota"}]},{id:"food",label:"Comida e bebidas",icon:"🍕",emojis:[{char:"🍏",name:"maçã verde"},{char:"🍎",name:"maçã"},{char:"🍊",name:"tangerina"},{char:"🍋",name:"limão"},{char:"🍌",name:"banana"},{char:"🍉",name:"melancia"},{char:"🍇",name:"uva"},{char:"🍓",name:"morango"},{char:"🍒",name:"cereja"},{char:"🍑",name:"pêssego"},{char:"🥝",name:"kiwi"},{char:"🍅",name:"tomate"},{char:"🥑",name:"abacate"},{char:"🍕",name:"pizza"},{char:"🍔",name:"hambúrguer"},{char:"🍟",name:"batata frita"},{char:"🌮",name:"taco"},{char:"🍣",name:"sushi"},{char:"🍜",name:"macarrão"},{char:"🍦",name:"sorvete"},{char:"🍩",name:"donut"},{char:"🍰",name:"bolo"},{char:"🎂",name:"bolo de aniversário"},{char:"☕",name:"café"},{char:"🍺",name:"cerveja"},{char:"🍷",name:"vinho"},{char:"🥤",name:"bebida com canudo"}]},{id:"activities",label:"Atividades",icon:"⚽",emojis:[{char:"⚽",name:"futebol"},{char:"🏀",name:"basquete"},{char:"🏈",name:"futebol americano"},{char:"⚾",name:"baseball"},{char:"🎾",name:"tênis"},{char:"🏐",name:"vôlei"},{char:"🎱",name:"bilhar"},{char:"🏓",name:"ping pong"},{char:"🏸",name:"badminton"},{char:"🥊",name:"boxe"},{char:"🎮",name:"videogame"},{char:"🎲",name:"dado"},{char:"🎯",name:"dardo"},{char:"🎳",name:"boliche"},{char:"🎸",name:"guitarra"},{char:"🎨",name:"paleta de arte"},{char:"🎬",name:"cinema"},{char:"🎤",name:"microfone"},{char:"🎧",name:"fone de ouvido"},{char:"🏆",name:"troféu"},{char:"🥇",name:"medalha de ouro"}]},{id:"travel",label:"Viagens e lugares",icon:"✈️",emojis:[{char:"✈️",name:"avião"},{char:"🚗",name:"carro"},{char:"🚕",name:"taxi"},{char:"🚌",name:"ônibus"},{char:"🚓",name:"carro de polícia"},{char:"🚑",name:"ambulância"},{char:"🚒",name:"bombeiros"},{char:"🚲",name:"bicicleta"},{char:"🛵",name:"moto"},{char:"🚀",name:"foguete"},{char:"🚁",name:"helicóptero"},{char:"⛵",name:"veleiro"},{char:"🚢",name:"navio"},{char:"🗽",name:"estátua da liberdade"},{char:"🗼",name:"torre"},{char:"🏝️",name:"ilha"},{char:"🏔️",name:"montanha"},{char:"🌋",name:"vulcão"},{char:"🏕️",name:"acampamento"},{char:"🏠",name:"casa"},{char:"🏢",name:"prédio"}]},{id:"objects",label:"Objetos",icon:"💡",emojis:[{char:"💡",name:"lâmpada"},{char:"🔦",name:"lanterna"},{char:"📱",name:"celular"},{char:"💻",name:"notebook"},{char:"⌨️",name:"teclado"},{char:"🖥️",name:"computador"},{char:"🖨️",name:"impressora"},{char:"📷",name:"câmera"},{char:"📺",name:"televisão"},{char:"🎥",name:"câmera de filmagem"},{char:"⏰",name:"despertador"},{char:"📚",name:"livros"},{char:"✏️",name:"lápis"},{char:"📌",name:"pin"},{char:"📎",name:"clipe"},{char:"✂️",name:"tesoura"},{char:"🔒",name:"cadeado fechado"},{char:"🔑",name:"chave"},{char:"💰",name:"saco de dinheiro"},{char:"💳",name:"cartão de crédito"},{char:"🎁",name:"presente"}]},{id:"symbols",label:"Símbolos",icon:"❤️",emojis:[{char:"❤️",name:"coração vermelho"},{char:"🧡",name:"coração laranja"},{char:"💛",name:"coração amarelo"},{char:"💚",name:"coração verde"},{char:"💙",name:"coração azul"},{char:"💜",name:"coração roxo"},{char:"🖤",name:"coração preto"},{char:"🤍",name:"coração branco"},{char:"🤎",name:"coração marrom"},{char:"💔",name:"coração partido"},{char:"✨",name:"brilho"},{char:"💯",name:"cem pontos"},{char:"✅",name:"check"},{char:"❌",name:"x"},{char:"❓",name:"interrogação"},{char:"❗",name:"exclamação"},{char:"♻️",name:"reciclagem"},{char:"⚠️",name:"alerta"},{char:"🆗",name:"ok"},{char:"🆕",name:"novo"}]},{id:"flags",label:"Bandeiras",icon:"🏳️",emojis:[{char:"🇧🇷",name:"brasil"},{char:"🇺🇸",name:"estados unidos"},{char:"🇵🇹",name:"portugal"},{char:"🇪🇸",name:"espanha"},{char:"🇫🇷",name:"frança"},{char:"🇩🇪",name:"alemanha"},{char:"🇮🇹",name:"itália"},{char:"🇬🇧",name:"reino unido"},{char:"🇯🇵",name:"japão"},{char:"🇨🇳",name:"china"},{char:"🇦🇷",name:"argentina"},{char:"🇨🇦",name:"canadá"},{char:"🇲🇽",name:"méxico"},{char:"🇨🇱",name:"chile"},{char:"🇺🇾",name:"uruguai"},{char:"🇵🇾",name:"paraguai"}]}],_hoisted_1$x={key:0,class:"sm-emoji-picker__tabs",role:"tablist","aria-label":"Categorias de emoji"},_hoisted_2$u=["aria-selected","title","onClick"],_hoisted_3$r={"aria-hidden":"true"},_hoisted_4$q={class:"sm-emoji-picker__search"},_hoisted_5$o={class:"sm-emoji-picker__search-box"},_hoisted_6$k={class:"sm-emoji-picker__body"},_hoisted_7$i={class:"sm-emoji-picker__group-label"},_hoisted_8$f={key:0,class:"sm-emoji-picker__empty"},_hoisted_9$c={key:1,class:"sm-emoji-picker__grid"},_hoisted_10$b=["title","onClick"],_hoisted_11$a={class:"sm-emoji-picker__footer"},_hoisted_12$8=["aria-expanded","title"],_hoisted_13$6={class:"sm-emoji-picker__tone-swatch sm-emoji-picker__tone-swatch--current","aria-hidden":"true"},_hoisted_14$6={key:0,class:"sm-emoji-picker__tone-menu"},_hoisted_15$5=["aria-label","onClick"],TONE_PREVIEW_CHAR="👍",_sfc_main$C={__name:"EmojiPicker",props:{theme:{type:String,default:"light"},categories:{type:Array,default:()=>EMOJI_CATEGORIES}},emits:["select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useEmojiPickerStore(),oe=e$b.ref(""),ie=e$b.ref(!1),le=e$b.ref("recent"),ce={id:"recent",label:"Usados recentemente",icon:"🕘"},de=e$b.computed(()=>[ce,...ne.categories]),ue=e$b.computed(()=>le.value==="recent"?ce:ne.categories.find($e=>$e.id===le.value)),be=e$b.computed(()=>oe.value.trim().length>0),fe=e$b.computed(()=>re.skinTone),ge=e$b.computed(()=>SKIN_TONES.find($e=>$e.id===fe.value)||SKIN_TONES[0]),me=e$b.computed(()=>{const $e=oe.value.trim().toLowerCase();return $e?ne.categories.flatMap(ye=>ye.emojis).filter(ye=>ye.name.includes($e)||ye.char===$e).slice(0,60):[]}),pe=e$b.computed(()=>{var $e;return be.value?me.value:le.value==="recent"?re.recent.map(ye=>({char:ye,name:"recente",tone:!1})):(($e=ue.value)==null?void 0:$e.emojis)||[]});function ke($e){return $e.tone?applySkinTone($e.char,ge.value.modifier):$e.char}function ve($e){const ye=ke($e);re.addRecent(ye),ae("select",ye)}function _e($e){re.setSkinTone($e),ie.value=!1}return($e,ye)=>{var Ee;return e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["sm-emoji-picker",{"sm-emoji-picker--dark":ee.theme==="dark"}])},[be.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$x,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(de.value,Se=>(e$b.openBlock(),e$b.createElementBlock("button",{key:Se.id,type:"button",role:"tab","aria-selected":le.value===Se.id,title:Se.label,class:e$b.normalizeClass(["sm-emoji-picker__tab",{"sm-emoji-picker__tab--active":le.value===Se.id}]),onClick:Le=>le.value=Se.id},[e$b.createElementVNode("span",_hoisted_3$r,e$b.toDisplayString(Se.icon),1)],10,_hoisted_2$u))),128))])),e$b.createElementVNode("div",_hoisted_4$q,[e$b.createElementVNode("div",_hoisted_5$o,[ye[2]||(ye[2]=e$b.createElementVNode("svg",{class:"sm-emoji-picker__search-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z","clip-rule":"evenodd"})],-1)),e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":ye[0]||(ye[0]=Se=>oe.value=Se),type:"text",class:"sm-emoji-picker__search-input",placeholder:"Procure emojis","aria-label":"Buscar emoji"},null,512),[[e$b.vModelText,oe.value]])])]),e$b.createElementVNode("div",_hoisted_6$k,[e$b.createElementVNode("p",_hoisted_7$i,e$b.toDisplayString(be.value?"Resultados":(Ee=ue.value)==null?void 0:Ee.label),1),pe.value.length?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$c,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(pe.value,Se=>(e$b.openBlock(),e$b.createElementBlock("button",{key:Se.char+Se.name,type:"button",class:"sm-emoji-picker__emoji",title:Se.name,onClick:Le=>ve(Se)},e$b.toDisplayString(ke(Se)),9,_hoisted_10$b))),128))])):(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_8$f,e$b.toDisplayString(be.value?"Nenhum emoji encontrado":"Nenhum emoji recente ainda"),1))]),e$b.createElementVNode("div",_hoisted_11$a,[e$b.createElementVNode("button",{type:"button",class:"sm-emoji-picker__tone-toggle","aria-expanded":ie.value,"aria-label":"Alterar aparência do emoji",title:ge.value.label,onClick:ye[1]||(ye[1]=Se=>ie.value=!ie.value)},[e$b.createElementVNode("span",_hoisted_13$6,e$b.toDisplayString(TONE_PREVIEW_CHAR)+e$b.toDisplayString(ge.value.modifier),1),ye[3]||(ye[3]=e$b.createElementVNode("svg",{class:"sm-emoji-picker__tone-caret","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",fill:"none"},[e$b.createElementVNode("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],8,_hoisted_12$8),ie.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_14$6,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(e$b.unref(SKIN_TONES),Se=>(e$b.openBlock(),e$b.createElementBlock("button",{key:Se.id,type:"button",class:e$b.normalizeClass(["sm-emoji-picker__tone-swatch",{"sm-emoji-picker__tone-swatch--active":Se.id===fe.value}]),"aria-label":Se.label,onClick:Le=>_e(Se.id)},e$b.toDisplayString(TONE_PREVIEW_CHAR)+e$b.toDisplayString(Se.modifier),11,_hoisted_15$5))),128))])):e$b.createCommentVNode("",!0)])],2)}}},EmojiPicker=_export_sfc$1(_sfc_main$C,[["__scopeId","data-v-44a5a69e"]]),PICKER_WIDTH=320,PICKER_HEIGHT=380,VIEWPORT_GAP=8,_sfc_main$B={__name:"EmojiPickerPopover",props:{show:{type:Boolean,default:!1},theme:{type:String,default:"light"},categories:{type:Array,default:()=>EMOJI_CATEGORIES},anchorEl:{type:Object,default:null}},emits:["close","select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.ref(null),oe=e$b.ref({position:"fixed",top:"-9999px",left:"-9999px"});function ie(){const ue=ne.anchorEl;if(!ue){oe.value={position:"fixed",right:`${VIEWPORT_GAP}px`,bottom:`${VIEWPORT_GAP}px`,width:`${PICKER_WIDTH}px`,height:`${PICKER_HEIGHT}px`};return}const be=ue.getBoundingClientRect();let fe=be.top-PICKER_HEIGHT-VIEWPORT_GAP;fe<VIEWPORT_GAP&&(fe=be.bottom+VIEWPORT_GAP),fe=Math.min(fe,window.innerHeight-PICKER_HEIGHT-VIEWPORT_GAP),fe=Math.max(fe,VIEWPORT_GAP);let ge=be.left;ge=Math.min(ge,window.innerWidth-PICKER_WIDTH-VIEWPORT_GAP),ge=Math.max(ge,VIEWPORT_GAP),oe.value={position:"fixed",top:`${fe}px`,left:`${ge}px`,width:`${PICKER_WIDTH}px`,height:`${PICKER_HEIGHT}px`}}function le(ue){ae("select",ue)}function ce(ue){var fe,ge;if(!ne.show)return;const be=re.value;be&&!be.contains(ue.target)&&ue.target!==ne.anchorEl&&!((ge=(fe=ne.anchorEl)==null?void 0:fe.contains)!=null&&ge.call(fe,ue.target))&&ae("close")}function de(ue){ue.key==="Escape"&&ne.show&&ae("close")}return e$b.watch(()=>ne.show,ue=>{ue?(e$b.nextTick(ie),window.addEventListener("resize",ie),window.addEventListener("scroll",ie,!0)):(window.removeEventListener("resize",ie),window.removeEventListener("scroll",ie,!0))},{immediate:!0}),e$b.onMounted(()=>{document.addEventListener("mousedown",ce,!0),document.addEventListener("keydown",de)}),e$b.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ce,!0),document.removeEventListener("keydown",de),window.removeEventListener("resize",ie),window.removeEventListener("scroll",ie,!0)}),(ue,be)=>(e$b.openBlock(),e$b.createBlock(e$b.Teleport,{to:"body"},[e$b.createVNode(e$b.Transition,{name:"sm-emoji-popover-fade"},{default:e$b.withCtx(()=>[ee.show?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"rootEl",ref:re,class:e$b.normalizeClass(["sm-emoji-popover",{"sm-emoji-popover--dark":ee.theme==="dark"}]),role:"dialog","aria-label":"Seletor de emojis",style:e$b.normalizeStyle(oe.value)},[e$b.createVNode(EmojiPicker,{theme:ee.theme,categories:ee.categories,onSelect:le},null,8,["theme","categories"])],6)):e$b.createCommentVNode("",!0)]),_:1})]))}},EmojiPickerPopover=_export_sfc$1(_sfc_main$B,[["__scopeId","data-v-813b79e0"]]),_hoisted_1$w={class:"relative flex w-full items-center justify-center gap-1"},_hoisted_2$t=["onClick"],_hoisted_3$q={class:"text-base"},_hoisted_4$p=["aria-expanded"],_hoisted_5$n=["onClick"],_hoisted_6$j={class:"whitespace-nowrap text-base leading-none"},_sfc_main$A={__name:"MessageEmojiPicker",props:["isOwner"],emits:["emoji"],setup(ee,{emit:te}){const ne=te,ae=useMessageUiStore(),re=e$b.computed(()=>{var ve,_e;return((_e=(ve=ae.currentChat)==null?void 0:ve.instance)==null?void 0:_e.type)==="instagram"}),oe=e$b.computed(()=>{var ve,_e;return((_e=(ve=ae.currentChat)==null?void 0:ve.instance)==null?void 0:_e.type)==="telegram"}),ie=["❤","👍","👎","🔥","🥰","👏","😁","🤔","🤯","😱","🤬","😢","🎉","🤩","🤮","💩","🙏","👌","🕊","🤡","🥱","🥴","😍","🐳","❤🔥","🌚","🌭","💯","🤣","⚡","🍌","🏆","💔","🤨","😐","🍓","🍾","💋","🖕","😈","😴","😭","🤓","👻","👨💻","👀","🎃","🙈","😇","😨","🤝","✍","🤗","🫡","🎅","🎄","☃","💅","🤪","🗿","🆒","💘","🙉","🦄","😘","💊","🙊","😎","👾","🤷♂","🤷","🤷♀","😡"],le=e$b.computed(()=>re.value?["❤️","😂","😲","😢","😡","👍","👎"]:oe.value?["👍","👎","❤","🔥","🥰","👏"]:["👍","❤️","😂","😲","😢","🙏"]),ce=e$b.ref(!1),de=e$b.ref(null),ue=e$b.ref(null);function be(ve){ne("emoji",ve)}function fe(ve){ne("emoji",ve),ce.value=!1}function ge(ve){ne("emoji",ve),ce.value=!1}function me(ve){if(!oe.value||!ce.value)return;const _e=de.value;_e&&!_e.contains(ve.target)&&(ce.value=!1)}e$b.onMounted(()=>{document.addEventListener("mousedown",me,!0)}),e$b.onBeforeUnmount(()=>{document.removeEventListener("mousedown",me,!0)});function pe(ve){ve.stopPropagation(),ue.value=ve.currentTarget,ce.value=!ce.value}function ke(){ce.value=!1}return(ve,_e)=>(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_1$w,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(le.value,($e,ye)=>(e$b.openBlock(),e$b.createElementBlock("button",{key:ye,class:e$b.normalizeClass([e$b.unref(ae).themeMode?"hover:bg-white/10":"hover:bg-black/10","text-lg px-[5px] py-1 rounded-lg"]),type:"button",onClick:Ee=>be($e)},[e$b.createElementVNode("span",_hoisted_3$q,e$b.toDisplayString($e),1)],10,_hoisted_2$t))),128)),re.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("button",{key:0,class:e$b.normalizeClass([e$b.unref(ae).themeMode?"hover:bg-white/10":"hover:bg-black/10","px-2 py-1 rounded text-lg"]),type:"button","aria-haspopup":"dialog","aria-expanded":ce.value,onClick:pe}," + ",10,_hoisted_4$p)),oe.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,ref_key:"telegramPopoverEl",ref:de,class:e$b.normalizeClass(["absolute",ee.isOwner?"right-0":"left-0"]),style:e$b.normalizeStyle({bottom:"40px",zIndex:4e3,pointerEvents:ce.value?"auto":"none"})},[e$b.withDirectives(e$b.createElementVNode("div",{class:"relative",onMouseleave:ke},[_e[1]||(_e[1]=e$b.createElementVNode("div",{"aria-hidden":"true",class:"absolute -inset-x-0 mx-auto -left-10 w-[45vh] h-[50vh] rounded-lg",style:{"pointer-events":"auto"}},null,-1)),e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[e$b.withDirectives(e$b.createElementVNode("div",{class:e$b.normalizeClass(["grid max-h-[40vh] grid-cols-8 gap-1 overflow-y-auto rounded-lg p-2 shadow-lg",e$b.unref(ae).themeMode?"bg-neutral-800":"bg-white"])},[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie,($e,ye)=>e$b.createElementVNode("button",{key:ye,class:e$b.normalizeClass([e$b.unref(ae).themeMode?"hover:bg-white/10":"hover:bg-black/10","flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-lg"]),type:"button",onClick:Ee=>ge($e)},[e$b.createElementVNode("span",_hoisted_6$j,e$b.toDisplayString($e),1)],10,_hoisted_5$n)),64))],2),[[e$b.vShow,ce.value]])]),_:1})],544),[[e$b.vShow,ce.value]])],6)):(e$b.openBlock(),e$b.createBlock(EmojiPickerPopover,{key:2,show:ce.value,theme:e$b.unref(ae).themeMode?"dark":"light","anchor-el":ue.value,onClose:_e[0]||(_e[0]=$e=>ce.value=!1),onSelect:fe},null,8,["show","theme","anchor-el"]))]))}},MessageEmojiPicker=_export_sfc$1(_sfc_main$A,[["__scopeId","data-v-23288b29"]]),EDIT_WINDOW_MINUTES=15,DELETE_WINDOW_MINUTES=2880;function minutesSince(ee){const te=new Date(ee||0).getTime();return(Date.now()-te)/6e4}function normalizedStage(ee){return String((ee==null?void 0:ee.stage)||(ee==null?void 0:ee.status)||"").toLowerCase()}function isExcludedMessage(ee){const te=normalizedStage(ee);return te==="excluded"||te==="exclused"}function isProcessingMessage(ee){return normalizedStage(ee)==="processing"}function isFailedMessage(ee){return(ee==null?void 0:ee.stage)==="failed"}function hasMessagePackage(ee){return Array.isArray(ee==null?void 0:ee.items)&&ee.items.length>1}function hasSingleFileUrl(ee){if(hasMessagePackage(ee))return!1;const te=(ee==null?void 0:ee.content)||{};return["file","audio","image"].includes(ee==null?void 0:ee.type)&&!!te.url}function hasMessageText(ee){var te;return!!((te=ee==null?void 0:ee.content)!=null&&te.text)&&ee.content.text.trim().length>0}function resolveMessageActionRules(ee,te={}){var Oe,Ie,ze,Ve,Ne;const{chatActive:ne=!1,chatInstanceId:ae=null,attendant:re=null}=te,oe=isProcessingMessage(ee),ie=isExcludedMessage(ee),le=isFailedMessage(ee),ce=!!(ee!=null&&ee.from_me),de=!!(ee!=null&&ee.internal),ue=ee==null?void 0:ee.type,be=((Oe=ee==null?void 0:ee.instance)==null?void 0:Oe.type)||"",fe=["whatsapp-qrcode","telegram","webchat"].includes(be),ge=de?((Ie=ee==null?void 0:ee.sent_by)==null?void 0:Ie.id)===(re==null?void 0:re.id):!0,me=!!((ze=re==null?void 0:re.permissions)!=null&&ze.can_edit_message),pe=!!((Ve=re==null?void 0:re.permissions)!=null&&Ve.can_delete_message),ke=()=>{const Pe=[];return oe&&Pe.push("Ação indisponível para mensagens processando."),ie&&Pe.push("Mensagem excluída."),le&&Pe.push("A mensagem falhou no envio."),Pe},ve=ke();fe||ve.push("Disponível apenas para WhatsApp QR Code, Telegram e Webchat."),me||ve.push("Você não tem permissão para editar."),ce||ve.push("Só é possível editar mensagens enviadas por você."),ue!=="text"&&ve.push("Apenas mensagens de texto podem ser editadas."),de&&!ge&&ve.push("Mensagem interna só pode ser editada pelo mesmo autor."),ne||ve.push("A conversa precisa estar ativa."),minutesSince(ee==null?void 0:ee.sent_at)>EDIT_WINDOW_MINUTES&&ve.push("Janela de edição expirada (15 minutos).");const _e=ke();ie&&(_e[_e.indexOf("Mensagem excluída.")]="Mensagem já excluída."),fe||_e.push("Disponível apenas para WhatsApp QR Code, Telegram e Webchat."),pe||_e.push("Você não tem permissão para excluir."),ce||_e.push("Só é possível excluir mensagens enviadas por você."),de&&!ge&&_e.push("Mensagem interna só pode ser excluída pelo mesmo autor."),ne||_e.push("A conversa precisa estar ativa."),minutesSince(ee==null?void 0:ee.sent_at)>DELETE_WINDOW_MINUTES&&_e.push("Janela de exclusão expirada (48 horas)."),ue==="sms"&&_e.push("Não é possível excluir mensagens SMS.");const $e=ke();ee!=null&&ee.items&&$e.push("Não é possível responder a pacote de mensagens."),ne||$e.push("A conversa precisa estar ativa."),ue==="call"&&$e.push("Não é possível responder a mensagens de ligação."),ue==="ciphertext"&&$e.push("Não é possível responder a mensagens aguardando sincronização."),ue==="sms"&&$e.push("Não é possível responder a mensagens SMS.");const ye=(Ne=ee==null?void 0:ee.instance)==null?void 0:Ne.id;ye&&ae&&ye!==ae&&$e.push("Não é possível citar mensagens de outra instância.");const Ee=[];oe&&Ee.push("Ação indisponível para mensagens processando."),ie&&Ee.push("Mensagem excluída."),hasSingleFileUrl(ee)||Ee.push("Não há arquivo único disponível para download."),le&&Ee.push("A mensagem falhou no envio.");const Se=ke();de&&Se.push("Não é possível encaminhar mensagens internas.");const Le={call:"Não é possível encaminhar mensagens de ligação.",location:"Não é possível encaminhar mensagens de localização.",ciphertext:"Não é possível encaminhar mensagens aguardando sincronização.",template:"Não é possível encaminhar mensagens de template.",list:"Não é possível encaminhar mensagens de lista.",button:"Não é possível encaminhar mensagens com botão.",sms:"Não é possível encaminhar mensagens SMS."};Le[ue]&&Se.push(Le[ue]),be==="webchat"&&Se.push("Não é possível encaminhar mensagens do Webchat.");const Ae=hasMessageText(ee)?[]:["Mensagem sem texto para copiar."],De=[];return oe?De.push("Ação indisponível para mensagens processando."):le||De.push("Essa mensagem já foi enviada com sucesso."),{edit:ve,delete:_e,reply:$e,download:Ee,forward:Se,copy:Ae,resend:De}}function canForwardMessage(ee){var te;return!ee||isExcludedMessage(ee)||isProcessingMessage(ee)||isFailedMessage(ee)||ee.internal||((te=ee==null?void 0:ee.instance)==null?void 0:te.type)==="webchat"?!1:!["call","ciphertext","template","list","button","location"].includes(ee==null?void 0:ee.type)}function failure(ee,te){var ne,ae;return{ok:!1,error:((ae=(ne=ee==null?void 0:ee.response)==null?void 0:ne.data)==null?void 0:ae.message)||te}}async function deleteMessage(ee){try{const{data:te}=await api.delete(`${messageUrl}${ee}/`);return{ok:!0,data:te}}catch(te){return failure(te,"Não foi possível excluir a mensagem.")}}async function resendMessage(ee){try{const{data:te}=await api.post(messageResend(ee));return{ok:!0,data:te}}catch(te){return failure(te,"Não foi possível reenviar a mensagem.")}}async function reactToMessage(ee,te){if(!ee)return{ok:!1,error:"Mensagem ausente."};ee.metadata||(ee.metadata={});const ne=ee.metadata.reaction;ee.metadata.reaction=te;try{const{data:ae}=await api.post(messageReaction(ee.id),{reaction:te});return{ok:!0,data:ae}}catch(ae){return ee.metadata.reaction=ne,failure(ae,"Erro ao adicionar reação.")}}async function transcriptAudio(ee){if(!ee)return{ok:!1,error:"Mensagem ausente."};ee.isTranscripting=!0;try{const{data:te}=await api.get(messageTranscript(ee.id));return ee.metadata||(ee.metadata={}),ee.metadata.transcripted_text=te.transcript_text,{ok:!0,data:te}}catch(te){return failure(te,"Erro ao transcrever o áudio.")}finally{ee.isTranscripting=!1}}const _hoisted_1$v=["disabled"],_hoisted_2$s={class:"relative flex h-6 items-center justify-center uppercase"},_hoisted_3$p={key:0},_hoisted_4$o={key:1,class:"flex items-center justify-center"},_hoisted_5$m={class:"flex items-center gap-2"},_hoisted_6$i=["disabled"],_hoisted_7$h={class:"relative flex h-5 items-center justify-center text-[12px] uppercase"},_hoisted_8$e={key:0},_hoisted_9$b={key:1,class:"flex items-center justify-center"},_sfc_main$z={__name:"MessageActionsMenu",emits:["info","download","download-package","copy-native","deleted","resent"],setup(ee,{emit:te}){const ne=te,ae=useMessageUiStore(),re=e$b.computed(()=>ae.loggedAttendant),oe=e$b.computed(()=>!ae.themeMode),ie=e$b.ref(!1),le=e$b.ref(!1),ce=e$b.ref(!1),de=e$b.ref(!1),ue=e$b.computed(()=>ae.actionsMenu.message||{}),be=e$b.computed(()=>resolveMessageActionRules(ue.value,{chatActive:ae.chatActive,chatInstanceId:ae.chatInstanceId,attendant:re.value})),fe=e$b.computed(()=>isExcludedMessage(ue.value)),ge=e$b.computed(()=>!fe.value&&ae.chatActive&&be.value.reply.length===0),me=e$b.computed(()=>!fe.value&&hasMessagePackage(ue.value)),pe=e$b.computed(()=>!fe.value&&!hasMessagePackage(ue.value)&&be.value.download.length===0);function ke(){ae.closeActions()}function ve(){le.value=!1}function _e(xe,Ce){if(!xe)return{};const{top:Fe,left:Re,width:qe}=Ce(xe,260,130);return{top:`${Fe}px`,left:`${Re}px`,width:`${qe}px`}}const $e={edit:"Não é possível editar",delete:"Não é possível excluir",download:"Não é possível baixar",saveas:"Não é possível baixar",reply:"Não é possível responder","re-send":"Não é possível reenviar mensagem"};function ye(xe){(xe.ctrlKey||xe.metaKey)&&xe.key.toLowerCase()==="c"&&(xe.preventDefault(),hasMessageText(ue.value)&&ze())}function Ee(){ve(),!(be.value.reply.length||fe.value)&&(ae.setQuote(ue.value.content,ue.value.sent_by,ue.value.id),ke())}function Se(){ve(),!(be.value.edit.length||fe.value)&&(ae.startEdit(ue.value),ke())}function Le(){ve(),!be.value.forward.length&&(ae.startForward(ue.value),ke())}function Ae(){be.value.delete.length||fe.value||(le.value=!le.value)}async function De(){if(be.value.delete.length)return;ce.value=!0;const xe=await deleteMessage(ue.value.id);if(ce.value=!1,!xe.ok){notiwind.notify({group:"error",title:"Erro",text:xe.error},2e3);return}ne("deleted",ue.value),notiwind.notify({group:"success",title:"Sucesso",text:"Mensagem Apagada"},2e3),le.value=!1,ke()}async function Oe(){var Ce;ve(),ie.value=!0;const xe=await resendMessage(ue.value.id);if(ie.value=!1,!xe.ok){notiwind.notify({group:"error",title:"Erro",text:xe.error},4e3),ke();return}ne("resent",ue.value),notiwind.notify({group:"success",title:"Sucesso",text:((Ce=xe.data)==null?void 0:Ce.message)||"Mensagem reenviada com sucesso"},2e3),ke()}async function Ie(xe){ve();const Ce=await reactToMessage(ue.value,xe);if(!Ce.ok){notiwind.notify({group:"error",title:"Erro",text:Ce.error},4e3);return}ke()}async function ze(){var Fe,Re;ve();const xe=((Re=(Fe=ue.value)==null?void 0:Fe.content)==null?void 0:Re.text)||"";if(!ae.isWebDevice){ne("copy-native",xe),ke();return}if(!await copyToClipboard(xe)){notiwind.notify({group:"error",title:"Erro",text:"Não foi possível copiar o texto. Tente novamente."},2e3),ke();return}notiwind.notify({group:"success",title:"Copiado",text:"Texto copiado para a área de transferência."},2e3),de.value=!0,setTimeout(()=>{de.value=!1,ke()},900)}function Ve(){ve(),ne("info",ue.value),ke()}function Ne(){ve(),ne("download",ue.value),ke()}function Pe(){ve(),ne("download-package",ue.value),ke()}const Be={reply:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path d="M14.502 7.046h-2.5v-.928a2.122 2.122 0 0 0-1.199-1.954 1.827 1.827 0 0 0-1.984.311L3.71 8.965a2.2 2.2 0 0 0 0 3.24L8.82 16.7a1.829 1.829 0 0 0 1.985.31 2.121 2.121 0 0 0 1.199-1.959v-.928h1a2.025 2.025 0 0 1 1.999 2.047V19a1 1 0 0 0 1.275.961 6.59 6.59 0 0 0 4.662-7.22 6.593 6.593 0 0 0-6.437-5.695Z"/> </svg>',copy:'<svg class="size-4" viewBox="0 0 24 24" fill="currentColor"><path d="M16 1H4a2 2 0 0 0-2 2v12h2V3h12V1zm3 4H8a2 2 0 0 0-2 2v14h11a2 2 0 0 0 2-2V5z"/></svg>',check:'<svg class="size-4 text-emerald-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>',forward:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path d="M5.027 10.9a8.729 8.729 0 0 1 6.422-3.62v-1.2A2.061 2.061 0 0 1 12.61 4.2a1.986 1.986 0 0 1 2.104.23l5.491 4.308a2.11 2.11 0 0 1 .588 2.566 2.109 2.109 0 0 1-.588.734l-5.489 4.308a1.983 1.983 0 0 1-2.104.228 2.065 2.065 0 0 1-1.16-1.876v-.942c-5.33 1.284-6.212 5.251-6.25 5.441a1 1 0 0 1-.923.806h-.06a1.003 1.003 0 0 1-.955-.7A10.221 10.221 0 0 1 5.027 10.9Z"/> </svg>',trash:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z" clip-rule="evenodd"/> </svg>',edit:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"> <path fill-rule="evenodd" d="M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z" clip-rule="evenodd"/> </svg>',info:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.408-5.5a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2h-.01ZM10 10a1 1 0 1 0 0 2h1v3h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-4a1 1 0 0 0-1-1h-2Z" clip-rule="evenodd"/></svg>',package:'<svg class="size-4" viewBox="0 0 24 24" fill="currentColor"><path d="M21 16V8l-9-5-9 5v8l9 5 9-5zM12 4.15 18.53 7.5 12 10.85 5.47 7.5z"/></svg>',download:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z" clip-rule="evenodd"/></svg>',resend:'<svg class="size-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.651 7.65a7.131 7.131 0 0 0-12.68 3.15M18.001 4v4h-4m-7.652 8.35a7.13 7.13 0 0 0 12.68-3.15M6 20v-4h4"/> </svg>'},Me=e$b.computed(()=>{const xe=be.value,Ce=[{key:"reply",label:"Responder",icon:Be.reply,enabled:!xe.reply.length,reasons:xe.reply,handler:Ee},{key:"copy",label:de.value?"Copiado!":"Copiar",icon:de.value?Be.check:Be.copy,enabled:!xe.copy.length,reasons:xe.copy,handler:ze,trailing:de.value?"":"Ctrl+C"},{key:"forward",label:"Encaminhar",icon:Be.forward,enabled:!xe.forward.length,reasons:xe.forward,handler:Le},{key:"re-send",label:"Reenviar",icon:Be.resend,enabled:!xe.resend.length,reasons:xe.resend,loading:ie.value,handler:Oe},{key:"__divider__"},{key:"delete",label:"Apagar",icon:Be.trash,enabled:!xe.delete.length,reasons:xe.delete,handler:Ae},{key:"__divider__"},{key:"edit",label:"Editar",icon:Be.edit,enabled:!xe.edit.length,reasons:xe.edit,handler:Se},{key:"info",label:"Informações",icon:Be.info,enabled:!0,reasons:[],handler:Ve}];return me.value?Ce.push({key:"download_pkg",label:"Baixar pacote",icon:Be.package,enabled:!0,reasons:[],handler:Pe}):pe.value&&Ce.push({key:"download",label:"Salvar como...",icon:Be.download,enabled:!0,reasons:[],handler:Ne}),Ce});return(xe,Ce)=>(e$b.openBlock(),e$b.createBlock(ActionMenu,{items:Me.value,x:e$b.unref(ae).actionsMenu.x,y:e$b.unref(ae).actionsMenu.y,light:oe.value,"sheet-safe-area":140,"reason-titles":$e,onClose:ke,onKeydown:ye},e$b.createSlots({extra:e$b.withCtx(({anchorRect:Fe,veryNarrow:Re,positionBeside:qe})=>[e$b.createVNode(e$b.Transition,{name:"sheet"},{default:e$b.withCtx(()=>[le.value&&Re?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["fixed inset-x-0 bottom-0 z-[2002] select-none rounded-t-2xl p-3 shadow-2xl",oe.value?"bg-white text-black/90 ring-1 ring-black/20":"bg-base-200 text-white/90 ring-1 ring-black/50"])},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["mx-auto mb-3 h-1.5 w-10 rounded-full opacity-40",oe.value?"bg-black/40":"bg-white/40"]),onClick:Ce[0]||(Ce[0]=Ge=>ve())},null,2),Ce[4]||(Ce[4]=e$b.createElementVNode("p",{class:"mb-3 text-center text-[12px] font-medium uppercase"}," Realmente deseja excluir essa mensagem? ",-1)),e$b.createElementVNode("button",{disabled:ce.value,class:"confirm-delete-btn group",onClick:De},[Ce[3]||(Ce[3]=e$b.createElementVNode("span",{class:"confirm-delete-shine"},null,-1)),e$b.createElementVNode("span",_hoisted_2$s,[ce.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_4$o,[...Ce[2]||(Ce[2]=[e$b.createElementVNode("svg",{class:"size-5 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})],-1)])])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$p,"Excluir mensagem"))])],8,_hoisted_1$v)],2)):le.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(["fixed z-[2002] min-w-[220px] rounded-xl p-2 shadow-2xl",oe.value?"bg-white text-black/90 ring-1 ring-black/20":"bg-base-200 text-white/90 ring-1 ring-black/50"]),style:e$b.normalizeStyle(_e(Fe,qe))},[Ce[7]||(Ce[7]=e$b.createElementVNode("p",{class:"mb-2 text-center text-[12px] font-medium uppercase"}," Realmente deseja excluir essa mensagem? ",-1)),e$b.createElementVNode("div",_hoisted_5$m,[e$b.createElementVNode("button",{type:"button",class:e$b.normalizeClass(["flex-1 rounded-xl px-3 py-2 text-[12px] uppercase",oe.value?"bg-black/10 text-black/70 hover:bg-black/15":"bg-white/10 text-white/70 hover:bg-white/15"]),onClick:Ce[1]||(Ce[1]=Ge=>ve())}," Cancelar ",2),e$b.createElementVNode("button",{disabled:ce.value,class:"confirm-delete-btn group flex-1",onClick:De},[Ce[6]||(Ce[6]=e$b.createElementVNode("span",{class:"confirm-delete-shine"},null,-1)),e$b.createElementVNode("span",_hoisted_7$h,[ce.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_9$b,[...Ce[5]||(Ce[5]=[e$b.createElementVNode("svg",{class:"size-4 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})],-1)])])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_8$e,"Excluir"))])],8,_hoisted_6$i)])],6)):e$b.createCommentVNode("",!0)]),_:2},1024)]),_:2},[ge.value?{name:"footer",fn:e$b.withCtx(()=>[e$b.createVNode(MessageEmojiPicker,{onEmoji:Ie})]),key:"0"}:void 0]),1032,["items","x","y","light"]))}},MessageActionsMenu=_export_sfc$1(_sfc_main$z,[["__scopeId","data-v-4beff81c"]]),_hoisted_1$u={class:"audio-player hover:bg-base-100"},_hoisted_2$r=["disabled"],_hoisted_3$o={class:"audio-player-info"},_hoisted_4$n={class:"audio-progress-container"},_hoisted_5$l=["max","value","disabled"],_hoisted_6$h={class:"audio-duration"},_hoisted_7$g={key:0,class:"align-middle"},_hoisted_8$d=["src"],_sfc_main$y={__name:"AudioPlayer",props:{src:{type:String,required:!0},label:{type:String,required:!0},type:{type:String,required:!0,validator:ee=>["client","attendant","general"].includes(ee)},activeSrc:{type:String,required:!1}},emits:["play-start","play-pause"],setup(ee,{emit:te}){const ne=te,ae=ee,re=e$b.ref(null),oe=e$b.ref(!1),ie=e$b.ref(0),le=e$b.ref(0),ce=e$b.ref(!1),de=e$b.ref(!1);function ue(){if(re.value)if(oe.value)re.value.pause(),oe.value=!1,De();else{if(Ae(),!re.value)return;de.value=!0;const Oe=re.value.play();Oe&&typeof Oe.then=="function"?Oe.then(()=>{de.value=!1,oe.value=!0}).catch(Ie=>{console.error("Audio play failed:",Ie),de.value=!1,oe.value=!1}):(de.value=!1,oe.value=!0)}}function be(Oe){re.value&&(re.value.currentTime=Oe.target.value)}function fe(){re.value&&(le.value=re.value.duration||0)}function ge(){ce.value=!0}function me(){ce.value=!1}function pe(){de.value=!1,oe.value=!0}function ke(){de.value=!0}function ve(Oe){console.error("Audio error:",Oe),ce.value=!1,de.value=!1,oe.value=!1}function _e(){re.value&&(ie.value=re.value.currentTime)}function $e(){oe.value=!1,ie.value=0,De()}function ye(){window.open(ae.src,"_blank")}function Ee(Oe){if(!Oe||isNaN(Oe))return"0:00";const Ie=Math.floor(Oe/60),ze=Math.floor(Oe%60);return`${Ie}:${ze.toString().padStart(2,"0")}`}function Se(){switch(ae.type){case"client":return"#22d3ee";case"attendant":return"#14b8a6";case"general":return"#0ea5e9";default:return"#9ca3af"}}function Le(){return{backgroundColor:`${Se()}20`,color:Se()}}function Ae(){ne("play-start",ae.src)}function De(){ne("play-pause",ae.src)}return e$b.watch(()=>ae.activeSrc,Oe=>{Oe&&Oe!==ae.src&&oe.value&&re.value&&(re.value.pause(),oe.value=!1)}),e$b.onUnmounted(()=>{re.value&&(re.value.pause(),re.value.src="")}),(Oe,Ie)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$u,[e$b.createElementVNode("button",{onClick:e$b.withModifiers(ue,["stop"]),class:"audio-play-btn hover:bg-base-100",title:"Reproduzir",disabled:ce.value||de.value,style:e$b.normalizeStyle(Le())},[ce.value||de.value?(e$b.openBlock(),e$b.createElementBlock("svg",{key:0,class:"audio-play-spinner",style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...Ie[0]||(Ie[0]=[e$b.createElementVNode("circle",{cx:"12",cy:"12",r:"10","stroke-width":"4","stroke-opacity":"0.2"},null,-1),e$b.createElementVNode("path",{d:"M4 12a8 8 0 018-8","stroke-width":"4","stroke-linecap":"round"},null,-1)])],4)):oe.value?(e$b.openBlock(),e$b.createElementBlock("svg",{key:2,style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Ie[2]||(Ie[2]=[e$b.createElementVNode("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])],4)):(e$b.openBlock(),e$b.createElementBlock("svg",{key:1,style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Ie[1]||(Ie[1]=[e$b.createElementVNode("path",{d:"M8 5v14l11-7z"},null,-1)])],4))],12,_hoisted_2$r),e$b.createElementVNode("div",_hoisted_3$o,[e$b.createElementVNode("div",{class:"audio-player-title",style:e$b.normalizeStyle({color:Se()})},e$b.toDisplayString(ee.label),5),e$b.createElementVNode("div",_hoisted_4$n,[e$b.createElementVNode("div",{class:"audio-progress-track",style:e$b.normalizeStyle({backgroundColor:`${Se()}20`})},[e$b.createElementVNode("div",{class:"audio-progress-fill",style:e$b.normalizeStyle({width:le.value>0?`${ie.value/le.value*100}%`:"0%",backgroundColor:Se()})},null,4),e$b.createElementVNode("input",{type:"range",class:"audio-progress-input",min:"0",max:le.value,value:ie.value,onInput:e$b.withModifiers(be,["stop"]),disabled:ce.value||de.value},null,40,_hoisted_5$l)],4)])]),e$b.createElementVNode("span",_hoisted_6$h,[ce.value||de.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_7$g,"-- : --")):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(Ee(ie.value))+" : "+e$b.toDisplayString(Ee(le.value)),1)],64))]),e$b.createElementVNode("button",{onClick:e$b.withModifiers(ye,["stop"]),class:"audio-download-btn hover:bg-base-300",title:"Baixar"},[(e$b.openBlock(),e$b.createElementBlock("svg",{style:e$b.normalizeStyle({color:Se()}),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[...Ie[3]||(Ie[3]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"},null,-1)])],4))]),e$b.createElementVNode("audio",{ref_key:"audioElement",ref:re,src:ee.src,onLoadstart:ge,onLoadedmetadata:fe,onCanplay:me,onPlaying:pe,onWaiting:ke,onTimeupdate:_e,onEnded:$e,onError:ve,preload:"metadata"},null,40,_hoisted_8$d)]))}},AudioPlayer=_export_sfc$1(_sfc_main$y,[["__scopeId","data-v-fbc276d0"]]),_sfc_main$x={__name:"CallRecordPlayer",props:{recordMetadata:{type:Object,required:!0}},emits:["close"],setup(ee){const te=e$b.ref(null);function ne(re){te.value=re}function ae(re){te.value===re&&(te.value=null)}return(re,oe)=>{var ie,le;return e$b.openBlock(),e$b.createElementBlock("div",{onClick:e$b.withModifiers(ce=>null,["stop"]),class:"call-record-player bg-base-200"},[(le=(ie=ee.recordMetadata)==null?void 0:ie.urls)!=null&&le.general?(e$b.openBlock(),e$b.createBlock(AudioPlayer,{key:0,src:ee.recordMetadata.urls.general,label:"Conversa",type:"general","active-src":te.value,onPlayStart:ne,onPlayPause:ae},null,8,["src","active-src"])):e$b.createCommentVNode("",!0)])}}},CallRecordPlayer=_export_sfc$1(_sfc_main$x,[["__scopeId","data-v-b2bf056b"]]),_hoisted_1$t={class:"call-card-header"},_hoisted_2$q={class:"call-card-header-left"},_hoisted_3$n={class:"call-card-content"},_hoisted_4$m={class:"call-card-title"},_hoisted_5$k={key:0,class:"opacity-70"},_hoisted_6$g={key:0,class:"call-card-text"},_hoisted_7$f={class:"call-card-actions"},_hoisted_8$c={key:0,class:"call-card-expanded"},_hoisted_9$a={class:"call-events"},_hoisted_10$a={class:"call-event-left"},_hoisted_11$9={class:"call-event-time"},_sfc_main$w={__name:"CallCard",props:{call:{type:Object,required:!0},hideMessageButton:{type:Boolean,default:!1},onMessageClick:{type:Function,required:!1,default:null}},setup(ee){const te=ee,ne=e$b.ref([]),ae=e$b.ref({});function re(ye){const Ee=ne.value.indexOf(ye);Ee>-1?ne.value.splice(Ee,1):ne.value.push(ye)}function oe(ye){return _e(ye).length>0}function ie(ye){oe(ye)&&re(ye.id)}function le(ye){ae.value[ye]=!ae.value[ye]}function ce(ye){le(ye)}function de(ye){te.onMessageClick&&te.onMessageClick(ye)}function ue(ye){return ye.events&&ye.events.length>0?ye.events[0].event_type:ye.historical&&ye.historical.length>0?ye.historical[ye.historical.length-1].status:""}function be(ye){switch(ye){case"offer":return"event-status-offer";case"answer":return"event-status-answer";case"accepted":return"event-status-accepted";case"ringing":return"event-status-ringing";case"rejected":case"error":return"event-status-rejected";case"terminated":return"event-status-terminated";case"update":return"event-status-update";default:return"event-status-unknown"}}function fe(ye){switch(ye){case"offer":return"event-bg-offer";case"answer":return"event-bg-answer";case"accepted":return"event-bg-accepted";case"ringing":return"event-bg-ringing";case"rejected":case"error":return"event-bg-rejected";case"terminated":return"bg-primary";case"update":return"event-bg-update";default:return"event-bg-unknown"}}function ge(ye){switch(ye){case"offer":return"event-dot-offer";case"answer":return"event-dot-answer";case"accepted":return"event-dot-accepted";case"ringing":return"event-dot-ringing";case"rejected":case"error":return"event-dot-rejected";case"terminated":return"event-dot-terminated";case"update":return"event-dot-update";default:return"event-dot-unknown"}}function me(ye){switch(ye){case"offer":return"Chamada recebida";case"answer":return"Chamada iniciada";case"ringing":return"Tocando...";case"accepted":return"Chamada atendida";case"rejected":return"Chamada rejeitada";case"terminated":return"Chamada terminada";case"error":return"Erro na chamada";case"update":return"Chamada atualizada";default:return"Evento desconhecido"}}function pe(ye){if(!ye)return"";const Ee=new Date(ye),Le=new Date-Ee,Ae=Math.floor(Le/(1e3*60*60*24));return Ae===0?"Hoje":Ae===1?"Ontem":Ae<7?`${Ae}d atrás`:Ee.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"})}function ke(ye){return ye?new Date(ye).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"}):""}function ve(ye){var Ee,Se,Le,Ae,De,Oe;return((Se=(Ee=ye.record_metadata)==null?void 0:Ee.urls)==null?void 0:Se.client)||((Ae=(Le=ye.record_metadata)==null?void 0:Le.urls)==null?void 0:Ae.attendant)||((Oe=(De=ye.record_metadata)==null?void 0:De.urls)==null?void 0:Oe.general)}function _e(ye){return ye.events&&ye.events.length>0?[...ye.events].reverse():ye.historical&&ye.historical.length>0?ye.historical:[]}function $e(ye){return ye.event_type||ye.status}return(ye,Ee)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ee.call.id,"data-test":"call-card",onClick:Ee[4]||(Ee[4]=e$b.withModifiers(Se=>ie(ee.call),["stop"])),class:"call-card bg-base-300 border hover:bg-base-300 border-base-300"},[e$b.createElementVNode("div",_hoisted_1$t,[e$b.createElementVNode("div",_hoisted_2$q,[e$b.createElementVNode("div",{class:e$b.normalizeClass(["call-icon bg-primary",fe(ue(ee.call))])},[(e$b.openBlock(),e$b.createElementBlock("svg",{style:e$b.normalizeStyle(ee.hideMessageButton?{width:"2.2rem",height:"2.2rem"}:{width:"1.3rem",height:"1.3rem"}),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Ee[5]||(Ee[5]=[e$b.createElementVNode("path",{d:"M7.978 4a2.553 2.553 0 0 0-1.926.877C4.233 6.7 3.699 8.751 4.153 10.814c.44 1.995 1.778 3.893 3.456 5.572 1.68 1.679 3.577 3.018 5.57 3.459 2.062.456 4.115-.073 5.94-1.885a2.556 2.556 0 0 0 .001-3.861l-1.21-1.21a2.689 2.689 0 0 0-3.802 0l-.617.618a.806.806 0 0 1-1.14 0l-1.854-1.855a.807.807 0 0 1 0-1.14l.618-.62a2.692 2.692 0 0 0 0-3.803l-1.21-1.211A2.555 2.555 0 0 0 7.978 4Z"},null,-1)])],4))],2),e$b.createElementVNode("div",_hoisted_3$n,[e$b.createElementVNode("div",_hoisted_4$m,[e$b.createTextVNode(e$b.toDisplayString(ee.call.direction==="outbound"?"Efetuada":"Recebida")+" ",1),ee.call.started_at?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$k," • "+e$b.toDisplayString(pe(ee.call.started_at)),1)):e$b.createCommentVNode("",!0)]),ee.hideMessageButton?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$g,e$b.toDisplayString(ee.call.direction==="outbound"?"Uma ligação foi efetuada":"Uma ligação foi recebida"),1)):e$b.createCommentVNode("",!0),_e(ee.call).length>0?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(["call-card-status",be(ue(ee.call))])},e$b.toDisplayString(me(ue(ee.call))),3)):e$b.createCommentVNode("",!0)])]),e$b.createElementVNode("div",_hoisted_7$f,[!ee.hideMessageButton&&ee.call.external_id?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,onClick:Ee[0]||(Ee[0]=e$b.withModifiers(Se=>de(ee.call),["stop"])),title:"Ver mensagem",class:"hover:bg-base-100"},[...Ee[6]||(Ee[6]=[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7l5 5m0 0l-5 5m5-5H6"})],-1)])])):e$b.createCommentVNode("",!0),ve(ee.call)?(e$b.openBlock(),e$b.createElementBlock("button",{key:1,class:e$b.normalizeClass({"bg-base-100":ae.value[ee.call.id],"hover:bg-base-100":!0}),onClick:Ee[1]||(Ee[1]=e$b.withModifiers(Se=>ce(ee.call.id),["stop"])),title:"Ver gravações"},[(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(ae.value[ee.call.id]?"text-primary":"opacity-70"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[...Ee[7]||(Ee[7]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M17.316 4.052a.99.99 0 0 0-.9.14c-.262.19-.416.495-.416.82v8.566a4.573 4.573 0 0 0-2-.464c-1.99 0-4 1.342-4 3.443 0 2.1 2.01 3.443 4 3.443 1.99 0 4-1.342 4-3.443V6.801c.538.5 1 1.219 1 2.262 0 .56.448 1.013 1 1.013s1-.453 1-1.013c0-1.905-.956-3.18-1.86-3.942a6.391 6.391 0 0 0-1.636-.998 4 4 0 0 0-.166-.063l-.013-.005-.005-.002h-.002l-.002-.001ZM4 5.012c-.552 0-1 .454-1 1.013 0 .56.448 1.013 1 1.013h9c.552 0 1-.453 1-1.013 0-.559-.448-1.012-1-1.012H4Zm0 4.051c-.552 0-1 .454-1 1.013 0 .56.448 1.013 1 1.013h9c.552 0 1-.454 1-1.013 0-.56-.448-1.013-1-1.013H4Zm0 4.05c-.552 0-1 .454-1 1.014 0 .559.448 1.012 1 1.012h4c.552 0 1-.453 1-1.012 0-.56-.448-1.013-1-1.013H4Z","clip-rule":"evenodd"},null,-1)])],2))],2)):e$b.createCommentVNode("",!0),oe(ee.call)?(e$b.openBlock(),e$b.createElementBlock("button",{key:2,onClick:Ee[2]||(Ee[2]=e$b.withModifiers(Se=>ie(ee.call),["stop"])),class:e$b.normalizeClass(["call-expand-btn hover:bg-base-100",{rotated:ne.value.includes(ee.call.id)}])},[...Ee[8]||(Ee[8]=[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)])],2)):e$b.createCommentVNode("",!0)])]),e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[ne.value.includes(ee.call.id)?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$c,[ae.value[ee.call.id]&&ve(ee.call)?(e$b.openBlock(),e$b.createBlock(CallRecordPlayer,{key:0,"record-metadata":ee.call.record_metadata,onClose:Ee[3]||(Ee[3]=Se=>le(ee.call.id))},null,8,["record-metadata"])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_9$a,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(_e(ee.call),(Se,Le)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:Le,class:"call-event-item"},[e$b.createElementVNode("div",_hoisted_10$a,[e$b.createElementVNode("div",{class:e$b.normalizeClass(["call-event-dot",ge($e(Se))])},null,2),e$b.createElementVNode("span",{class:e$b.normalizeClass(["call-event-text",be($e(Se))])},e$b.toDisplayString(me($e(Se))),3)]),e$b.createElementVNode("span",_hoisted_11$9,e$b.toDisplayString(ke(Se.created_at)),1)]))),128))])])):e$b.createCommentVNode("",!0)]),_:1})]))}},CallCard=_export_sfc$1(_sfc_main$w,[["__scopeId","data-v-7de9d6c1"]]),_hoisted_1$s={class:"call-message-container"},_sfc_main$v=e$b.defineComponent({__name:"CallMessage",props:{content:{type:Object,required:!0}},setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$s,[e$b.createVNode(CallCard,{call:ee.content,"hide-message-button":!0},null,8,["call"])]))}}),CallMessage=_export_sfc$1(_sfc_main$v,[["__scopeId","data-v-f368f432"]]);function normalizeVcardContent(ee){const te=(ee==null?void 0:ee.vcard_info)??ee??{},ne=ae=>ae==null?[]:Array.isArray(ae)?ae:[ae];return{name:te.name||"Contato",title:te.title||"",org:te.org||te.organization||"",photo:te.photo||null,birthday:te.birthday||"",phones:ne(te.telephones??te.phones??te.phone??te.telephone).filter(Boolean),emails:ne(te.emails??te.email).map(ae=>typeof ae=="string"?{email:ae,type:""}:ae).filter(ae=>ae&&ae.email),urls:ne(te.urls??te.url).map(ae=>typeof ae=="string"?{url:ae,type:""}:ae).filter(ae=>ae&&ae.url),addresses:ne(te.addresses??te.address).filter(Boolean)}}function normalizeVcardContents(ee){const te=ee==null?void 0:ee.contacts;return Array.isArray(te)&&te.length?te.map(ne=>normalizeVcardContent(ne)):[normalizeVcardContent(ee)]}const _hoisted_1$r={key:0,class:"size-3.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_hoisted_2$p=["id"],_hoisted_3$m={key:0,class:"flex select-none text-gray-400 opacity-70 dark:text-blue-800"},_hoisted_4$l={key:1,class:"mb-1.5 flex items-center gap-1.5 text-xs opacity-80"},_hoisted_5$j={key:5,class:"flex flex-col"},_hoisted_6$f={key:9},_hoisted_7$e={key:12,class:"relative flex w-full flex-col px-1"},_hoisted_8$b={key:0,class:"flex items-center justify-center space-x-1 italic"},_hoisted_9$9=["id"],_hoisted_10$9={key:0,class:"flex items-center gap-1"},_hoisted_11$8=["disabled"],_hoisted_12$7={class:"tabular-nums opacity-80"},_hoisted_13$5={class:"flex items-center gap-1"},_hoisted_14$5={class:"flex items-center space-x-1"},_hoisted_15$4={class:"flex items-center gap-1 opacity-80"},_hoisted_16$4={key:0},_hoisted_17$2={key:0},_hoisted_18$2={class:"message-reaction-emoji"},_hoisted_19$2={key:3,class:"shrink-0"},_hoisted_20$2={key:4,class:"w-12 shrink-0"},BOT_AVATAR="https://sm-click.s3.amazonaws.com/static/bot-attendance.png",_sfc_main$u={__name:"MessageBubble",props:{message:{type:Object,default:()=>({})},nextMessage:{type:Object,default:()=>({})},isInfo:{type:Boolean,default:!1},chat:{type:Object,default:null},readonly:{type:Boolean,default:!1}},emits:["go-to-message","start-chat","expand","open-native-pdf","update-proposal-status","download","download-package","copy-native","info","deleted","resent","error"],setup(ee,{emit:te}){const ne=ee,ae=te,re=useMessageUiStore(),oe=e$b.ref(!1),ie=e$b.ref(!1),le=e$b.computed(()=>re.isActionsTarget(ne.message.id));function ce(at){ne.readonly||re.openActions(ne.message,at)}const de=e$b.computed(()=>ne.message.from_me),ue=e$b.computed(()=>{var at;return/https?:\/\/[^\s<]*(?:youtube\.com|youtu\.be)\/[^\s<]*/i.test(((at=ne.message.content)==null?void 0:at.text)||"")}),be=e$b.computed(()=>["file","image","video","document"].includes(ne.message.type)||Array.isArray(ne.message.items)&&ne.message.items.length>0),fe=e$b.computed(()=>ne.chat?!!ne.chat.group:re.isGroupChat),ge=e$b.computed(()=>fe.value?"shrink-0":"hidden shrink-0 md:block"),me=e$b.computed(()=>{var at;return ne.chat?((at=ne.chat.contact)==null?void 0:at.photo)??"":re.contactPhoto}),pe=e$b.computed(()=>{var at;return ne.chat?((at=ne.chat.contact)==null?void 0:at.name)??"":re.contactName}),ke=e$b.computed(()=>{var at;return((at=re.loggedAttendant)==null?void 0:at.id)??null}),ve=e$b.computed(()=>!!ne.message.sent_by&&ne.message.sent_by.id!==ke.value),_e=e$b.computed(()=>{var at,Je,lt;return{title:pe.value||"Áudio",subtitle:de.value?"Você":((at=ne.message.sent_by)==null?void 0:at.name)||pe.value||"",chatId:((Je=ne.chat)==null?void 0:Je.id)??((lt=re.currentChat)==null?void 0:lt.id)??null,messageId:ne.message.id}}),$e=e$b.computed(()=>{var at,Je;return!!((at=ne.message.quoted)!=null&&at.content)||!!ne.message.isTranscripting||!!((Je=ne.message.metadata)!=null&&Je.transcripted_text)}),ye=e$b.computed(()=>ne.message.type==="sms"?"icon-sms":ne.message.from_me?ne.message.internal?"icon-internal":"icon-owner":"icon-received"),Ee=e$b.computed(()=>ne.message.type==="sms"?"-right-[8px] message-dot-sms reflex":de.value?"-right-[8px] message-dot-owner reflex":"message-dot-received -left-[8px]"),Se=e$b.computed(()=>{const at=(ne.message.items||[]).map(Je=>Je==null?void 0:Je.id).filter(Boolean);return at.length?at.some(Je=>re.isMessageSelected(Je)):re.isMessageSelected(ne.message.id)}),Le=e$b.computed(()=>canForwardMessage(ne.message));function Ae(){if(!Le.value)return;const at=(ne.message.items||[]).map(Je=>Je==null?void 0:Je.id).filter(Boolean);at.length?re.togglePackageSelection(at):re.toggleMessageSelection(ne.message.id)}function De(at,Je){var gt,Et,mt,je,Qe,ut,dt,pt,tt,We,Ke,nt;if(!at||!at.sent_by&&!((gt=at.content)!=null&>.sender))return!1;if(!Je||!Je.sent_by&&!((Et=Je.content)!=null&&Et.sender))return!0;const lt=((mt=at.sent_by)==null?void 0:mt.id)||((Qe=(je=at.content)==null?void 0:je.sender)==null?void 0:Qe.id)||((dt=(ut=at.content)==null?void 0:ut.sender)==null?void 0:dt.name),it=((pt=Je.sent_by)==null?void 0:pt.id)||((We=(tt=Je.content)==null?void 0:tt.sender)==null?void 0:We.id)||((nt=(Ke=Je.content)==null?void 0:Ke.sender)==null?void 0:nt.name);return lt&&it?lt!==it:!1}const Oe=e$b.computed(()=>De(ne.message,ne.nextMessage)),Ie=e$b.computed(()=>isSticker(ne.message)||isTgSticker(ne.message)),ze=e$b.computed(()=>isPtv(ne.message)),Ve=e$b.computed(()=>Ie.value||ze.value),Ne=e$b.computed(()=>{var at;return(!de.value||ve.value)&&Oe.value&&!!((at=ne.message.content)!=null&&at.sender)}),Pe=e$b.computed(()=>{var at,Je,lt;return ve.value?(at=ne.message.sent_by)==null?void 0:at.name:(lt=(Je=ne.message.content)==null?void 0:Je.sender)==null?void 0:lt.name}),Be=["file","image","audio","text","sms","button","document","proposal","template","video"],Me=e$b.computed(()=>!ne.readonly&&ne.message.stage!=="excluded"&&Be.includes(ne.message.type)&&(ne.message.whatsapp_id!=="waiting to create"||ne.message.fail_reason||ne.message.stage==="processing")),xe=e$b.computed(()=>normalizeVcardContents(ne.message.content));function Ce(at){return Object.keys(at||{}).length!==0}function Fe(at){const Je=Math.floor(at/60),lt=(at%60).toFixed(0);return`${String(Je).padStart(2,"0")}:${String(lt).padStart(2,"0")}`}function Re(at){ne.message.content.currentTime=at}let qe;function Ge(at){var it;if(ne.readonly)return;const Je=(it=at.touches)==null?void 0:it[0],lt={clientX:(Je==null?void 0:Je.clientX)??0,clientY:(Je==null?void 0:Je.clientY)??0};qe=setTimeout(()=>{oe.value=!0,re.openActions(ne.message,lt)},550)}function Ze(){clearTimeout(qe)}e$b.onBeforeUnmount(()=>clearTimeout(qe));async function Xe(){const at=await transcriptAudio(ne.message);at.ok||notiwind.notify({group:"error",title:"Erro",text:at.error},4e3)}async function Ue(){const at=await reactToMessage(ne.message,"");at.ok||notiwind.notify({group:"error",title:"Erro",text:at.error},4e3)}return(at,Je)=>{var lt,it,gt,Et,mt,je,Qe,ut,dt,pt,tt,We,Ke,nt,ht,st,ft;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.renderSlot(at.$slots,"default",{class:"w-full"}),(Ce(ee.message.content)||ee.message.type==="ciphertext"||ee.message.type==="call")&&!ee.message.special?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["flex w-full rounded-lg transition-colors duration-200 lg:px-2",{"justify-end":de.value,"justify-start":!de.value,"z-20":oe.value,"pt-1.5":Oe.value,"pt-0.5":!Oe.value,"pt-4":ee.nextMessage&&ee.nextMessage.metadata&&ee.nextMessage.metadata.reaction,"bg-gray-400/5 py-1 dark:bg-primary/20":Se.value}])},[e$b.unref(re).forwardMode.active&&!ee.message.internal&&Le.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,"data-test":"forward-message-checkbox",type:"button",class:"mr-2 flex items-center focus:outline-none",onClick:e$b.withModifiers(Ae,["stop"])},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["flex size-5 cursor-pointer items-center justify-center rounded border-2 transition-colors",Se.value?"bg-primary border-primary":"border-gray-400 dark:bg-gray-500/60 dark:border-gray-600 hover:border-primary"])},[Se.value?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_1$r,[...Je[22]||(Je[22]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):e$b.createCommentVNode("",!0)],2)])):e$b.createCommentVNode("",!0),!de.value&&Oe.value&&ee.message.content.sender?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:e$b.normalizeClass(ge.value)},[e$b.createVNode(Avatar,{photo:fe.value?(gt=(it=(lt=ee.message)==null?void 0:lt.content)==null?void 0:it.sender)==null?void 0:gt.photo:me.value,name:fe.value?(je=(mt=(Et=ee.message)==null?void 0:Et.content)==null?void 0:mt.sender)==null?void 0:je.name:pe.value,size:"fill",class:"mr-4 mt-1 size-8 select-none"},null,8,["photo","name"])],2)):ee.isInfo?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",{key:2,class:e$b.normalizeClass(["w-12 shrink-0",ge.value])},null,2)),e$b.createElementVNode("div",{id:ee.message.id,class:e$b.normalizeClass(["bubble-rise relative rounded-[7.5px] text-sm",{"bubble-rise-owner":de.value,"min-w-[100px] p-1.5 px-2 pb-0":!Ve.value,"message-media-bubble":be.value&&!ze.value,"internal-owner":ee.message.internal&&!Ve.value,"message-sms":ee.message.type==="sms"&&!Ve.value,"message-owner":de.value&&ee.message.type!=="sms"&&!Ve.value,"message-received":!de.value&&ee.message.type!=="sms"&&!Ve.value,"w-[320px]":ue.value,"transition duration-150 ease-in-out":ee.message.type==="text","max-w-[80%] md:max-w-[60%]":!ee.isInfo}]),onMouseenter:Je[20]||(Je[20]=yt=>oe.value=!0),onMouseleave:Je[21]||(Je[21]=yt=>oe.value=!1),onTouchstart:Ge,onTouchend:Ze,onContextmenu:e$b.withModifiers(ce,["prevent"])},[Oe.value&&!Ve.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["absolute top-[18px] z-0 h-3 w-2.5",Ee.value])},[(e$b.openBlock(),e$b.createElementBlock("svg",{width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",class:e$b.normalizeClass(ye.value)},[...Je[23]||(Je[23]=[e$b.createElementVNode("path",{d:"M2.08716 0.990608C6.96945 3.99222 14.3729 -1.53342 13.0005 3.49993C11.9288 7.43005 15.5661 14.0304 12.5 13.5001C11.2754 13.2882 7.30071 12.6987 4.10282 9.18332C1.80094 6.65292 0.995844 3.64548 0.812781 1.59225C0.755256 0.947065 1.53536 0.651363 2.08716 0.990608Z",fill:"currentColor"},null,-1)])],2))],2)):e$b.createCommentVNode("",!0),Ne.value?(e$b.openBlock(),e$b.createElementBlock("header",{key:1,class:e$b.normalizeClass(["message-sender-name text-left",Ve.value?"sticker-name":""]),style:e$b.normalizeStyle(e$b.unref(senderColorStyle)(Pe.value))},e$b.toDisplayString(Pe.value),7)):e$b.createCommentVNode("",!0),e$b.createElementVNode("main",{class:e$b.normalizeClass(["flex w-full",Ve.value?["items-end gap-1",de.value?"flex-row-reverse":"flex-row"]:"flex-col"])},[ee.message.stage==="excluded"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_3$m,[...Je[24]||(Je[24]=[e$b.createElementVNode("section",{class:"flex items-center justify-center"},[e$b.createElementVNode("svg",{class:"mb-0.3 size-4",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",width:"100",height:"100"},[e$b.createElementVNode("path",{d:"M25,2C12.317,2,2,12.318,2,25s10.317,23,23,23s23-10.318,23-23S37.683,2,25,2z M7,25c0-4.062,1.371-7.8,3.65-10.815 L35.815,39.35C32.8,41.629,29.062,43,25,43C15.075,43,7,34.925,7,25z M39.35,35.815L14.185,10.65C17.2,8.371,20.938,7,25,7 c9.925,0,18,8.075,18,18C43,29.062,41.629,32.8,39.35,35.815z"})]),e$b.createElementVNode("p",{class:"p-1 italic"},"Mensagem apagada")],-1)])])):e$b.createCommentVNode("",!0),ee.message.is_forward?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_4$l,[...Je[25]||(Je[25]=[e$b.createElementVNode("svg",{class:"size-3.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{d:"M5.027 10.9a8.729 8.729 0 0 1 6.422-3.62v-1.2A2.061 2.061 0 0 1 12.61 4.2a1.986 1.986 0 0 1 2.104.23l5.491 4.308a2.11 2.11 0 0 1 .588 2.566 2.109 2.109 0 0 1-.588.734l-5.489 4.308a1.983 1.983 0 0 1-2.104.228 2.065 2.065 0 0 1-1.16-1.876v-.942c-5.33 1.284-6.212 5.251-6.25 5.441a1 1 0 0 1-.923.806h-.06a1.003 1.003 0 0 1-.955-.7A10.221 10.221 0 0 1 5.027 10.9Z"})],-1),e$b.createElementVNode("span",null,"Encaminhada",-1)])])):e$b.createCommentVNode("",!0),ee.message.quoted&&ee.message.quoted.content?(e$b.openBlock(),e$b.createBlock(MessageQuote,{key:2,"chat-id":ee.message.quoted.chat,attendant:ee.message.quoted.sent_by,"is-message":!0,"message-id":ee.message.quoted.id,message:ee.message.quoted.content,onGo:Je[0]||(Je[0]=(yt,wt)=>ae("go-to-message",yt,wt))},null,8,["chat-id","attendant","message-id","message"])):e$b.createCommentVNode("",!0),ee.message.content.is_ad?(e$b.openBlock(),e$b.createBlock(_sfc_main$I,{key:3,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):e$b.createCommentVNode("",!0),(Qe=ee.message.content)!=null&&Qe.post_info?(e$b.openBlock(),e$b.createBlock(_sfc_main$H,{key:4,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):e$b.createCommentVNode("",!0),ee.message.type==="sms"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5$j,[Je[26]||(Je[26]=e$b.createElementVNode("span",{class:"inline-flex items-center gap-1 self-end rounded-full bg-violet-100/15 px-2 text-[9px] font-bold uppercase tracking-widest text-violet-100 dark:bg-violet-600/15 dark:text-violet-600"}," SMS ",-1)),e$b.createVNode(YouTubePreview,{content:ee.message.content.text},null,8,["content"]),e$b.createVNode(MessageMarkdown,{class:"text-left",content:ee.message.content.text},null,8,["content"])])):ee.message.type==="text"&&!ee.message.content.is_ad&&!((ut=ee.message.content)!=null&&ut.post_info)?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:6},[e$b.createVNode(YouTubePreview,{content:ee.message.content.text},null,8,["content"]),e$b.createVNode(MessageMarkdown,{class:e$b.normalizeClass(["text-left",ee.message.stage==="excluded"?"opacity-70 text-gray-400":""]),content:ee.message.content.text},null,8,["class","content"])],64)):ee.message.type==="list"?(e$b.openBlock(),e$b.createBlock(MessageMarkdown,{key:7,class:"text-left",content:ee.message.content.description},null,8,["content"])):ee.message.type==="call"?(e$b.openBlock(),e$b.createBlock(CallMessage,{key:8,content:ee.message.content},null,8,["content"])):ee.message.type==="location"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$f,[e$b.createVNode(MessageLocationMap,{map:ee.message.content,"map-id":`${ee.message.id}-map`},null,8,["map","map-id"])])):ee.message.type==="ciphertext"?(e$b.openBlock(),e$b.createBlock(MessageCiphertext,{key:10})):ee.message.whatsapp_id==="waiting to create"&&ee.message.type!=="text"&&ee.message.content&&!ee.message.content.url?(e$b.openBlock(),e$b.createBlock(_sfc_main$F,{key:11,message:ee.message},null,8,["message"])):e$b.unref(isAudio)(ee.message)?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$e,[e$b.createVNode(MessageAudio,{audio:ee.message.content.data64?ee.message.content.data64:ee.message.content.url,"is-owner":de.value,"full-width":$e.value,"track-id":ee.message.id,"track-meta":_e.value,onCurrentTime:Re},null,8,["audio","is-owner","full-width","track-id","track-meta"]),ee.message.isTranscripting?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$b,[...Je[27]||(Je[27]=[e$b.createElementVNode("svg",{fill:"none",class:"size-7 animate-spin",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},[e$b.createElementVNode("path",{"clip-rule":"evenodd",d:"M15.165 8.53a.5.5 0 01-.404.58A7 7 0 1023 16a.5.5 0 011 0 8 8 0 11-9.416-7.874.5.5 0 01.58.404z",fill:"currentColor","fill-rule":"evenodd"})],-1),e$b.createElementVNode("div",null,"Transcrevendo...",-1)])])):e$b.createCommentVNode("",!0),(dt=ee.message.metadata)!=null&&dt.transcripted_text&&!ee.message.isTranscripting?(e$b.openBlock(),e$b.createElementBlock("div",{key:1,id:`transcriptedMessage${ee.message.id}`,class:"max-h-[200px] overflow-auto pb-1 pr-2 text-left opacity-90"},[e$b.createElementVNode("em",null,'"'+e$b.toDisplayString((pt=ee.message.metadata)==null?void 0:pt.transcripted_text)+'"',1)],8,_hoisted_9$9)):e$b.createCommentVNode("",!0)])):ee.message.items&&ee.message.items.length>1?(e$b.openBlock(),e$b.createBlock(_sfc_main$E,{key:13,message:ee.message,onExpand:Je[1]||(Je[1]=yt=>ae("expand",ee.message,!0,yt))},null,8,["message"])):["file","image","video","document"].includes(ee.message.type)&&!ee.message.items?(e$b.openBlock(),e$b.createBlock(MessageFileRenderer,{key:14,message:ee.message,onExpand:Je[2]||(Je[2]=(yt,wt)=>ae("expand",yt,wt)),onOpenNativePdf:Je[3]||(Je[3]=yt=>ae("open-native-pdf",yt)),onDownload:Je[4]||(Je[4]=()=>ae("download",ee.message)),onError:Je[5]||(Je[5]=yt=>ae("error",yt))},null,8,["message"])):ee.message.type==="proposal"?(e$b.openBlock(),e$b.createBlock(ProposalMessageCard,{key:15,message:ee.message,interactive:!ee.readonly,onUpdateStatus:Je[6]||(Je[6]=(yt,wt)=>ae("update-proposal-status",ee.message,yt,wt)),onOpenNativePdf:Je[7]||(Je[7]=yt=>ae("open-native-pdf",yt))},null,8,["message","interactive"])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",{class:e$b.normalizeClass([[Ve.value?"sticker-meta":ee.message.content.duration?"justify-between":"justify-end pl-2"],"flex select-none items-center space-x-1 text-[10px]"])},[ee.message.content.duration&&!ze.value?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_10$9,[e$b.unref(isAudio)(ee.message)&&!((tt=ee.message.metadata)!=null&&tt.transcripted_text)?(e$b.openBlock(),e$b.createBlock(e$b.unref(entry_esm),{key:0,"offset-distance":"2",hover:!0,content:"Transcrever áudio",placement:"top",class:"text-[14px]"},{default:e$b.withCtx(()=>[e$b.createElementVNode("button",{disabled:ee.message.isTranscripting,class:"stage-mark mt-[6px] hover:text-primary",onClick:e$b.withModifiers(Xe,["stop"])},[...Je[28]||(Je[28]=[e$b.createElementVNode("svg",{class:"size-5.5","clip-rule":"evenodd","fill-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"2",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e$b.createElementVNode("path",{fill:"currentColor",d:"m11.239 15.533c-1.045 3.004-1.238 3.451-1.238 3.84 0 .441.385.627.627.627.272 0 1.108-.301 3.829-1.249zm.888-.888 3.22 3.22 6.408-6.401c.163-.163.245-.376.245-.591 0-.213-.082-.427-.245-.591-.58-.579-1.458-1.457-2.039-2.036-.163-.163-.377-.245-.591-.245-.213 0-.428.082-.592.245zm-3.127-.895c0-.402-.356-.75-.75-.75-2.561 0-2.939 0-5.5 0-.394 0-.75.348-.75.75s.356.75.75.75h5.5c.394 0 .75-.348.75-.75zm5-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75zm0-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75zm0-3c0-.402-.356-.75-.75-.75-2.561 0-7.939 0-10.5 0-.394 0-.75.348-.75.75s.356.75.75.75h10.5c.394 0 .75-.348.75-.75z","fill-rule":"nonzero"})],-1)])],8,_hoisted_11$8)]),_:1})):e$b.createCommentVNode("",!0),e$b.createElementVNode("p",_hoisted_12$7,e$b.toDisplayString(Fe(ee.message.content.currentTime||ee.message.content.duration)),1)])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_13$5,[ee.message.internal?(e$b.openBlock(),e$b.createBlock(e$b.unref(entry_esm),{key:0,arrow:!0,hover:"",placement:"top"},{content:e$b.withCtx(()=>[...Je[29]||(Je[29]=[e$b.createElementVNode("div",{class:"w-32 text-center"},"Mensagem visível apenas para outros atendentes",-1)])]),default:e$b.withCtx(()=>[Je[30]||(Je[30]=e$b.createElementVNode("svg",{class:"size-3.5 text-white/50 dark:text-black/40","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 6a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm-1.5 8a4 4 0 0 0-4 4 2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-3Zm6.82-3.096a5.51 5.51 0 0 0-2.797-6.293 3.5 3.5 0 1 1 2.796 6.292ZM19.5 18h.5a2 2 0 0 0 2-2 4 4 0 0 0-4-4h-1.1a5.503 5.503 0 0 1-.471.762A5.998 5.998 0 0 1 19.5 18ZM4 7.5a3.5 3.5 0 0 1 5.477-2.889 5.5 5.5 0 0 0-2.796 6.293A3.501 3.501 0 0 1 4 7.5ZM7.1 12H6a4 4 0 0 0-4 4 2 2 0 0 0 2 2h.5a5.998 5.998 0 0 1 3.071-5.238A5.505 5.505 0 0 1 7.1 12Z","clip-rule":"evenodd"})],-1))]),_:1})):e$b.createCommentVNode("",!0),e$b.createElementVNode("main",_hoisted_14$5,[e$b.createElementVNode("p",_hoisted_15$4,[((Ke=(We=ee.message.content)==null?void 0:We.history)==null?void 0:Ke.length)>0?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_16$4,"Editada")):e$b.createCommentVNode("",!0),e$b.createTextVNode(" "+e$b.toDisplayString(((ht=(nt=ee.message)==null?void 0:nt.sent_at)==null?void 0:ht.split("T")[1].slice(0,5))||"--:--"),1)]),de.value?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_17$2,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,"failed-size":12,class:e$b.normalizeClass(ee.message.stage==="failed"?"size-4":"")},null,8,["stage","class"])])):e$b.createCommentVNode("",!0)])])],2)],2),ee.message.type==="list"?(e$b.openBlock(),e$b.createBlock(_sfc_main$U,{key:2,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):ee.message.type==="template"?(e$b.openBlock(),e$b.createBlock(_sfc_main$R,{key:3,from_me:ee.message.from_me,message:ee.message.content},null,8,["from_me","message"])):ee.message.type==="vcard"?(e$b.openBlock(),e$b.createBlock(ContactMessageCard,{key:4,contacts:xe.value,"show-start-chat":!0,onStartChat:Je[8]||(Je[8]=yt=>ae("start-chat",yt))},null,8,["contacts"])):ee.message.type==="button"?(e$b.openBlock(),e$b.createBlock(_sfc_main$Q,{key:5,content:ee.message.content},null,8,["content"])):e$b.createCommentVNode("",!0),e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[Me.value?e$b.withDirectives((e$b.openBlock(),e$b.createElementBlock("button",{key:0,type:"button","aria-label":"Ações da mensagem",class:"absolute right-[1.5px] top-0 ml-3 flex items-center justify-center pr-1 pt-1",onClick:e$b.withModifiers(ce,["stop"])},[...Je[31]||(Je[31]=[e$b.createElementVNode("svg",{fill:"currentColor",viewBox:"0 0 20 20",class:"size-5 rounded bg-gray-800/80 text-white transition-transform duration-200 dark:bg-gray-400"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])],512)),[[e$b.vShow,oe.value]]):e$b.createCommentVNode("",!0)]),_:1}),le.value?(e$b.openBlock(),e$b.createBlock(MessageActionsMenu,{key:6,onInfo:Je[9]||(Je[9]=yt=>ae("info",yt)),onDownload:Je[10]||(Je[10]=yt=>ae("download",yt)),onDownloadPackage:Je[11]||(Je[11]=yt=>ae("download-package",yt)),onCopyNative:Je[12]||(Je[12]=yt=>ae("copy-native",yt)),onDeleted:Je[13]||(Je[13]=yt=>ae("deleted",yt)),onResent:Je[14]||(Je[14]=yt=>ae("resent",yt))})):e$b.createCommentVNode("",!0),(st=ee.message.metadata)!=null&&st.reaction?(e$b.openBlock(),e$b.createElementBlock("footer",{key:7,class:e$b.normalizeClass(["message-reaction",{"message-reaction-sticker":Ve.value&&de.value}]),onMouseenter:Je[15]||(Je[15]=yt=>ie.value=!0),onMouseleave:Je[16]||(Je[16]=yt=>ie.value=!1),onTouchstart:Je[17]||(Je[17]=yt=>ie.value=!0),onTouchend:Je[18]||(Je[18]=yt=>ie.value=!1),onTouchcancel:Je[19]||(Je[19]=yt=>ie.value=!1)},[e$b.createElementVNode("button",{type:"button",class:"message-reaction-slot","aria-label":"Remover reação",onClick:e$b.withModifiers(Ue,["stop"])},[e$b.createElementVNode("span",_hoisted_18$2,e$b.toDisplayString((ft=ee.message.metadata)==null?void 0:ft.reaction),1),(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(["message-reaction-remove",{"is-visible":ie.value}]),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...Je[32]||(Je[32]=[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M6 18 17.94 6M18 18 6.06 6"},null,-1)])],2))])],34)):e$b.createCommentVNode("",!0)],42,_hoisted_2$p),de.value&&Oe.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_19$2,[ee.message.sent_by?(e$b.openBlock(),e$b.createBlock(Avatar,{key:0,attendant:ee.message.sent_by,size:"fill","show-level":!1,"effect-level":"border",class:"ml-4 mt-1 size-8 select-none"},null,8,["attendant"])):(e$b.openBlock(),e$b.createBlock(Avatar,{key:1,photo:BOT_AVATAR,size:"fill",class:"ml-4 mt-1 size-8 select-none"}))])):ee.isInfo?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_20$2))],2)):e$b.createCommentVNode("",!0)],64)}}},_hoisted_1$q={class:"flex w-full justify-center py-1.5"},_hoisted_2$o={class:"inline-flex max-w-[85%] items-center gap-2 rounded-full bg-base-200 py-1.5 pl-1.5 pr-3.5 text-xs font-semibold text-base-content/80 shadow-sm ring-1 ring-base-300/60"},_hoisted_3$l={class:"flex size-5 shrink-0 items-center justify-center rounded-full bg-base-100 text-primary shadow-sm"},_hoisted_4$k={class:"min-w-0 truncate"},_hoisted_5$i={key:0,class:"shrink-0 text-[10px] font-normal opacity-60"},_sfc_main$t={__name:"SystemMessage",props:{message:{type:Object,required:!0},time:{type:String,default:""}},setup(ee){return(te,ne)=>{var ae;return e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,[e$b.renderSlot(te.$slots,"default"),e$b.createElementVNode("div",_hoisted_1$q,[e$b.createElementVNode("span",_hoisted_2$o,[e$b.createElementVNode("span",_hoisted_3$l,[e$b.renderSlot(te.$slots,"icon",{},()=>[ne[0]||(ne[0]=e$b.createElementVNode("svg",{class:"size-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.586 2.586A2 2 0 0 1 11 2h2a2 2 0 0 1 2 2v.089l.473.196.063-.063a2.002 2.002 0 0 1 2.828 0l1.414 1.414a2 2 0 0 1 0 2.827l-.063.064.196.473H20a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-.089l-.196.473.063.063a2.002 2.002 0 0 1 0 2.828l-1.414 1.414a2 2 0 0 1-2.828 0l-.063-.063-.473.196V20a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-.089l-.473-.196-.063.063a2.002 2.002 0 0 1-2.828 0l-1.414-1.414a2 2 0 0 1 0-2.827l.063-.064L4.089 15H4a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2h.09l.195-.473-.063-.063a2 2 0 0 1 0-2.828l1.414-1.414a2 2 0 0 1 2.827 0l.064.063L9 4.089V4a2 2 0 0 1 .586-1.414ZM8 12a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z","clip-rule":"evenodd"})],-1))])]),e$b.createElementVNode("span",_hoisted_4$k,e$b.toDisplayString((ae=ee.message.content)==null?void 0:ae.text),1),ee.time?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$i,e$b.toDisplayString(ee.time),1)):e$b.createCommentVNode("",!0)])])],64)}}},_hoisted_1$p={class:"history-shell relative min-h-0 w-full flex-1 overflow-hidden"},_hoisted_2$n={class:"history-infinite-spinner",role:"status"},_hoisted_3$k={class:"history-pixel-bar","aria-hidden":"true"},_hoisted_4$j={class:"smplay-pixel-label"},_hoisted_5$h=["aria-hidden","inert","data-history-key"],_hoisted_6$e={key:0,class:"history-separator my-4"},_hoisted_7$d={class:"history-protocol-label"},_hoisted_8$a={class:"min-w-0 truncate"},_hoisted_9$8={key:0,class:"history-separator history-separator-unread"},_hoisted_10$8={class:"history-unread-label"},_hoisted_11$7={class:"history-unread-count"},_hoisted_12$6={key:1,class:"history-separator history-separator-day"},_hoisted_13$4={class:"day-badge history-separator-chip"},_hoisted_14$4={class:"history-overlay"},_hoisted_15$3={key:0,class:"history-overlay-banner"},_hoisted_16$3={key:0,class:"history-loader-layer"},INFINITE_PRERENDER_MIN_DELAY_MS=64,INFINITE_MEDIA_WARMUP_TIMEOUT_MS=80,HISTORY_ITEM_BLEED=8,NAV_HYSTERESIS_PX=48,_sfc_main$s={__name:"ChatHistory",props:{messages:{type:Array,default:()=>[]},chat:{type:Object,default:null},chatKey:{type:[String,Number],default:null},hasMore:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreText:{type:String,default:"Carregando mais..."},unreadCount:{type:Number,default:0},readonly:{type:Boolean,default:!1},messageHandlers:{type:Object,default:()=>({})},loadMore:{type:Function,default:null},dateFormatter:{type:Function,default:null}},setup(ee,{expose:te}){const ne={},ae=ee,re=useMessageUiStore(),oe=e$b.ref(null),ie=e$b.ref(null),le=e$b.computed(()=>re.forwardMode.selectedMessages.length),ce=new Intl.DateTimeFormat("pt-BR",{timeZone:"America/Sao_Paulo",year:"numeric",month:"2-digit",day:"2-digit"});function de(je){if(!je)return null;const Qe=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(je)&&!/[zZ]|[+-]\d{2}:\d{2}$/.test(je),ut=new Date(Qe?je+"Z":je);return isNaN(ut.getTime())?null:ut}function ue(je){const Qe=de(je);if(!Qe)return"";const ut=new Date,dt=new Date(ut);return dt.setDate(dt.getDate()-1),isSameWeek(Qe,ut,{weekStartsOn:1})?be(Qe,ut)?"Hoje":be(Qe,dt)?"Ontem":format(Qe,"iiii",{locale:ptBR}):format(Qe,Qe.getFullYear()===ut.getFullYear()?"dd/MM":"dd/MM/yyyy",{locale:ptBR})}function be(je,Qe){return je.getDate()===Qe.getDate()&&je.getMonth()===Qe.getMonth()&&je.getFullYear()===Qe.getFullYear()}function fe(je){return ae.dateFormatter?ae.dateFormatter(je):ue(je)}function ge(je){var Qe;return je.sent_by?`internal:${je.sent_by.id}`:(Qe=je.content)!=null&&Qe.sender?`external:${je.content.sender.name||""}`:"unknown"}const me=new WeakMap,pe=e$b.ref(!1),ke=e$b.ref(new Set),ve=e$b.ref({});function _e(){return new Promise(je=>window.setTimeout(je,INFINITE_PRERENDER_MIN_DELAY_MS))}function $e(){var Qe;const je=(Qe=oe.value)==null?void 0:Qe.getBoundingClientRect();ke.value=new Set(ae.messages.map(Me)),ve.value=je?{"--history-prerender-left":`${je.left}px`,"--history-prerender-top":`${je.top}px`,"--history-prerender-width":`${je.width}px`,"--history-prerender-height":`${je.height}px`}:{},pe.value=!0}function ye(){pe.value=!1,ke.value=new Set,ve.value={}}function Ee(je){return pe.value&&!ke.value.has(je)}function Se(je){var dt,pt;const Qe=[((pt=(dt=ae.chat)==null?void 0:dt.contact)==null?void 0:pt.photo)||re.contactPhoto],ut=tt=>{var Ke;if(!tt||tt.special)return;const We=tt.content||{};Qe.push((Ke=We.sender)==null?void 0:Ke.photo),(isImage(tt)||isGif(tt)||isSticker(tt))&&Qe.push(We.data64,We.url,We.blobUrl),Array.isArray(tt.items)&&tt.items.forEach(ut)};return je.forEach(ut),Qe}function Le(je){var st,ft,yt,wt,Tt,Dt,Lt,Gt,Rt,Xt;const Qe=je&&typeof je=="object"?me.get(je):null,ut=((st=je==null?void 0:je.sent_by)==null?void 0:st.id)||((yt=(ft=je==null?void 0:je.content)==null?void 0:ft.sender)==null?void 0:yt.id)||((Tt=(wt=je==null?void 0:je.content)==null?void 0:wt.sender)==null?void 0:Tt.name)||"",dt=(Dt=je==null?void 0:je.content)==null?void 0:Dt.caption,pt=(Lt=je==null?void 0:je.content)==null?void 0:Lt.text,tt=(Gt=je==null?void 0:je.content)==null?void 0:Gt.type,We=((Rt=je==null?void 0:je.content)==null?void 0:Rt.url)||((Xt=je==null?void 0:je.content)==null?void 0:Xt.data64),Ke=(je==null?void 0:je.stage)||null;if(Qe&&Qe.sentAt===(je==null?void 0:je.sent_at)&&Qe.type===(je==null?void 0:je.type)&&Qe.contentType===tt&&Qe.caption===dt&&Qe.text===pt&&Qe.senderKey===ut&&Qe.stage===Ke&&Qe.url===We)return Qe;const nt=de(je==null?void 0:je.sent_at),ht={author:ge(je||{}),caption:dt,contentType:tt,dayKey:nt?ce.format(nt):"",hasCaption:!!(dt||pt),internal:(je==null?void 0:je.internal)||!1,isMedia:(isVideo(je)||isImage(je))&&!isPtv(je),senderKey:ut,sentAt:je==null?void 0:je.sent_at,sentAtMs:nt?nt.getTime():NaN,stage:Ke,text:pt,type:je==null?void 0:je.type,url:We};return je&&typeof je=="object"&&me.set(je,ht),ht}function Ae(je,Qe,ut,dt){return dt.isMedia&&Qe.isMedia&&je.from_me===ut.from_me&&dt.sentAtMs-Qe.sentAtMs<=12e4&&Qe.internal===dt.internal&&!dt.hasCaption&&!Qe.hasCaption&&Qe.author===dt.author&&Qe.stage===dt.stage}let De={messages:[],groups:[],collapsed:!1};const Oe=e$b.computed(()=>{const je=ae.messages,Qe=[];let ut=!1,dt=null,pt=null;for(let We=0;We<je.length;We++){const Ke=je[We],nt=Le(Ke);We===0||!Ae(dt,pt,Ke,nt)?Qe.push(We):ut=!0,dt=Ke,pt=nt}if(!ut&&!De.collapsed&&sameList(De.messages,je))return De.groups;const tt=[];for(let We=0;We<Qe.length;We++){const Ke=Qe[We],nt=We+1<Qe.length?Qe[We+1]:je.length;tt.push(nt-Ke===1?je[Ke]:{...je[Ke],items:je.slice(Ke,nt)})}return De={messages:je.slice(),groups:tt,collapsed:ut},tt}),Ie=stableList(()=>Oe.value.map(Me)),ze=stableList(()=>{const je=[];let Qe=null;return Oe.value.forEach((ut,dt)=>{const{dayKey:pt}=Le(ut),tt=dt===0||pt!==Qe;je.push(!ut.special&&tt?fe(ut.sent_at):null),Qe=pt}),je});let Ve=new Map,Ne=null;const Pe=e$b.computed(()=>{const je=Oe.value,Qe=Ie.value,ut=ze.value,{chat:dt,readonly:pt}=ae;(!Ne||Ne.chat!==dt||Ne.readonly!==pt)&&(Ve=new Map,Ne={chat:dt,readonly:pt});const tt=new Map,We=je.map((Ke,nt)=>{const ht=Qe[nt],st=ut[nt],ft=je[nt-1],yt=Ve.get(ht);if(yt&&yt.message===Ke&&yt.nextMessage===ft&&yt.dayLabel===st)return tt.set(ht,yt),yt.row;const wt=Ke.type==="system",Tt={message:Ke,nextMessage:ft,dayLabel:st,row:{key:ht,dayLabel:st,message:Ke,isSystem:wt,component:wt?_sfc_main$t:_sfc_main$u,props:wt?{message:Ke,time:Be(Ke)}:{message:Ke,nextMessage:ft,chat:dt,readonly:pt}}};return tt.set(ht,Tt),Tt.row});return Ve=tt,We});function Be(je){var Qe,ut;return((ut=(Qe=je==null?void 0:je.sent_at)==null?void 0:Qe.split("T")[1])==null?void 0:ut.slice(0,5))||""}function Me(je){var Qe,ut;return(je==null?void 0:je.id)!==void 0&&(je==null?void 0:je.id)!==null&&(je==null?void 0:je.id)!==""?String(je.id):je!=null&&je.special?`special:${je.content}`:`${(je==null?void 0:je.type)||"message"}:${(je==null?void 0:je.sent_at)||""}:${((Qe=je==null?void 0:je.content)==null?void 0:Qe.url)||((ut=je==null?void 0:je.content)==null?void 0:ut.text)||""}`}const xe=e$b.computed(()=>{const je=Oe.value.findIndex(Qe=>!Qe.special&&Qe.opened===!1&&(ae.chatKey==null||Qe.chat==null||Qe.chat===ae.chatKey));return je===-1?null:Ie.value[je]});function Ce(je){var dt;const Qe=String(je||""),ut=Qe.match(/PROTOCOLO\s+(.+)$/i);return(dt=ut==null?void 0:ut[1])!=null&&dt.trim()?`Protocolo ${ut[1].trim()}`:Qe}const Fe=e$b.ref(!1),Re=e$b.ref(!1);function qe(){var ut;const je=(ut=ie.value)==null?void 0:ut.querySelectorAll("[data-history-key]:not([data-history-measured])");if(!(je!=null&&je.length))return;const Qe=Array.from(je,dt=>dt.offsetHeight);je.forEach((dt,pt)=>{const tt=Qe[pt];tt<=0||(dt.style.containIntrinsicSize=`auto ${Math.max(1,tt-HISTORY_ITEM_BLEED*2)}px`,dt.dataset.historyMeasured="1")})}function Ge(je,Qe){let ut=null;const dt=(...pt)=>{ut&&window.clearTimeout(ut),ut=window.setTimeout(()=>{ut=null,je(...pt)},Qe)};return dt.cancel=()=>{ut&&window.clearTimeout(ut),ut=null},dt}const Ze=Ge(async je=>{if(ae.loading||!ae.loadMore){je.loaded();return}const Qe=ae.chatKey,ut=new Set(ae.messages.map(Me));try{if(!ae.hasMore){je.complete();return}if($e(),await ae.loadMore(),Qe!==ae.chatKey){ye(),je.loaded();return}const dt=ae.messages.filter(tt=>!ut.has(Me(tt))),pt=Se(dt);await e$b.nextTick(),await Promise.all([warmImageSources(pt,INFINITE_MEDIA_WARMUP_TIMEOUT_MS),_e()]),ye(),await e$b.nextTick(()=>{oe.value&&(qe(),lt())}),ae.hasMore?je.loaded():je.complete()}catch(dt){ye(),console.error("Erro durante o carregamento da rolagem infinita:",dt),je.complete()}},500);function Xe(){oe.value&&oe.value.scrollTo({top:0,behavior:"instant"})}function Ue(){if(!oe.value)return;const je=Math.max(oe.value.scrollHeight-oe.value.clientHeight,0);oe.value.scrollTo({top:-je,behavior:"smooth"})}let at={max:0,threshold:0},Je=null;function lt(){if(!oe.value)return;const je=oe.value.clientHeight;at={max:Math.max(oe.value.scrollHeight-je,0),threshold:Math.min(Math.max(je*.25,96),220)}}function it(je,Qe,ut){return je?Qe>ut-NAV_HYSTERESIS_PX:Qe>ut}function gt(){if(!oe.value)return;const{max:je,threshold:Qe}=at,ut=Math.min(Math.max(-oe.value.scrollTop,0),je);Fe.value=it(Fe.value,je-ut,Qe),Re.value=it(Re.value,ut,Qe)}let Et=null;function mt(){Et===null&&(Et=requestAnimationFrame(()=>{Et=null,gt()}))}return e$b.onMounted(async()=>{var je;await e$b.nextTick(),(je=oe.value)==null||je.addEventListener("scroll",mt,{passive:!0}),Je=new ResizeObserver(()=>{lt(),gt()}),oe.value&&Je.observe(oe.value),ie.value&&Je.observe(ie.value),requestAnimationFrame(()=>{qe(),lt(),gt()})}),e$b.onUnmounted(()=>{var je;ye(),(je=oe.value)==null||je.removeEventListener("scroll",mt),Je==null||Je.disconnect(),Je=null,Et!==null&&cancelAnimationFrame(Et)}),e$b.watch(()=>Oe.value.length,async()=>{await e$b.nextTick(),qe(),lt(),gt()}),e$b.watch(()=>ae.chatKey,async()=>{Ze.cancel(),ye(),Ve.clear(),re.forwardMode.active&&(re.forwardMode.active=!1,re.forwardMode.selectedMessages=[]),await e$b.nextTick(),qe(),lt(),gt()}),te({scrollToTop:Ue,scrollToBottom:Xe}),(je,Qe)=>(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_1$p,[e$b.createElementVNode("main",{ref_key:"chatContainer",ref:oe,class:e$b.normalizeClass([ee.loadingMore?"overflow-hidden":"overflow-y-auto","history-scroll scroll relative size-full"]),style:e$b.normalizeStyle(ve.value)},[e$b.createElementVNode("div",{ref_key:"chatContent",ref:ie,class:"history-content chat-column relative flex min-h-full w-full flex-none flex-col justify-end px-[10.5px] py-3"},[e$b.withDirectives(e$b.createVNode(e$b.unref(Y$1),{top:!0,direction:"top",class:"z-50 mb-2 py-1",onInfinite:e$b.unref(Ze)},{complete:e$b.withCtx(()=>[...Qe[0]||(Qe[0]=[e$b.createElementVNode("span",null,null,-1)])]),spinner:e$b.withCtx(()=>[e$b.createElementVNode("div",_hoisted_2$n,[e$b.createElementVNode("span",_hoisted_3$k,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(6,ut=>e$b.createElementVNode("i",{key:ut,class:"history-pixel-cell",style:e$b.normalizeStyle({"--cell":ut-1})},null,4)),64))]),e$b.createElementVNode("span",_hoisted_4$j,e$b.toDisplayString(ee.loadingMoreText),1)])]),_:1},8,["onInfinite"]),[[e$b.vShow,!ee.loading&&ee.hasMore]]),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(Pe.value,ut=>{var dt;return e$b.openBlock(),e$b.createElementBlock("div",{key:ut.key,class:e$b.normalizeClass(["history-item",{"history-item-prerender":Ee(ut.key),"history-item-overflowing":!!((dt=ut.message.metadata)!=null&&dt.reaction)}]),"aria-hidden":Ee(ut.key)?"true":void 0,inert:Ee(ut.key),"data-history-key":ut.key},[(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ut.component),e$b.mergeProps({ref_for:!0},ut.props,e$b.toHandlers(ut.isSystem?ne:ee.messageHandlers)),{default:e$b.withCtx(()=>[ut.message.special?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$e,[e$b.createElementVNode("div",_hoisted_7$d,[Qe[1]||(Qe[1]=e$b.createElementVNode("span",null,"Conversa anterior",-1)),e$b.createElementVNode("span",_hoisted_8$a,e$b.toDisplayString(Ce(ut.message.content)),1)])])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[ee.unreadCount>0&&ut.key===xe.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$8,[e$b.createElementVNode("div",_hoisted_10$8,[e$b.createElementVNode("span",_hoisted_11$7,e$b.toDisplayString(ee.unreadCount),1),e$b.createElementVNode("span",null,e$b.toDisplayString(ee.unreadCount===1?"mensagem não lida":"mensagens não lidas"),1)])])):e$b.createCommentVNode("",!0),ut.dayLabel?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_12$6,[e$b.createElementVNode("div",_hoisted_13$4,e$b.toDisplayString(ut.dayLabel),1)])):e$b.createCommentVNode("",!0),Qe[2]||(Qe[2]=e$b.createElementVNode("div",{class:"message"},null,-1))],64))]),_:2},1040))],10,_hoisted_5$h)}),128))],512)],6),e$b.createElementVNode("div",_hoisted_14$4,[e$b.createVNode(e$b.Transition,{name:"fade"},{default:e$b.withCtx(()=>[e$b.unref(re).forwardMode.active&&je.$slots.banner?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_15$3,[e$b.renderSlot(je.$slots,"banner",{selectedCount:le.value})])):e$b.createCommentVNode("",!0)]),_:3})]),e$b.createVNode(e$b.Transition,{name:"history-loader"},{default:e$b.withCtx(()=>[ee.loading&&je.$slots.loading?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$3,[e$b.renderSlot(je.$slots,"loading")])):e$b.createCommentVNode("",!0)]),_:3}),e$b.createVNode(e$b.TransitionGroup,{name:"history-nav",tag:"div",class:"history-navigation"},{default:e$b.withCtx(()=>[Fe.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:"top",type:"button",class:"history-navigation-button","aria-label":"Ir para o início da conversa",title:"Ir para o início da conversa",onClick:Ue},[...Qe[3]||(Qe[3]=[e$b.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none"},[e$b.createElementVNode("path",{d:"m6.75 14.25 5.25-5.25 5.25 5.25"})],-1)])])):e$b.createCommentVNode("",!0),Re.value?(e$b.openBlock(),e$b.createElementBlock("button",{key:"bottom",type:"button",class:"history-navigation-button","aria-label":"Ir para as mensagens mais recentes",title:"Ir para as mensagens mais recentes",onClick:Xe},[...Qe[4]||(Qe[4]=[e$b.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none"},[e$b.createElementVNode("path",{d:"m6.75 9.75 5.25 5.25 5.25-5.25"})],-1)])])):e$b.createCommentVNode("",!0)]),_:1})]))}},_hoisted_1$o=["aria-label"],_hoisted_2$m={key:0,class:"size-4 translate-x-px","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_3$j={key:1,class:"size-4","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_4$i={class:"apb-body"},_hoisted_5$g={class:"apb-head"},_hoisted_6$d={class:"apb-title"},_hoisted_7$c={class:"apb-time"},_hoisted_8$9={class:"apb-wave-slot"},_hoisted_9$7={key:0,class:"apb-equalizer","aria-hidden":"true"},_hoisted_10$7=["aria-label"],BAR_COUNT=28,_sfc_main$r={__name:"AudioPlaybackBar",props:{variant:{type:String,default:"inline",validator:ee=>["inline","floating"].includes(ee)},waveHeight:{type:Number,default:26}},emits:["open"],setup(ee,{emit:te}){const ne=te,ae=ee,re=useAudioPlaybackStore(),oe=e$b.ref(null),ie=e$b.ref(null),le=e$b.ref(!1);let ce=null,de=null,ue=null;const be=e$b.computed(()=>{var $e;return(($e=re.meta)==null?void 0:$e.title)||"Áudio"}),fe=e$b.computed(()=>me(re.currentTime)),ge=e$b.computed(()=>me(re.duration));function me($e){if(!$e||Number.isNaN($e))return"0:00";const ye=Math.floor($e/60),Ee=Math.floor($e%60);return`${ye}:${String(Ee).padStart(2,"0")}`}function pe($e){return{animationDelay:`-${(1.2-$e%8*.1).toFixed(2)}s`}}function ke(){var ye;const $e=re.rate>=2?1:+(re.rate+.5).toFixed(1);re.setRate($e),(ye=ce==null?void 0:ce.setPlaybackRate)==null||ye.call(ce,$e)}function ve(){var $e,ye;detachSharedMedia(ce,de,re);try{($e=ce==null?void 0:ce.unAll)==null||$e.call(ce)}catch{}try{(ye=ce==null?void 0:ce.destroy)==null||ye.call(ce)}catch{}ce=null,de=null}async function _e(){if(ve(),le.value=!1,await e$b.nextTick(),!ie.value)return;const $e=re.activeElement();if(!$e)return;const ye=readWaveColors(oe.value);ce=w$5.create({container:ie.value,media:new Audio,waveColor:ye.wave,progressColor:ye.progress,cursorColor:ye.cursor,cursorWidth:10,height:ae.waveHeight,barWidth:2,barRadius:2,barHeight:.9,barGap:2,hideScrollbar:!0});const Ee=ce,Se=re.activePeaks(),Le=re.activeSrc();try{Se?await ce.load(Le,Se.peaks,Se.duration):await ce.load(Le)}catch(Ae){console.error("Falha ao desenhar a onda do mini player:",Ae)}ce===Ee&&(de=$e,attachSharedMedia(ce,de,{rate:re.rate}),le.value=!0)}return e$b.watch(()=>re.isFloating&&re.trackId,$e=>{if(!$e){ve(),le.value=!1;return}_e()},{immediate:!0}),e$b.watch(oe,$e=>{if(ue==null||ue.disconnect(),ue=null,!$e||typeof ResizeObserver>"u")return;let ye=$e.clientWidth;ue=new ResizeObserver(()=>{!ce||Math.abs($e.clientWidth-ye)<8||(ye=$e.clientWidth,_e())}),ue.observe($e)}),e$b.onBeforeUnmount(()=>{ue==null||ue.disconnect(),ue=null,ve()}),($e,ye)=>(e$b.openBlock(),e$b.createBlock(e$b.Transition,{name:ee.variant==="floating"?"apb-float":"apb"},{default:e$b.withCtx(()=>[e$b.unref(re).isFloating?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"rootEl",ref:oe,class:e$b.normalizeClass(["apb-root",`apb-${ee.variant}`])},[e$b.createElementVNode("button",{type:"button",class:"apb-play","aria-label":e$b.unref(re).isPlaying?"Pausar":"Tocar",onClick:ye[0]||(ye[0]=Ee=>e$b.unref(re).toggle())},[e$b.unref(re).isPlaying?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$j,[...ye[4]||(ye[4]=[e$b.createElementVNode("path",{d:"M8 5h3v14H8V5Zm5 0h3v14h-3V5Z"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$m,[...ye[3]||(ye[3]=[e$b.createElementVNode("path",{d:"M8.6 5.2A1 1 0 0 0 7 6v12a1 1 0 0 0 1.6.8l8-6a1 1 0 0 0 0-1.6l-8-6Z"},null,-1)])]))],8,_hoisted_1$o),e$b.createElementVNode("div",_hoisted_4$i,[e$b.createElementVNode("div",_hoisted_5$g,[e$b.createElementVNode("button",{type:"button",class:"apb-info",title:"Ir para a mensagem",onClick:ye[1]||(ye[1]=Ee=>ne("open",e$b.unref(re).meta))},[e$b.createElementVNode("span",_hoisted_6$d,e$b.toDisplayString(be.value),1)]),e$b.createElementVNode("span",_hoisted_7$c,e$b.toDisplayString(fe.value)+" / "+e$b.toDisplayString(ge.value),1)]),e$b.createElementVNode("div",_hoisted_8$9,[le.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$7,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(BAR_COUNT,Ee=>e$b.createElementVNode("span",{key:Ee,style:e$b.normalizeStyle(pe(Ee))},null,4)),64))])),e$b.withDirectives(e$b.createElementVNode("div",{ref_key:"waveEl",ref:ie,class:"apb-wave"},null,512),[[e$b.vShow,le.value]])])]),e$b.createElementVNode("button",{type:"button",class:"apb-rate","aria-label":`Velocidade ${e$b.unref(re).rate.toFixed(1)}x. Clique para mudar`,onClick:ke},e$b.toDisplayString(e$b.unref(re).rate.toFixed(1))+"x ",9,_hoisted_10$7),e$b.createElementVNode("button",{type:"button",class:"apb-close","aria-label":"Fechar",onClick:ye[2]||(ye[2]=Ee=>e$b.unref(re).clear())},[...ye[5]||(ye[5]=[e$b.createElementVNode("svg",{class:"size-4","aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e$b.createElementVNode("path",{"stroke-linecap":"round",d:"M6 6l12 12M18 6L6 18"})],-1)])])],2)):e$b.createCommentVNode("",!0)]),_:1},8,["name"]))}},AudioPlaybackBar=_export_sfc$1(_sfc_main$r,[["__scopeId","data-v-b40822ed"]]),_hoisted_1$n={class:"modal-head"},_hoisted_2$l={class:"modal_responsive"},_hoisted_3$i={class:"flex min-h-full items-center justify-center"},_hoisted_4$h={class:"modal-size w-full max-w-md"},_hoisted_5$f={class:"modal-background sidebar"},_hoisted_6$c={class:"modal-title items-center"},_hoisted_7$b={class:"flex items-center"},_hoisted_8$8={class:"pb-3"},_hoisted_9$6={class:"sidebar p-2 font-semibold lg:text-base"},_hoisted_10$6=["for"],_hoisted_11$6={class:"text-base"},_hoisted_12$5={class:"opacity-70"},_sfc_main$q={__name:"MessageListModal",setup(ee){const te=useMessageUiStore(),ne=e$b.computed(()=>te.list.message);return(ae,re)=>{var oe;return e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$n,[re[3]||(re[3]=e$b.createElementVNode("div",{class:"modal-overlay"},null,-1)),e$b.createElementVNode("div",_hoisted_2$l,[e$b.createElementVNode("div",_hoisted_3$i,[e$b.createElementVNode("div",_hoisted_4$h,[e$b.createElementVNode("div",_hoisted_5$f,[e$b.createElementVNode("div",_hoisted_6$c,[re[2]||(re[2]=e$b.createElementVNode("div",{class:"flex items-center"},[e$b.createElementVNode("h3",{class:"text-base lg:text-xl"},"Lista")],-1)),e$b.createElementVNode("div",_hoisted_7$b,[e$b.createElementVNode("button",{type:"button","aria-label":"Fechar",class:"inline-flex items-center rounded-lg bg-transparent p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900",onClick:re[0]||(re[0]=ie=>e$b.unref(te).closeList())},[...re[1]||(re[1]=[e$b.createElementVNode("svg",{class:"size-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])])])]),e$b.createElementVNode("div",_hoisted_8$8,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(((oe=ne.value)==null?void 0:oe.sections)||[],(ie,le)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:le},[e$b.createElementVNode("p",_hoisted_9$6,e$b.toDisplayString(ie.title),1),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ie.rows,ce=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ce.rowId,class:"hover:header flex items-center justify-between px-2 py-1"},[e$b.createElementVNode("label",{class:"mt-px w-full select-none",for:`${le}${ce.rowId}`},[e$b.createElementVNode("div",_hoisted_11$6,e$b.toDisplayString(ce.title),1),e$b.createElementVNode("p",_hoisted_12$5,e$b.toDisplayString(ce.description),1)],8,_hoisted_10$6)]))),128))]))),128))])])])])])])}}};var t={207:(ee,te,ne)=>{ee.exports=ne(452)},452:ee=>{var te=function(ne){var ae,re=Object.prototype,oe=re.hasOwnProperty,ie=typeof Symbol=="function"?Symbol:{},le=ie.iterator||"@@iterator",ce=ie.asyncIterator||"@@asyncIterator",de=ie.toStringTag||"@@toStringTag";function ue(Me,xe,Ce){return Object.defineProperty(Me,xe,{value:Ce,enumerable:!0,configurable:!0,writable:!0}),Me[xe]}try{ue({},"")}catch{ue=function(xe,Ce,Fe){return xe[Ce]=Fe}}function be(Me,xe,Ce,Fe){var Re=xe&&xe.prototype instanceof _e?xe:_e,qe=Object.create(Re.prototype),Ge=new Ne(Fe||[]);return qe._invoke=function(Ze,Xe,Ue){var at=ge;return function(Je,lt){if(at===pe)throw new Error("Generator is already running");if(at===ke){if(Je==="throw")throw lt;return Be()}for(Ue.method=Je,Ue.arg=lt;;){var it=Ue.delegate;if(it){var gt=Ie(it,Ue);if(gt){if(gt===ve)continue;return gt}}if(Ue.method==="next")Ue.sent=Ue._sent=Ue.arg;else if(Ue.method==="throw"){if(at===ge)throw at=ke,Ue.arg;Ue.dispatchException(Ue.arg)}else Ue.method==="return"&&Ue.abrupt("return",Ue.arg);at=pe;var Et=fe(Ze,Xe,Ue);if(Et.type==="normal"){if(at=Ue.done?ke:me,Et.arg===ve)continue;return{value:Et.arg,done:Ue.done}}Et.type==="throw"&&(at=ke,Ue.method="throw",Ue.arg=Et.arg)}}}(Me,Ce,Ge),qe}function fe(Me,xe,Ce){try{return{type:"normal",arg:Me.call(xe,Ce)}}catch(Fe){return{type:"throw",arg:Fe}}}ne.wrap=be;var ge="suspendedStart",me="suspendedYield",pe="executing",ke="completed",ve={};function _e(){}function $e(){}function ye(){}var Ee={};ue(Ee,le,function(){return this});var Se=Object.getPrototypeOf,Le=Se&&Se(Se(Pe([])));Le&&Le!==re&&oe.call(Le,le)&&(Ee=Le);var Ae=ye.prototype=_e.prototype=Object.create(Ee);function De(Me){["next","throw","return"].forEach(function(xe){ue(Me,xe,function(Ce){return this._invoke(xe,Ce)})})}function Oe(Me,xe){function Ce(Re,qe,Ge,Ze){var Xe=fe(Me[Re],Me,qe);if(Xe.type!=="throw"){var Ue=Xe.arg,at=Ue.value;return at&&typeof at=="object"&&oe.call(at,"__await")?xe.resolve(at.__await).then(function(Je){Ce("next",Je,Ge,Ze)},function(Je){Ce("throw",Je,Ge,Ze)}):xe.resolve(at).then(function(Je){Ue.value=Je,Ge(Ue)},function(Je){return Ce("throw",Je,Ge,Ze)})}Ze(Xe.arg)}var Fe;this._invoke=function(Re,qe){function Ge(){return new xe(function(Ze,Xe){Ce(Re,qe,Ze,Xe)})}return Fe=Fe?Fe.then(Ge,Ge):Ge()}}function Ie(Me,xe){var Ce=Me.iterator[xe.method];if(Ce===ae){if(xe.delegate=null,xe.method==="throw"){if(Me.iterator.return&&(xe.method="return",xe.arg=ae,Ie(Me,xe),xe.method==="throw"))return ve;xe.method="throw",xe.arg=new TypeError("The iterator does not provide a 'throw' method")}return ve}var Fe=fe(Ce,Me.iterator,xe.arg);if(Fe.type==="throw")return xe.method="throw",xe.arg=Fe.arg,xe.delegate=null,ve;var Re=Fe.arg;return Re?Re.done?(xe[Me.resultName]=Re.value,xe.next=Me.nextLoc,xe.method!=="return"&&(xe.method="next",xe.arg=ae),xe.delegate=null,ve):Re:(xe.method="throw",xe.arg=new TypeError("iterator result is not an object"),xe.delegate=null,ve)}function ze(Me){var xe={tryLoc:Me[0]};1 in Me&&(xe.catchLoc=Me[1]),2 in Me&&(xe.finallyLoc=Me[2],xe.afterLoc=Me[3]),this.tryEntries.push(xe)}function Ve(Me){var xe=Me.completion||{};xe.type="normal",delete xe.arg,Me.completion=xe}function Ne(Me){this.tryEntries=[{tryLoc:"root"}],Me.forEach(ze,this),this.reset(!0)}function Pe(Me){if(Me){var xe=Me[le];if(xe)return xe.call(Me);if(typeof Me.next=="function")return Me;if(!isNaN(Me.length)){var Ce=-1,Fe=function Re(){for(;++Ce<Me.length;)if(oe.call(Me,Ce))return Re.value=Me[Ce],Re.done=!1,Re;return Re.value=ae,Re.done=!0,Re};return Fe.next=Fe}}return{next:Be}}function Be(){return{value:ae,done:!0}}return $e.prototype=ye,ue(Ae,"constructor",ye),ue(ye,"constructor",$e),$e.displayName=ue(ye,de,"GeneratorFunction"),ne.isGeneratorFunction=function(Me){var xe=typeof Me=="function"&&Me.constructor;return!!xe&&(xe===$e||(xe.displayName||xe.name)==="GeneratorFunction")},ne.mark=function(Me){return Object.setPrototypeOf?Object.setPrototypeOf(Me,ye):(Me.__proto__=ye,ue(Me,de,"GeneratorFunction")),Me.prototype=Object.create(Ae),Me},ne.awrap=function(Me){return{__await:Me}},De(Oe.prototype),ue(Oe.prototype,ce,function(){return this}),ne.AsyncIterator=Oe,ne.async=function(Me,xe,Ce,Fe,Re){Re===void 0&&(Re=Promise);var qe=new Oe(be(Me,xe,Ce,Fe),Re);return ne.isGeneratorFunction(xe)?qe:qe.next().then(function(Ge){return Ge.done?Ge.value:qe.next()})},De(Ae),ue(Ae,de,"Generator"),ue(Ae,le,function(){return this}),ue(Ae,"toString",function(){return"[object Generator]"}),ne.keys=function(Me){var xe=[];for(var Ce in Me)xe.push(Ce);return xe.reverse(),function Fe(){for(;xe.length;){var Re=xe.pop();if(Re in Me)return Fe.value=Re,Fe.done=!1,Fe}return Fe.done=!0,Fe}},ne.values=Pe,Ne.prototype={constructor:Ne,reset:function(Me){if(this.prev=0,this.next=0,this.sent=this._sent=ae,this.done=!1,this.delegate=null,this.method="next",this.arg=ae,this.tryEntries.forEach(Ve),!Me)for(var xe in this)xe.charAt(0)==="t"&&oe.call(this,xe)&&!isNaN(+xe.slice(1))&&(this[xe]=ae)},stop:function(){this.done=!0;var Me=this.tryEntries[0].completion;if(Me.type==="throw")throw Me.arg;return this.rval},dispatchException:function(Me){if(this.done)throw Me;var xe=this;function Ce(Xe,Ue){return qe.type="throw",qe.arg=Me,xe.next=Xe,Ue&&(xe.method="next",xe.arg=ae),!!Ue}for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Re=this.tryEntries[Fe],qe=Re.completion;if(Re.tryLoc==="root")return Ce("end");if(Re.tryLoc<=this.prev){var Ge=oe.call(Re,"catchLoc"),Ze=oe.call(Re,"finallyLoc");if(Ge&&Ze){if(this.prev<Re.catchLoc)return Ce(Re.catchLoc,!0);if(this.prev<Re.finallyLoc)return Ce(Re.finallyLoc)}else if(Ge){if(this.prev<Re.catchLoc)return Ce(Re.catchLoc,!0)}else{if(!Ze)throw new Error("try statement without catch or finally");if(this.prev<Re.finallyLoc)return Ce(Re.finallyLoc)}}}},abrupt:function(Me,xe){for(var Ce=this.tryEntries.length-1;Ce>=0;--Ce){var Fe=this.tryEntries[Ce];if(Fe.tryLoc<=this.prev&&oe.call(Fe,"finallyLoc")&&this.prev<Fe.finallyLoc){var Re=Fe;break}}Re&&(Me==="break"||Me==="continue")&&Re.tryLoc<=xe&&xe<=Re.finallyLoc&&(Re=null);var qe=Re?Re.completion:{};return qe.type=Me,qe.arg=xe,Re?(this.method="next",this.next=Re.finallyLoc,ve):this.complete(qe)},complete:function(Me,xe){if(Me.type==="throw")throw Me.arg;return Me.type==="break"||Me.type==="continue"?this.next=Me.arg:Me.type==="return"?(this.rval=this.arg=Me.arg,this.method="return",this.next="end"):Me.type==="normal"&&xe&&(this.next=xe),ve},finish:function(Me){for(var xe=this.tryEntries.length-1;xe>=0;--xe){var Ce=this.tryEntries[xe];if(Ce.finallyLoc===Me)return this.complete(Ce.completion,Ce.afterLoc),Ve(Ce),ve}},catch:function(Me){for(var xe=this.tryEntries.length-1;xe>=0;--xe){var Ce=this.tryEntries[xe];if(Ce.tryLoc===Me){var Fe=Ce.completion;if(Fe.type==="throw"){var Re=Fe.arg;Ve(Ce)}return Re}}throw new Error("illegal catch attempt")},delegateYield:function(Me,xe,Ce){return this.delegate={iterator:Pe(Me),resultName:xe,nextLoc:Ce},this.method==="next"&&(this.arg=ae),ve}},ne}(ee.exports);try{regeneratorRuntime=te}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=te:Function("r","regeneratorRuntime = r")(te)}}},n={};function r(ee){var te=n[ee];if(te!==void 0)return te.exports;var ne=n[ee]={exports:{}};return t[ee](ne,ne.exports,r),ne.exports}r.n=ee=>{var te=ee&&ee.__esModule?()=>ee.default:()=>ee;return r.d(te,{a:te}),te},r.d=(ee,te)=>{for(var ne in te)r.o(te,ne)&&!r.o(ee,ne)&&Object.defineProperty(ee,ne,{enumerable:!0,get:te[ne]})},r.o=(ee,te)=>Object.prototype.hasOwnProperty.call(ee,te);var o={};function a(ee,te){(te==null||te>ee.length)&&(te=ee.length);for(var ne=0,ae=new Array(te);ne<te;ne++)ae[ne]=ee[ne];return ae}function i(ee,te){if(ee){if(typeof ee=="string")return a(ee,te);var ne=Object.prototype.toString.call(ee).slice(8,-1);return ne==="Object"&&ee.constructor&&(ne=ee.constructor.name),ne==="Map"||ne==="Set"?Array.from(ee):ne==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne)?a(ee,te):void 0}}function c(ee){return function(te){if(Array.isArray(te))return a(te)}(ee)||function(te){if(typeof Symbol<"u"&&te[Symbol.iterator]!=null||te["@@iterator"]!=null)return Array.from(te)}(ee)||i(ee)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
282
282
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function l(ee,te,ne){return te in ee?Object.defineProperty(ee,te,{value:ne,enumerable:!0,configurable:!0,writable:!0}):ee[te]=ne,ee}r.d(o,{A:()=>L$1});const u$1=(f$1={Fragment:()=>e__namespace.Fragment,computed:()=>e__namespace.computed,createTextVNode:()=>e__namespace.createTextVNode,createVNode:()=>e__namespace.createVNode,defineComponent:()=>e__namespace.defineComponent,nextTick:()=>e__namespace.nextTick,reactive:()=>e__namespace.reactive,ref:()=>e__namespace.ref,watch:()=>e__namespace.watch,watchEffect:()=>e__namespace.watchEffect},p={},r.d(p,f$1),p),d=(0,u$1.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var ee=this.data,te=this.onClick;return(0,u$1.createVNode)("span",{class:"vjs-tree-brackets",onClick:te},[ee])}}),s$1=(0,u$1.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(ee,te){var ne=te.emit;return{uiType:(0,u$1.computed)(function(){return ee.isMultiple?"checkbox":"radio"}),model:(0,u$1.computed)({get:function(){return ee.checked},set:function(ae){return ne("update:modelValue",ae)}})}},render:function(){var ee=this.uiType,te=this.model,ne=this.$emit;return(0,u$1.createVNode)("label",{class:["vjs-check-controller",te?"is-checked":""],onClick:function(ae){return ae.stopPropagation()}},[(0,u$1.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(ee)},null),(0,u$1.createVNode)("input",{checked:te,class:"vjs-check-controller-original is-".concat(ee),type:ee,onChange:function(){return ne("change",te)}},null)])}}),h=(0,u$1.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var ee=this.nodeType,te=this.onClick,ne=ee==="objectStart"||ee==="arrayStart";return ne||ee==="objectCollapsed"||ee==="arrayCollapsed"?(0,u$1.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(ne?"open":"close"),onClick:te},[(0,u$1.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,u$1.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var f$1,p;function v(ee){return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},v(ee)}function y(ee){return Object.prototype.toString.call(ee).slice(8,-1).toLowerCase()}function g(ee){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"root",ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,ae=(arguments.length>3?arguments[3]:void 0)||{},re=ae.key,oe=ae.index,ie=ae.type,le=ie===void 0?"content":ie,ce=ae.showComma,de=ce!==void 0&&ce,ue=ae.length,be=ue===void 0?1:ue,fe=y(ee);if(fe==="array"){var ge=m(ee.map(function(ke,ve,_e){return g(ke,"".concat(te,"[").concat(ve,"]"),ne+1,{index:ve,showComma:ve!==_e.length-1,length:be,type:le})}));return[g("[",te,ne,{showComma:!1,key:re,length:ee.length,type:"arrayStart"})[0]].concat(ge,g("]",te,ne,{showComma:de,length:ee.length,type:"arrayEnd"})[0])}if(fe==="object"){var me=Object.keys(ee),pe=m(me.map(function(ke,ve,_e){return g(ee[ke],/^[a-zA-Z_]\w*$/.test(ke)?"".concat(te,".").concat(ke):"".concat(te,'["').concat(ke,'"]'),ne+1,{key:ke,showComma:ve!==_e.length-1,length:be,type:le})}));return[g("{",te,ne,{showComma:!1,key:re,index:oe,length:me.length,type:"objectStart"})[0]].concat(pe,g("}",te,ne,{showComma:de,length:me.length,type:"objectEnd"})[0])}return[{content:ee,level:ne,key:re,index:oe,path:te,showComma:de,length:be,type:le}]}function m(ee){if(typeof Array.prototype.flat=="function")return ee.flat();for(var te=c(ee),ne=[];te.length;){var ae=te.shift();Array.isArray(ae)?te.unshift.apply(te,c(ae)):ne.push(ae)}return ne}function b(ee){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(ee==null)return ee;if(ee instanceof Date)return new Date(ee);if(ee instanceof RegExp)return new RegExp(ee);if(v(ee)!=="object")return ee;if(te.get(ee))return te.get(ee);if(Array.isArray(ee)){var ne=ee.map(function(oe){return b(oe,te)});return te.set(ee,ne),ne}var ae={};for(var re in ee)ae[re]=b(ee[re],te);return te.set(ee,ae),ae}function w(ee,te,ne,ae,re,oe,ie){try{var le=ee[oe](ie),ce=le.value}catch(de){return void ne(de)}le.done?te(ce):Promise.resolve(ce).then(ae,re)}var N=r(207),k=r.n(N);function C(ee,te){var ne=Object.keys(ee);if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(ee);te&&(ae=ae.filter(function(re){return Object.getOwnPropertyDescriptor(ee,re).enumerable})),ne.push.apply(ne,ae)}return ne}function x(ee){for(var te=1;te<arguments.length;te++){var ne=arguments[te]!=null?arguments[te]:{};te%2?C(Object(ne),!0).forEach(function(ae){l(ee,ae,ne[ae])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ee,Object.getOwnPropertyDescriptors(ne)):C(Object(ne)).forEach(function(ae){Object.defineProperty(ee,ae,Object.getOwnPropertyDescriptor(ne,ae))})}return ee}var j={data:{type:[String,Number,Boolean,Array,Object],default:null},rootPath:{type:String,default:"root"},indent:{type:Number,default:2},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},renderNodeKey:Function,renderNodeValue:Function,renderNodeActions:{type:[Boolean,Function],default:void 0},selectableType:String,showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},showLineNumber:{type:Boolean,default:!1},selectOnClickNode:{type:Boolean,default:!0},nodeSelectable:{type:Function,default:function(){return!0}},highlightSelectedNode:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},theme:{type:String,default:"light"},showKeyValueSpace:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},editableTrigger:{type:String,default:"click"},onNodeClick:{type:Function},onNodeMouseover:{type:Function},onBracketsClick:{type:Function},onIconClick:{type:Function},onValueChange:{type:Function}};const S=(0,u$1.defineComponent)({name:"TreeNode",props:x(x({},j),{},{node:{type:Object,required:!0},collapsed:Boolean,checked:Boolean,style:Object,onSelectedChange:{type:Function}}),emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","valueChange"],setup:function(ee,te){var ne=te.emit,ae=(0,u$1.computed)(function(){return y(ee.node.content)}),re=(0,u$1.computed)(function(){return"vjs-value vjs-value-".concat(ae.value)}),oe=(0,u$1.computed)(function(){return ee.showDoubleQuotes?'"'.concat(ee.node.key,'"'):ee.node.key}),ie=(0,u$1.computed)(function(){return ee.selectableType==="multiple"}),le=(0,u$1.computed)(function(){return ee.selectableType==="single"}),ce=(0,u$1.computed)(function(){return ee.nodeSelectable(ee.node)&&(ie.value||le.value)}),de=(0,u$1.reactive)({editing:!1}),ue=function(Se){var Le,Ae,De=(Ae=(Le=Se.target)===null||Le===void 0?void 0:Le.value)==="null"?null:Ae==="undefined"?void 0:Ae==="true"||Ae!=="false"&&(Ae[0]+Ae[Ae.length-1]==='""'||Ae[0]+Ae[Ae.length-1]==="''"?Ae.slice(1,-1):typeof Number(Ae)=="number"&&!isNaN(Number(Ae))||Ae==="NaN"?Number(Ae):Ae);ne("valueChange",De,ee.node.path)},be=(0,u$1.computed)(function(){var Se,Le=(Se=ee.node)===null||Se===void 0?void 0:Se.content;return Le===null?Le="null":Le===void 0&&(Le="undefined"),ae.value==="string"?'"'.concat(Le,'"'):Le+""}),fe=function(){var Se=ee.renderNodeValue;return Se?Se({node:ee.node,defaultValue:be.value}):be.value},ge=function(){ne("bracketsClick",!ee.collapsed,ee.node)},me=function(){ne("iconClick",!ee.collapsed,ee.node)},pe=function(){ne("selectedChange",ee.node)},ke=function(){ne("nodeClick",ee.node),ce.value&&ee.selectOnClickNode&&ne("selectedChange",ee.node)},ve=function(){ne("nodeMouseover",ee.node)},_e=function(Se){if(ee.editable&&!de.editing){de.editing=!0;var Le=function Ae(De){var Oe;De.target!==Se.target&&((Oe=De.target)===null||Oe===void 0?void 0:Oe.parentElement)!==Se.target&&(de.editing=!1,document.removeEventListener("click",Ae))};document.removeEventListener("click",Le),document.addEventListener("click",Le)}},$e=function(){var Se=(0,u$1.ref)(!1),Le=function(){var Ae,De=(Ae=k().mark(function Oe(Ie){return k().wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:return ze.prev=0,ze.next=3,navigator.clipboard.writeText(Ie);case 3:Se.value=!0,setTimeout(function(){Se.value=!1},300),ze.next=10;break;case 7:ze.prev=7,ze.t0=ze.catch(0),console.error("[vue-json-pretty] Copy failed: ",ze.t0);case 10:case"end":return ze.stop()}},Oe,null,[[0,7]])}),function(){var Oe=this,Ie=arguments;return new Promise(function(ze,Ve){var Ne=Ae.apply(Oe,Ie);function Pe(Me){w(Ne,ze,Ve,Pe,Be,"next",Me)}function Be(Me){w(Ne,ze,Ve,Pe,Be,"throw",Me)}Pe(void 0)})});return function(Oe){return De.apply(this,arguments)}}();return{copy:Le}}().copy,ye=function(){var Se=ee.node,Le=Se.key,Ae=Se.path,De=ee.rootPath,Oe=new Function("data","return data".concat(Ae.slice(De.length)))(ee.data),Ie=JSON.stringify(Le?l({},Le,Oe):Oe,null,2);$e(Ie)},Ee=function(){var Se=ee.renderNodeActions;if(!Se)return null;var Le={copy:ye};return typeof Se=="function"?Se({node:ee.node,defaultActions:Le}):(0,u$1.createVNode)("span",{onClick:ye,class:"vjs-tree-node-actions-item"},[(0,u$1.createTextVNode)("copy")])};return function(){var Se,Le=ee.node;return(0,u$1.createVNode)("div",{class:{"vjs-tree-node":!0,"has-selector":ee.showSelectController,"has-carets":ee.showIcon,"is-highlight":ee.highlightSelectedNode&&ee.checked,dark:ee.theme==="dark"},onClick:ke,onMouseover:ve,style:ee.style},[ee.showLineNumber&&(0,u$1.createVNode)("span",{class:"vjs-node-index"},[Le.id+1]),ee.showSelectController&&ce.value&&Le.type!=="objectEnd"&&Le.type!=="arrayEnd"&&(0,u$1.createVNode)(s$1,{isMultiple:ie.value,checked:ee.checked,onChange:pe},null),(0,u$1.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(Le.level)).map(function(Ae,De){return(0,u$1.createVNode)("div",{key:De,class:{"vjs-indent-unit":!0,"has-line":ee.showLine}},[Array.from(Array(ee.indent)).map(function(){return(0,u$1.createVNode)(u$1.Fragment,null,[(0,u$1.createTextVNode)(" ")])})])}),ee.showIcon&&(0,u$1.createVNode)(h,{nodeType:Le.type,onClick:me},null)]),Le.key&&(0,u$1.createVNode)("span",{class:"vjs-key"},[(Se=ee.renderNodeKey,Se?Se({node:ee.node,defaultKey:oe.value||""}):oe.value),(0,u$1.createVNode)("span",{class:"vjs-colon"},[":".concat(ee.showKeyValueSpace?" ":"")])]),(0,u$1.createVNode)("span",null,[Le.type!=="content"&&Le.content?(0,u$1.createVNode)(d,{data:Le.content.toString(),onClick:ge},null):(0,u$1.createVNode)("span",{class:re.value,onClick:!ee.editable||ee.editableTrigger&&ee.editableTrigger!=="click"?void 0:_e,onDblclick:ee.editable&&ee.editableTrigger==="dblclick"?_e:void 0},[ee.editable&&de.editing?(0,u$1.createVNode)("input",{value:be.value,onChange:ue,style:{padding:"3px 8px",border:"1px solid #eee",boxShadow:"none",boxSizing:"border-box",borderRadius:5,fontFamily:"inherit"}},null):fe()]),Le.showComma&&(0,u$1.createVNode)("span",null,[","]),ee.showLength&&ee.collapsed&&(0,u$1.createVNode)("span",{class:"vjs-comment"},[(0,u$1.createTextVNode)(" // "),Le.length,(0,u$1.createTextVNode)(" items ")])]),ee.renderNodeActions&&(0,u$1.createVNode)("span",{class:"vjs-tree-node-actions"},[Ee()])])}}});function O(ee,te){var ne=Object.keys(ee);if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(ee);te&&(ae=ae.filter(function(re){return Object.getOwnPropertyDescriptor(ee,re).enumerable})),ne.push.apply(ne,ae)}return ne}function V(ee){for(var te=1;te<arguments.length;te++){var ne=arguments[te]!=null?arguments[te]:{};te%2?O(Object(ne),!0).forEach(function(ae){l(ee,ae,ne[ae])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ee,Object.getOwnPropertyDescriptors(ne)):O(Object(ne)).forEach(function(ae){Object.defineProperty(ee,ae,Object.getOwnPropertyDescriptor(ne,ae))})}return ee}const L$1=(0,u$1.defineComponent)({name:"Tree",props:V(V({},j),{},{collapsedNodeLength:{type:Number,default:1/0},deep:{type:Number,default:1/0},pathCollapsible:{type:Function,default:function(){return!1}},virtual:{type:Boolean,default:!1},height:{type:Number,default:400},itemHeight:{type:Number,default:20},dynamicHeight:{type:Boolean,default:!0},selectedValue:{type:[String,Array],default:function(){return""}},collapsedOnClickBrackets:{type:Boolean,default:!0},style:Object,onSelectedChange:{type:Function},theme:{type:String,default:"light"}}),slots:["renderNodeKey","renderNodeValue","renderNodeActions"],emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","update:selectedValue","update:data"],setup:function(ee,te){var ne=te.emit,ae=te.slots,re=(0,u$1.ref)(),oe=(0,u$1.computed)(function(){return g(ee.data,ee.rootPath)}),ie=function(Ve,Ne){return oe.value.reduce(function(Pe,Be){var Me,xe=Be.level>=Ve||Be.length>=Ne,Ce=(Me=ee.pathCollapsible)===null||Me===void 0?void 0:Me.call(ee,Be);return Be.type!=="objectStart"&&Be.type!=="arrayStart"||!xe&&!Ce?Pe:V(V({},Pe),{},l({},Be.path,1))},{})},le=(0,u$1.reactive)({translateY:0,visibleData:null,hiddenPaths:ie(ee.deep,ee.collapsedNodeLength),startIndex:0,endIndex:0}),ce=[],de=[],ue=0,be={},fe=function(Ve){ce=Array(Ve).fill(0).map(function(){return ee.itemHeight||20}),(de=new Array(Ve+1))[0]=0;for(var Ne=0;Ne<Ve;Ne++)de[Ne+1]=de[Ne]+ce[Ne];ue=de[Ve]||0},ge=function(Ve){var Ne=ce.length;Ve<0&&(Ve=0),Ve>Ne&&(Ve=Ne);for(var Pe=Ve;Pe<Ne;Pe++)de[Pe+1]=de[Pe]+ce[Pe];ue=de[Ne]||0},me=function(Ve,Ne){for(var Pe=0,Be=Ve.length-1;Pe<Be;){var Me=Pe+Be>>>1;Ve[Me]<Ne?Pe=Me+1:Be=Me}return Pe},pe=(0,u$1.computed)(function(){for(var Ve=null,Ne=[],Pe=oe.value.length,Be=0;Be<Pe;Be++){var Me=V(V({},oe.value[Be]),{},{id:Be}),xe=le.hiddenPaths[Me.path];if(Ve&&Ve.path===Me.path){var Ce=Ve.type==="objectStart",Fe=V(V(V({},Me),Ve),{},{showComma:Me.showComma,content:Ce?"{...}":"[...]",type:Ce?"objectCollapsed":"arrayCollapsed"});Ve=null,Ne.push(Fe)}else{if(xe&&!Ve){Ve=Me;continue}if(Ve)continue;Ne.push(Me)}}return Ne}),ke=(0,u$1.computed)(function(){var Ve=ee.selectedValue;return Ve&&ee.selectableType==="multiple"&&Array.isArray(Ve)?Ve:[Ve]}),ve=(0,u$1.computed)(function(){return!ee.selectableType||ee.selectOnClickNode||ee.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."}),_e=(0,u$1.computed)(function(){return ee.dynamicHeight?ue||0:pe.value.length*ee.itemHeight}),$e=function Ve(){var Ne=pe.value;if(Ne)if(ee.virtual){var Pe,Be=((Pe=re.value)===null||Pe===void 0?void 0:Pe.scrollTop)||0;if(ee.dynamicHeight){ce.length!==Ne.length&&fe(Ne.length);var Me=function(Xe){var Ue=me(de,Xe+1e-4);return Math.max(0,Math.min(Ue-1,ce.length-1))}(Be),xe=function(Xe,Ue){var at=me(de,Xe+Ue);return Math.max(0,Math.min(at+1,ce.length))}(Be,ee.height),Ce=Math.max(0,Me-5),Fe=Math.min(Ne.length,xe+5);le.startIndex=Ce,le.endIndex=Fe,le.translateY=de[Ce]||0,le.visibleData=Ne.slice(Ce,Fe),(0,u$1.nextTick)().then(function(){for(var Xe=!1,Ue=le.startIndex;Ue<le.endIndex;Ue++){var at=be[Ue];if(at){var Je=at.offsetHeight;Je&&ce[Ue]!==Je&&(ce[Ue]=Je,de[Ue+1]=de[Ue]+ce[Ue],ge(Ue+1),Xe=!0)}}Xe&&Ve()})}else{var Re=ee.height/ee.itemHeight,qe=Math.floor(Be/ee.itemHeight),Ge=qe<0?0:qe+Re>Ne.length?Ne.length-Re:qe;Ge<0&&(Ge=0);var Ze=Ge+Re;le.translateY=Ge*ee.itemHeight,le.startIndex=Ge,le.endIndex=Ze,le.visibleData=Ne.slice(Ge,Ze)}}else le.translateY=0,le.startIndex=0,le.endIndex=Ne.length,le.visibleData=Ne},ye=null,Ee=function(){ye&&cancelAnimationFrame(ye),ye=requestAnimationFrame(function(){$e()})},Se=function(Ve){var Ne,Pe,Be=Ve.path,Me=ee.selectableType;if(Me==="multiple"){var xe=ke.value.findIndex(function(qe){return qe===Be}),Ce=c(ke.value);xe!==-1?Ce.splice(xe,1):Ce.push(Be),ne("update:selectedValue",Ce),ne("selectedChange",Ce,c(ke.value))}else if(Me==="single"&&ke.value[0]!==Be){var Fe=(Ne=ke.value,Pe=1,function(qe){if(Array.isArray(qe))return qe}(Ne)||function(qe,Ge){var Ze=qe==null?null:typeof Symbol<"u"&&qe[Symbol.iterator]||qe["@@iterator"];if(Ze!=null){var Xe,Ue,at=[],Je=!0,lt=!1;try{for(Ze=Ze.call(qe);!(Je=(Xe=Ze.next()).done)&&(at.push(Xe.value),!Ge||at.length!==Ge);Je=!0);}catch(it){lt=!0,Ue=it}finally{try{Je||Ze.return==null||Ze.return()}finally{if(lt)throw Ue}}return at}}(Ne,Pe)||i(Ne,Pe)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
283
283
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())[0],Re=Be;ne("update:selectedValue",Re),ne("selectedChange",Re,Fe)}},Le=function(Ve){ne("nodeClick",Ve)},Ae=function(Ve){ne("nodeMouseover",Ve)},De=function(Ve,Ne){if(Ve)le.hiddenPaths=V(V({},le.hiddenPaths),{},l({},Ne,1));else{var Pe=V({},le.hiddenPaths);delete Pe[Ne],le.hiddenPaths=Pe}},Oe=function(Ve,Ne){ee.collapsedOnClickBrackets&&De(Ve,Ne.path),ne("bracketsClick",Ve,Ne)},Ie=function(Ve,Ne){De(Ve,Ne.path),ne("iconClick",Ve,Ne)},ze=function(Ve,Ne){var Pe=b(ee.data),Be=ee.rootPath;new Function("data","val","data".concat(Ne.slice(Be.length),"=val"))(Pe,Ve),ne("update:data",Pe)};return(0,u$1.watchEffect)(function(){ve.value&&function(Ve){throw new Error("[VueJSONPretty] ".concat(Ve))}(ve.value)}),(0,u$1.watchEffect)(function(){pe.value&&(ee.virtual&&ee.dynamicHeight&&ce.length!==pe.value.length&&fe(pe.value.length),$e())}),(0,u$1.watch)(function(){return[ee.dynamicHeight,ee.itemHeight,oe.value.length]},function(){ee.virtual&&ee.dynamicHeight&&(fe(pe.value.length),(0,u$1.nextTick)($e))}),(0,u$1.watch)(function(){return ee.deep},function(Ve){Ve&&(le.hiddenPaths=ie(Ve,ee.collapsedNodeLength))}),(0,u$1.watch)(function(){return ee.collapsedNodeLength},function(Ve){Ve&&(le.hiddenPaths=ie(ee.deep,Ve))}),function(){var Ve,Ne,Pe,Be,Me,xe=(Ve=ee.renderNodeKey)!==null&&Ve!==void 0?Ve:ae.renderNodeKey,Ce=(Ne=ee.renderNodeValue)!==null&&Ne!==void 0?Ne:ae.renderNodeValue,Fe=(Pe=(Be=ee.renderNodeActions)!==null&&Be!==void 0?Be:ae.renderNodeActions)!==null&&Pe!==void 0&&Pe,Re=(Me=le.visibleData)===null||Me===void 0?void 0:Me.map(function(qe,Ge){var Ze=le.startIndex+Ge;return(0,u$1.createVNode)("div",{key:qe.id,ref:function(Xe){return function(Ue,at){at?be[Ue]=at:delete be[Ue]}(Ze,Xe||null)}},[(0,u$1.createVNode)(S,{data:ee.data,rootPath:ee.rootPath,indent:ee.indent,node:qe,collapsed:!!le.hiddenPaths[qe.path],theme:ee.theme,showDoubleQuotes:ee.showDoubleQuotes,showLength:ee.showLength,checked:ke.value.includes(qe.path),selectableType:ee.selectableType,showLine:ee.showLine,showLineNumber:ee.showLineNumber,showSelectController:ee.showSelectController,selectOnClickNode:ee.selectOnClickNode,nodeSelectable:ee.nodeSelectable,highlightSelectedNode:ee.highlightSelectedNode,editable:ee.editable,editableTrigger:ee.editableTrigger,showIcon:ee.showIcon,showKeyValueSpace:ee.showKeyValueSpace,renderNodeKey:xe,renderNodeValue:Ce,renderNodeActions:Fe,onNodeClick:Le,onNodeMouseover:Ae,onBracketsClick:Oe,onIconClick:Ie,onSelectedChange:Se,onValueChange:ze,class:ee.dynamicHeight?"dynamic-height":void 0,style:ee.dynamicHeight?{}:ee.itemHeight&&ee.itemHeight!==20?{lineHeight:"".concat(ee.itemHeight,"px")}:{}},null)])});return(0,u$1.createVNode)("div",{ref:re,class:{"vjs-tree":!0,"is-virtual":ee.virtual,dark:ee.theme==="dark"},onScroll:ee.virtual?Ee:void 0,style:ee.showLineNumber?V({paddingLeft:"".concat(12*Number(oe.value.length.toString().length),"px")},ee.style):ee.style},[ee.virtual?(0,u$1.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(ee.height,"px")}},[(0,u$1.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(_e.value,"px")}},[(0,u$1.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(le.translateY,"px)")}},[Re])])]):Re])}}});var P=o.A;const _hoisted_1$m={class:"space-y-2"},_hoisted_2$k={class:"w-full overflow-auto p-2 pb-3"},_hoisted_3$h={class:"info_form"},_hoisted_4$g={key:0,class:"p-2"},_hoisted_5$e={key:0,class:"flex items-center"},_hoisted_6$b={key:1,class:"flex items-center"},_hoisted_7$a={key:2,class:"flex items-center"},_hoisted_8$7={key:1,class:"border-t border-gray-700 dark:border-gray-300"},_hoisted_9$5={class:"p-2 px-4 opacity-80"},_hoisted_10$5={key:0},_hoisted_11$5={key:1},_hoisted_12$4={key:0,class:"info_form"},_hoisted_13$3={class:"flex max-h-[200px] flex-wrap items-center gap-2 overflow-auto p-2"},_hoisted_14$3={key:1,class:"info_form"},_hoisted_15$2={class:"flex items-center p-2"},_hoisted_16$2={key:0,class:"overflow-x-auto"},_hoisted_17$1={key:2,class:"info_form"},_hoisted_18$1={class:"p-2"},_hoisted_19$1={class:"flex items-center pl-1"},_hoisted_20$1={class:"mt-1 flex items-center pl-1"},_hoisted_21$1={key:3,class:"info_form"},_hoisted_22={class:"flex items-center p-2"},_sfc_main$p={__name:"MessageInfoPanel",props:{message:{type:Object,required:!0},now:{type:Date,default:null},brandBackground:{type:String,default:"zap"}},setup(ee){const te=ee,ne=useMessageUiStore(),ae=e$b.computed(()=>!ne.themeMode),re=e$b.computed(()=>te.now||new Date);function oe(ce){const de=new Date(Date.parse(ce)),ue=re.value;if(isSameWeek(de,ue)){const be=new Date(ue);return be.setDate(be.getDate()-1),isSameDay(de,ue)?"Hoje":isSameDay(de,be)?"Ontem":format(de,"iiii",{locale:ptBR})}return format(de,"dd/MM/yyyy",{locale:ptBR})}function ie(ce){try{return JSON.parse(String(ce).replace(/'/g,'"'))}catch{return!1}}const le=e$b.computed(()=>{var ce;return(ce=te.message)!=null&&ce.fail_reason?ie(te.message.fail_reason):!1});return(ce,de)=>{var ue,be;return e$b.openBlock(),e$b.createElementBlock("main",_hoisted_1$m,[e$b.createElementVNode("section",{class:e$b.normalizeClass(["chat-background",`banner-${ee.brandBackground}`])},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["flex items-center justify-center",`bg-${ee.brandBackground}`])},null,2),e$b.createElementVNode("div",_hoisted_2$k,[e$b.createVNode(_sfc_main$u,{"is-info":!0,message:ee.message},null,8,["message"])])],2),e$b.createElementVNode("section",_hoisted_3$h,[e$b.createElementVNode("section",null,[ee.message.from_me?(e$b.openBlock(),e$b.createElementBlock("header",_hoisted_4$g,[ee.message.stage==="processing"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5$e,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,class:"mr-2 size-4"},null,8,["stage"]),de[0]||(de[0]=e$b.createTextVNode(" Processando ",-1))])):ee.message.stage==="received"||ee.message.stage==="sent"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_6$b,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,class:"mr-2"},null,8,["stage"]),de[1]||(de[1]=e$b.createTextVNode(" Recebida ",-1))])):ee.message.stage==="failed"?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$a,[e$b.createVNode(MessageStageIcon,{stage:ee.message.stage,"failed-size":14,class:"mr-2 size-4"},null,8,["stage"]),de[2]||(de[2]=e$b.createTextVNode(" Falhou ",-1))])):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),ee.message.from_me?(e$b.openBlock(),e$b.createElementBlock("hr",_hoisted_8$7)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_9$5,[ee.message.created_at?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10$5," Criada às "+e$b.toDisplayString(ee.message.created_at.split("T")[1].slice(0,5))+" - "+e$b.toDisplayString(oe(ee.message.created_at)),1)):e$b.createCommentVNode("",!0),ee.message.sent_at?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_11$5," Enviada às "+e$b.toDisplayString(ee.message.sent_at.split("T")[1].slice(0,5))+" - "+e$b.toDisplayString(oe(ee.message.sent_at)),1)):e$b.createCommentVNode("",!0)])])]),(be=(ue=ee.message)==null?void 0:ue.content)!=null&&be.history?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_12$4,[de[3]||(de[3]=e$b.createElementVNode("div",{class:"flex items-center p-2"},[e$b.createElementVNode("svg",{class:"mr-2 size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 2a2 2 0 0 0-2 2v15a3 3 0 0 0 3 3h12a1 1 0 1 0 0-2h-2v-2h2a1 1 0 0 0 1-1V4a2 2 0 0 0-2-2h-8v16h5v2H7a1 1 0 1 1 0-2h1V2H6Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Histórico de mensagem ")],-1)),de[4]||(de[4]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("div",_hoisted_13$3,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ee.message.content.history,(fe,ge)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:ge,class:"message-owner rounded-lg p-2 py-1"},e$b.toDisplayString(fe),1))),128))])])):e$b.createCommentVNode("",!0),ee.message.fail_reason?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_14$3,[de[5]||(de[5]=e$b.createElementVNode("div",{class:"flex items-center p-2"},[e$b.createElementVNode("svg",{class:"mr-2 size-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm11-4a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0V8Zm-1 7a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H12Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Motivo de falha ")],-1)),de[6]||(de[6]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("div",_hoisted_15$2,[le.value?(e$b.openBlock(),e$b.createBlock(e$b.unref(P),{key:1,"collapsed-on-click-brackets":!1,theme:ae.value?"light":"dark",data:le.value},null,8,["theme","data"])):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$2,e$b.toDisplayString(ee.message.fail_reason),1))])])):e$b.createCommentVNode("",!0),ee.message.instance?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_17$1,[de[9]||(de[9]=e$b.createElementVNode("div",{class:"flex items-center p-2"},[e$b.createElementVNode("svg",{class:"mr-2 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512"},[e$b.createElementVNode("path",{d:"M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z",fill:"currentColor"})]),e$b.createTextVNode(" Instância ")],-1)),de[10]||(de[10]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("main",_hoisted_18$1,[e$b.createElementVNode("div",_hoisted_19$1,[de[7]||(de[7]=e$b.createElementVNode("svg",{class:"mr-2 size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 20a8 8 0 0 1-5-1.8v-.6c0-1.8 1.5-3.3 3.3-3.3h3.4c1.8 0 3.3 1.5 3.3 3.3v.6a8 8 0 0 1-5 1.8ZM2 12a10 10 0 1 1 10 10A10 10 0 0 1 2 12Zm10-5a3.3 3.3 0 0 0-3.3 3.3c0 1.7 1.5 3.2 3.3 3.2 1.8 0 3.3-1.5 3.3-3.3C15.3 8.6 13.8 7 12 7Z","clip-rule":"evenodd"})],-1)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.message.instance.name),1)]),e$b.createElementVNode("div",_hoisted_20$1,[de[8]||(de[8]=e$b.createElementVNode("svg",{class:"mr-2 size-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{d:"M8 4a2.6 2.6 0 0 0-2 .9 6.2 6.2 0 0 0-1.8 6 12 12 0 0 0 3.4 5.5 12 12 0 0 0 5.6 3.4 6.2 6.2 0 0 0 6.6-2.7 2.6 2.6 0 0 0-.7-3L18 12.9a2.7 2.7 0 0 0-3.8 0l-.6.6a.8.8 0 0 1-1.1 0l-1.9-1.8a.8.8 0 0 1 0-1.2l.6-.6a2.7 2.7 0 0 0 0-3.8L10 4.9A2.6 2.6 0 0 0 8 4Z"})],-1)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.message.instance.telephone),1)])])])):e$b.createCommentVNode("",!0),ee.message.sent_by?(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_21$1,[de[11]||(de[11]=e$b.createElementVNode("div",{class:"flex items-center p-2 pl-3"},[e$b.createElementVNode("svg",{class:"mr-2 size-4 rotate-45","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M12 2c.4 0 .8.3 1 .6l7 18a1 1 0 0 1-1.4 1.3L13 19.5V13a1 1 0 1 0-2 0v6.5L5.4 22A1 1 0 0 1 4 20.6l7-18a1 1 0 0 1 1-.6Z","clip-rule":"evenodd"})]),e$b.createTextVNode(" Remetente ")],-1)),de[12]||(de[12]=e$b.createElementVNode("hr",{class:"border-t border-gray-700 dark:border-gray-300"},null,-1)),e$b.createElementVNode("div",_hoisted_22,[e$b.createVNode(Avatar,{class:"mr-4 size-10",size:"fill",photo:ee.message.sent_by.photo,name:ee.message.sent_by.name},null,8,["photo","name"]),e$b.createTextVNode(e$b.toDisplayString(ee.message.sent_by.name),1)])])):e$b.createCommentVNode("",!0)])}}},_hoisted_1$l={class:"h-full max-h-[500px] overflow-auto"},_hoisted_2$j={style:{"border-bottom-left-radius":"0px","border-bottom-right-radius":"0px"},class:"chat-background banner-zap"},_sfc_main$o=Object.assign({inheritAttrs:!1},{__name:"MessageQuickPreview",props:{message:{type:Array,default:()=>[]}},setup(ee){const te=ee,ne=useMessageUiStore();function ae(oe){var ue;const ie=ne.loggedAttendant,le={name:(ie==null?void 0:ie.name)||"Atendente",photo:(ie==null?void 0:ie.photo)||null},ce=new Date().toISOString(),de=(ue=oe.file_type)!=null&&ue.includes("/")?oe.file_type.split("/")[1]:oe.file_type;return{id:crypto.randomUUID(),type:oe.type||"text",stage:"sent",sent_by:{id:ie==null?void 0:ie.id,...le},content:{text:oe.message||"",is_ad:!1,sender:le,ad_info:null,url:oe.url||null,type:de||oe.type||null,title:oe.title||null,caption:oe.caption||null},whatsapp_id:null,status:!0,from_me:!0,created_at:ce,updated_at:ce,sent_at:ce,quoted:null}}const re=e$b.computed(()=>te.message.map(ae));return(oe,ie)=>(e$b.openBlock(),e$b.createElementBlock("main",_hoisted_1$l,[e$b.createElementVNode("section",_hoisted_2$j,[ie[0]||(ie[0]=e$b.createElementVNode("div",{class:"bg-zap flex items-center justify-center"},null,-1)),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(re.value,(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",{key:le.id,class:"pb-2"},[e$b.createVNode(_sfc_main$u,e$b.mergeProps({"is-info":!0,message:le,"next-message":re.value[ce-1]},{ref_for:!0},oe.$attrs),null,16,["message","next-message"])]))),128))])]))}}),_hoisted_1$k={class:"sm-emoji-drawer-inline__crop"},DISMISS_RATIO=.28,DISMISS_VELOCITY=.6,DRAG_TOLERANCE=6,_sfc_main$n={__name:"EmojiPickerDrawer",props:{show:{type:Boolean,default:!1},theme:{type:String,default:"light"},categories:{type:Array,default:()=>EMOJI_CATEGORIES},inline:{type:Boolean,default:!1}},emits:["close","select"],setup(ee,{emit:te}){const ne=ee,ae=te;function re(Se){Se.key==="Escape"&&ne.show&&ae("close")}e$b.onMounted(()=>document.addEventListener("keydown",re)),e$b.onBeforeUnmount(()=>{document.removeEventListener("keydown",re),document.removeEventListener("pointerdown",oe,!0)});function oe(Se){!ne.inline||!ne.show||ie.value&&!ie.value.contains(Se.target)&&ae("close")}e$b.watch(()=>ne.show&&ne.inline,Se=>{document.removeEventListener("pointerdown",oe,!0),Se&&document.addEventListener("pointerdown",oe,!0)});const ie=e$b.ref(null),le=e$b.ref(!1),ce=e$b.ref(0);let de=null,ue=0,be=0,fe=0,ge=0,me=0,pe=!1;function ke(Se){ie.value&&(de=Se.pointerId,ue=Se.clientY,fe=Se.clientY,ge=Se.timeStamp,me=0,pe=!1,be=ie.value.offsetHeight,le.value=!0,Se.currentTarget.setPointerCapture(de))}function ve(Se){if(!le.value||Se.pointerId!==de)return;const Le=Se.clientY-ue;Math.abs(Le)>DRAG_TOLERANCE&&(pe=!0),ce.value=Math.max(0,Le);const Ae=Se.timeStamp-ge;Ae>0&&(me=(Se.clientY-fe)/Ae),fe=Se.clientY,ge=Se.timeStamp}function _e(Se){if(!le.value)return;le.value=!1;const Le=ce.value;if(ce.value=0,!Se)return;const Ae=be>0&&Le>be*DISMISS_RATIO,De=me>DISMISS_VELOCITY&&Le>12;(Ae||De)&&ae("close")}function $e(Se){Se.pointerId===de&&_e(!0)}function ye(Se){Se.pointerId===de&&_e(!1)}function Ee(){if(pe){pe=!1;return}ae("close")}return(Se,Le)=>ee.inline?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["sm-emoji-drawer-inline",{"sm-emoji-drawer-inline--open":ee.show}])},[e$b.createElementVNode("div",_hoisted_1$k,[e$b.createElementVNode("div",{ref_key:"panelRef",ref:ie,class:e$b.normalizeClass(["sm-emoji-drawer sm-emoji-drawer--inline",{"sm-emoji-drawer--dark":ee.theme==="dark","sm-emoji-drawer--dragging":le.value}]),style:e$b.normalizeStyle(ce.value?{transform:`translateY(${ce.value}px)`}:null),role:"dialog","aria-label":"Seletor de emojis"},[e$b.createElementVNode("div",{class:"sm-emoji-drawer__handle",onPointerdown:ke,onPointermove:ve,onPointerup:$e,onPointercancel:ye,onClick:Ee},[...Le[3]||(Le[3]=[e$b.createElementVNode("span",{class:"sm-emoji-drawer__handle-bar","aria-hidden":"true"},null,-1)])],32),e$b.createVNode(EmojiPicker,{theme:ee.theme,categories:ee.categories,onSelect:Le[0]||(Le[0]=Ae=>ae("select",Ae))},null,8,["theme","categories"])],6)])],2)):(e$b.openBlock(),e$b.createBlock(e$b.Teleport,{key:1,to:"body"},[e$b.createVNode(e$b.Transition,{name:"sm-emoji-drawer-fade"},{default:e$b.withCtx(()=>[ee.show?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:"sm-emoji-drawer__backdrop",onClick:Le[1]||(Le[1]=Ae=>ae("close"))})):e$b.createCommentVNode("",!0)]),_:1}),e$b.createVNode(e$b.Transition,{name:"sm-emoji-drawer-slide"},{default:e$b.withCtx(()=>[ee.show?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,ref_key:"panelRef",ref:ie,class:e$b.normalizeClass(["sm-emoji-drawer",{"sm-emoji-drawer--dark":ee.theme==="dark","sm-emoji-drawer--dragging":le.value}]),style:e$b.normalizeStyle(ce.value?{transform:`translateY(${ce.value}px)`}:null),role:"dialog","aria-label":"Seletor de emojis"},[e$b.createElementVNode("div",{class:"sm-emoji-drawer__handle",onPointerdown:ke,onPointermove:ve,onPointerup:$e,onPointercancel:ye,onClick:Ee},[...Le[4]||(Le[4]=[e$b.createElementVNode("span",{class:"sm-emoji-drawer__handle-bar","aria-hidden":"true"},null,-1)])],32),e$b.createVNode(EmojiPicker,{theme:ee.theme,categories:ee.categories,onSelect:Le[2]||(Le[2]=Ae=>ae("select",Ae))},null,8,["theme","categories"])],6)):e$b.createCommentVNode("",!0)]),_:1})]))}},EmojiPickerDrawer=_export_sfc$1(_sfc_main$n,[["__scopeId","data-v-0bc491ca"]]),_sfc_main$m={__name:"GameProfileCard",props:{attendant:{type:Object,default:()=>({})},identity:{type:Object,default:null},editable:{type:Boolean,default:!1},embedded:{type:Boolean,default:!1},effectLevel:{type:String,default:"border",validator:ee=>["full","compact","border"].includes(ee)},progress:{type:Object,default:null}},emits:["edit"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.computed(()=>ne.identity||resolveAttendantGamification(ne.attendant));return(oe,ie)=>{var le,ce;return e$b.openBlock(),e$b.createBlock(GameIdentity,{variant:"card",name:((le=ee.attendant)==null?void 0:le.name)||"Atendente",photo:((ce=ee.attendant)==null?void 0:ce.photo)||"",level:re.value.level,frame:re.value.frame,title:re.value.title,achievement:re.value.achievement,progress:ee.progress,editable:ee.editable,embedded:ee.embedded,"effect-level":ee.effectLevel,onEdit:ie[0]||(ie[0]=de=>ae("edit"))},e$b.createSlots({_:2},[oe.$slots.footer?{name:"footer",fn:e$b.withCtx(()=>[e$b.renderSlot(oe.$slots,"footer")]),key:"0"}:void 0]),1032,["name","photo","level","frame","title","achievement","progress","editable","embedded","effect-level"])}}},_hoisted_1$j={class:"tabular-nums"},_sfc_main$l={__name:"AnimatedNumber",props:{value:{type:Number,default:0},duration:{type:Number,default:900},locale:{type:Boolean,default:!1},decimals:{type:Number,default:0}},setup(ee){const te=ee,ne=e$b.ref(0);let ae=null;function re(ie){const le=ne.value,ce=performance.now();cancelAnimationFrame(ae);const de=ue=>{const be=Math.min(1,(ue-ce)/te.duration),fe=1-Math.pow(1-be,3);ne.value=le+(ie-le)*fe,be<1?ae=requestAnimationFrame(de):ne.value=ie};ae=requestAnimationFrame(de)}function oe(ie){const le=te.decimals?Number(ie.toFixed(te.decimals)):Math.round(ie);return te.locale?le.toLocaleString("pt-BR",{minimumFractionDigits:te.decimals,maximumFractionDigits:te.decimals}):te.decimals?le.toFixed(te.decimals):String(le)}return e$b.watch(()=>te.value,ie=>re(ie)),e$b.onMounted(()=>re(te.value)),e$b.onBeforeUnmount(()=>cancelAnimationFrame(ae)),(ie,le)=>(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_1$j,e$b.toDisplayString(oe(ne.value)),1))}},_hoisted_1$i={class:"sr-only"},_hoisted_2$i={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","aria-hidden":"true"},_hoisted_3$g={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","aria-hidden":"true"},_hoisted_4$f={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","aria-hidden":"true"},_sfc_main$k={__name:"TrendIndicator",props:{trend:{type:String,default:"flat",validator:ee=>["up","down","flat"].includes(ee)},variant:{type:String,default:"arrow",validator:ee=>["arrow","text"].includes(ee)}},setup(ee){const te=ee,ne={up:{text:"↑ Subindo",label:"Subiu de posição"},down:{text:"↓ Caindo",label:"Caiu de posição"},flat:{text:"→ Estável",label:"Posição estável"}},ae=e$b.computed(()=>ne[te.trend]||ne.flat);return(re,oe)=>ee.variant==="text"?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["trend-text",`trend--${ee.trend}`])},e$b.toDisplayString(ae.value.text),3)):(e$b.openBlock(),e$b.createElementBlock("span",{key:1,class:e$b.normalizeClass(["trend-chip",`trend--${ee.trend}`])},[e$b.createElementVNode("span",_hoisted_1$i,e$b.toDisplayString(ae.value.label),1),ee.trend==="up"?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$i,[...oe[0]||(oe[0]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6 15 6-6 6 6"},null,-1)])])):ee.trend==="down"?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$g,[...oe[1]||(oe[1]=[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6 9 6 6 6-6"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_4$f,[...oe[2]||(oe[2]=[e$b.createElementVNode("path",{"stroke-linecap":"round",d:"M6 12h12"},null,-1)])]))],2))}},TrendIndicator=_export_sfc$1(_sfc_main$k,[["__scopeId","data-v-4a8e687c"]]),_hoisted_1$h={class:"ranking-body"},_hoisted_2$h={class:"ranking-name"},_hoisted_3$f={key:1,class:"ranking-subtitle"},_hoisted_4$e={class:"ranking-points"},_hoisted_5$d={class:"ranking-points-value"},_sfc_main$j={__name:"RankingRow",props:{rank:{type:Number,default:null},rankSuffix:{type:String,default:""},name:{type:String,default:"Atendente"},photo:{type:String,default:""},level:{type:Number,default:null},frame:{type:Object,default:null},title:{type:Object,default:null},attendant:{type:Object,default:null},hoverPreview:{type:Boolean,default:!1},department:{type:String,default:""},showDepartment:{type:Boolean,default:!1},points:{type:Number,default:0},animate:{type:Boolean,default:!0},trend:{type:String,default:""},trendVariant:{type:String,default:"arrow",validator:ee=>["arrow","text"].includes(ee)},highlighted:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},avatarSize:{type:String,default:"sm"},effectLevel:{type:String,default:"compact",validator:ee=>["full","compact","border"].includes(ee)}},emits:["select"],setup(ee){const te=ee,ne=e$b.computed(()=>{if(te.title)return te.showDepartment&&te.department?te.department:"";const ae=[];return te.level!=null&&ae.push(`Nível ${te.level}`),te.showDepartment&&te.department&&ae.push(te.department),ae.join(" · ")});return(ae,re)=>(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.clickable?"button":"div"),{type:ee.clickable?"button":void 0,class:e$b.normalizeClass(["ranking-row",{"ranking-row--clickable":ee.clickable,"ranking-row--highlight":ee.highlighted,"smplay-hover-motion":ee.effectLevel!=="border"}]),"aria-label":ee.clickable?`Ver detalhes de ${ee.name}`:void 0,onClick:re[0]||(re[0]=oe=>ee.clickable&&ae.$emit("select"))},{default:e$b.withCtx(()=>[ee.rank!=null?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["ranking-rank",{"ranking-rank--highlight":ee.highlighted}])},e$b.toDisplayString(ee.rank)+e$b.toDisplayString(ee.rankSuffix),3)):e$b.createCommentVNode("",!0),ee.attendant?(e$b.openBlock(),e$b.createBlock(AttendantGameIdentity,{key:1,attendant:ee.attendant,variant:"list","avatar-size":ee.avatarSize,"effect-level":ee.effectLevel,frame:ee.frame??void 0,title:ee.title??void 0,"show-level":!0,"show-achievement":!1,"hover-preview":ee.hoverPreview,class:"ranking-identity"},null,8,["attendant","avatar-size","effect-level","frame","title","hover-preview"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:2},[e$b.createVNode(Avatar,{name:ee.name,photo:ee.photo,level:ee.level,frame:ee.frame,size:ee.avatarSize,"effect-level":ee.effectLevel,class:"ranking-avatar"},null,8,["name","photo","level","frame","size","effect-level"]),e$b.createElementVNode("span",_hoisted_1$h,[e$b.createElementVNode("span",_hoisted_2$h,e$b.toDisplayString(ee.name),1),ee.title?(e$b.openBlock(),e$b.createBlock(_sfc_main$2b,{key:0,title:ee.title,size:"sm",class:"ranking-title"},null,8,["title"])):e$b.createCommentVNode("",!0),ne.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$f,e$b.toDisplayString(ne.value),1)):e$b.createCommentVNode("",!0)])],64)),ee.trend&&ee.trendVariant==="arrow"?(e$b.openBlock(),e$b.createBlock(TrendIndicator,{key:3,trend:ee.trend,variant:"arrow",class:"ranking-trend-chip"},null,8,["trend"])):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_4$e,[e$b.createElementVNode("strong",_hoisted_5$d,[ee.animate?(e$b.openBlock(),e$b.createBlock(_sfc_main$l,{key:0,value:ee.points,locale:""},null,8,["value"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(ee.points.toLocaleString("pt-BR")),1)],64))]),ee.trend&&ee.trendVariant==="text"?(e$b.openBlock(),e$b.createBlock(TrendIndicator,{key:0,trend:ee.trend,variant:"text"},null,8,["trend"])):e$b.createCommentVNode("",!0)])]),_:1},8,["type","class","aria-label"]))}},RankingRow=_export_sfc$1(_sfc_main$j,[["__scopeId","data-v-131d36ca"]]),_hoisted_1$g={class:"podium-empty"},_hoisted_2$g={class:"podium-empty-title"},_hoisted_3$e={class:"podium-empty-text"},_hoisted_4$d={class:"podium-cols podium-cols--ghost",style:{"--podium-cols":3},"aria-hidden":"true"},_hoisted_5$c={key:0,class:"podium-spotlight","aria-hidden":"true"},_hoisted_6$a={key:1,class:"podium-crown-slot","aria-hidden":"true"},_hoisted_7$9={key:0,class:"podium-crown",viewBox:"0 0 24 24",fill:"currentColor"},_hoisted_8$6={class:"podium-avatar-wrap"},_hoisted_9$4={key:0,class:"podium-aura","aria-hidden":"true"},_hoisted_10$4={key:3,class:"podium-dept"},_hoisted_11$4={class:"podium-points"},_hoisted_12$3=["aria-label"],_sfc_main$i={__name:"RankingPodium",props:{entries:{type:Array,default:()=>[]},showDepartment:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},animate:{type:Boolean,default:!0},effectLevel:{type:String,default:"full",validator:ee=>["full","compact","border"].includes(ee)},emptyTitle:{type:String,default:"Pódio ainda vazio"},emptyText:{type:String,default:"Os três primeiros aparecem assim que alguém pontuar."}},emits:["select"],setup(ee){const te=ee;function ne(ce,de){var be;if(de==="border")return!1;const ue=(be=resolveFrameVisual(ce.frame))==null?void 0:be.ornament;return!!(ue!=null&&ue.enabled&&ue.variant==="crown")}const ae=e$b.computed(()=>{const[ce,de,ue]=te.entries;return(te.entries.length>=3?[de,ce,ue]:[ce,de]).filter(Boolean).map(fe=>({...fe,source:fe,showCrown:fe.rank===1&&!ne(fe,te.effectLevel)}))}),re=e$b.computed(()=>te.effectLevel==="full"),oe=e$b.computed(()=>ae.value.length<3),ie=e$b.computed(()=>ae.value.length===0),le=[2,1,3];return(ce,de)=>(e$b.openBlock(),e$b.createElementBlock("section",{class:e$b.normalizeClass(["podium",{"podium--sparse":oe.value,"podium--empty":ie.value,"podium--lit":re.value}])},[de[5]||(de[5]=e$b.createElementVNode("div",{class:"podium-arena-glow","aria-hidden":"true"},null,-1)),ie.value?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[e$b.createElementVNode("div",_hoisted_1$g,[e$b.renderSlot(ce.$slots,"empty",{},()=>[e$b.createElementVNode("p",_hoisted_2$g,e$b.toDisplayString(ee.emptyTitle),1),e$b.createElementVNode("p",_hoisted_3$e,e$b.toDisplayString(ee.emptyText),1)],!0)]),e$b.createElementVNode("div",_hoisted_4$d,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(le,(ue,be)=>e$b.createElementVNode("div",{key:ue,class:e$b.normalizeClass(["podium-col podium-col--ghost",`podium-col--${ue}`]),style:e$b.normalizeStyle({animationDelay:`${be*110}ms`})},[e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-ghost-avatar",{"podium-ghost-avatar--first":ue===1}])},null,2),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-pedestal",`podium-pedestal--${ue}`]),style:e$b.normalizeStyle({animationDelay:`${be*110+120}ms`})},[de[0]||(de[0]=e$b.createElementVNode("div",{class:"podium-pedestal-top"},null,-1)),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-medal",`podium-medal--${ue}`])},e$b.toDisplayString(ue),3)],6)],6)),64))])],64)):(e$b.openBlock(),e$b.createElementBlock("div",{key:1,class:"podium-cols",style:e$b.normalizeStyle({"--podium-cols":ae.value.length})},[de[4]||(de[4]=e$b.createElementVNode("div",{class:"podium-floor","aria-hidden":"true"},null,-1)),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae.value,(ue,be)=>(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.clickable?"button":"div"),{key:ue.rank,type:ee.clickable?"button":void 0,class:e$b.normalizeClass(["podium-col",`podium-col--${ue.rank}`]),style:e$b.normalizeStyle({animationDelay:`${be*110}ms`}),"aria-label":ee.clickable?`Ver detalhes de ${ue.name}`:void 0,onClick:fe=>ee.clickable&&ce.$emit("select",ue.source)},{default:e$b.withCtx(()=>{var fe;return[ue.rank===1&&re.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$c)):e$b.createCommentVNode("",!0),ue.rank===1?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6$a,[ue.showCrown?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_7$9,[...de[1]||(de[1]=[e$b.createElementVNode("path",{d:"M4.2 7.2a.7.7 0 0 1 1.1-.6l3.4 2.4a.7.7 0 0 0 1-.2l1.7-2.9a.7.7 0 0 1 1.2 0l1.7 2.9a.7.7 0 0 0 1 .2l3.4-2.4a.7.7 0 0 1 1.1.6l-1 7.1a1 1 0 0 1-1 .9H6.2a1 1 0 0 1-1-.9l-1-7.1Zm1.6 10a.8.8 0 0 1 .8-.8h10.8a.8.8 0 0 1 0 1.6H6.6a.8.8 0 0 1-.8-.8Z"},null,-1)])])):e$b.createCommentVNode("",!0)])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_8$6,[ue.rank===1?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$4)):e$b.createCommentVNode("",!0),e$b.createVNode(Avatar,{name:ue.name,photo:ue.photo,level:ue.level,frame:ue.frame,scale:"app",size:ue.rank===1?"xl":"lg","effect-level":ee.effectLevel,class:"podium-avatar"},null,8,["name","photo","level","frame","size","effect-level"])]),e$b.createElementVNode("p",{class:e$b.normalizeClass(["podium-name",{"podium-name--first":ue.rank===1}])},e$b.toDisplayString(ue.name),3),ue.title?(e$b.openBlock(),e$b.createBlock(_sfc_main$2b,{key:2,title:ue.title,size:"sm",class:"podium-title"},null,8,["title"])):e$b.createCommentVNode("",!0),ee.showDepartment&&((fe=ue.department)!=null&&fe.name)?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_10$4,e$b.toDisplayString(ue.department.name),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("p",_hoisted_11$4,[e$b.createElementVNode("span",{class:e$b.normalizeClass(["podium-points-value",`podium-points--${ue.rank}`])},[ee.animate?(e$b.openBlock(),e$b.createBlock(_sfc_main$l,{key:0,value:ue.points,locale:""},null,8,["value"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString(ue.points.toLocaleString("pt-BR")),1)],64))],2),de[2]||(de[2]=e$b.createElementVNode("span",{class:"podium-points-unit"},"pts",-1)),ue.trend==="up"||ue.trend==="down"?(e$b.openBlock(),e$b.createBlock(TrendIndicator,{key:0,trend:ue.trend,class:"podium-trend"},null,8,["trend"])):e$b.createCommentVNode("",!0)]),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-pedestal",`podium-pedestal--${ue.rank}`]),style:e$b.normalizeStyle({animationDelay:`${be*110+120}ms`})},[de[3]||(de[3]=e$b.createElementVNode("div",{class:"podium-pedestal-top","aria-hidden":"true"},null,-1)),e$b.createElementVNode("div",{class:e$b.normalizeClass(["podium-medal",`podium-medal--${ue.rank}`]),"aria-label":`${ue.rank}º lugar`},e$b.toDisplayString(ue.rank),11,_hoisted_12$3)],6)]}),_:2},1032,["type","class","style","aria-label","onClick"]))),128))],4))],2))}},RankingPodium=_export_sfc$1(_sfc_main$i,[["__scopeId","data-v-5737213a"]]),_hoisted_1$f={class:"season-badge"},_hoisted_2$f={class:"season-dot-wrap"},_sfc_main$h={__name:"SeasonBadge",props:{label:{type:String,default:"Temporada"},status:{type:String,default:"live",validator:ee=>["live","paused","scheduled"].includes(ee)},daysLeft:{type:Number,default:null}},setup(ee){const te=ee,ne={live:{text:"Ao vivo"},paused:{text:"Pausada"},scheduled:{text:"Agendada"}},ae=e$b.computed(()=>ne[te.status]||ne.live);return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_1$f,[e$b.createElementVNode("span",_hoisted_2$f,[ee.status==="live"?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["season-ping",`season--${ee.status}`])},null,2)):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",{class:e$b.normalizeClass(["season-dot",`season--${ee.status}`])},null,2)]),e$b.createTextVNode(" "+e$b.toDisplayString(ee.label)+" ",1),oe[0]||(oe[0]=e$b.createElementVNode("span",{class:"season-divider","aria-hidden":"true"},null,-1)),e$b.createElementVNode("span",{class:e$b.normalizeClass(["season-status",`season--${ee.status}`])},[e$b.createTextVNode(e$b.toDisplayString(ae.value.text),1),ee.daysLeft!=null?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[e$b.createTextVNode(" · "+e$b.toDisplayString(ee.daysLeft)+" dias",1)],64)):e$b.createCommentVNode("",!0)],2)]))}},SeasonBadge=_export_sfc$1(_sfc_main$h,[["__scopeId","data-v-3fb77058"]]),_hoisted_1$e={class:"season-track-labels"},_hoisted_2$e={class:"season-track-edge"},_hoisted_3$d={class:"season-track-today"},_hoisted_4$c={class:"season-track-edge season-track-edge--end"},_hoisted_5$b={key:0,class:"today-contrail","aria-hidden":"true"},_hoisted_6$9={key:1,class:"today-runway","aria-hidden":"true"},_sfc_main$g={__name:"SeasonTrack",props:{startedLabel:{type:String,default:"—"},endsLabel:{type:String,default:"—"},todayText:{type:String,default:""},percent:{type:Number,default:0},rail:{type:String,default:"rgb(var(--primary-rgb))"},flying:{type:Boolean,default:!1},finalStretch:{type:Boolean,default:!1}},setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:"season-track",style:e$b.normalizeStyle({"--rail":ee.rail})},[e$b.createElementVNode("div",_hoisted_1$e,[e$b.createElementVNode("span",_hoisted_2$e,[ne[0]||(ne[0]=e$b.createElementVNode("span",{class:"season-track-edge-label"},"Início",-1)),e$b.createTextVNode(e$b.toDisplayString(ee.startedLabel),1)]),e$b.createElementVNode("span",_hoisted_3$d,e$b.toDisplayString(ee.todayText),1),e$b.createElementVNode("span",_hoisted_4$c,[ne[1]||(ne[1]=e$b.createElementVNode("span",{class:"season-track-edge-label"},"Encerra",-1)),e$b.createTextVNode(e$b.toDisplayString(ee.endsLabel),1)])]),e$b.createElementVNode("div",{class:e$b.normalizeClass(["track",{"track--final":ee.finalStretch}])},[e$b.createElementVNode("div",{class:"fill",style:e$b.normalizeStyle({width:`${ee.percent}%`})},null,4),ne[3]||(ne[3]=e$b.createElementVNode("span",{class:"node start"},null,-1)),e$b.createElementVNode("span",{class:e$b.normalizeClass(["node end",{reached:ee.percent>=100,"node--final":ee.finalStretch}])},null,2),e$b.createElementVNode("span",{class:e$b.normalizeClass(["today",ee.flying?"flying":"landed"]),style:e$b.normalizeStyle({left:`${ee.percent}%`})},[ee.flying?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$b)):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6$9)),ne[2]||(ne[2]=e$b.createElementVNode("svg",{class:"today-plane",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M16 10h4a2 2 0 1 1 0 4h-4l-4 7H9l2-7H7l-2 2H2l1-4-1-4h3l2 2h4L9 3h3l4 7Z"})],-1))],6)],2)],4))}},SeasonTrack=_export_sfc$1(_sfc_main$g,[["__scopeId","data-v-f0dfa804"]]),_hoisted_1$d={class:"season-head"},_hoisted_2$d={class:"season-head-main"},_hoisted_3$c={class:"season-pill-mark"},_hoisted_4$b={key:0,class:"season-pill-plane",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},_hoisted_5$a={key:1,class:"season-pill-dot"},_hoisted_6$8={key:0,class:"season-sprint"},_hoisted_7$8={class:"season-name"},_hoisted_8$5={key:1,class:"season-description"},_hoisted_9$3={key:0,class:"season-actions"},_hoisted_10$3={key:0,class:"season-frozen"},_hoisted_11$3={key:1,class:"season-sprint-note"},_hoisted_12$2={class:"season-track-slot"},_hoisted_13$2={key:2,class:"season-tile-suffix"},_hoisted_14$2={class:"season-tile-label"},_sfc_main$f={__name:"SeasonCard",props:{season:{type:Object,default:null},tiles:{type:Array,default:()=>[]},finalStretchDays:{type:Number,default:7}},setup(ee){const te=ee,ne=e$b.computed(()=>{var ve;return((ve=te.season)==null?void 0:ve.status)??"scheduled"}),ae=e$b.computed(()=>ne.value==="active"),re=e$b.computed(()=>ne.value==="paused"),oe=e$b.computed(()=>ne.value==="scheduled"),ie={active:{label:"Ativa",rail:"var(--color-state-success, rgb(var(--success-rgb, 34 197 94)))"},paused:{label:"Pausada",rail:"var(--color-state-warning, rgb(var(--warning-rgb, 245 158 11)))"},scheduled:{label:"Agendada",rail:"rgb(var(--bg-base-100) / 0.7)"}},le=e$b.computed(()=>ie[ne.value]??ie.scheduled),ce=e$b.computed(()=>{var ve;return((ve=te.season)==null?void 0:ve.duration_days)||1}),de=e$b.computed(()=>{var ve;return Math.max(0,((ve=te.season)==null?void 0:ve.days_left)||0)}),ue=e$b.computed(()=>Math.max(0,ce.value-de.value)),be=e$b.computed(()=>!te.season||oe.value?0:Math.min(100,Math.round(ue.value/ce.value*100))),fe=e$b.computed(()=>Math.min(ce.value,Math.max(1,ue.value))),ge=e$b.computed(()=>ae.value&&de.value<=te.finalStretchDays),me=e$b.computed(()=>de.value<=0?"Reta final · último dia":`Reta final · ${de.value} ${de.value===1?"dia":"dias"}`),pe=e$b.computed(()=>oe.value?"Ainda não começou":`${re.value?"Pausada":"Hoje"} · dia ${fe.value} de ${ce.value}`),ke=e$b.computed(()=>[{value:oe.value?ce.value:de.value,suffix:"dias",label:oe.value?"de duração":"restantes",tone:"status"},...te.tiles]);return(ve,_e)=>ee.season?(e$b.openBlock(),e$b.createElementBlock("section",{key:0,class:"season-card",style:e$b.normalizeStyle({"--rail":le.value.rail})},[e$b.createElementVNode("header",_hoisted_1$d,[e$b.createElementVNode("div",_hoisted_2$d,[e$b.createElementVNode("span",{class:e$b.normalizeClass(["season-pill",`season-pill--${ne.value}`])},[e$b.createElementVNode("span",_hoisted_3$c,[ae.value?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_4$b,[..._e[0]||(_e[0]=[e$b.createElementVNode("path",{d:"M16 10h4a2 2 0 1 1 0 4h-4l-4 7H9l2-7H7l-2 2H2l1-4-1-4h3l2 2h4L9 3h3l4 7Z"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$a))]),e$b.createTextVNode(" "+e$b.toDisplayString(le.value.label),1)],2),ge.value?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6$8,e$b.toDisplayString(me.value),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("h3",_hoisted_7$8,e$b.toDisplayString(ee.season.name),1),ee.season.description?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_8$5,e$b.toDisplayString(ee.season.description),1)):e$b.createCommentVNode("",!0)]),ve.$slots.actions?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_9$3,[e$b.renderSlot(ve.$slots,"actions",{},void 0,!0)])):e$b.createCommentVNode("",!0)]),re.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10$3,[..._e[1]||(_e[1]=[e$b.createElementVNode("svg",{class:"season-frozen-icon",fill:"none",stroke:"currentColor","stroke-width":"1.8",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v18M5 8l14 8M19 8 5 16"})],-1),e$b.createElementVNode("p",{class:"season-frozen-text"},[e$b.createElementVNode("strong",null,"Pontuação congelada."),e$b.createTextVNode(" Ninguém ganha ou perde pontos enquanto pausada — o prazo de encerramento também para. ")],-1)])])):e$b.createCommentVNode("",!0),ge.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_11$3,[..._e[2]||(_e[2]=[e$b.createElementVNode("p",null,[e$b.createElementVNode("strong",null,"Últimos dias da temporada."),e$b.createTextVNode(" Ao encerrar, os pontos zeram e a disputa recomeça — nível e XP permanecem. ")],-1)])])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",_hoisted_12$2,[e$b.createVNode(SeasonTrack,{"started-label":ee.season.started_label||"—","ends-label":ee.season.ends_label||"—","today-text":pe.value,percent:be.value,rail:le.value.rail,flying:ae.value,"final-stretch":ge.value},null,8,["started-label","ends-label","today-text","percent","rail","flying","final-stretch"])]),e$b.createElementVNode("div",{class:"season-tiles",style:e$b.normalizeStyle({"--tiles":ke.value.length})},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ke.value,$e=>(e$b.openBlock(),e$b.createElementBlock("div",{key:$e.label,class:"season-tile"},[e$b.createElementVNode("p",{class:e$b.normalizeClass(["season-tile-value",{"season-tile-value--status":$e.tone==="status"}])},[typeof $e.value=="number"?(e$b.openBlock(),e$b.createBlock(_sfc_main$l,{key:0,value:$e.value},null,8,["value"])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createTextVNode(e$b.toDisplayString($e.value),1)],64)),$e.suffix?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_13$2,e$b.toDisplayString($e.suffix),1)):e$b.createCommentVNode("",!0)],2),e$b.createElementVNode("p",_hoisted_14$2,e$b.toDisplayString($e.label),1)]))),128))],4),e$b.renderSlot(ve.$slots,"default",{},void 0,!0)],4)):e$b.createCommentVNode("",!0)}},SeasonCard=_export_sfc$1(_sfc_main$f,[["__scopeId","data-v-aa96ada4"]]),MONTHS_ABBR=["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"];function seasonDayLabel(ee){const[te,ne,ae]=String(ee).slice(0,10).split("-").map(Number);return`${ae} ${MONTHS_ABBR[ne-1]} ${te}`}function normalizeSeason(ee){return!ee||typeof ee!="object"||!ee.id&&!ee.started_at&&!ee.ends_at?null:{...ee,name:ee.name??"",description:ee.description??"",duration_days:ee.duration_days??1,started_label:ee.started_at?seasonDayLabel(ee.started_at):ee.started_label??"—",ends_label:ee.ends_at?seasonDayLabel(ee.ends_at):ee.ends_label??"—",period_label:ee.started_at&&ee.ends_at?`${seasonDayLabel(ee.started_at)} – ${seasonDayLabel(ee.ends_at)}`:ee.period_label??""}}const AVATAR_TONES=["bg-blue-500/20 text-blue-200 ring-blue-400/25","bg-pink-500/20 text-pink-200 ring-pink-400/25","bg-emerald-500/20 text-emerald-200 ring-emerald-400/25","bg-amber-500/20 text-amber-200 ring-amber-400/25","bg-violet-500/20 text-violet-200 ring-violet-400/25"];function buildRanking(ee=[],{tieBreak:te="name"}={}){return ee.slice().sort((ne,ae)=>(ae.points??0)-(ne.points??0)||String(ne[te]??"").localeCompare(String(ae[te]??""))).map((ne,ae)=>{const re=ae+1;return{...ne,rank:re,tone:AVATAR_TONES[(re-1)%AVATAR_TONES.length],ref:ne}})}function podiumOrder(ee=[]){const[te,ne,ae]=ee;return[ne,te,ae].filter(Boolean)}function attendantSeasonPoints(ee){var ne;const te=(ee==null?void 0:ee.gamification)??(ee==null?void 0:ee.game_profile)??{};return Number(((ne=te.season)==null?void 0:ne.points)??te.season_points??0)}function belongsToDepartment(ee,te){return(Array.isArray(ee==null?void 0:ee.department)?ee.department:[]).some(ae=>String(ae==null?void 0:ae.id)===String(te))}function compareRankEntries(ee,te){return te.level-ee.level||te.points-ee.points||String(ee.name??"").localeCompare(String(te.name??""))}function unlockedLabel(ee,{short:te=!1}={}){const ne="Desbloqueado";if(!ee)return ne;const ae=new Date(ee);return Number.isNaN(ae.getTime())?ne:te?`Desde ${ae.toLocaleDateString("pt-BR")}`:`Desbloqueado em ${ae.toLocaleDateString("pt-BR",{day:"2-digit",month:"short",year:"numeric"})}`}const _sfc_main$e={__name:"CosmeticRequirements",props:{item:{type:Object,required:!0},kind:{type:String,default:null},mode:{type:String,default:"attendant"},attendantName:{type:String,default:""},requirement:{type:Object,default:null},unlocked:{type:Boolean,default:!1},unlockedAt:{type:[String,Number,Date],default:null},selected:{type:Boolean,default:!1},selectedLabel:{type:String,default:"Equipado"}},setup(ee){const te=ee,ne=e$b.computed(()=>te.kind||te.item.type),ae=e$b.computed(()=>ne.value==="title"),re=e$b.computed(()=>te.mode==="catalog"),oe=e$b.computed(()=>{var ue;return te.unlocked||re.value?null:((ue=te.requirement)==null?void 0:ue.progress)??null}),ie=e$b.computed(()=>re.value?"Como é obtido":te.unlocked?"Como você obteve":"Como desbloquear"),le=e$b.computed(()=>({frame:"Moldura",title:"Título",achievement:"Destaque"})[ne.value]||"Item"),ce=e$b.computed(()=>te.selected?[{label:te.selectedLabel,class:"font-black text-primary"}]:[]),de=e$b.computed(()=>re.value?null:te.unlocked?{label:unlockedLabel(te.unlockedAt),class:"text-success"}:{label:"Bloqueado"});return(ue,be)=>{var fe,ge,me,pe;return e$b.openBlock(),e$b.createBlock(UnlockHint,{class:"cosmetic-requirements",eyebrow:le.value,name:ee.item.name||"Sem nome","block-label":ie.value,text:((fe=ee.requirement)==null?void 0:fe.text)||((ge=ee.requirement)==null?void 0:ge.label)||"Requisito não informado.",note:((me=ee.requirement)==null?void 0:me.note)||"",unit:((pe=ee.requirement)==null?void 0:pe.unit)||"",progress:oe.value,pills:ce.value,status:de.value},e$b.createSlots({piece:e$b.withCtx(()=>[ne.value==="frame"?(e$b.openBlock(),e$b.createBlock(Avatar,{key:0,name:ee.attendantName,frame:ee.item,"show-level":!1,"frame-only":"",size:"md","effect-level":"full"},null,8,["name","frame"])):ne.value==="achievement"?(e$b.openBlock(),e$b.createBlock(_sfc_main$2c,{key:1,achievement:ee.item,size:"md"},null,8,["achievement"])):e$b.createCommentVNode("",!0)]),_:2},[ae.value?{name:"name",fn:e$b.withCtx(()=>[e$b.createVNode(_sfc_main$2b,{title:ee.item,size:"lg",align:"start",tooltip:!1,class:"mt-1.5"},null,8,["title"])]),key:"0"}:void 0]),1032,["eyebrow","name","block-label","text","note","unit","progress","pills","status"])}}},_hoisted_1$c={class:"min-w-0 flex-1"},_hoisted_2$c={class:"truncate"},_hoisted_3$b={class:"flex shrink-0 items-center"},_hoisted_4$a=["aria-label"],_hoisted_5$9={key:1,class:"grid place-items-center rounded-full bg-base-100 p-1.5 ring-1 ring-base-200","aria-label":"Item bloqueado"},_hoisted_6$7={class:"truncate"},_hoisted_7$7={key:2,class:"absolute inset-0 grid place-items-center rounded-[inherit] bg-base-300/70 backdrop-blur-[1px]","aria-live":"polite"},_hoisted_8$4={class:"sm-hover-panel-face"},_sfc_main$d={__name:"CosmeticCard",props:{item:{type:Object,required:!0},kind:{type:String,default:null},mode:{type:String,default:"catalog"},attendantName:{type:String,default:""},density:{type:String,default:"comfortable",validator:ee=>["comfortable","compact","tight"].includes(ee)},caption:{type:String,default:""},captionTone:{type:String,default:"muted",validator:ee=>["muted","primary","success"].includes(ee)},captionDot:{type:String,default:""},locked:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},selectedLabel:{type:String,default:"Equipado"},busy:{type:Boolean,default:!1},denied:{type:Boolean,default:!1},interactive:{type:Boolean,default:!0},enterDelay:{type:Number,default:0},hoverRequirements:{type:Boolean,default:!1},requirement:{type:Object,default:null},hoverDelay:{type:Number,default:240},unlockedAt:{type:[String,Number,Date],default:null}},emits:["select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.useAttrs(),oe={comfortable:{root:"",stage:"min-h-28 p-4",badge:"size-6",footer:"p-3",name:"text-sm",caption:"mt-1 text-[11px]",avatar:"md",token:"md",plaque:"min-h-[3.75rem] bg-base-200/80 gap-3 py-2 pl-3.5 pr-3",plaqueTitle:"xl",plaqueCaption:"text-[11px]",plaqueLabel:!0},compact:{root:"min-h-32",stage:"min-h-24 p-3",badge:"size-5",footer:"p-2 text-center",name:"text-[12px] font-medium leading-tight",caption:"justify-center text-[10.5px]",avatar:"md",token:"md",plaque:"min-h-16 gap-2.5 py-3 pl-3 pr-2.5",plaqueTitle:"lg",plaqueCaption:"text-[10.5px]",plaqueLabel:!0},tight:{root:"",stage:"min-h-16 p-2",badge:"size-5",footer:"px-2 py-2 text-center",name:"text-[13px] font-semibold leading-tight",caption:"mt-0.5 justify-center text-[11px] leading-tight",avatar:"sm",token:"md",plaque:"min-h-14 gap-2 py-2.5 pl-2.5 pr-2",plaqueTitle:"lg",plaqueCaption:"text-[11px] leading-tight",plaqueLabel:!1}},ie=e$b.computed(()=>ne.kind||ne.item.type),le=e$b.computed(()=>ie.value==="title"),ce=e$b.computed(()=>oe[ne.density]||oe.comfortable),de=e$b.computed(()=>ne.interactive&&!ne.busy),ue=e$b.computed(()=>ne.mode==="catalog"&&holdersCount(ne.item.holders)!==null),be=e$b.computed(()=>({primary:"text-primary",success:"text-success",muted:"text-base-content/55"})[ne.captionTone]),fe=e$b.computed(()=>["plate cosmetic-plate p-px",le.value?"":"cosmetic-plate--niche",ge.value?"cosmetic-plate--lit":"",ne.selected?"is-selected":"",ne.locked?"opacity-75 brightness-[0.78] saturate-[0.5]":"",ie.value==="frame"?"smplay-hover-motion":""]),ge=e$b.computed(()=>{var ze;if(ie.value!=="frame")return null;const Ie=(ze=resolveFrameVisual(ne.item))==null?void 0:ze.ring.colors;return Ie!=null&&Ie[0]?Ie:null}),me=e$b.computed(()=>{const Ie=ne.enterDelay?{animationDelay:`${ne.enterDelay}ms`}:{};if(!ge.value)return Ie;const[ze,Ve=ze]=ge.value;return{...Ie,"--frame-accent":ze,"--frame-accent-soft":Ve}}),pe=e$b.computed(()=>{var ze,Ve;if(ge.value){const[Ne,Pe=Ne]=ge.value;return{"--panel-accent":Ne,"--panel-accent-soft":Pe}}const Ie=(Ve=RARITIES[(ze=ne.item)==null?void 0:ze.rarity])==null?void 0:Ve.accentRgb;return Ie?{"--panel-accent":`rgb(${Ie})`}:{}}),ke=e$b.computed(()=>{if(ne.hoverRequirements)return;if(re.title)return re.title;const Ie=[ne.item.name,ne.caption];return ne.selected&&ne.selectedLabel&&Ie.push(ne.selectedLabel),Ie.filter(Boolean).join(" — ")}),ve=e$b.computed(()=>ne.hoverRequirements),_e=e$b.computed(()=>ne.hoverDelay),{triggerRef:$e,open:ye,panelStyle:Ee,placement:Se,scheduleOpen:Le,scheduleClose:Ae,closeNow:De}=useHoverPanel({enabled:ve,delay:_e,width:320});function Oe(){De(),de.value&&ae("select",ne.item)}return(Ie,ze)=>(e$b.openBlock(),e$b.createBlock(e$b.resolveDynamicComponent(ee.interactive?"button":"article"),{ref_key:"triggerRef",ref:$e,type:ee.interactive?"button":void 0,disabled:ee.interactive?ee.busy:void 0,"aria-pressed":ee.interactive?ee.selected:void 0,"aria-disabled":ee.locked||void 0,title:ke.value,style:e$b.normalizeStyle(me.value),class:e$b.normalizeClass(["cosmetic-card relative flex flex-col text-left",fe.value,le.value?"":ce.value.root,ee.denied?"shake-denied":"",de.value&&!ee.locked?"cursor-pointer ":"",ee.locked?"is-locked cursor-not-allowed":""]),onMouseenter:e$b.unref(Le),onMouseleave:e$b.unref(Ae),onClick:Oe},{default:e$b.withCtx(()=>[le.value?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["flex w-full items-center",ce.value.plaque])},[e$b.createElementVNode("span",_hoisted_1$c,[e$b.createVNode(_sfc_main$2b,{title:ee.item,size:ce.value.plaqueTitle,align:"start",tooltip:!1},null,8,["title","size"]),ee.caption?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["mt-1 flex min-w-0 items-center gap-1.5",[ce.value.plaqueCaption,be.value]])},[ee.captionDot?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["size-1.5 shrink-0 rounded-full",ee.captionDot]),"aria-hidden":"true"},null,2)):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_2$c,e$b.toDisplayString(ee.caption),1)],2)):e$b.createCommentVNode("",!0),ue.value?(e$b.openBlock(),e$b.createBlock(_sfc_main$12,{key:1,count:ee.item.holders,"icon-class":"size-3",class:e$b.normalizeClass(["mt-0.5 flex min-w-0",ce.value.plaqueCaption])},null,8,["count","class"])):e$b.createCommentVNode("",!0),e$b.renderSlot(Ie.$slots,"caption",{},void 0,!0)]),e$b.createElementVNode("span",_hoisted_3$b,[ee.selected?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["inline-flex items-center gap-1 rounded-full bg-primary/15 font-bold text-primary",ce.value.plaqueLabel?"px-2 py-1 text-[10px] uppercase tracking-wide":"p-1"]),"aria-label":ee.selectedLabel},[ze[2]||(ze[2]=e$b.createElementVNode("svg",{class:"size-3 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"3",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5 13 4 4L19 7"})],-1)),ce.value.plaqueLabel?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[e$b.createTextVNode(e$b.toDisplayString(ee.selectedLabel),1)],64)):e$b.createCommentVNode("",!0)],10,_hoisted_4$a)):ee.locked?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$9,[...ze[3]||(ze[3]=[e$b.createElementVNode("svg",{class:"size-3 text-base-content/60",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5Zm-3 8V7a3 3 0 1 1 6 0v3H9Z"})],-1)])])):e$b.renderSlot(Ie.$slots,"badge",{key:2},void 0,!0)])],2)):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["plate-stage relative grid flex-1 place-items-center",[ce.value.stage,ee.locked?"opacity-55 grayscale-[25%]":""]])},[ie.value==="frame"?(e$b.openBlock(),e$b.createBlock(Avatar,{key:0,name:ee.attendantName,frame:ee.item,"show-level":!1,"frame-only":"",size:ce.value.avatar,"effect-level":"compact"},null,8,["name","frame","size"])):(e$b.openBlock(),e$b.createBlock(_sfc_main$2c,{key:1,achievement:ee.item,size:ce.value.token},null,8,["achievement","size"])),ee.locked?(e$b.openBlock(),e$b.createElementBlock("span",{key:2,class:e$b.normalizeClass(["absolute right-2 top-2 grid place-items-center rounded-full bg-base-100 ring-1 ring-base-200",ce.value.badge]),"aria-label":"Item bloqueado"},[...ze[4]||(ze[4]=[e$b.createElementVNode("svg",{class:"size-3 text-base-content/60",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5Zm-3 8V7a3 3 0 1 1 6 0v3H9Z"})],-1)])],2)):ee.selected?(e$b.openBlock(),e$b.createElementBlock("span",{key:3,class:e$b.normalizeClass(["absolute right-2 top-2 grid place-items-center rounded-full bg-primary text-white ring-2 ring-base-300",ce.value.badge]),"aria-label":"Equipado"},[...ze[5]||(ze[5]=[e$b.createElementVNode("svg",{class:"size-3",fill:"none",stroke:"currentColor","stroke-width":"3",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5 13 4 4L19 7"})],-1)])],2)):e$b.renderSlot(Ie.$slots,"badge",{key:4},void 0,!0)],2),e$b.createElementVNode("span",{class:e$b.normalizeClass(["plate-cut-bottom block border-t border-base-200 bg-base-200/70",ce.value.footer])},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["block truncate font-semibold",ce.value.name])},e$b.toDisplayString(ee.item.name),3),ee.selected&&ee.selectedLabel?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["flex items-center gap-1 font-semibold text-primary",ce.value.caption])},[ze[6]||(ze[6]=e$b.createElementVNode("svg",{class:"size-3 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"2.5",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5 13 4 4L19 7"})],-1)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.selectedLabel),1)],2)):ee.caption?(e$b.openBlock(),e$b.createElementBlock("span",{key:1,class:e$b.normalizeClass(["flex min-w-0 items-center gap-1.5",[ce.value.caption,be.value]])},[ee.captionDot?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["size-1.5 shrink-0 rounded-full",ee.captionDot]),"aria-hidden":"true"},null,2)):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_6$7,e$b.toDisplayString(ee.caption),1)],2)):e$b.createCommentVNode("",!0),ue.value?(e$b.openBlock(),e$b.createBlock(_sfc_main$12,{key:2,count:ee.item.holders,"icon-class":"size-3",class:e$b.normalizeClass(["flex min-w-0",ce.value.caption])},null,8,["count","class"])):e$b.createCommentVNode("",!0),e$b.renderSlot(Ie.$slots,"caption",{},void 0,!0)],2)],64)),ee.busy?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_7$7,[...ze[7]||(ze[7]=[e$b.createElementVNode("svg",{class:"size-6 animate-spin text-primary",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4Z"})],-1)])])):e$b.createCommentVNode("",!0),ee.hoverRequirements?(e$b.openBlock(),e$b.createBlock(e$b.Teleport,{key:3,to:"body"},[e$b.createVNode(e$b.Transition,{name:"sm-hover-panel"},{default:e$b.withCtx(()=>[e$b.unref(ye)?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["sm-hover-panel",`sm-hover-panel--${e$b.unref(Se)}`]),style:e$b.normalizeStyle([e$b.unref(Ee),pe.value]),onMouseenter:ze[0]||(ze[0]=(...Ve)=>e$b.unref(Le)&&e$b.unref(Le)(...Ve)),onMouseleave:ze[1]||(ze[1]=(...Ve)=>e$b.unref(Ae)&&e$b.unref(Ae)(...Ve))},[e$b.createElementVNode("div",_hoisted_8$4,[e$b.createVNode(_sfc_main$e,{item:ee.item,kind:ie.value,mode:ee.mode,"attendant-name":ee.attendantName,requirement:ee.requirement,unlocked:!ee.locked,"unlocked-at":ee.unlockedAt,selected:ee.selected,"selected-label":ee.selectedLabel},null,8,["item","kind","mode","attendant-name","requirement","unlocked","unlocked-at","selected","selected-label"])])],38)):e$b.createCommentVNode("",!0)]),_:1})])):e$b.createCommentVNode("",!0)]),_:3},40,["type","disabled","aria-pressed","aria-disabled","title","style","class","onMouseenter","onMouseleave"]))}},CosmeticCard=_export_sfc$1(_sfc_main$d,[["__scopeId","data-v-1d521bcb"]]),_hoisted_1$b={class:"flex flex-col items-center gap-2 rounded-2xl border border-dashed border-base-100/20 bg-base-200/40 p-8 text-center"},_hoisted_2$b={class:"size-8 text-base-content/35",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},_hoisted_3$a=["d"],_hoisted_4$9={class:"text-sm font-bold"},_hoisted_5$8={class:"text-xs text-base-content/50"},_hoisted_6$6={key:0,class:"mt-1 text-[11px] leading-relaxed text-base-content/35"},_hoisted_7$6={key:1,class:"mt-2 flex flex-wrap items-center justify-center gap-2"},_sfc_main$c={__name:"EmptyState",props:{icon:{type:String,default:"empty"},title:{type:String,default:""},subtitle:{type:String,default:""},flavor:{type:String,default:""}},setup(ee){const te=ee,ne={empty:["M3 14h4l1.5 2.5h7L17 14h4","M5 5.5 3 14v3.5A1.5 1.5 0 0 0 4.5 19h15a1.5 1.5 0 0 0 1.5-1.5V14l-2-8.5A1.5 1.5 0 0 0 17.5 4h-11A1.5 1.5 0 0 0 5 5.5Z"],ledger:["M6 3h9l4 4v12.5a1.5 1.5 0 0 1-2.17 1.35L15 20l-1.83.85a1.5 1.5 0 0 1-1.34 0L10 20l-1.83.85A1.5 1.5 0 0 1 6 19.5Z","M14 3v4h5","M9 10h7","M9 14h5"],locked:["M6 11h12a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1Z","M8.5 11V8a3.5 3.5 0 0 1 7 0v3","M12 15v2"],sparkle:["M12 3.5l1.7 4.3 4.3 1.7-4.3 1.7L12 15.5l-1.7-4.3L6 9.5l4.3-1.7Z","M18 15.5l.85 2.15L21 18.5l-2.15.85L18 21.5l-.85-2.15L15 18.5l2.15-.85Z"]},ae=()=>ne[te.icon]||ne.empty;return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$b,[e$b.renderSlot(re.$slots,"icon",{},()=>[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$b,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae(),ie=>(e$b.openBlock(),e$b.createElementBlock("path",{key:ie,d:ie},null,8,_hoisted_3$a))),128))]))]),e$b.createElementVNode("p",_hoisted_4$9,e$b.toDisplayString(ee.title),1),e$b.createElementVNode("p",_hoisted_5$8,[e$b.renderSlot(re.$slots,"default",{},()=>[e$b.createTextVNode(e$b.toDisplayString(ee.subtitle),1)])]),ee.flavor?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_6$6,e$b.toDisplayString(ee.flavor),1)):e$b.createCommentVNode("",!0),re.$slots.actions?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_7$6,[e$b.renderSlot(re.$slots,"actions")])):e$b.createCommentVNode("",!0)]))}},_hoisted_1$a=["role","aria-label"],_hoisted_2$a=["role","aria-selected","aria-pressed","onClick"],_hoisted_3$9={key:0,class:"size-4 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24","aria-hidden":"true"},_hoisted_4$8=["d"],_hoisted_5$7={key:1,class:"ml-1 tabular-nums opacity-70"},_sfc_main$b={__name:"PillTabs",props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},ariaLabel:{type:String,default:""},layout:{type:String,default:"grid"},size:{type:String,default:"sm"},tone:{type:String,default:"primary",validator:ee=>["primary","neutral"].includes(ee)},role:{type:String,default:"tablist",validator:ee=>["tablist","buttons"].includes(ee)},icon:{type:Boolean,default:!1},wrap:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(ee){const te=ee,ne=e$b.computed(()=>te.role==="tablist"),ae=e$b.computed(()=>te.layout==="row"?null:{gridTemplateColumns:`repeat(${te.options.length}, minmax(0, 1fr))`});return(re,oe)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["pill-tabs rounded-xl p-0.5",[ee.layout==="row"?"inline-flex gap-1":"pill-tabs--fluid grid gap-1",ee.wrap?"flex-wrap":""]]),style:e$b.normalizeStyle(ae.value),role:ne.value?"tablist":void 0,"aria-label":ee.ariaLabel||void 0},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ee.options,ie=>(e$b.openBlock(),e$b.createElementBlock("button",{key:ie.key,type:"button",role:ne.value?"tab":void 0,"aria-selected":ne.value?ee.modelValue===ie.key:void 0,"aria-pressed":ne.value?void 0:ee.modelValue===ie.key,class:e$b.normalizeClass(["pill-tabs__tab min-w-0 whitespace-nowrap rounded-lg font-semibold transition-all duration-200",ee.icon?"inline-flex items-center gap-2":"",ee.size==="md"?"pill-tabs__tab--md px-3.5 py-2 text-sm active:scale-95":"p-2 text-xs",ee.modelValue===ie.key?ee.tone==="neutral"?"pill-tabs__tab--active pill-tabs__tab--neutral text-base-content":"pill-tabs__tab--active pill-tabs__tab--primary text-primary-content":"text-base-content/80 hover:text-base-content"]),onClick:le=>re.$emit("update:modelValue",ie.key)},[ee.icon&&ie.icon?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_3$9,[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:ie.icon},null,8,_hoisted_4$8)])):e$b.createCommentVNode("",!0),e$b.createTextVNode(" "+e$b.toDisplayString(ie.label)+" ",1),ie.count!=null?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_5$7,e$b.toDisplayString(ie.count),1)):e$b.createCommentVNode("",!0)],10,_hoisted_2$a))),128))],14,_hoisted_1$a))}},PillTabs=_export_sfc$1(_sfc_main$b,[["__scopeId","data-v-b615d6ed"]]),FLAVOR={loading:["Ninguém compra moldura aqui. Só conquista.","A temporada leva os pontos. Seu nível fica.","Tudo que brilha no seu avatar foi merecido.","O placar reinicia. Sua coleção não.","Todo ponto tem origem — e ela está no extrato.","Título não se herda. Se ganha.","A disputa é dentro do seu departamento.","Você veste o que quiser — do que já é seu."],"collection-empty":["Vitrine vazia. Por enquanto.","Aqui só entra o que você arrancou.","O primeiro item é sempre o mais difícil.","Nada aqui se compra. Nada aqui se perde."],"achievements-empty":["Nenhuma no bolso. Todas ainda em jogo.","Cada card diz como cair. Escolha um alvo.","As secretas não avisam. Elas caem.","Ninguém começa com a estante cheia."],"ledger-empty":["Nada lançado ainda. O placar começa limpo.","Cada ponto vai aparecer aqui com nome e origem.","Estorno não some do extrato: vira linha nova.","O que o gestor ajusta também passa por aqui."]},cursors=new Map,FLAVOR_CONTEXTS=Object.keys(FLAVOR);function pickFlavor(ee,te){const ne=FLAVOR[ee];if(!(ne!=null&&ne.length))return"";if(Number.isFinite(te))return ne[(te%ne.length+ne.length)%ne.length];const ae=(cursors.get(ee)??-1)+1;return cursors.set(ee,ae),ne[ae%ne.length]}const _hoisted_1$9={class:"cosmetic-grid flex min-h-0 flex-col gap-3"},_hoisted_2$9={key:0,class:"flex shrink-0 flex-wrap items-center gap-2.5"},_hoisted_3$8={key:0,class:"flex h-11 min-w-48 flex-1 items-center gap-2.5 rounded-lg border border-base-200 bg-base-200 px-3 transition-colors focus-within:border-primary/60 focus-within:ring-2 focus-within:ring-primary/15"},_hoisted_4$7=["aria-label"],_hoisted_5$6={key:1,class:"flex min-h-56 flex-1 items-center justify-center py-10","aria-busy":"true"},_hoisted_6$5={key:0,class:"flex items-center gap-2"},_hoisted_7$5={class:"text-[11px] tabular-nums leading-none text-base-content/60"},_sfc_main$a={__name:"CosmeticGrid",props:{items:{type:Array,required:!0},kind:{type:String,default:null},attendantName:{type:String,default:""},density:{type:String,default:"comfortable"},layout:{type:String,default:null},loading:{type:Boolean,default:!1},selectedId:{type:[String,Number],default:null},busyId:{type:[String,Number],default:null},deniedId:{type:[String,Number],default:null},selectedLabel:{type:String,default:"Equipado"},searchable:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},groupByRarity:{type:Boolean,default:!1},cascade:{type:Boolean,default:!1},noun:{type:String,default:"item"},scroll:{type:Boolean,default:!1}},emits:["select"],setup(ee,{emit:te}){const ne=ee,ae=te,re=[{key:"all",label:"Todos"},{key:"unlocked",label:"Desbloqueados"},{key:"locked",label:"Bloqueados"}],oe=e$b.ref("all"),ie=e$b.ref(""),le=e$b.computed(()=>(ne.layout||(ce()==="title"?"plaques":"tiles"))==="plaques"?"smplay-grid-3":"smplay-grid-tiles");function ce(){var $e;return ne.kind||(($e=ne.items[0])==null?void 0:$e.type)||null}const de=e$b.computed(()=>{const $e=ne.items.length,ye=ne.items.filter(Se=>Se.unlocked).length,Ee={all:$e,unlocked:ye,locked:$e-ye};return re.map(Se=>({...Se,count:Ee[Se.key]}))});function ue($e){return String($e||"").normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase()}const be=e$b.computed(()=>{let $e=ne.items;if(ne.filterable&&oe.value!=="all"){const Ee=oe.value==="unlocked";$e=$e.filter(Se=>!!Se.unlocked===Ee)}const ye=ue(ie.value.trim());return!ne.searchable||!ye?$e:$e.filter(Ee=>ue(Ee.name).includes(ye)||ue(Ee.requirementLabel).includes(ye))}),fe=Object.values(RARITIES).sort(($e,ye)=>$e.order-ye.order).map($e=>$e.key),ge=e$b.computed(()=>{const $e=be.value;if(!ne.groupByRarity)return $e.length?[{key:"all",meta:null,offset:0,items:$e}]:[];const ye=[];let Ee=0;for(const Se of fe){const Le=$e.filter(Ae=>Ae.rarity===Se);Le.length&&(ye.push({key:Se,meta:RARITIES[Se],offset:Ee,items:Le}),Ee+=Le.length)}return ye});function me($e,ye){return ne.cascade?Math.min(($e.offset+ye)*30,300):0}const pe=pickFlavor("loading"),ke=pickFlavor("collection-empty"),ve=e$b.computed(()=>ie.value||oe.value!=="all"?"":ke),_e=e$b.computed(()=>ie.value?`Nada encontrado para "${ie.value}".`:`Nenhum ${ne.noun} encontrado neste filtro.`);return($e,ye)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$9,[!ee.loading&&(ee.searchable||ee.filterable||$e.$slots["toolbar-end"])?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2$9,[ee.searchable?(e$b.openBlock(),e$b.createElementBlock("label",_hoisted_3$8,[ye[2]||(ye[2]=e$b.createElementVNode("svg",{class:"size-4 shrink-0 text-base-content/55",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round",d:"m21 21-4.3-4.3M17 10.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0Z"})],-1)),e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":ye[0]||(ye[0]=Ee=>ie.value=Ee),type:"search",placeholder:"Buscar",class:"w-full appearance-none border-0 bg-transparent p-0 text-sm font-normal text-base-content placeholder:text-base-content/55 focus:outline-none focus:ring-0 [&::-webkit-search-cancel-button]:appearance-none","aria-label":`Buscar ${ee.noun}`},null,8,_hoisted_4$7),[[e$b.vModelText,ie.value]])])):e$b.createCommentVNode("",!0),ee.filterable?(e$b.openBlock(),e$b.createBlock(PillTabs,{key:1,modelValue:oe.value,"onUpdate:modelValue":ye[1]||(ye[1]=Ee=>oe.value=Ee),options:de.value,layout:"row",size:"sm",tone:"neutral","aria-label":`Filtro de ${ee.noun}s`},null,8,["modelValue","options","aria-label"])):e$b.createCommentVNode("",!0),e$b.renderSlot($e.$slots,"toolbar-end",{},void 0,!0)])):e$b.createCommentVNode("",!0),ee.loading?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5$6,[e$b.createVNode(PixelLoader,{size:"lg",label:"Carregando",flavor:e$b.unref(pe)},null,8,["flavor"])])):ge.value.length?(e$b.openBlock(),e$b.createElementBlock("div",{key:2,class:e$b.normalizeClass(["min-h-0 flex-1 space-y-3",ee.scroll?"overflow-y-auto":""])},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ge.value,Ee=>(e$b.openBlock(),e$b.createElementBlock("section",{key:Ee.key,class:"cosmetic-group space-y-2"},[Ee.meta?(e$b.openBlock(),e$b.createElementBlock("header",_hoisted_6$5,[e$b.createElementVNode("span",{class:e$b.normalizeClass([Ee.meta.chip,"inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-bold uppercase leading-tight tracking-wide"])},e$b.toDisplayString(Ee.meta.label),3),e$b.createElementVNode("span",_hoisted_7$5,e$b.toDisplayString(Ee.items.length),1),ye[3]||(ye[3]=e$b.createElementVNode("span",{class:"h-px flex-1 bg-base-100","aria-hidden":"true"},null,-1))])):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",{class:e$b.normalizeClass(["gap-3",le.value])},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(Ee.items,(Se,Le)=>(e$b.openBlock(),e$b.createBlock(CosmeticCard,{key:Se.id,item:Se,kind:ee.kind||Se.type,"attendant-name":ee.attendantName,density:ee.density,caption:Se.requirementLabel,locked:!Se.unlocked,selected:ee.selectedId===Se.id,"selected-label":ee.selectedLabel,busy:ee.busyId===Se.id,denied:ee.deniedId===Se.id,"enter-delay":me(Ee,Le),mode:"attendant","hover-requirements":"",requirement:Se.requirementDetail,"unlocked-at":Se.unlocked_at,onSelect:Ae=>ae("select",Se)},null,8,["item","kind","attendant-name","density","caption","locked","selected","selected-label","busy","denied","enter-delay","requirement","unlocked-at","onSelect"]))),128))],2)]))),128))],2)):(e$b.openBlock(),e$b.createBlock(_sfc_main$c,{key:3,icon:"sparkle",title:"Nada por aqui ainda",subtitle:_e.value,flavor:ve.value},null,8,["subtitle","flavor"]))]))}},CosmeticGrid=_export_sfc$1(_sfc_main$a,[["__scopeId","data-v-c6a4dca5"]]),BREAKDOWN_RULES=[{id:"chat_finished",label:"Atendimentos",eventLabel:"Atendimento finalizado",kind:"points",icon:"M9 12l2 2 4-4m6 2a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",filledIcon:"M9.55 17.45 4.1 12l1.4-1.4 4.05 4.05L18.5 5.7l1.4 1.4-10.35 10.35Z"},{id:"chat_grade",label:"Boa avaliação",eventLabel:"Boa avaliação",kind:"points",icon:"M11.48 3.5l2.02 4.1 4.52.66-3.27 3.19.77 4.5-4.04-2.13-4.04 2.13.77-4.5-3.27-3.19 4.52-.66 2.02-4.1z",filledIcon:"M13.85 4.22c-.68-1.63-3.02-1.63-3.7 0L8.4 8.39l-4.55.36c-1.78.14-2.5 2.33-1.15 3.48l3.47 2.93-1.06 4.39c-.41 1.72 1.47 3.07 2.99 2.15L12 19.35l3.9 2.35c1.52.92 3.4-.43 2.99-2.15l-1.06-4.39 3.47-2.93c1.35-1.15.63-3.34-1.15-3.48l-4.55-.36-1.75-4.17Z",negative:{label:"Nota baixa",eventLabel:"Nota baixa",kind:"deduction",icon:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-3.6-5.4a4.5 4.5 0 0 1 7.2 0M9 10h.01M15 10h.01",filledIcon:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20ZM8.5 8.5a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm7 0a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm1.08 8.25a1 1 0 0 1-1.4-.17A4.03 4.03 0 0 0 12 15a4.03 4.03 0 0 0-3.18 1.58 1 1 0 1 1-1.57-1.24A6.03 6.03 0 0 1 12 13a6.03 6.03 0 0 1 4.75 2.34 1 1 0 0 1-.17 1.41Z"}},{id:"chat_attending_time",label:"Resolução rápida",eventLabel:"Resolução rápida",kind:"points",icon:"M13 2 4.5 13H11l-1 9 8.5-11H12l1-9Z",filledIcon:"M13 2 4.5 13H11l-1 9 8.5-11H12l1-9Z"},{id:"chat_waiting_time",label:"Fila",eventLabel:"Fila curta",kind:"points",icon:"M12 8v4l3 2m6-2a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",filledIcon:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1 6v3.59l2.7 2.7a1 1 0 0 1-1.4 1.42l-3-3A1 1 0 0 1 11 12V8a1 1 0 1 1 2 0Z",negative:{label:"Fila longa",eventLabel:"Fila longa",kind:"deduction",icon:"M6 3h12M6 21h12M8 3v3.5a4 4 0 0 0 1.6 3.2L12 12l-2.4 2.3A4 4 0 0 0 8 17.5V21m8-18v3.5a4 4 0 0 1-1.6 3.2L12 12l2.4 2.3a4 4 0 0 1 1.6 3.2V21",filledIcon:"M6 2a1 1 0 0 0 0 2h1v2.5a5 5 0 0 0 2 4L10.67 12 9 13.5a5 5 0 0 0-2 4V20H6a1 1 0 1 0 0 2h12a1 1 0 1 0 0-2h-1v-2.5a5 5 0 0 0-2-4L13.33 12 15 10.5a5 5 0 0 0 2-4V4h1a1 1 0 1 0 0-2H6Zm3 2h6v2.5a3 3 0 0 1-1.2 2.4L12 10.5l-1.8-1.6A3 3 0 0 1 9 6.5V4Zm3 9.5 1.8 1.6a3 3 0 0 1 1.2 2.4V20H9v-2.5a3 3 0 0 1 1.2-2.4l1.8-1.6Z"}},{id:"chat_flow",label:"Atendimento proativo",eventLabel:"Atendimento proativo",kind:"points",icon:"M3 17l6-6 4 4 8-8m0 0h-5m5 0v5",filledIcon:"M20 5h-5a1 1 0 1 0 0 2h2.59L13 11.59l-3.29-3.3a1 1 0 0 0-1.42 0l-6 6a1 1 0 1 0 1.42 1.42L9 10.41l3.29 3.3a1 1 0 0 0 1.42 0L19 8.41V11a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1Z"},{id:"daily_cap",label:"Teto diário",eventLabel:"Teto diário atingido",kind:"cap",icon:"M12 3l8 3v6c0 4-3 7-8 9-5-2-8-5-8-9V6l8-3zM12 8v4m0 3h.01",filledIcon:"M12 2.1 4 5v6.1c0 4.6 3.4 8.4 8 9.8 4.6-1.4 8-5.2 8-9.8V5l-8-2.9Zm-1 4.9h2v6.2h-2V7Zm1 8a1.2 1.2 0 0 1 0 2.4 1.2 1.2 0 0 1 0-2.4Z"},{id:"penalty",label:"Punições",eventLabel:"Punição",kind:"penalty",icon:"M12 3.2 4.6 6v2.4c0 4.9 3 8.9 7.4 10.4 4.4-1.5 7.4-5.5 7.4-10.4V6L12 3.2ZM12 8.2v3.9m0 3h.01",filledIcon:"M11.48 2.6a.75.75 0 0 1 1.04 0 12.7 12.7 0 0 0 8.1 3.55c.4.03.71.35.72.75.02.5.02 1 .02 1.45 0 5.79-3.6 10.73-8.68 12.72a1.9 1.9 0 0 1-1.36 0C6.24 19.08 2.64 14.14 2.64 8.35c0-.45 0-.95.02-1.45.01-.4.32-.72.72-.75a12.7 12.7 0 0 0 8.1-3.55Zm.52 4.65a.95.95 0 0 0-.95 1l.22 4a.73.73 0 0 0 1.46 0l.22-4a.95.95 0 0 0-.95-1Zm0 8a1.1 1.1 0 1 0 0 2.2 1.1 1.1 0 0 0 0-2.2Z"},{id:"achievement",label:"Conquistas",eventLabel:"Conquista desbloqueada",kind:"achievement",icon:"M7 4h10v4a5 5 0 0 1-10 0V4Zm0 1H4v2a4 4 0 0 0 4 4m9-6h3v2a4 4 0 0 1-4 4M9 19h6M12 13v6",filledIcon:"M18 3V2H6v1H2v3a5 5 0 0 0 4.1 4.9A6 6 0 0 0 11 14.9V18H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-3.1A6 6 0 0 0 17.9 11 5 5 0 0 0 22 6V3h-4ZM4 6V5h2v3.8A3 3 0 0 1 4 6Zm16 0a3 3 0 0 1-2 2.8V5h2v1Z"},{id:"reverse",label:"Estornos",eventLabel:"Estorno",kind:"reversal",icon:"M9 14 4 9l5-5M4 9h9a7 7 0 0 1 0 14h-3",filledIcon:"M8.7 3.3a1 1 0 0 1 0 1.4L6.41 7H13a7.5 7.5 0 0 1 0 15h-2a1 1 0 1 1 0-2h2a5.5 5.5 0 0 0 0-11H6.41l2.3 2.3a1 1 0 1 1-1.42 1.4l-4-4a1 1 0 0 1 0-1.4l4-4a1 1 0 0 1 1.42 0Z"}],BREAKDOWN_RULE=BREAKDOWN_RULES.reduce((ee,te)=>(ee[te.id]=te,ee),{}),BREAKDOWN_RULE_IDS=BREAKDOWN_RULES.map(ee=>ee.id),BREAKDOWN_RULES_WITH_NEGATIVE=BREAKDOWN_RULES.filter(ee=>ee.negative).map(ee=>ee.id);function breakdownRuleFor(ee,te){const ne=BREAKDOWN_RULE[ee];return!(ne!=null&&ne.negative)||!(Number(te)<0)?ne:{...ne,...ne.negative}}const _hoisted_1$8=["aria-label"],_hoisted_2$8={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},_hoisted_3$7=["d"],_sfc_main$9={__name:"RuleBadge",props:{rule:{type:String,required:!0},size:{type:String,default:"md"},tone:{type:String,default:"primary"},negative:{type:Boolean,default:!1}},setup(ee){const te=ee,ne=e$b.computed(()=>breakdownRuleFor(te.rule,te.negative?-1:0)),ae=e$b.computed(()=>{var oe;return((oe=ne.value)==null?void 0:oe.icon)||""}),re=e$b.computed(()=>{var oe;return((oe=ne.value)==null?void 0:oe.label)||te.rule});return(oe,ie)=>(e$b.openBlock(),e$b.createElementBlock("span",{class:e$b.normalizeClass(["rule-badge",[`rule-badge-${ee.size}`,`rule-badge-${ee.tone}`]]),role:"img","aria-label":re.value},[(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_2$8,[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:ae.value},null,8,_hoisted_3$7)]))],10,_hoisted_1$8))}},RuleBadge=_export_sfc$1(_sfc_main$9,[["__scopeId","data-v-210e017d"]]),_hoisted_1$7={viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},_hoisted_2$7=["d"],_sfc_main$8={__name:"RuleIcon",props:{rule:{type:String,required:!0},negative:{type:Boolean,default:!1}},setup(ee){const te=ee,ne=e$b.computed(()=>breakdownRuleFor(te.rule,te.negative?-1:0));return(ae,re)=>{var oe,ie;return e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_1$7,[e$b.createElementVNode("path",{d:((oe=ne.value)==null?void 0:oe.filledIcon)||((ie=ne.value)==null?void 0:ie.icon)||""},null,8,_hoisted_2$7)])}}};function ledgerEntryDetails(ee={}){return Array.isArray(ee==null?void 0:ee.details)?ee.details.map(te=>({...te,rule:te==null?void 0:te.name,points:Number(te==null?void 0:te.point)||0})).filter(te=>!!te.rule):[]}function ledgerEntryReversed(ee={}){return!!(ee!=null&&ee.reversed)}function ledgerEntryReversal(ee={}){return!!(ee!=null&&ee.is_reversal)}function ledgerEntryKind(ee,te){var ne;return((ne=breakdownRuleFor(ee,te))==null?void 0:ne.kind)??"points"}function ledgerEntryXp(ee){const te=ledgerEntryDetails(ee);return te.length?te.reduce((ne,ae)=>ledgerEntryKind(ae.rule,ae.points)==="cap"?ne:ne+(ae.points>0?ae.points:0),0):0}function formatLedgerValue(ee,te){if(te==null)return"";switch(ee){case"chat_attending_time":return`${te} min`;case"chat_waiting_time":return`cliente esperou ${te} min`;case"chat_grade":return`nota ${te}`;case"chat_flow":return`×${Number(te).toLocaleString("pt-BR")}`;default:return""}}function rollupLedgerByRule(ee=[]){var ne;const te=new Map;for(const ae of ee)for(const re of ledgerEntryDetails(ae)){const{rule:oe,points:ie}=re;if(ledgerEntryKind(oe,ie)==="cap")continue;const le=ie<0&&!!((ne=BREAKDOWN_RULE[oe])!=null&&ne.negative),ce=le?`${oe}:negative`:oe;te.has(ce)||te.set(ce,{rule:oe,negative:le,count:0,points:0});const de=te.get(ce);de.count+=1,de.points+=ie}return[...te.values()]}const DAY_MS=864e5,dayFormatter=new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"short"});function ledgerDayKey(ee){const te=new Date(ee);return Number.isNaN(te.getTime())?0:new Date(te.getFullYear(),te.getMonth(),te.getDate()).getTime()}function ledgerDayLabel(ee,te=new Date){const ne=ledgerDayKey(te);return ee===ne?"Hoje":ee===ne-DAY_MS?"Ontem":dayFormatter.format(new Date(ee))}function ledgerRelativeTime(ee,te=new Date){const ne=new Date(ee);if(Number.isNaN(ne.getTime()))return"";const ae=Math.max(0,Math.round((new Date(te)-ne)/6e4));if(ae<1)return"agora";if(ae<60)return`há ${ae} min`;const re=Math.round(ae/60);return re<24?`há ${re} h`:`há ${Math.round(re/24)} d`}function groupLedgerByDay(ee=[],te=new Date){const ne=new Map;for(const ae of ee){const re=ledgerDayKey(ae==null?void 0:ae.created_at);ne.has(re)||ne.set(re,[]),ne.get(re).push(ae)}return[...ne.entries()].sort((ae,re)=>re[0]-ae[0]).map(([ae,re])=>({key:ae,label:ledgerDayLabel(ae,te),rows:re,points:re.reduce((oe,ie)=>oe+(Number(ie.points)||0),0)}))}function summarizeLedger(ee=[]){const te=ee.reduce((ne,ae)=>ne+(Number(ae.points)||0),0);return{points:te,xp:te}}const _hoisted_1$6={key:0,class:"sm-ledger-day"},_hoisted_2$6={class:"sm-ledger-rail"},_hoisted_3$6={class:"sm-ledger-day-head"},_hoisted_4$6={class:"sm-ledger-day-label"},_hoisted_5$5={class:"sm-ledger-rail"},_hoisted_6$4={class:"sm-ledger-main"},_hoisted_7$4=["aria-expanded","onClick"],_hoisted_8$3={class:"min-w-0 flex-1"},_hoisted_9$2={class:"sm-ledger-title"},_hoisted_10$2={class:"sm-ledger-sub"},_hoisted_11$2={key:0,class:"sm-ledger-tag"},_hoisted_12$1={key:1,class:"sm-ledger-meta"},_hoisted_13$1=["title"],_hoisted_14$1={class:"sm-ledger-side"},_hoisted_15$1={class:"sm-ledger-stamp"},_hoisted_16$1={key:0,class:"sm-ledger-actions"},_hoisted_17={key:0,class:"sm-ledger-detail"},_hoisted_18={class:"sm-ledger-detail-label"},_hoisted_19={class:"sm-ledger-more-spin"},_hoisted_20={key:0,class:"sm-ledger-more-count"},_hoisted_21={key:1},_sfc_main$7={__name:"LedgerTimeline",props:{entries:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},density:{type:String,default:"cozy",validator:ee=>["cozy","compact"].includes(ee)},hasMore:{type:Boolean,default:!1},loadMore:{type:Function,default:null},pageKey:{type:[String,Number],default:""},total:{type:Number,default:0},now:{type:[Date,Number,String],default:()=>new Date}},setup(ee){const te=ee,ne=e$b.computed(()=>new Date(te.now)),ae=e$b.computed(()=>groupLedgerByDay(te.entries,ne.value)),re=e$b.ref(new Set);function oe(me){const pe=new Set(re.value);pe.has(me)?pe.delete(me):pe.add(me),re.value=pe}const ie=me=>re.value.has(me);e$b.watch(()=>te.entries,()=>{re.value=new Set});function le(me){const pe=Number(me)||0;return`${pe>0?"+":""}${pe.toLocaleString("pt-BR")}`}function ce(me){return ledgerRelativeTime(me,ne.value)}function de(me){return Array.isArray(me.details)&&me.details.length?me.details:[{id:`${me.id}:0`,rule:me.rule,kind:me.kind,label:me.label||me.title,points:me.points}]}function ue(me){const pe=de(me);return pe.length>1?pe:[]}const be=me=>de(me)[0],fe=e$b.computed(()=>`${te.pageKey}:${te.entries.length}`);async function ge(me){if(te.loading||!te.loadMore)return me.loaded();if(!te.hasMore)return me.complete();try{await te.loadMore()}catch{return me.error()}te.hasMore?me.loaded():me.complete()}return(me,pe)=>(e$b.openBlock(),e$b.createElementBlock("div",{class:e$b.normalizeClass(["sm-ledger",`sm-ledger--${ee.density}`])},[ee.loading?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$6,[pe[1]||(pe[1]=e$b.createElementVNode("div",{class:"sm-ledger-day-head"},[e$b.createElementVNode("span",{class:"sm-ledger-day-marker"}),e$b.createElementVNode("span",{class:"sm-ledger-skeleton h-3 w-20"}),e$b.createElementVNode("span",{class:"sm-ledger-day-line"})],-1)),e$b.createElementVNode("div",_hoisted_2$6,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(4,ke=>e$b.createElementVNode("div",{key:ke,class:"sm-ledger-row"},[...pe[0]||(pe[0]=[e$b.createStaticVNode('<span class="sm-ledger-node sm-ledger-node--ghost" data-v-71053be6></span><div class="sm-ledger-main" data-v-71053be6><div class="min-w-0 flex-1 space-y-1.5" data-v-71053be6><span class="sm-ledger-skeleton h-3 w-2/3" data-v-71053be6></span><span class="sm-ledger-skeleton h-2.5 w-1/3" data-v-71053be6></span></div><span class="sm-ledger-skeleton h-5 w-12 shrink-0" data-v-71053be6></span></div>',2)])])),64))])])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ae.value,ke=>(e$b.openBlock(),e$b.createElementBlock("section",{key:ke.key,class:"sm-ledger-day","aria-label":"Lançamentos do dia"},[e$b.createElementVNode("header",_hoisted_3$6,[pe[2]||(pe[2]=e$b.createElementVNode("span",{class:"sm-ledger-day-marker","aria-hidden":"true"},null,-1)),e$b.createElementVNode("h3",_hoisted_4$6,e$b.toDisplayString(ke.label),1),pe[3]||(pe[3]=e$b.createElementVNode("span",{class:"sm-ledger-day-line","aria-hidden":"true"},null,-1)),ke.points?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["sm-ledger-day-total",ke.points<0?"is-negative":""])},e$b.toDisplayString(le(ke.points))+" pts ",3)):e$b.createCommentVNode("",!0)]),e$b.createElementVNode("ol",_hoisted_5$5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ke.rows,ve=>(e$b.openBlock(),e$b.createElementBlock("li",{key:ve.id,class:e$b.normalizeClass(["sm-ledger-row",[`is-${ve.kind||"points"}`,ve.reversed?"is-reversed":"",ie(ve.id)?"is-open":""]])},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["sm-ledger-node",`is-${ve.kind||"points"}`]),"aria-hidden":"true"},[e$b.createVNode(_sfc_main$8,{rule:be(ve).rule,negative:be(ve).points<0},null,8,["rule","negative"])],2),e$b.createElementVNode("div",_hoisted_6$4,[e$b.createElementVNode("button",{type:"button",class:"sm-ledger-hit","aria-expanded":ie(ve.id),onClick:_e=>oe(ve.id)},[e$b.createElementVNode("span",_hoisted_8$3,[e$b.createElementVNode("span",_hoisted_9$2,e$b.toDisplayString(ve.title),1),e$b.createElementVNode("span",_hoisted_10$2,[ve.reversed?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_11$2," estornado ")):e$b.createCommentVNode("",!0),ve.subtitle?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_12$1,e$b.toDisplayString(ve.subtitle),1)):e$b.createCommentVNode("",!0),(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ue(ve),_e=>(e$b.openBlock(),e$b.createElementBlock("span",{key:_e.id,class:e$b.normalizeClass(["sm-ledger-chip",_e.points<0?"is-negative":""]),title:_e.label},[e$b.createVNode(_sfc_main$8,{rule:_e.rule,negative:_e.points<0},null,8,["rule","negative"]),e$b.createTextVNode(" "+e$b.toDisplayString(le(_e.points)),1)],10,_hoisted_13$1))),128))])]),e$b.createElementVNode("span",_hoisted_14$1,[e$b.createElementVNode("span",{class:e$b.normalizeClass(["sm-ledger-amount",[ve.points<0?"is-negative":"",ve.points?"":"is-neutral"]])},[e$b.createTextVNode(e$b.toDisplayString(ve.points?le(ve.points):"0")+" ",1),pe[4]||(pe[4]=e$b.createElementVNode("small",null,"pts",-1))],2),e$b.createElementVNode("span",_hoisted_15$1,e$b.toDisplayString(ce(ve.created_at)),1)]),pe[5]||(pe[5]=e$b.createElementVNode("svg",{class:"sm-ledger-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6 9 6 6 6-6"})],-1))],8,_hoisted_7$4),me.$slots.actions?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_16$1,[e$b.renderSlot(me.$slots,"actions",{entry:ve},void 0,!0)])):e$b.createCommentVNode("",!0)]),ie(ve.id)?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_17,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(de(ve),_e=>(e$b.openBlock(),e$b.createElementBlock("div",{key:_e.id,class:"sm-ledger-detail-row"},[e$b.createElementVNode("span",{class:e$b.normalizeClass(["sm-ledger-detail-icon",_e.points<0?"is-negative":""])},[e$b.createVNode(_sfc_main$8,{rule:_e.rule,negative:_e.points<0},null,8,["rule","negative"])],2),e$b.createElementVNode("span",_hoisted_18,e$b.toDisplayString(_e.label),1),_e.points?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,class:e$b.normalizeClass(["sm-ledger-detail-points",_e.points<0?"is-negative":""])},e$b.toDisplayString(le(_e.points)),3)):e$b.createCommentVNode("",!0)]))),128))])):e$b.createCommentVNode("",!0)],2))),128))])]))),128)),ee.loadMore?(e$b.openBlock(),e$b.createBlock(e$b.unref(Y$1),{key:0,class:"sm-ledger-more",identifier:fe.value,distance:120,onInfinite:ge},{spinner:e$b.withCtx(()=>[e$b.createElementVNode("span",_hoisted_19,[e$b.createVNode(Loader,{size:"xs",tone:"current"})])]),complete:e$b.withCtx(()=>[ee.total?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_20,e$b.toDisplayString(ee.entries.length)+" de "+e$b.toDisplayString(ee.total),1)):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_21))]),_:1},8,["identifier"])):e$b.createCommentVNode("",!0)],64))],2))}},LedgerTimeline=_export_sfc$1(_sfc_main$7,[["__scopeId","data-v-71053be6"]]),NON_CONFIGURABLE=new Set(["daily_cap","penalty","achievement","reverse"]),SCORING_RULE_IDS=BREAKDOWN_RULE_IDS.filter(ee=>!NON_CONFIGURABLE.has(ee)),SCORING_RULE_SHAPE={chat_finished:"flat",chat_grade:"bands",chat_attending_time:"bands",chat_waiting_time:"bands",chat_flow:"multiplier"},FLAT_FIELDS={chat_finished:{points:"base_points",threshold:null}},DEFAULT_FLAT_FIELDS={points:"points",threshold:null},BAND_ORDER={chat_grade:{valueKey:"grade",dir:"desc"},chat_attending_time:{valueKey:"limit",dir:"asc"},chat_waiting_time:{valueKey:"limit",dir:"asc"}},SCORING_NEGATIVE_RULE_IDS=SCORING_RULE_IDS.filter(ee=>{var te;return!!((te=BREAKDOWN_RULE[ee])!=null&&te.negative)});function acceptsNegativeBands(ee){var te;return!!((te=BREAKDOWN_RULE[ee])!=null&&te.negative)}function scoringBandOrder(ee,{negative:te=!1}={}){const ne=BAND_ORDER[ee];return ne?te?{valueKey:ne.valueKey,dir:ne.dir==="asc"?"desc":"asc"}:ne:null}function ruleRank(ee){const te=SCORING_RULE_IDS.indexOf(ee);return te===-1?SCORING_RULE_IDS.length:te}function resolveScoringRules(ee){return{...(ee==null?void 0:ee.rules)??{},...(ee==null?void 0:ee.overrides)??{}}}function scoringOverriddenRuleIds(ee){const te=(ee==null?void 0:ee.overrides)??{};return SCORING_RULE_IDS.filter(ne=>!!te[ne])}function ruleTiers(ee,te,ne){if(!(te!=null&&te.enabled))return[];const ae=SCORING_RULE_SHAPE[ee]??"flat";if(ae==="multiplier")return[];if(ae==="flat"){const ie=FLAT_FIELDS[ee]??DEFAULT_FLAT_FIELDS,le=Number(te[ie.points])||0;if(ne||le<0)return[];const ce=ie.threshold?Number(te[ie.threshold]):NaN;return[{value:Number.isFinite(ce)?ce:null,points:le}]}const re=scoringBandOrder(ee,{negative:ne}),oe=(Array.isArray(te.bands)?te.bands:[]).map(ie=>({value:Number(ie==null?void 0:ie[re==null?void 0:re.valueKey]),points:Number(ie==null?void 0:ie.points)||0})).filter(ie=>Number.isFinite(ie.value)&&(ne?ie.points<0:ie.points>0));return re?oe.sort((ie,le)=>re.dir==="asc"?ie.value-le.value:le.value-ie.value):oe}function scoringRuleTiers(ee,te){return ruleTiers(ee,te,!1)}function scoringRuleNegativeTiers(ee,te){return ruleTiers(ee,te,!0)}function scoringRuleBestPoints(ee,te){return scoringRuleTiers(ee,te).reduce((ne,ae)=>Math.max(ne,ae.points),0)}function scoringRuleWorstPoints(ee,te){return scoringRuleNegativeTiers(ee,te).reduce((ne,ae)=>Math.min(ne,ae.points),0)}function scoringRuleMultiplier(ee){const te=Number(ee==null?void 0:ee.multiplier);return ee!=null&&ee.enabled&&Number.isFinite(te)&&te>0?te:1}function scoringMaxPerChat(ee={}){const te=[];let ne=0;for(const re of Object.keys(ee)){if(SCORING_RULE_SHAPE[re]==="multiplier")continue;const oe=scoringRuleBestPoints(re,ee[re]);oe&&(te.push({rule:re,points:oe}),ne+=oe)}const ae=scoringRuleMultiplier(ee.chat_flow);return{base:ne,multiplier:ae,total:Math.round(ne*ae),contributions:te.map(re=>({...re,share:ne?re.points/ne:0})).sort((re,oe)=>oe.points-re.points||ruleRank(re.rule)-ruleRank(oe.rule))}}function scoringMaxDeductionPerChat(ee={}){const te=[];let ne=0;for(const ae of Object.keys(ee)){const re=scoringRuleWorstPoints(ae,ee[ae]);re&&(te.push({rule:ae,points:re}),ne+=re)}return{total:ne,contributions:te.sort((ae,re)=>ae.points-re.points||ruleRank(ae.rule)-ruleRank(re.rule))}}const _hoisted_1$5={class:"rounded-lg border border-base-100/20 bg-base-300"},_hoisted_2$5={class:"flex items-center justify-between gap-2 border-b border-base-100/15 px-3 py-2"},_hoisted_3$5={class:"text-xs font-bold uppercase tracking-wide text-base-content/50"},_hoisted_4$5={class:"divide-y divide-base-100/10"},_hoisted_5$4={class:"text-xs font-medium text-base-content/70"},_hoisted_6$3={class:"flex items-center gap-1.5 text-sm tabular-nums"},_hoisted_7$3={class:"font-bold text-base-content"},_hoisted_8$2={key:0,class:"rounded-md bg-warning/15 px-1.5 py-0.5 text-xs font-bold text-warning"},_sfc_main$6={__name:"ImpactPreview",props:{title:{type:String,required:!0},items:{type:Array,required:!0}},setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("section",_hoisted_1$5,[e$b.createElementVNode("p",_hoisted_2$5,[e$b.createElementVNode("span",_hoisted_3$5,e$b.toDisplayString(ee.title),1),e$b.renderSlot(te.$slots,"badge")]),e$b.createElementVNode("ul",_hoisted_4$5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ee.items,ae=>(e$b.openBlock(),e$b.createElementBlock("li",{key:ae.key,class:"flex items-center justify-between gap-3 px-3 py-2"},[e$b.createElementVNode("span",_hoisted_5$4,e$b.toDisplayString(ae.label),1),e$b.createElementVNode("span",_hoisted_6$3,[e$b.createElementVNode("span",{class:e$b.normalizeClass(ae.changed?"text-base-content/50 line-through":"font-bold text-base-content")},e$b.toDisplayString(ae.from),3),ae.changed?(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:0},[ne[0]||(ne[0]=e$b.createElementVNode("svg",{class:"size-3.5 shrink-0 text-warning",fill:"none",stroke:"currentColor","stroke-width":"2.5",viewBox:"0 0 24 24","aria-hidden":"true"},[e$b.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 12h14m0 0-5-5m5 5-5 5"})],-1)),e$b.createElementVNode("span",_hoisted_7$3,e$b.toDisplayString(ae.to),1),ae.note?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_8$2,e$b.toDisplayString(ae.note),1)):e$b.createCommentVNode("",!0)],64)):e$b.createCommentVNode("",!0)])]))),128))])]))}},_hoisted_1$4={class:"flex flex-col items-center gap-2 rounded-2xl border border-dashed border-base-100/20 bg-base-200/40 p-8 text-center",role:"alert"},_hoisted_2$4={class:"text-sm font-bold"},_hoisted_3$4={class:"text-xs text-base-content/50"},_hoisted_4$4=["disabled"],_sfc_main$5={__name:"LoadError",props:{title:{type:String,default:"Não foi possível carregar"},subtitle:{type:String,default:""},retryLabel:{type:String,default:"Tentar de novo"},retrying:{type:Boolean,default:!1}},emits:["retry"],setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$4,[e$b.renderSlot(te.$slots,"icon",{},()=>[ne[1]||(ne[1]=e$b.createElementVNode("svg",{class:"h-8 w-8 text-error",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e$b.createElementVNode("path",{d:"M12 3.8a8.2 8.2 0 1 1-5.8 2.4","stroke-dasharray":"3 3.2"}),e$b.createElementVNode("path",{d:"M12 8.5v4"}),e$b.createElementVNode("path",{d:"M12 16h.01"})],-1))]),e$b.createElementVNode("p",_hoisted_2$4,e$b.toDisplayString(ee.title),1),e$b.createElementVNode("p",_hoisted_3$4,[e$b.renderSlot(te.$slots,"default",{},()=>[e$b.createTextVNode(e$b.toDisplayString(ee.subtitle),1)])]),ee.retryLabel?(e$b.openBlock(),e$b.createElementBlock("button",{key:0,type:"button",class:"mt-1 inline-flex h-8 items-center gap-1.5 rounded-lg bg-primary px-3 text-xs font-bold text-primary-content transition hover:brightness-110 active:scale-95 disabled:pointer-events-none disabled:opacity-50",disabled:ee.retrying,onClick:ne[0]||(ne[0]=ae=>te.$emit("retry"))},[(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(["h-3.5 w-3.5",{"animate-spin":ee.retrying}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...ne[2]||(ne[2]=[e$b.createElementVNode("path",{d:"M20 11.5A8 8 0 1 0 18 17"},null,-1),e$b.createElementVNode("path",{d:"M20 5.5V12h-6"},null,-1)])],2)),e$b.createTextVNode(" "+e$b.toDisplayString(ee.retrying?"Tentando…":ee.retryLabel),1)],8,_hoisted_4$4)):e$b.createCommentVNode("",!0)]))}},_hoisted_1$3={class:"space-y-1.5"},_hoisted_2$3={class:"flex items-baseline justify-between gap-2"},_hoisted_3$3=["for"],_hoisted_4$3={key:0,class:"text-warning"},_hoisted_5$3={class:"text-xs tabular-nums text-base-content/50"},_hoisted_6$2=["id","value","maxlength","placeholder"],_hoisted_7$2={key:0,class:"pt-0.5 text-xs leading-relaxed text-base-content/50"},_sfc_main$4={__name:"ReasonField",props:{modelValue:{type:String,default:""},id:{type:String,required:!0},label:{type:String,default:"Motivo"},maxlength:{type:Number,default:140},placeholder:{type:String,default:""},hint:{type:String,default:""},required:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(ee){return(te,ne)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1$3,[e$b.createElementVNode("div",_hoisted_2$3,[e$b.createElementVNode("label",{for:ee.id,class:"text-xs font-medium text-base-content/70"},[e$b.createTextVNode(e$b.toDisplayString(ee.label)+" ",1),ee.required?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_4$3,"*")):e$b.createCommentVNode("",!0)],8,_hoisted_3$3),e$b.createElementVNode("span",_hoisted_5$3,e$b.toDisplayString(ee.modelValue.length)+"/"+e$b.toDisplayString(ee.maxlength),1)]),e$b.createElementVNode("textarea",{id:ee.id,value:ee.modelValue,rows:"2",maxlength:ee.maxlength,placeholder:ee.placeholder,class:"reason-field min-h-16 w-full resize-none rounded-lg border border-base-100/20 bg-base-300 px-3 py-2 text-sm font-medium leading-relaxed transition",onInput:ne[0]||(ne[0]=ae=>te.$emit("update:modelValue",ae.target.value))},null,40,_hoisted_6$2),ee.hint?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_7$2,e$b.toDisplayString(ee.hint),1)):e$b.createCommentVNode("",!0)]))}},ReasonField=_export_sfc$1(_sfc_main$4,[["__scopeId","data-v-4f5e8328"]]),_hoisted_1$2=["disabled"],_hoisted_2$2={class:"flex min-w-0 items-center gap-2"},_hoisted_3$2={class:"truncate"},_hoisted_4$2={class:"shrink-0 text-xs opacity-60"},_hoisted_5$2={key:0,class:"size-4 shrink-0 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},_hoisted_6$1={class:"relative p-2"},_hoisted_7$1={class:"scrollbar-none max-h-[224px] space-y-0.5 overflow-y-auto px-2 pb-2"},_hoisted_8$1={key:0,class:"tz-empty rounded-lg p-3 text-center text-sm opacity-60"},_hoisted_9$1=["onClick"],_hoisted_10$1={class:"truncate"},_hoisted_11$1={class:"shrink-0 text-xs opacity-60"},_sfc_main$3={__name:"TimezoneSelect",props:{modelValue:{type:String,default:"America/Sao_Paulo"},disabled:{type:Boolean,default:!1},saving:{type:Boolean,default:!1},bg:{type:String,default:"bg-base-200"},rounded:{type:String,default:"rounded-xl"},borderColor:{type:String,default:"border-transparent"}},emits:["update:modelValue","change"],setup(ee,{emit:te}){const ne=te,ae=["America/Araguaina","America/Bahia","America/Belem","America/Boa_Vista","America/Campo_Grande","America/Cuiaba","America/Eirunepe","America/Fortaleza","America/Maceio","America/Manaus","America/Noronha","America/Porto_Acre","America/Porto_Velho","America/Recife","America/Rio_Branco","America/Santarem","America/Sao_Paulo"];function re(me){const pe=[],ke=[];return me.forEach(ve=>(ae.includes(ve)?pe:ke).push(ve)),pe.sort(),ke.sort(),[...pe,...ke]}const oe=re((()=>{try{return Intl.supportedValuesOf("timeZone")}catch{return ae}})());function ie(me){try{const pe=new Date,ke=new Date(pe.toLocaleString("en-US",{timeZone:"UTC"})).getTime(),ve=new Date(pe.toLocaleString("en-US",{timeZone:me})).getTime(),_e=Math.round((ve-ke)/6e4),$e=_e>=0?"+":"-",ye=Math.abs(_e),Ee=Math.floor(ye/60),Se=ye%60;return`UTC ${$e}${Ee}:${String(Se).padStart(2,"0")}`}catch{return"UTC +0:00"}}function le(me){return String(me).replace(/_/g," ")}function ce(me){return String(me).normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[/_]/g," ").toLowerCase()}const de=e$b.ref(!1),ue=e$b.ref(""),be=e$b.ref(null),fe=e$b.computed(()=>{const me=ce(ue.value||"");return me?oe.filter(pe=>ce(pe).includes(me)):oe});function ge(me){ne("update:modelValue",me),ne("change",me),de.value=!1,ue.value=""}return onClickOutside(be,()=>{de.value=!1}),(me,pe)=>(e$b.openBlock(),e$b.createElementBlock("div",{ref_key:"target",ref:be,class:"relative w-full"},[e$b.createElementVNode("button",{type:"button",disabled:ee.disabled||ee.saving,onClick:pe[0]||(pe[0]=e$b.withModifiers(ke=>de.value=!de.value,["stop"])),class:e$b.normalizeClass([[ee.bg,ee.rounded,ee.borderColor],"tz-trigger flex w-full items-center justify-between gap-2 border px-4 text-sm outline-none transition-all disabled:cursor-not-allowed disabled:opacity-50"])},[e$b.createElementVNode("span",_hoisted_2$2,[e$b.createElementVNode("span",_hoisted_3$2,e$b.toDisplayString(le(ee.modelValue)),1),e$b.createElementVNode("span",_hoisted_4$2,"("+e$b.toDisplayString(ie(ee.modelValue))+")",1)]),ee.saving?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_5$2,[...pe[2]||(pe[2]=[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12h4Z"},null,-1)])])):(e$b.openBlock(),e$b.createElementBlock("svg",{key:1,class:e$b.normalizeClass([de.value?"rotate-180":"","size-4 shrink-0 opacity-60 transition-transform duration-200"]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...pe[3]||(pe[3]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.4 10.3A2 2 0 0 0 17 7H7a2 2 0 0 0-1.5 3.3l4.9 5.9a2 2 0 0 0 3 0l5-6Z","clip-rule":"evenodd"},null,-1)])],2))],10,_hoisted_1$2),e$b.createVNode(e$b.Transition,{name:"tz-fade"},{default:e$b.withCtx(()=>[de.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass([ee.rounded,"tz-dropdown absolute left-0 right-0 top-[calc(100%+4px)] z-30 border shadow-lg"])},[e$b.createElementVNode("div",_hoisted_6$1,[pe[4]||(pe[4]=e$b.createElementVNode("div",{class:"pointer-events-none absolute inset-y-0 left-5 flex items-center"},[e$b.createElementVNode("svg",{class:"size-4 opacity-50",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},[e$b.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"})])],-1)),e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":pe[1]||(pe[1]=ke=>ue.value=ke),type:"search",class:"tz-search w-full rounded-lg py-2 pl-10 pr-3 text-sm outline-none",placeholder:"Pesquise seu fuso horário..."},null,512),[[e$b.vModelText,ue.value]])]),e$b.createElementVNode("div",_hoisted_7$1,[fe.value.length?(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,{key:1},e$b.renderList(fe.value,(ke,ve)=>(e$b.openBlock(),e$b.createElementBlock("button",{key:ve,onClick:_e=>ge(ke),class:e$b.normalizeClass(["tz-option flex w-full items-center justify-between gap-2 rounded-lg px-3 py-2 text-sm transition-all",ke===ee.modelValue?"tz-option--active":""])},[e$b.createElementVNode("span",_hoisted_10$1,e$b.toDisplayString(le(ke)),1),e$b.createElementVNode("span",_hoisted_11$1,"("+e$b.toDisplayString(ie(ke))+")",1)],10,_hoisted_9$1))),128)):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8$1," Sem resultados "))])],2)):e$b.createCommentVNode("",!0)]),_:1})],512))}},TimezoneSelect=_export_sfc$1(_sfc_main$3,[["__scopeId","data-v-d686d01a"]]);function normalizeSmsListPayload(ee){return Array.isArray(ee==null?void 0:ee.results)?ee.results:Array.isArray(ee)?ee:[]}function getSmsPoolCredits(ee){return Number((ee==null?void 0:ee.balance)??(ee==null?void 0:ee.effective_available_credits)??(ee==null?void 0:ee.credits)??0)}function getSmsValidContacts(ee){return(ee==null?void 0:ee.valid_contacts)??(ee==null?void 0:ee.valid)??[]}function getSmsInvalidContacts(ee){return(ee==null?void 0:ee.invalid_contacts)??(ee==null?void 0:ee.invalid)??[]}function getSmsContactName(ee){var te;return(ee==null?void 0:ee.name)??((te=ee==null?void 0:ee.contact)==null?void 0:te.name)??"-"}function getSmsContactPhone(ee){var te;return(ee==null?void 0:ee.telephone)??(ee==null?void 0:ee.phone)??(ee==null?void 0:ee.number)??((te=ee==null?void 0:ee.contact)==null?void 0:te.telephone)??"-"}function getSmsCreditsToConsume(ee){return Number((ee==null?void 0:ee.credits_to_consume)??(ee==null?void 0:ee.credits)??getSmsValidContacts(ee).length)}async function listSmsPools({url:ee=smsPoolUrl}={}){const{data:te}=await api.get(ee);return normalizeSmsListPayload(te)}async function listSmsPoolsPaginated({page:ee=1,search:te="",pageSize:ne=20,url:ae=smsPoolUrl}={}){const re={page:ee,page_size:ne};te&&(re.name=te);const{data:oe}=await api.get(ae,{params:re});return oe}async function updateSmsPool(ee,te){const{data:ne}=await api.patch(`${smsPoolUrl}${ee}/`,te);return ne}const _hoisted_1$1={key:0,class:"mb-1.5 block text-xs font-semibold uppercase tracking-wide opacity-80"},_hoisted_2$1=["disabled"],_hoisted_3$1={key:0,class:"flex items-center gap-2 truncate"},_hoisted_4$1={class:"truncate font-semibold"},_hoisted_5$1={class:"shrink-0 rounded-full bg-primary/20 px-2 py-0.5 text-xs font-bold text-primary"},_hoisted_6={key:1,class:"text-current/40"},_hoisted_7={class:"ml-2 flex shrink-0 items-center gap-1"},_hoisted_8={key:0,class:"border-b border-base-100/50 px-2 py-2"},_hoisted_9={class:"max-h-52 overflow-y-auto"},_hoisted_10={key:0,class:"px-3 py-3 space-y-2"},_hoisted_11=["onClick"],_hoisted_12={class:"flex items-center gap-2 truncate"},_hoisted_13={key:0,class:"size-3.5 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},_hoisted_14={class:"truncate"},_hoisted_15={key:0,class:"py-4 text-center text-sm text-current/40"},_hoisted_16={key:1,class:"mt-1 text-xs text-red-500"},DROPDOWN_HEIGHT=260,_sfc_main$2={__name:"smsPoolSelect",props:{modelValue:{default:null},pools:{type:Array,default:null},loading:{type:Boolean,default:!1},error:{type:String,default:""},label:{type:String,default:"Carteira SMS"},placeholder:{type:String,default:"Selecione uma carteira"},disabled:{type:Boolean,default:!1},apiUrl:{type:String,default:smsPoolUrl}},emits:["update:modelValue"],setup(ee,{emit:te}){const ne=ee,ae=te,re=e$b.ref(!1),oe=e$b.ref(!1),ie=e$b.ref(""),le=e$b.ref([]),ce=e$b.ref(1),de=e$b.ref(0),ue=e$b.ref(!1),be=e$b.ref(!0),fe=e$b.ref(null),ge=e$b.ref(null);function me(){if(!ge.value)return;const De=ge.value.getBoundingClientRect(),Oe=window.innerHeight-De.bottom;oe.value=Oe<DROPDOWN_HEIGHT&&De.top>DROPDOWN_HEIGHT}const pe=e$b.computed(()=>Array.isArray(ne.pools)),ke=e$b.computed(()=>pe.value?ne.pools:le.value),ve=e$b.computed(()=>pe.value?ne.loading:ue.value);async function _e(De){if(pe.value){De.complete();return}ue.value=!0;try{const Oe=await listSmsPoolsPaginated({page:ce.value,search:ie.value,url:ne.apiUrl}),Ie=Array.isArray(Oe==null?void 0:Oe.results)?Oe.results:Array.isArray(Oe)?Oe:[];le.value.push(...Ie),ce.value++,Oe.next?(be.value=!0,De.loaded()):(be.value=!1,De.complete())}catch{De.error()}finally{ue.value=!1}}let $e=null;function ye(){clearTimeout($e),$e=setTimeout(()=>{le.value=[],ce.value=1,be.value=!0,de.value++},350)}e$b.watch(ie,()=>{pe.value||ye()});function Ee(De){getSmsPoolCredits(De)<=0||(ae("update:modelValue",De),re.value=!1)}function Se(De){De.stopPropagation(),ae("update:modelValue",null)}function Le(){ne.disabled||(re.value||me(),re.value=!re.value)}function Ae(De){fe.value&&!fe.value.contains(De.target)&&(re.value=!1)}return e$b.onMounted(()=>document.addEventListener("mousedown",Ae)),e$b.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Ae),clearTimeout($e)}),(De,Oe)=>(e$b.openBlock(),e$b.createElementBlock("div",null,[ee.label?(e$b.openBlock(),e$b.createElementBlock("label",_hoisted_1$1,e$b.toDisplayString(ee.label),1)):e$b.createCommentVNode("",!0),e$b.createElementVNode("div",{ref_key:"dropdownRef",ref:fe,class:"relative"},[e$b.createElementVNode("button",{ref_key:"triggerRef",ref:ge,type:"button",disabled:ee.disabled,onClick:Le,class:e$b.normalizeClass(["flex w-full items-center justify-between rounded-lg bg-base-200 px-3 py-2.5 text-sm transition hover:brightness-95 disabled:cursor-not-allowed disabled:opacity-60",{"ring-2 ring-red-500/60":ee.error}])},[ee.modelValue?(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_3$1,[e$b.createElementVNode("span",_hoisted_4$1,e$b.toDisplayString(ee.modelValue.name),1),e$b.createElementVNode("span",_hoisted_5$1,e$b.toDisplayString(e$b.unref(getSmsPoolCredits)(ee.modelValue))+" créditos ",1)])):(e$b.openBlock(),e$b.createElementBlock("span",_hoisted_6,e$b.toDisplayString(ee.placeholder),1)),e$b.createElementVNode("span",_hoisted_7,[ee.modelValue?(e$b.openBlock(),e$b.createElementBlock("span",{key:0,onClick:Se,class:"flex size-4 items-center justify-center rounded-full text-current/40 transition hover:text-current/80"},[...Oe[2]||(Oe[2]=[e$b.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"size-3.5",fill:"currentColor",viewBox:"0 0 24 24"},[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm7.707-3.707a1 1 0 0 0-1.414 1.414L10.586 12l-2.293 2.293a1 1 0 1 0 1.414 1.414L12 13.414l2.293 2.293a1 1 0 0 0 1.414-1.414L13.414 12l2.293-2.293a1 1 0 0 0-1.414-1.414L12 10.586 9.707 8.293Z","clip-rule":"evenodd"})],-1)])])):e$b.createCommentVNode("",!0),(e$b.openBlock(),e$b.createElementBlock("svg",{class:e$b.normalizeClass(["size-4 text-current/50 transition-transform",{"rotate-180":re.value}]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[...Oe[3]||(Oe[3]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.425 10.271C19.499 8.967 18.57 7 16.88 7H7.12c-1.69 0-2.618 1.967-1.544 3.271l4.881 5.927a2 2 0 0 0 3.088 0l4.88-5.927Z","clip-rule":"evenodd"},null,-1)])],2))])],10,_hoisted_2$1),e$b.createVNode(e$b.Transition,{name:"sms-pool-fade"},{default:e$b.withCtx(()=>[re.value?(e$b.openBlock(),e$b.createElementBlock("div",{key:0,class:e$b.normalizeClass(["absolute left-0 z-30 w-full overflow-hidden rounded-lg bg-base-300 shadow-lg shadow-black/20",oe.value?"bottom-full mb-1":"top-full mt-1"])},[pe.value?e$b.createCommentVNode("",!0):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_8,[e$b.withDirectives(e$b.createElementVNode("input",{"onUpdate:modelValue":Oe[0]||(Oe[0]=Ie=>ie.value=Ie),type:"text",placeholder:"Buscar carteira…",class:"w-full border-none focus:border-none rounded-md bg-base-200 px-3 py-1.5 text-sm outline-none placeholder:text-current/30",onClick:Oe[1]||(Oe[1]=e$b.withModifiers(()=>{},["stop"]))},null,512),[[e$b.vModelText,ie.value]])])),e$b.createElementVNode("div",_hoisted_9,[ve.value&&ke.value.length===0?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_10,[(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(3,Ie=>e$b.createElementVNode("div",{key:Ie,class:"h-8 w-full animate-pulse rounded-md bg-base-100/60"})),64))])):(e$b.openBlock(),e$b.createElementBlock(e$b.Fragment,{key:1},[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(ke.value,Ie=>{var ze,Ve;return e$b.openBlock(),e$b.createElementBlock("div",{key:Ie.id,onClick:Ne=>Ee(Ie),class:e$b.normalizeClass(["flex items-center justify-between px-3 py-2.5 text-sm transition",[e$b.unref(getSmsPoolCredits)(Ie)<=0?"cursor-not-allowed opacity-40":"cursor-pointer hover:bg-base-200/60",((ze=ee.modelValue)==null?void 0:ze.id)===Ie.id?"bg-primary/10 font-semibold":""]])},[e$b.createElementVNode("span",_hoisted_12,[((Ve=ee.modelValue)==null?void 0:Ve.id)===Ie.id?(e$b.openBlock(),e$b.createElementBlock("svg",_hoisted_13,[...Oe[4]||(Oe[4]=[e$b.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm13.707-1.293a1 1 0 0 0-1.414-1.414L11 12.586l-1.793-1.793a1 1 0 0 0-1.414 1.414l2.5 2.5a1 1 0 0 0 1.414 0l4-4Z","clip-rule":"evenodd"},null,-1)])])):e$b.createCommentVNode("",!0),e$b.createElementVNode("span",_hoisted_14,e$b.toDisplayString(Ie.name),1)]),e$b.createElementVNode("span",{class:e$b.normalizeClass(["ml-2 shrink-0 rounded-full px-2 py-0.5 text-xs font-bold",e$b.unref(getSmsPoolCredits)(Ie)>0?"bg-primary/20 text-primary":"bg-base-100 text-current/40"])},e$b.toDisplayString(e$b.unref(getSmsPoolCredits)(Ie))+" créditos ",3)],10,_hoisted_11)}),128)),!ve.value&&ke.value.length===0?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_15," Nenhuma carteira encontrada ")):e$b.createCommentVNode("",!0),!pe.value&&be.value?(e$b.openBlock(),e$b.createBlock(e$b.unref(Y$1),{key:de.value,onInfinite:_e},{spinner:e$b.withCtx(()=>[...Oe[5]||(Oe[5]=[e$b.createElementVNode("div",{class:"flex justify-center py-3"},[e$b.createElementVNode("div",{class:"size-5 animate-spin rounded-full border-4 border-t-transparent border-primary"})],-1)])]),complete:e$b.withCtx(()=>[...Oe[6]||(Oe[6]=[e$b.createElementVNode("span",null,null,-1)])]),_:1})):e$b.createCommentVNode("",!0)],64))])],2)):e$b.createCommentVNode("",!0)]),_:1})],512),ee.error?(e$b.openBlock(),e$b.createElementBlock("p",_hoisted_16,e$b.toDisplayString(ee.error),1)):e$b.createCommentVNode("",!0)]))}},SmsPoolSelect=_export_sfc$1(_sfc_main$2,[["__scopeId","data-v-6616f293"]]),_hoisted_1={class:"call-history-container"},_hoisted_2={key:0,class:"call-history-loading"},_hoisted_3={key:1,class:"call-history-error"},_hoisted_4={key:2,class:"call-history-empty"},_hoisted_5={key:3,class:"call-history-list"},_sfc_main$1={__name:"CallHistory",props:{chatId:{type:[String,Number],required:!0},callsApiUrl:{type:String,required:!1,default:callsUrl},onMessageClick:{type:Function,required:!1,default:null}},setup(ee){const te=ee,ne=e$b.ref(!1),ae=e$b.ref(null),re=e$b.ref([]);e$b.onMounted(()=>{oe()}),e$b.watch(()=>te.chatId,()=>{oe()});async function oe(){var le,ce;if(te.chatId){ne.value=!0,ae.value=null;try{const de=await api.get(`${te.callsApiUrl}?chat_id=${te.chatId}`);re.value=de.data.results||de.data||[]}catch(de){console.error("Erro ao buscar ligações:",de),ae.value=((ce=(le=de.response)==null?void 0:le.data)==null?void 0:ce.message)||"Erro ao carregar o histórico de ligações"}finally{ne.value=!1}}}function ie(le){te.onMessageClick&&te.onMessageClick(le)}return(le,ce)=>(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_1,[ne.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_2,[...ce[0]||(ce[0]=[e$b.createElementVNode("svg",{class:"call-history-loading-spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e$b.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e$b.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})],-1),e$b.createElementVNode("span",{class:"call-history-loading-text"},"Carregando ligações...",-1)])])):ae.value?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_3,e$b.toDisplayString(ae.value),1)):re.value.length===0?(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_4," Nenhuma ligação registrada nesta conversa ")):(e$b.openBlock(),e$b.createElementBlock("div",_hoisted_5,[(e$b.openBlock(!0),e$b.createElementBlock(e$b.Fragment,null,e$b.renderList(re.value,de=>(e$b.openBlock(),e$b.createBlock(CallCard,{key:de.id,call:de,"on-message-click":ie},null,8,["call"]))),128))]))]))}},CallHistory=_export_sfc$1(_sfc_main$1,[["__scopeId","data-v-23aeed88"]]);function install(ee){ee.component("PrimarySelect",primarySelect),ee.component("DepartSelect",departSelect),ee.component("AttendantSelect",attendantSelect),ee.component("SimpleModal",simpleModal),ee.component("SimpleCard",_sfc_main$2H),ee.component("InstanceSelect",instanceSelect),ee.component("CalendarEvents",calendar),ee.component("MFA",_sfc_main$2g),ee.component("MfaQrCode",_sfc_main$2f),ee.component("ChatWindow",chatWindow),ee.component("FilterSelectLib",FilterSelectLib),ee.component("RandomAvatar",RandomAvatar),ee.component("MinModal",MinModal),ee.component("Modal",Modal),ee.component("LibPatchNotes",libPatchNotes),ee.component("BtnNewUpdates",btnNewUpdates),ee.component("LibPhotoPicker",_sfc_main$1H),ee.component("SelectMultipleDepartments",SelectMultipleDepartments),ee.component("SelectMultipleInstances",SelectMultipleInstances),ee.component("PrimaryInput",PrimaryInput),ee.component("CurrencyDisplay",CurrencyDisplay),ee.component("SimpleSelect",SimpleSelect),ee.component("FloatingDev",FloatingDev),ee.component("RatingInput",RatingInput),ee.component("TagView",_sfc_main$16),ee.component("TagChip",TagChip),ee.component("TagList",TagList),ee.component("ClientsForm",ClientsForm),ee.component("SelectMultipleTags",SelectMultipleTags),ee.component("SimpleLoader",_sfc_main$1v),ee.component("Loader",Loader),ee.component("OutcomeButton",OutcomeButton),ee.component("CallHistory",CallHistory),ee.component("CallMessage",CallMessage),ee.component("SystemMessage",_sfc_main$t),ee.component("ListProducts",ListProducts),ee.component("ContactCard",ContactCard),ee.component("ContactMessageCard",ContactMessageCard),ee.component("ProposalMessageCard",ProposalMessageCard),ee.component("WalletCard",WalletCard),ee.component("ReminderModal",ReminderModal),ee.component("SoundSelect",SoundSelect),ee.component("TimezoneSelect",TimezoneSelect),ee.component("SmsPoolSelect",SmsPoolSelect),ee.component("BaseTable",baseTable),ee.component("TemplateTable",templateTable),ee.component("CategoryBadge",_sfc_main$2M),ee.component("AchievementCard",AchievementCard),ee.component("NetworkIcon",_sfc_main$2A)}function attLibDeparts(ee,te="add"){const ne=useDepartmentStore();te==="add"?ne.addDepartments(ee):te==="delete"?ne.removeDepartments(ee):te==="update"?(ne.departments=ee,ne.loaded=!0):console.error(`Ação "${te}" não suportada em attLibDeparts.`)}function attLibAttendants(ee,te="add"){const ne=useAttendantStore();te==="add"?ne.addAttendants(ee):te==="delete"?ne.removeAttendants(ee):te==="update"?(ne.attendants=ee,ne.loaded=!0):console.error(`Ação "${te}" não suportada em attLibAttendants.`)}function attLibInstances(ee,te="add"){const ne=useInstanceStore();te==="add"?ne.addInstance(ee):te==="delete"?ne.removeInstance(ee):te==="update"?(ne.instances=ee,ne.loaded=!0):console.error(`Ação "${te}" não suportada em attLibInstances.`)}async function setupLibrary(ee,te,ne,ae=[],re=[],oe=[],ie=null){try{setPiniaInstance(ee);const le=await useAuthStore(ee);te&&await le.setToken(te),ne&&setApiBaseURL(ne),ie&&setRefreshTokenUrl(ie);const ce=useDepartmentStore(ee);re.length>0&&(ce.departments=re,ce.count=re.length);const de=useAttendantStore(ee);ae.length>0&&(de.attendants=ae,de.count=ae.length),await useInstanceStore(ee).fetchInstances()}catch(le){console.error("Erro no setupLibrary:",le)}}function getWithContrastColor(ee){return getContrastColor(ee)}function attReminderByLib(ee){return moveReminderToCompleted(ee)}const index={install,setupLibrary,attLibDeparts,attLibAttendants,attLibInstances,primarySelect,simpleModal,simpleCard:_sfc_main$2H,instanceSelect,SimpleSelect,FloatingDev,calendar,SimpleLoader:_sfc_main$1v,Loader,MFA:_sfc_main$2g,chatWindow,departSelect,attendantSelect,FilterSelectLib,RandomAvatar,MinModal,Modal,libPatchNotes,btnNewUpdates,LibPhotoPicker:_sfc_main$1H,SelectMultipleDepartments,SelectMultipleInstances,SelectMultipleTags,PrimaryInput,CurrencyDisplay,getWithContrastColor,RatingInput,TagView:_sfc_main$16,TagChip,TagList,ClientsForm,OutcomeButton,CallHistory,CallMessage,SystemMessage:_sfc_main$t,ListProducts,ContactCard,ContactMessageCard,ProposalMessageCard,NetworkIcon:_sfc_main$2A,ReminderModal,attReminderByLib,SoundSelect,TimezoneSelect,formatCurrency,getCurrencySymbol,getCurrencyLocale};function s(ee){ee.CapacitorUtils.Synapse=new Proxy({},{get(te,ne){return new Proxy({},{get(ae,re){return(oe,ie,le)=>{const ce=ee.Capacitor.Plugins[ne];if(ce===void 0){le(new Error(`Capacitor plugin ${ne} not found`));return}if(typeof ce[re]!="function"){le(new Error(`Method ${re} not found in Capacitor plugin ${ne}`));return}(async()=>{try{const de=await ce[re](oe);ie(de)}catch(de){le(de)}})()}}})}})}function u(ee){ee.CapacitorUtils.Synapse=new Proxy({},{get(te,ne){return ee.cordova.plugins[ne]}})}function f(ee=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!ee?s(window):window.cordova!==void 0&&u(window))}var Directory;(function(ee){ee.Documents="DOCUMENTS",ee.Data="DATA",ee.Library="LIBRARY",ee.Cache="CACHE",ee.External="EXTERNAL",ee.ExternalStorage="EXTERNAL_STORAGE",ee.ExternalCache="EXTERNAL_CACHE",ee.LibraryNoCloud="LIBRARY_NO_CLOUD",ee.Temporary="TEMPORARY"})(Directory||(Directory={}));var Encoding;(function(ee){ee.UTF8="utf8",ee.ASCII="ascii",ee.UTF16="utf16"})(Encoding||(Encoding={}));const Filesystem=registerPlugin("Filesystem",{web:()=>Promise.resolve().then(()=>web).then(ee=>new ee.FilesystemWeb)});f();const BlobWriter=registerPlugin("BlobWriter");function array_buffer_to_base64(ee){return window.btoa(Array.from(new Uint8Array(ee)).map(function(te){return String.fromCharCode(te)}).join(""))}function write_file_via_indexeddb({path:ee,directory:te,blob:ne,recursive:ae}){return Filesystem.writeFile({directory:te,path:ee,recursive:ae,data:""}).then(function(){return new Promise(function(re,oe){function ie(ce){oe(ce.target.error)}const le=window.indexedDB.open("Disc");le.onerror=ie,le.onsuccess=function(){const de=le.result.transaction("FileStorage","readwrite");de.onerror=ie;const ue=de.objectStore("FileStorage"),be=`/${te}/${ee.replace(/^\//,"")}`,fe=ue.get(be);fe.onsuccess=function(){fe.result.size=ne.size,fe.result.content=ne;const ge=ue.put(fe.result);ge.onsuccess=function(){re(void 0)}}}})})}function write_file_via_bridge({path:ee,directory:te,blob:ne,recursive:ae}){return Filesystem.writeFile({directory:te,path:ee,recursive:ae,data:""}).then(function re(){if(ne.size===0)return Promise.resolve();const oe=3*128*1024,ie=ne.slice(0,oe);return ne=ne.slice(oe),new Response(ie).arrayBuffer().then(function(ce){return Filesystem.appendFile({directory:te,path:ee,data:array_buffer_to_base64(ce)})}).then(re)})}function write_blob(ee){const{path:te,directory:ne,blob:ae,fast_mode:re=!1,recursive:oe,on_fallback:ie}=ee;return!ae||!Number.isSafeInteger(ae.size)||typeof ae.type!="string"?Promise.reject(new Error("Not a Blob.")):Capacitor.getPlatform()==="web"?re?write_file_via_indexeddb(ee):write_file_via_bridge(ee):Promise.all([BlobWriter.get_config(),Filesystem.getUri({path:te,directory:ne})]).then(function([le,ce]){const de=ce.uri.replace("file://","");return(window.CapacitorWebFetch||window.fetch)(le.base_url+de+(oe?"?recursive=true":""),{headers:{authorization:le.auth_token},method:"put",body:ae}).then(function(be){if(be.status!==204)throw new Error("Bad HTTP status: "+be.status);return ce.uri})}).catch(function(ce){return ie!==void 0&&ie(ce),write_file_via_bridge(ee)})}const write_blob$1=Object.freeze(write_blob);var getBlobDuration$1={};function _interopRequireDefault(ee){return ee&&ee.__esModule?ee:{default:ee}}var interopRequireDefault=_interopRequireDefault,runtime={exports:{}},hasRequiredRuntime;function requireRuntime(){return hasRequiredRuntime||(hasRequiredRuntime=1,function(ee){var te=function(ne){var ae=Object.prototype,re=ae.hasOwnProperty,oe=Object.defineProperty||function(Ce,Fe,Re){Ce[Fe]=Re.value},ie,le=typeof Symbol=="function"?Symbol:{},ce=le.iterator||"@@iterator",de=le.asyncIterator||"@@asyncIterator",ue=le.toStringTag||"@@toStringTag";function be(Ce,Fe,Re){return Object.defineProperty(Ce,Fe,{value:Re,enumerable:!0,configurable:!0,writable:!0}),Ce[Fe]}try{be({},"")}catch{be=function(Fe,Re,qe){return Fe[Re]=qe}}function fe(Ce,Fe,Re,qe){var Ge=Fe&&Fe.prototype instanceof $e?Fe:$e,Ze=Object.create(Ge.prototype),Xe=new Be(qe||[]);return oe(Ze,"_invoke",{value:ze(Ce,Re,Xe)}),Ze}ne.wrap=fe;function ge(Ce,Fe,Re){try{return{type:"normal",arg:Ce.call(Fe,Re)}}catch(qe){return{type:"throw",arg:qe}}}var me="suspendedStart",pe="suspendedYield",ke="executing",ve="completed",_e={};function $e(){}function ye(){}function Ee(){}var Se={};be(Se,ce,function(){return this});var Le=Object.getPrototypeOf,Ae=Le&&Le(Le(Me([])));Ae&&Ae!==ae&&re.call(Ae,ce)&&(Se=Ae);var De=Ee.prototype=$e.prototype=Object.create(Se);ye.prototype=Ee,oe(De,"constructor",{value:Ee,configurable:!0}),oe(Ee,"constructor",{value:ye,configurable:!0}),ye.displayName=be(Ee,ue,"GeneratorFunction");function Oe(Ce){["next","throw","return"].forEach(function(Fe){be(Ce,Fe,function(Re){return this._invoke(Fe,Re)})})}ne.isGeneratorFunction=function(Ce){var Fe=typeof Ce=="function"&&Ce.constructor;return Fe?Fe===ye||(Fe.displayName||Fe.name)==="GeneratorFunction":!1},ne.mark=function(Ce){return Object.setPrototypeOf?Object.setPrototypeOf(Ce,Ee):(Ce.__proto__=Ee,be(Ce,ue,"GeneratorFunction")),Ce.prototype=Object.create(De),Ce},ne.awrap=function(Ce){return{__await:Ce}};function Ie(Ce,Fe){function Re(Ze,Xe,Ue,at){var Je=ge(Ce[Ze],Ce,Xe);if(Je.type==="throw")at(Je.arg);else{var lt=Je.arg,it=lt.value;return it&&typeof it=="object"&&re.call(it,"__await")?Fe.resolve(it.__await).then(function(gt){Re("next",gt,Ue,at)},function(gt){Re("throw",gt,Ue,at)}):Fe.resolve(it).then(function(gt){lt.value=gt,Ue(lt)},function(gt){return Re("throw",gt,Ue,at)})}}var qe;function Ge(Ze,Xe){function Ue(){return new Fe(function(at,Je){Re(Ze,Xe,at,Je)})}return qe=qe?qe.then(Ue,Ue):Ue()}oe(this,"_invoke",{value:Ge})}Oe(Ie.prototype),be(Ie.prototype,de,function(){return this}),ne.AsyncIterator=Ie,ne.async=function(Ce,Fe,Re,qe,Ge){Ge===void 0&&(Ge=Promise);var Ze=new Ie(fe(Ce,Fe,Re,qe),Ge);return ne.isGeneratorFunction(Fe)?Ze:Ze.next().then(function(Xe){return Xe.done?Xe.value:Ze.next()})};function ze(Ce,Fe,Re){var qe=me;return function(Ze,Xe){if(qe===ke)throw new Error("Generator is already running");if(qe===ve){if(Ze==="throw")throw Xe;return xe()}for(Re.method=Ze,Re.arg=Xe;;){var Ue=Re.delegate;if(Ue){var at=Ve(Ue,Re);if(at){if(at===_e)continue;return at}}if(Re.method==="next")Re.sent=Re._sent=Re.arg;else if(Re.method==="throw"){if(qe===me)throw qe=ve,Re.arg;Re.dispatchException(Re.arg)}else Re.method==="return"&&Re.abrupt("return",Re.arg);qe=ke;var Je=ge(Ce,Fe,Re);if(Je.type==="normal"){if(qe=Re.done?ve:pe,Je.arg===_e)continue;return{value:Je.arg,done:Re.done}}else Je.type==="throw"&&(qe=ve,Re.method="throw",Re.arg=Je.arg)}}}function Ve(Ce,Fe){var Re=Fe.method,qe=Ce.iterator[Re];if(qe===ie)return Fe.delegate=null,Re==="throw"&&Ce.iterator.return&&(Fe.method="return",Fe.arg=ie,Ve(Ce,Fe),Fe.method==="throw")||Re!=="return"&&(Fe.method="throw",Fe.arg=new TypeError("The iterator does not provide a '"+Re+"' method")),_e;var Ge=ge(qe,Ce.iterator,Fe.arg);if(Ge.type==="throw")return Fe.method="throw",Fe.arg=Ge.arg,Fe.delegate=null,_e;var Ze=Ge.arg;if(!Ze)return Fe.method="throw",Fe.arg=new TypeError("iterator result is not an object"),Fe.delegate=null,_e;if(Ze.done)Fe[Ce.resultName]=Ze.value,Fe.next=Ce.nextLoc,Fe.method!=="return"&&(Fe.method="next",Fe.arg=ie);else return Ze;return Fe.delegate=null,_e}Oe(De),be(De,ue,"Generator"),be(De,ce,function(){return this}),be(De,"toString",function(){return"[object Generator]"});function Ne(Ce){var Fe={tryLoc:Ce[0]};1 in Ce&&(Fe.catchLoc=Ce[1]),2 in Ce&&(Fe.finallyLoc=Ce[2],Fe.afterLoc=Ce[3]),this.tryEntries.push(Fe)}function Pe(Ce){var Fe=Ce.completion||{};Fe.type="normal",delete Fe.arg,Ce.completion=Fe}function Be(Ce){this.tryEntries=[{tryLoc:"root"}],Ce.forEach(Ne,this),this.reset(!0)}ne.keys=function(Ce){var Fe=Object(Ce),Re=[];for(var qe in Fe)Re.push(qe);return Re.reverse(),function Ge(){for(;Re.length;){var Ze=Re.pop();if(Ze in Fe)return Ge.value=Ze,Ge.done=!1,Ge}return Ge.done=!0,Ge}};function Me(Ce){if(Ce){var Fe=Ce[ce];if(Fe)return Fe.call(Ce);if(typeof Ce.next=="function")return Ce;if(!isNaN(Ce.length)){var Re=-1,qe=function Ge(){for(;++Re<Ce.length;)if(re.call(Ce,Re))return Ge.value=Ce[Re],Ge.done=!1,Ge;return Ge.value=ie,Ge.done=!0,Ge};return qe.next=qe}}return{next:xe}}ne.values=Me;function xe(){return{value:ie,done:!0}}return Be.prototype={constructor:Be,reset:function(Ce){if(this.prev=0,this.next=0,this.sent=this._sent=ie,this.done=!1,this.delegate=null,this.method="next",this.arg=ie,this.tryEntries.forEach(Pe),!Ce)for(var Fe in this)Fe.charAt(0)==="t"&&re.call(this,Fe)&&!isNaN(+Fe.slice(1))&&(this[Fe]=ie)},stop:function(){this.done=!0;var Ce=this.tryEntries[0],Fe=Ce.completion;if(Fe.type==="throw")throw Fe.arg;return this.rval},dispatchException:function(Ce){if(this.done)throw Ce;var Fe=this;function Re(at,Je){return Ze.type="throw",Ze.arg=Ce,Fe.next=at,Je&&(Fe.method="next",Fe.arg=ie),!!Je}for(var qe=this.tryEntries.length-1;qe>=0;--qe){var Ge=this.tryEntries[qe],Ze=Ge.completion;if(Ge.tryLoc==="root")return Re("end");if(Ge.tryLoc<=this.prev){var Xe=re.call(Ge,"catchLoc"),Ue=re.call(Ge,"finallyLoc");if(Xe&&Ue){if(this.prev<Ge.catchLoc)return Re(Ge.catchLoc,!0);if(this.prev<Ge.finallyLoc)return Re(Ge.finallyLoc)}else if(Xe){if(this.prev<Ge.catchLoc)return Re(Ge.catchLoc,!0)}else if(Ue){if(this.prev<Ge.finallyLoc)return Re(Ge.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(Ce,Fe){for(var Re=this.tryEntries.length-1;Re>=0;--Re){var qe=this.tryEntries[Re];if(qe.tryLoc<=this.prev&&re.call(qe,"finallyLoc")&&this.prev<qe.finallyLoc){var Ge=qe;break}}Ge&&(Ce==="break"||Ce==="continue")&&Ge.tryLoc<=Fe&&Fe<=Ge.finallyLoc&&(Ge=null);var Ze=Ge?Ge.completion:{};return Ze.type=Ce,Ze.arg=Fe,Ge?(this.method="next",this.next=Ge.finallyLoc,_e):this.complete(Ze)},complete:function(Ce,Fe){if(Ce.type==="throw")throw Ce.arg;return Ce.type==="break"||Ce.type==="continue"?this.next=Ce.arg:Ce.type==="return"?(this.rval=this.arg=Ce.arg,this.method="return",this.next="end"):Ce.type==="normal"&&Fe&&(this.next=Fe),_e},finish:function(Ce){for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Re=this.tryEntries[Fe];if(Re.finallyLoc===Ce)return this.complete(Re.completion,Re.afterLoc),Pe(Re),_e}},catch:function(Ce){for(var Fe=this.tryEntries.length-1;Fe>=0;--Fe){var Re=this.tryEntries[Fe];if(Re.tryLoc===Ce){var qe=Re.completion;if(qe.type==="throw"){var Ge=qe.arg;Pe(Re)}return Ge}}throw new Error("illegal catch attempt")},delegateYield:function(Ce,Fe,Re){return this.delegate={iterator:Me(Ce),resultName:Fe,nextLoc:Re},this.method==="next"&&(this.arg=ie),_e}},ne}(ee.exports);try{regeneratorRuntime=te}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=te:Function("r","regeneratorRuntime = r")(te)}}(runtime)),runtime.exports}var regenerator,hasRequiredRegenerator;function requireRegenerator(){return hasRequiredRegenerator||(hasRequiredRegenerator=1,regenerator=requireRuntime()),regenerator}var asyncToGenerator,hasRequiredAsyncToGenerator;function requireAsyncToGenerator(){if(hasRequiredAsyncToGenerator)return asyncToGenerator;hasRequiredAsyncToGenerator=1;function ee(ne,ae,re,oe,ie,le,ce){try{var de=ne[le](ce),ue=de.value}catch(be){re(be);return}de.done?ae(ue):Promise.resolve(ue).then(oe,ie)}function te(ne){return function(){var ae=this,re=arguments;return new Promise(function(oe,ie){var le=ne.apply(ae,re);function ce(ue){ee(le,oe,ie,ce,de,"next",ue)}function de(ue){ee(le,oe,ie,ce,de,"throw",ue)}ce(void 0)})}}return asyncToGenerator=te,asyncToGenerator}(function(ee){var te=interopRequireDefault;Object.defineProperty(ee,"__esModule",{value:!0}),ee.default=re;var ne=te(requireRegenerator()),ae=te(requireAsyncToGenerator());function re(ie){return oe.apply(this,arguments)}function oe(){return(oe=(0,ae.default)(ne.default.mark(function ie(le){var ce,de;return ne.default.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ce=document.createElement("video"),de=new Promise(function(be,fe){ce.addEventListener("loadedmetadata",function(){ce.duration===1/0?(ce.currentTime=Number.MAX_SAFE_INTEGER,ce.ontimeupdate=function(){ce.ontimeupdate=null,be(ce.duration),ce.currentTime=0}):be(ce.duration)}),ce.onerror=function(ge){return fe(ge.target.error)}}),ce.src=typeof le=="string"||le instanceof String?le:window.URL.createObjectURL(le),ue.abrupt("return",de);case 4:case"end":return ue.stop()}},ie)}))).apply(this,arguments)}})(getBlobDuration$1);const getBlobDuration=getDefaultExportFromCjs(getBlobDuration$1),successResponse=()=>({value:!0}),failureResponse=()=>({value:!1}),missingPermissionError=()=>new Error("MISSING_PERMISSION"),alreadyRecordingError=()=>new Error("ALREADY_RECORDING"),deviceCannotVoiceRecordError=()=>new Error("DEVICE_CANNOT_VOICE_RECORD"),failedToRecordError=()=>new Error("FAILED_TO_RECORD"),emptyRecordingError=()=>new Error("EMPTY_RECORDING"),recordingHasNotStartedError=()=>new Error("RECORDING_HAS_NOT_STARTED"),failedToFetchRecordingError=()=>new Error("FAILED_TO_FETCH_RECORDING"),couldNotQueryPermissionStatusError=()=>new Error("COULD_NOT_QUERY_PERMISSION_STATUS"),POSSIBLE_MIME_TYPES={"audio/aac":".aac","audio/mp4":".mp3","audio/webm;codecs=opus":".ogg","audio/webm":".ogg","audio/ogg;codecs=opus":".ogg"},neverResolvingPromise=()=>new Promise(()=>{});class VoiceRecorderImpl{constructor(){this.mediaRecorder=null,this.chunks=[],this.pendingResult=neverResolvingPromise()}static async canDeviceVoiceRecord(){var te;return((te=navigator==null?void 0:navigator.mediaDevices)===null||te===void 0?void 0:te.getUserMedia)==null||VoiceRecorderImpl.getSupportedMimeType()==null?failureResponse():successResponse()}async startRecording(te){if(this.mediaRecorder!=null)throw alreadyRecordingError();if(!(await VoiceRecorderImpl.canDeviceVoiceRecord()).value)throw deviceCannotVoiceRecordError();if(!(await VoiceRecorderImpl.hasAudioRecordingPermission().catch(()=>successResponse())).value)throw missingPermissionError();return navigator.mediaDevices.getUserMedia({audio:!0}).then(re=>this.onSuccessfullyStartedRecording(re,te)).catch(this.onFailedToStartRecording.bind(this))}async stopRecording(){if(this.mediaRecorder==null)throw recordingHasNotStartedError();try{return this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(te=>te.stop()),this.pendingResult}catch{throw failedToFetchRecordingError()}finally{this.prepareInstanceForNextOperation()}}static async hasAudioRecordingPermission(){return navigator.permissions.query==null?navigator.mediaDevices==null?Promise.reject(couldNotQueryPermissionStatusError()):navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>successResponse()).catch(()=>{throw couldNotQueryPermissionStatusError()}):navigator.permissions.query({name:"microphone"}).then(te=>({value:te.state==="granted"})).catch(()=>{throw couldNotQueryPermissionStatusError()})}static async requestAudioRecordingPermission(){return(await VoiceRecorderImpl.hasAudioRecordingPermission().catch(()=>failureResponse())).value?successResponse():navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>successResponse()).catch(()=>failureResponse())}pauseRecording(){if(this.mediaRecorder==null)throw recordingHasNotStartedError();return this.mediaRecorder.state==="recording"?(this.mediaRecorder.pause(),Promise.resolve(successResponse())):Promise.resolve(failureResponse())}resumeRecording(){if(this.mediaRecorder==null)throw recordingHasNotStartedError();return this.mediaRecorder.state==="paused"?(this.mediaRecorder.resume(),Promise.resolve(successResponse())):Promise.resolve(failureResponse())}getCurrentStatus(){return this.mediaRecorder==null?Promise.resolve({status:RecordingStatus.NONE}):this.mediaRecorder.state==="recording"?Promise.resolve({status:RecordingStatus.RECORDING}):this.mediaRecorder.state==="paused"?Promise.resolve({status:RecordingStatus.PAUSED}):Promise.resolve({status:RecordingStatus.NONE})}static getSupportedMimeType(){if((MediaRecorder==null?void 0:MediaRecorder.isTypeSupported)==null)return null;const te=Object.keys(POSSIBLE_MIME_TYPES).find(ne=>MediaRecorder.isTypeSupported(ne));return te??null}onSuccessfullyStartedRecording(te,ne){return this.pendingResult=new Promise((ae,re)=>{this.mediaRecorder=new MediaRecorder(te),this.mediaRecorder.onerror=()=>{this.prepareInstanceForNextOperation(),re(failedToRecordError())},this.mediaRecorder.onstop=async()=>{var oe,ie,le;const ce=VoiceRecorderImpl.getSupportedMimeType();if(ce==null){this.prepareInstanceForNextOperation(),re(failedToFetchRecordingError());return}const de=new Blob(this.chunks,{type:ce});if(de.size<=0){this.prepareInstanceForNextOperation(),re(emptyRecordingError());return}let ue,be;ne!=null?(ue=`${(le=(ie=(oe=ne.subDirectory)===null||oe===void 0?void 0:oe.match(/^\/?(.+[^/])\/?$/))===null||ie===void 0?void 0:ie[1])!==null&&le!==void 0?le:""}/recording-${new Date().getTime()}${POSSIBLE_MIME_TYPES[ce]}`,await write_blob$1({blob:de,directory:ne.directory,fast_mode:!0,path:ue,recursive:!0})):be=await VoiceRecorderImpl.blobToBase64(de);const fe=await getBlobDuration(de);this.prepareInstanceForNextOperation(),ae({value:{recordDataBase64:be,mimeType:ce,msDuration:fe*1e3,path:ue}})},this.mediaRecorder.ondataavailable=oe=>this.chunks.push(oe.data),this.mediaRecorder.start()}),successResponse()}onFailedToStartRecording(){throw this.prepareInstanceForNextOperation(),failedToRecordError()}static blobToBase64(te){return new Promise(ne=>{const ae=new FileReader;ae.onloadend=()=>{const re=String(ae.result),oe=re.split("base64,"),ie=oe.length>1?oe[1]:re;ne(ie.trim())},ae.readAsDataURL(te)})}prepareInstanceForNextOperation(){if(this.mediaRecorder!=null&&this.mediaRecorder.state==="recording")try{this.mediaRecorder.stop()}catch(te){console.warn("While trying to stop a media recorder, an error was thrown",te)}this.pendingResult=neverResolvingPromise(),this.mediaRecorder=null,this.chunks=[]}}class VoiceRecorderWeb extends WebPlugin{constructor(){super(...arguments),this.voiceRecorderInstance=new VoiceRecorderImpl}canDeviceVoiceRecord(){return VoiceRecorderImpl.canDeviceVoiceRecord()}hasAudioRecordingPermission(){return VoiceRecorderImpl.hasAudioRecordingPermission()}requestAudioRecordingPermission(){return VoiceRecorderImpl.requestAudioRecordingPermission()}startRecording(te){return this.voiceRecorderInstance.startRecording(te)}stopRecording(){return this.voiceRecorderInstance.stopRecording()}pauseRecording(){return this.voiceRecorderInstance.pauseRecording()}resumeRecording(){return this.voiceRecorderInstance.resumeRecording()}getCurrentStatus(){return this.voiceRecorderInstance.getCurrentStatus()}}const web$1=Object.freeze(Object.defineProperty({__proto__:null,VoiceRecorderWeb},Symbol.toStringTag,{value:"Module"}));var lottie={exports:{}};(function(module,exports){typeof navigator<"u"&&function(ee,te){module.exports=te()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(te){_useWebWorker=!!te},getWebWorker=function(){return _useWebWorker},setLocationHref=function(te){locationHref=te},getLocationHref=function(){return locationHref};function createTag(ee){return document.createElement(ee)}function extendPrototype(ee,te){var ne,ae=ee.length,re;for(ne=0;ne<ae;ne+=1){re=ee[ne].prototype;for(var oe in re)Object.prototype.hasOwnProperty.call(re,oe)&&(te.prototype[oe]=re[oe])}}function getDescriptor(ee,te){return Object.getOwnPropertyDescriptor(ee,te)}function createProxyFunction(ee){function te(){}return te.prototype=ee,te}var audioControllerFactory=function(){function ee(te){this.audios=[],this.audioFactory=te,this._volume=1,this._isMuted=!1}return ee.prototype={addAudio:function(ne){this.audios.push(ne)},pause:function(){var ne,ae=this.audios.length;for(ne=0;ne<ae;ne+=1)this.audios[ne].pause()},resume:function(){var ne,ae=this.audios.length;for(ne=0;ne<ae;ne+=1)this.audios[ne].resume()},setRate:function(ne){var ae,re=this.audios.length;for(ae=0;ae<re;ae+=1)this.audios[ae].setRate(ne)},createAudio:function(ne){return this.audioFactory?this.audioFactory(ne):window.Howl?new window.Howl({src:[ne]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(ne){this.audioFactory=ne},setVolume:function(ne){this._volume=ne,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var ne,ae=this.audios.length;for(ne=0;ne<ae;ne+=1)this.audios[ne].volume(this._volume*(this._isMuted?0:1))}},function(){return new ee}}(),createTypedArray=function(){function ee(ne,ae){var re=0,oe=[],ie;switch(ne){case"int16":case"uint8c":ie=1;break;default:ie=1.1;break}for(re=0;re<ae;re+=1)oe.push(ie);return oe}function te(ne,ae){return ne==="float32"?new Float32Array(ae):ne==="int16"?new Int16Array(ae):ne==="uint8c"?new Uint8ClampedArray(ae):ee(ne,ae)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?te:ee}();function createSizedArray(ee){return Array.apply(null,{length:ee})}function _typeof$6(ee){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$6=function(ne){return typeof ne}:_typeof$6=function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},_typeof$6(ee)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var ee=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],te,ne=ee.length;for(te=0;te<ne;te+=1)BMMath[ee[te]]=Math[ee[te]]})(),BMMath.random=Math.random,BMMath.abs=function(ee){var te=_typeof$6(ee);if(te==="object"&&ee.length){var ne=createSizedArray(ee.length),ae,re=ee.length;for(ae=0;ae<re;ae+=1)ne[ae]=Math.abs(ee[ae]);return ne}return Math.abs(ee)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(ee){ee.style.position="absolute",ee.style.top=0,ee.style.left=0,ee.style.display="block",ee.style.transformOrigin="0 0",ee.style.webkitTransformOrigin="0 0",ee.style.backfaceVisibility="visible",ee.style.webkitBackfaceVisibility="visible",ee.style.transformStyle="preserve-3d",ee.style.webkitTransformStyle="preserve-3d",ee.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(ee,te,ne,ae){this.type=ee,this.currentTime=te,this.totalTime=ne,this.direction=ae<0?-1:1}function BMCompleteEvent(ee,te){this.type=ee,this.direction=te<0?-1:1}function BMCompleteLoopEvent(ee,te,ne,ae){this.type=ee,this.currentLoop=ne,this.totalLoops=te,this.direction=ae<0?-1:1}function BMSegmentStartEvent(ee,te,ne){this.type=ee,this.firstFrame=te,this.totalFrames=ne}function BMDestroyEvent(ee,te){this.type=ee,this.target=te}function BMRenderFrameErrorEvent(ee,te){this.type="renderFrameError",this.nativeError=ee,this.currentTime=te}function BMConfigErrorEvent(ee){this.type="configError",this.nativeError=ee}var createElementID=function(){var ee=0;return function(){return ee+=1,idPrefix$1+"__lottie_element_"+ee}}();function HSVtoRGB(ee,te,ne){var ae,re,oe,ie,le,ce,de,ue;switch(ie=Math.floor(ee*6),le=ee*6-ie,ce=ne*(1-te),de=ne*(1-le*te),ue=ne*(1-(1-le)*te),ie%6){case 0:ae=ne,re=ue,oe=ce;break;case 1:ae=de,re=ne,oe=ce;break;case 2:ae=ce,re=ne,oe=ue;break;case 3:ae=ce,re=de,oe=ne;break;case 4:ae=ue,re=ce,oe=ne;break;case 5:ae=ne,re=ce,oe=de;break}return[ae,re,oe]}function RGBtoHSV(ee,te,ne){var ae=Math.max(ee,te,ne),re=Math.min(ee,te,ne),oe=ae-re,ie,le=ae===0?0:oe/ae,ce=ae/255;switch(ae){case re:ie=0;break;case ee:ie=te-ne+oe*(te<ne?6:0),ie/=6*oe;break;case te:ie=ne-ee+oe*2,ie/=6*oe;break;case ne:ie=ee-te+oe*4,ie/=6*oe;break}return[ie,le,ce]}function addSaturationToRGB(ee,te){var ne=RGBtoHSV(ee[0]*255,ee[1]*255,ee[2]*255);return ne[1]+=te,ne[1]>1?ne[1]=1:ne[1]<=0&&(ne[1]=0),HSVtoRGB(ne[0],ne[1],ne[2])}function addBrightnessToRGB(ee,te){var ne=RGBtoHSV(ee[0]*255,ee[1]*255,ee[2]*255);return ne[2]+=te,ne[2]>1?ne[2]=1:ne[2]<0&&(ne[2]=0),HSVtoRGB(ne[0],ne[1],ne[2])}function addHueToRGB(ee,te){var ne=RGBtoHSV(ee[0]*255,ee[1]*255,ee[2]*255);return ne[0]+=te/360,ne[0]>1?ne[0]-=1:ne[0]<0&&(ne[0]+=1),HSVtoRGB(ne[0],ne[1],ne[2])}var rgbToHex=function(){var ee=[],te,ne;for(te=0;te<256;te+=1)ne=te.toString(16),ee[te]=ne.length===1?"0"+ne:ne;return function(ae,re,oe){return ae<0&&(ae=0),re<0&&(re=0),oe<0&&(oe=0),"#"+ee[ae]+ee[re]+ee[oe]}}(),setSubframeEnabled=function(te){subframeEnabled=!!te},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(te){expressionsPlugin=te},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(te){expressionsInterfaces=te},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(te){defaultCurveSegments=te},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(te){idPrefix$1=te};function createNS(ee){return document.createElementNS(svgNS,ee)}function _typeof$5(ee){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(ne){return typeof ne}:_typeof$5=function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},_typeof$5(ee)}var dataManager=function(){var ee=1,te=[],ne,ae,re={onmessage:function(){},postMessage:function(ge){ne({data:ge})}},oe={postMessage:function(ge){re.onmessage({data:ge})}};function ie(fe){if(window.Worker&&window.Blob&&getWebWorker()){var ge=new Blob(["var _workerSelf = self; self.onmessage = ",fe.toString()],{type:"text/javascript"}),me=URL.createObjectURL(ge);return new Worker(me)}return ne=fe,re}function le(){ae||(ae=ie(function(ge){function me(){function ke(Pe,Be){var Me,xe,Ce=Pe.length,Fe,Re,qe,Ge;for(xe=0;xe<Ce;xe+=1)if(Me=Pe[xe],"ks"in Me&&!Me.completed){if(Me.completed=!0,Me.hasMask){var Ze=Me.masksProperties;for(Re=Ze.length,Fe=0;Fe<Re;Fe+=1)if(Ze[Fe].pt.k.i)Ee(Ze[Fe].pt.k);else for(Ge=Ze[Fe].pt.k.length,qe=0;qe<Ge;qe+=1)Ze[Fe].pt.k[qe].s&&Ee(Ze[Fe].pt.k[qe].s[0]),Ze[Fe].pt.k[qe].e&&Ee(Ze[Fe].pt.k[qe].e[0])}Me.ty===0?(Me.layers=$e(Me.refId,Be),ke(Me.layers,Be)):Me.ty===4?ye(Me.shapes):Me.ty===5&&Ve(Me)}}function ve(Pe,Be){if(Pe){var Me=0,xe=Pe.length;for(Me=0;Me<xe;Me+=1)Pe[Me].t===1&&(Pe[Me].data.layers=$e(Pe[Me].data.refId,Be),ke(Pe[Me].data.layers,Be))}}function _e(Pe,Be){for(var Me=0,xe=Be.length;Me<xe;){if(Be[Me].id===Pe)return Be[Me];Me+=1}return null}function $e(Pe,Be){var Me=_e(Pe,Be);return Me?Me.layers.__used?JSON.parse(JSON.stringify(Me.layers)):(Me.layers.__used=!0,Me.layers):null}function ye(Pe){var Be,Me=Pe.length,xe,Ce;for(Be=Me-1;Be>=0;Be-=1)if(Pe[Be].ty==="sh")if(Pe[Be].ks.k.i)Ee(Pe[Be].ks.k);else for(Ce=Pe[Be].ks.k.length,xe=0;xe<Ce;xe+=1)Pe[Be].ks.k[xe].s&&Ee(Pe[Be].ks.k[xe].s[0]),Pe[Be].ks.k[xe].e&&Ee(Pe[Be].ks.k[xe].e[0]);else Pe[Be].ty==="gr"&&ye(Pe[Be].it)}function Ee(Pe){var Be,Me=Pe.i.length;for(Be=0;Be<Me;Be+=1)Pe.i[Be][0]+=Pe.v[Be][0],Pe.i[Be][1]+=Pe.v[Be][1],Pe.o[Be][0]+=Pe.v[Be][0],Pe.o[Be][1]+=Pe.v[Be][1]}function Se(Pe,Be){var Me=Be?Be.split("."):[100,100,100];return Pe[0]>Me[0]?!0:Me[0]>Pe[0]?!1:Pe[1]>Me[1]?!0:Me[1]>Pe[1]?!1:Pe[2]>Me[2]?!0:Me[2]>Pe[2]?!1:null}var Le=function(){var Pe=[4,4,14];function Be(xe){var Ce=xe.t.d;xe.t.d={k:[{s:Ce,t:0}]}}function Me(xe){var Ce,Fe=xe.length;for(Ce=0;Ce<Fe;Ce+=1)xe[Ce].ty===5&&Be(xe[Ce])}return function(xe){if(Se(Pe,xe.v)&&(Me(xe.layers),xe.assets)){var Ce,Fe=xe.assets.length;for(Ce=0;Ce<Fe;Ce+=1)xe.assets[Ce].layers&&Me(xe.assets[Ce].layers)}}}(),Ae=function(){var Pe=[4,7,99];return function(Be){if(Be.chars&&!Se(Pe,Be.v)){var Me,xe=Be.chars.length;for(Me=0;Me<xe;Me+=1){var Ce=Be.chars[Me];Ce.data&&Ce.data.shapes&&(ye(Ce.data.shapes),Ce.data.ip=0,Ce.data.op=99999,Ce.data.st=0,Ce.data.sr=1,Ce.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},Be.chars[Me].t||(Ce.data.shapes.push({ty:"no"}),Ce.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),De=function(){var Pe=[5,7,15];function Be(xe){var Ce=xe.t.p;typeof Ce.a=="number"&&(Ce.a={a:0,k:Ce.a}),typeof Ce.p=="number"&&(Ce.p={a:0,k:Ce.p}),typeof Ce.r=="number"&&(Ce.r={a:0,k:Ce.r})}function Me(xe){var Ce,Fe=xe.length;for(Ce=0;Ce<Fe;Ce+=1)xe[Ce].ty===5&&Be(xe[Ce])}return function(xe){if(Se(Pe,xe.v)&&(Me(xe.layers),xe.assets)){var Ce,Fe=xe.assets.length;for(Ce=0;Ce<Fe;Ce+=1)xe.assets[Ce].layers&&Me(xe.assets[Ce].layers)}}}(),Oe=function(){var Pe=[4,1,9];function Be(xe){var Ce,Fe=xe.length,Re,qe;for(Ce=0;Ce<Fe;Ce+=1)if(xe[Ce].ty==="gr")Be(xe[Ce].it);else if(xe[Ce].ty==="fl"||xe[Ce].ty==="st")if(xe[Ce].c.k&&xe[Ce].c.k[0].i)for(qe=xe[Ce].c.k.length,Re=0;Re<qe;Re+=1)xe[Ce].c.k[Re].s&&(xe[Ce].c.k[Re].s[0]/=255,xe[Ce].c.k[Re].s[1]/=255,xe[Ce].c.k[Re].s[2]/=255,xe[Ce].c.k[Re].s[3]/=255),xe[Ce].c.k[Re].e&&(xe[Ce].c.k[Re].e[0]/=255,xe[Ce].c.k[Re].e[1]/=255,xe[Ce].c.k[Re].e[2]/=255,xe[Ce].c.k[Re].e[3]/=255);else xe[Ce].c.k[0]/=255,xe[Ce].c.k[1]/=255,xe[Ce].c.k[2]/=255,xe[Ce].c.k[3]/=255}function Me(xe){var Ce,Fe=xe.length;for(Ce=0;Ce<Fe;Ce+=1)xe[Ce].ty===4&&Be(xe[Ce].shapes)}return function(xe){if(Se(Pe,xe.v)&&(Me(xe.layers),xe.assets)){var Ce,Fe=xe.assets.length;for(Ce=0;Ce<Fe;Ce+=1)xe.assets[Ce].layers&&Me(xe.assets[Ce].layers)}}}(),Ie=function(){var Pe=[4,4,18];function Be(xe){var Ce,Fe=xe.length,Re,qe;for(Ce=Fe-1;Ce>=0;Ce-=1)if(xe[Ce].ty==="sh")if(xe[Ce].ks.k.i)xe[Ce].ks.k.c=xe[Ce].closed;else for(qe=xe[Ce].ks.k.length,Re=0;Re<qe;Re+=1)xe[Ce].ks.k[Re].s&&(xe[Ce].ks.k[Re].s[0].c=xe[Ce].closed),xe[Ce].ks.k[Re].e&&(xe[Ce].ks.k[Re].e[0].c=xe[Ce].closed);else xe[Ce].ty==="gr"&&Be(xe[Ce].it)}function Me(xe){var Ce,Fe,Re=xe.length,qe,Ge,Ze,Xe;for(Fe=0;Fe<Re;Fe+=1){if(Ce=xe[Fe],Ce.hasMask){var Ue=Ce.masksProperties;for(Ge=Ue.length,qe=0;qe<Ge;qe+=1)if(Ue[qe].pt.k.i)Ue[qe].pt.k.c=Ue[qe].cl;else for(Xe=Ue[qe].pt.k.length,Ze=0;Ze<Xe;Ze+=1)Ue[qe].pt.k[Ze].s&&(Ue[qe].pt.k[Ze].s[0].c=Ue[qe].cl),Ue[qe].pt.k[Ze].e&&(Ue[qe].pt.k[Ze].e[0].c=Ue[qe].cl)}Ce.ty===4&&Be(Ce.shapes)}}return function(xe){if(Se(Pe,xe.v)&&(Me(xe.layers),xe.assets)){var Ce,Fe=xe.assets.length;for(Ce=0;Ce<Fe;Ce+=1)xe.assets[Ce].layers&&Me(xe.assets[Ce].layers)}}}();function ze(Pe){Pe.__complete||(Oe(Pe),Le(Pe),Ae(Pe),De(Pe),Ie(Pe),ke(Pe.layers,Pe.assets),ve(Pe.chars,Pe.assets),Pe.__complete=!0)}function Ve(Pe){Pe.t.a.length===0&&"m"in Pe.t.p}var Ne={};return Ne.completeData=ze,Ne.checkColors=Oe,Ne.checkChars=Ae,Ne.checkPathProperties=De,Ne.checkShapes=Ie,Ne.completeLayers=ke,Ne}if(oe.dataManager||(oe.dataManager=me()),oe.assetLoader||(oe.assetLoader=function(){function ke(_e){var $e=_e.getResponseHeader("content-type");return $e&&_e.responseType==="json"&&$e.indexOf("json")!==-1||_e.response&&_typeof$5(_e.response)==="object"?_e.response:_e.response&&typeof _e.response=="string"?JSON.parse(_e.response):_e.responseText?JSON.parse(_e.responseText):null}function ve(_e,$e,ye,Ee){var Se,Le=new XMLHttpRequest;try{Le.responseType="json"}catch{}Le.onreadystatechange=function(){if(Le.readyState===4)if(Le.status===200)Se=ke(Le),ye(Se);else try{Se=ke(Le),ye(Se)}catch(Ae){Ee&&Ee(Ae)}};try{Le.open(["G","E","T"].join(""),_e,!0)}catch{Le.open(["G","E","T"].join(""),$e+"/"+_e,!0)}Le.send()}return{load:ve}}()),ge.data.type==="loadAnimation")oe.assetLoader.load(ge.data.path,ge.data.fullPath,function(ke){oe.dataManager.completeData(ke),oe.postMessage({id:ge.data.id,payload:ke,status:"success"})},function(){oe.postMessage({id:ge.data.id,status:"error"})});else if(ge.data.type==="complete"){var pe=ge.data.animation;oe.dataManager.completeData(pe),oe.postMessage({id:ge.data.id,payload:pe,status:"success"})}else ge.data.type==="loadData"&&oe.assetLoader.load(ge.data.path,ge.data.fullPath,function(ke){oe.postMessage({id:ge.data.id,payload:ke,status:"success"})},function(){oe.postMessage({id:ge.data.id,status:"error"})})}),ae.onmessage=function(fe){var ge=fe.data,me=ge.id,pe=te[me];te[me]=null,ge.status==="success"?pe.onComplete(ge.payload):pe.onError&&pe.onError()})}function ce(fe,ge){ee+=1;var me="processId_"+ee;return te[me]={onComplete:fe,onError:ge},me}function de(fe,ge,me){le();var pe=ce(ge,me);ae.postMessage({type:"loadAnimation",path:fe,fullPath:window.location.origin+window.location.pathname,id:pe})}function ue(fe,ge,me){le();var pe=ce(ge,me);ae.postMessage({type:"loadData",path:fe,fullPath:window.location.origin+window.location.pathname,id:pe})}function be(fe,ge,me){le();var pe=ce(ge,me);ae.postMessage({type:"complete",animation:fe,id:pe})}return{loadAnimation:de,loadData:ue,completeAnimation:be}}(),ImagePreloader=function(){var ee=function(){var ve=createTag("canvas");ve.width=1,ve.height=1;var _e=ve.getContext("2d");return _e.fillStyle="rgba(0,0,0,0)",_e.fillRect(0,0,1,1),ve}();function te(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function ne(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function ae(ve,_e,$e){var ye="";if(ve.e)ye=ve.p;else if(_e){var Ee=ve.p;Ee.indexOf("images/")!==-1&&(Ee=Ee.split("/")[1]),ye=_e+Ee}else ye=$e,ye+=ve.u?ve.u:"",ye+=ve.p;return ye}function re(ve){var _e=0,$e=setInterval((function(){var ye=ve.getBBox();(ye.width||_e>500)&&(this._imageLoaded(),clearInterval($e)),_e+=1}).bind(this),50)}function oe(ve){var _e=ae(ve,this.assetsPath,this.path),$e=createNS("image");isSafari?this.testImageLoaded($e):$e.addEventListener("load",this._imageLoaded,!1),$e.addEventListener("error",(function(){ye.img=ee,this._imageLoaded()}).bind(this),!1),$e.setAttributeNS("http://www.w3.org/1999/xlink","href",_e),this._elementHelper.append?this._elementHelper.append($e):this._elementHelper.appendChild($e);var ye={img:$e,assetData:ve};return ye}function ie(ve){var _e=ae(ve,this.assetsPath,this.path),$e=createTag("img");$e.crossOrigin="anonymous",$e.addEventListener("load",this._imageLoaded,!1),$e.addEventListener("error",(function(){ye.img=ee,this._imageLoaded()}).bind(this),!1),$e.src=_e;var ye={img:$e,assetData:ve};return ye}function le(ve){var _e={assetData:ve},$e=ae(ve,this.assetsPath,this.path);return dataManager.loadData($e,(function(ye){_e.img=ye,this._footageLoaded()}).bind(this),(function(){_e.img={},this._footageLoaded()}).bind(this)),_e}function ce(ve,_e){this.imagesLoadedCb=_e;var $e,ye=ve.length;for($e=0;$e<ye;$e+=1)ve[$e].layers||(!ve[$e].t||ve[$e].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(ve[$e]))):ve[$e].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(ve[$e]))))}function de(ve){this.path=ve||""}function ue(ve){this.assetsPath=ve||""}function be(ve){for(var _e=0,$e=this.images.length;_e<$e;){if(this.images[_e].assetData===ve)return this.images[_e].img;_e+=1}return null}function fe(){this.imagesLoadedCb=null,this.images.length=0}function ge(){return this.totalImages===this.loadedAssets}function me(){return this.totalFootages===this.loadedFootagesCount}function pe(ve,_e){ve==="svg"?(this._elementHelper=_e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function ke(){this._imageLoaded=te.bind(this),this._footageLoaded=ne.bind(this),this.testImageLoaded=re.bind(this),this.createFootageData=le.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return ke.prototype={loadAssets:ce,setAssetsPath:ue,setPath:de,loadedImages:ge,loadedFootages:me,destroy:fe,getAsset:be,createImgData:ie,createImageData:oe,imageLoaded:te,footageLoaded:ne,setCacheType:pe},ke}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(te,ne){if(this._cbs[te])for(var ae=this._cbs[te],re=0;re<ae.length;re+=1)ae[re](ne)},addEventListener:function(te,ne){return this._cbs[te]||(this._cbs[te]=[]),this._cbs[te].push(ne),(function(){this.removeEventListener(te,ne)}).bind(this)},removeEventListener:function(te,ne){if(!ne)this._cbs[te]=null;else if(this._cbs[te]){for(var ae=0,re=this._cbs[te].length;ae<re;)this._cbs[te][ae]===ne&&(this._cbs[te].splice(ae,1),ae-=1,re-=1),ae+=1;this._cbs[te].length||(this._cbs[te]=null)}}};var markerParser=function(){function ee(te){for(var ne=te.split(`\r
|
|
284
284
|
`),ae={},re,oe=0,ie=0;ie<ne.length;ie+=1)re=ne[ie].split(":"),re.length===2&&(ae[re[0]]=re[1].trim(),oe+=1);if(oe===0)throw new Error;return ae}return function(te){for(var ne=[],ae=0;ae<te.length;ae+=1){var re=te[ae],oe={time:re.tm,duration:re.dr};try{oe.payload=JSON.parse(te[ae].cm)}catch{try{oe.payload=ee(te[ae].cm)}catch{oe.payload={name:te[ae].cm}}}ne.push(oe)}return ne}}(),ProjectInterface=function(){function ee(te){this.compositions.push(te)}return function(){function te(ne){for(var ae=0,re=this.compositions.length;ae<re;){if(this.compositions[ae].data&&this.compositions[ae].data.nm===ne)return this.compositions[ae].prepareFrame&&this.compositions[ae].data.xt&&this.compositions[ae].prepareFrame(this.currentFrame),this.compositions[ae].compInterface;ae+=1}return null}return te.compositions=[],te.currentFrame=0,te.registerComposition=ee,te}}(),renderers={},registerRenderer=function(te,ne){renderers[te]=ne};function getRenderer(ee){return renderers[ee]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var ee in renderers)if(renderers[ee])return ee;return""}function _typeof$4(ee){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$4=function(ne){return typeof ne}:_typeof$4=function(ne){return ne&&typeof Symbol=="function"&&ne.constructor===Symbol&&ne!==Symbol.prototype?"symbol":typeof ne},_typeof$4(ee)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(ee){(ee.wrapper||ee.container)&&(this.wrapper=ee.wrapper||ee.container);var te="svg";ee.animType?te=ee.animType:ee.renderer&&(te=ee.renderer);var ne=getRenderer(te);this.renderer=new ne(this,ee.rendererSettings),this.imagePreloader.setCacheType(te,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=te,ee.loop===""||ee.loop===null||ee.loop===void 0||ee.loop===!0?this.loop=!0:ee.loop===!1?this.loop=!1:this.loop=parseInt(ee.loop,10),this.autoplay="autoplay"in ee?ee.autoplay:!0,this.name=ee.name?ee.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(ee,"autoloadSegments")?ee.autoloadSegments:!0,this.assetsPath=ee.assetsPath,this.initialSegment=ee.initialSegment,ee.audioFactory&&this.audioController.setAudioFactory(ee.audioFactory),ee.animationData?this.setupAnimation(ee.animationData):ee.path&&(ee.path.lastIndexOf("\\")!==-1?this.path=ee.path.substr(0,ee.path.lastIndexOf("\\")+1):this.path=ee.path.substr(0,ee.path.lastIndexOf("/")+1),this.fileName=ee.path.substr(ee.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(ee.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(ee){dataManager.completeAnimation(ee,this.configAnimation)},AnimationItem.prototype.setData=function(ee,te){te&&_typeof$4(te)!=="object"&&(te=JSON.parse(te));var ne={wrapper:ee,animationData:te},ae=ee.attributes;ne.path=ae.getNamedItem("data-animation-path")?ae.getNamedItem("data-animation-path").value:ae.getNamedItem("data-bm-path")?ae.getNamedItem("data-bm-path").value:ae.getNamedItem("bm-path")?ae.getNamedItem("bm-path").value:"",ne.animType=ae.getNamedItem("data-anim-type")?ae.getNamedItem("data-anim-type").value:ae.getNamedItem("data-bm-type")?ae.getNamedItem("data-bm-type").value:ae.getNamedItem("bm-type")?ae.getNamedItem("bm-type").value:ae.getNamedItem("data-bm-renderer")?ae.getNamedItem("data-bm-renderer").value:ae.getNamedItem("bm-renderer")?ae.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var re=ae.getNamedItem("data-anim-loop")?ae.getNamedItem("data-anim-loop").value:ae.getNamedItem("data-bm-loop")?ae.getNamedItem("data-bm-loop").value:ae.getNamedItem("bm-loop")?ae.getNamedItem("bm-loop").value:"";re==="false"?ne.loop=!1:re==="true"?ne.loop=!0:re!==""&&(ne.loop=parseInt(re,10));var oe=ae.getNamedItem("data-anim-autoplay")?ae.getNamedItem("data-anim-autoplay").value:ae.getNamedItem("data-bm-autoplay")?ae.getNamedItem("data-bm-autoplay").value:ae.getNamedItem("bm-autoplay")?ae.getNamedItem("bm-autoplay").value:!0;ne.autoplay=oe!=="false",ne.name=ae.getNamedItem("data-name")?ae.getNamedItem("data-name").value:ae.getNamedItem("data-bm-name")?ae.getNamedItem("data-bm-name").value:ae.getNamedItem("bm-name")?ae.getNamedItem("bm-name").value:"";var ie=ae.getNamedItem("data-anim-prerender")?ae.getNamedItem("data-anim-prerender").value:ae.getNamedItem("data-bm-prerender")?ae.getNamedItem("data-bm-prerender").value:ae.getNamedItem("bm-prerender")?ae.getNamedItem("bm-prerender").value:"";ie==="false"&&(ne.prerender=!1),ne.path?this.setParams(ne):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(ee){ee.op>this.animationData.op&&(this.animationData.op=ee.op,this.totalFrames=Math.floor(ee.op-this.animationData.ip));var te=this.animationData.layers,ne,ae=te.length,re=ee.layers,oe,ie=re.length;for(oe=0;oe<ie;oe+=1)for(ne=0;ne<ae;){if(te[ne].id===re[oe].id){te[ne]=re[oe];break}ne+=1}if((ee.chars||ee.fonts)&&(this.renderer.globalData.fontManager.addChars(ee.chars),this.renderer.globalData.fontManager.addFonts(ee.fonts,this.renderer.globalData.defs)),ee.assets)for(ae=ee.assets.length,ne=0;ne<ae;ne+=1)this.animationData.assets.push(ee.assets[ne]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(ee){this.animationData=ee;var te=getExpressionsPlugin();te&&te.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var ee=this.animationData.segments;if(!ee||ee.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var te=ee.shift();this.timeCompleted=te.time*this.frameRate;var ne=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(ne,this.includeLayers.bind(this),(function(){this.trigger("data_failed")}).bind(this))},AnimationItem.prototype.loadSegments=function(){var ee=this.animationData.segments;ee||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(ee){if(this.renderer)try{this.animationData=ee,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(ee),ee.assets||(ee.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(ee.assets),this.markers=markerParser(ee.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(te){this.triggerConfigError(te)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var ee=getExpressionsPlugin();ee&&ee.initExpressions(this),this.renderer.initItems(),setTimeout((function(){this.trigger("DOMLoaded")}).bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(ee,te){var ne=typeof ee=="number"?ee:void 0,ae=typeof te=="number"?te:void 0;this.renderer.updateContainerSize(ne,ae)},AnimationItem.prototype.setSubframe=function(ee){this.isSubframeEnabled=!!ee},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(ee){this.triggerRenderFrameError(ee)}},AnimationItem.prototype.play=function(ee){ee&&this.name!==ee||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(ee){ee&&this.name!==ee||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(ee){ee&&this.name!==ee||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(ee){ee&&this.name!==ee||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(ee){for(var te,ne=0;ne<this.markers.length;ne+=1)if(te=this.markers[ne],te.payload&&te.payload.name===ee)return te;return null},AnimationItem.prototype.goToAndStop=function(ee,te,ne){if(!(ne&&this.name!==ne)){var ae=Number(ee);if(isNaN(ae)){var re=this.getMarkerData(ee);re&&this.goToAndStop(re.time,!0)}else te?this.setCurrentRawFrameValue(ee):this.setCurrentRawFrameValue(ee*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(ee,te,ne){if(!(ne&&this.name!==ne)){var ae=Number(ee);if(isNaN(ae)){var re=this.getMarkerData(ee);re&&(re.duration?this.playSegments([re.time,re.time+re.duration],!0):this.goToAndStop(re.time,!0))}else this.goToAndStop(ae,te,ne);this.play()}},AnimationItem.prototype.advanceTime=function(ee){if(!(this.isPaused===!0||this.isLoaded===!1)){var te=this.currentRawFrame+ee*this.frameModifier,ne=!1;te>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(te>this.totalFrames?te%this.totalFrames:0)||(ne=!0,te=this.totalFrames-1):te>=this.totalFrames?(this.playCount+=1,this.checkSegments(te%this.totalFrames)||(this.setCurrentRawFrameValue(te%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(te):te<0?this.checkSegments(te%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+te%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(ne=!0,te=0)):this.setCurrentRawFrameValue(te),ne&&(this.setCurrentRawFrameValue(te),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(ee,te){this.playCount=0,ee[1]<ee[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=ee[0]-ee[1],this.timeCompleted=this.totalFrames,this.firstFrame=ee[1],this.setCurrentRawFrameValue(this.totalFrames-.001-te)):ee[1]>ee[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=ee[1]-ee[0],this.timeCompleted=this.totalFrames,this.firstFrame=ee[0],this.setCurrentRawFrameValue(.001+te)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(ee,te){var ne=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<ee?ne=ee:this.currentRawFrame+this.firstFrame>te&&(ne=te-ee)),this.firstFrame=ee,this.totalFrames=te-ee,this.timeCompleted=this.totalFrames,ne!==-1&&this.goToAndStop(ne,!0)},AnimationItem.prototype.playSegments=function(ee,te){if(te&&(this.segments.length=0),_typeof$4(ee[0])==="object"){var ne,ae=ee.length;for(ne=0;ne<ae;ne+=1)this.segments.push(ee[ne])}else this.segments.push(ee);this.segments.length&&te&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(ee){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),ee&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(ee){return this.segments.length?(this.adjustSegment(this.segments.shift(),ee),!0):!1},AnimationItem.prototype.destroy=function(ee){ee&&this.name!==ee||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(ee){this.currentRawFrame=ee,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(ee){this.playSpeed=ee,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(ee){this.playDirection=ee<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(ee){this.loop=ee},AnimationItem.prototype.setVolume=function(ee,te){te&&this.name!==te||this.audioController.setVolume(ee)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(ee){ee&&this.name!==ee||this.audioController.mute()},AnimationItem.prototype.unmute=function(ee){ee&&this.name!==ee||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(ee){var te="";if(ee.e)te=ee.p;else if(this.assetsPath){var ne=ee.p;ne.indexOf("images/")!==-1&&(ne=ne.split("/")[1]),te=this.assetsPath+ne}else te=this.path,te+=ee.u?ee.u:"",te+=ee.p;return te},AnimationItem.prototype.getAssetData=function(ee){for(var te=0,ne=this.assets.length;te<ne;){if(ee===this.assets[te].id)return this.assets[te];te+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(ee){return ee?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(ee,te,ne){try{var ae=this.renderer.getElementByPath(ee);ae.updateDocumentData(te,ne)}catch{}},AnimationItem.prototype.trigger=function(ee){if(this._cbs&&this._cbs[ee])switch(ee){case"enterFrame":this.triggerEvent(ee,new BMEnterFrameEvent(ee,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(ee,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(ee,new BMCompleteLoopEvent(ee,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(ee,new BMCompleteEvent(ee,this.frameMult));break;case"segmentStart":this.triggerEvent(ee,new BMSegmentStartEvent(ee,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(ee,new BMDestroyEvent(ee,this));break;default:this.triggerEvent(ee)}ee==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(ee,this.currentFrame,this.totalFrames,this.frameMult)),ee==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(ee,this.loop,this.playCount,this.frameMult)),ee==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(ee,this.frameMult)),ee==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(ee,this.firstFrame,this.totalFrames)),ee==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(ee,this))},AnimationItem.prototype.triggerRenderFrameError=function(ee){var te=new BMRenderFrameErrorEvent(ee,this.currentFrame);this.triggerEvent("error",te),this.onError&&this.onError.call(this,te)},AnimationItem.prototype.triggerConfigError=function(ee){var te=new BMConfigErrorEvent(ee,this.currentFrame);this.triggerEvent("error",te),this.onError&&this.onError.call(this,te)};var animationManager=function(){var ee={},te=[],ne=0,ae=0,re=0,oe=!0,ie=!1;function le(Be){for(var Me=0,xe=Be.target;Me<ae;)te[Me].animation===xe&&(te.splice(Me,1),Me-=1,ae-=1,xe.isPaused||be()),Me+=1}function ce(Be,Me){if(!Be)return null;for(var xe=0;xe<ae;){if(te[xe].elem===Be&&te[xe].elem!==null)return te[xe].animation;xe+=1}var Ce=new AnimationItem;return fe(Ce,Be),Ce.setData(Be,Me),Ce}function de(){var Be,Me=te.length,xe=[];for(Be=0;Be<Me;Be+=1)xe.push(te[Be].animation);return xe}function ue(){re+=1,Oe()}function be(){re-=1}function fe(Be,Me){Be.addEventListener("destroy",le),Be.addEventListener("_active",ue),Be.addEventListener("_idle",be),te.push({elem:Me,animation:Be}),ae+=1}function ge(Be){var Me=new AnimationItem;return fe(Me,null),Me.setParams(Be),Me}function me(Be,Me){var xe;for(xe=0;xe<ae;xe+=1)te[xe].animation.setSpeed(Be,Me)}function pe(Be,Me){var xe;for(xe=0;xe<ae;xe+=1)te[xe].animation.setDirection(Be,Me)}function ke(Be){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.play(Be)}function ve(Be){var Me=Be-ne,xe;for(xe=0;xe<ae;xe+=1)te[xe].animation.advanceTime(Me);ne=Be,re&&!ie?window.requestAnimationFrame(ve):oe=!0}function _e(Be){ne=Be,window.requestAnimationFrame(ve)}function $e(Be){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.pause(Be)}function ye(Be,Me,xe){var Ce;for(Ce=0;Ce<ae;Ce+=1)te[Ce].animation.goToAndStop(Be,Me,xe)}function Ee(Be){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.stop(Be)}function Se(Be){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.togglePause(Be)}function Le(Be){var Me;for(Me=ae-1;Me>=0;Me-=1)te[Me].animation.destroy(Be)}function Ae(Be,Me,xe){var Ce=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),Fe,Re=Ce.length;for(Fe=0;Fe<Re;Fe+=1)xe&&Ce[Fe].setAttribute("data-bm-type",xe),ce(Ce[Fe],Be);if(Me&&Re===0){xe||(xe="svg");var qe=document.getElementsByTagName("body")[0];qe.innerText="";var Ge=createTag("div");Ge.style.width="100%",Ge.style.height="100%",Ge.setAttribute("data-bm-type",xe),qe.appendChild(Ge),ce(Ge,Be)}}function De(){var Be;for(Be=0;Be<ae;Be+=1)te[Be].animation.resize()}function Oe(){!ie&&re&&oe&&(window.requestAnimationFrame(_e),oe=!1)}function Ie(){ie=!0}function ze(){ie=!1,Oe()}function Ve(Be,Me){var xe;for(xe=0;xe<ae;xe+=1)te[xe].animation.setVolume(Be,Me)}function Ne(Be){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.mute(Be)}function Pe(Be){var Me;for(Me=0;Me<ae;Me+=1)te[Me].animation.unmute(Be)}return ee.registerAnimation=ce,ee.loadAnimation=ge,ee.setSpeed=me,ee.setDirection=pe,ee.play=ke,ee.pause=$e,ee.stop=Ee,ee.togglePause=Se,ee.searchAnimations=Ae,ee.resize=De,ee.goToAndStop=ye,ee.destroy=Le,ee.freeze=Ie,ee.unfreeze=ze,ee.setVolume=Ve,ee.mute=Ne,ee.unmute=Pe,ee.getRegisteredAnimations=de,ee}(),BezierFactory=function(){var ee={};ee.getBezierEasing=ne;var te={};function ne(_e,$e,ye,Ee,Se){var Le=Se||("bez_"+_e+"_"+$e+"_"+ye+"_"+Ee).replace(/\./g,"p");if(te[Le])return te[Le];var Ae=new ve([_e,$e,ye,Ee]);return te[Le]=Ae,Ae}var ae=4,re=.001,oe=1e-7,ie=10,le=11,ce=1/(le-1),de=typeof Float32Array=="function";function ue(_e,$e){return 1-3*$e+3*_e}function be(_e,$e){return 3*$e-6*_e}function fe(_e){return 3*_e}function ge(_e,$e,ye){return((ue($e,ye)*_e+be($e,ye))*_e+fe($e))*_e}function me(_e,$e,ye){return 3*ue($e,ye)*_e*_e+2*be($e,ye)*_e+fe($e)}function pe(_e,$e,ye,Ee,Se){var Le,Ae,De=0;do Ae=$e+(ye-$e)/2,Le=ge(Ae,Ee,Se)-_e,Le>0?ye=Ae:$e=Ae;while(Math.abs(Le)>oe&&++De<ie);return Ae}function ke(_e,$e,ye,Ee){for(var Se=0;Se<ae;++Se){var Le=me($e,ye,Ee);if(Le===0)return $e;var Ae=ge($e,ye,Ee)-_e;$e-=Ae/Le}return $e}function ve(_e){this._p=_e,this._mSampleValues=de?new Float32Array(le):new Array(le),this._precomputed=!1,this.get=this.get.bind(this)}return ve.prototype={get:function($e){var ye=this._p[0],Ee=this._p[1],Se=this._p[2],Le=this._p[3];return this._precomputed||this._precompute(),ye===Ee&&Se===Le?$e:$e===0?0:$e===1?1:ge(this._getTForX($e),Ee,Le)},_precompute:function(){var $e=this._p[0],ye=this._p[1],Ee=this._p[2],Se=this._p[3];this._precomputed=!0,($e!==ye||Ee!==Se)&&this._calcSampleValues()},_calcSampleValues:function(){for(var $e=this._p[0],ye=this._p[2],Ee=0;Ee<le;++Ee)this._mSampleValues[Ee]=ge(Ee*ce,$e,ye)},_getTForX:function($e){for(var ye=this._p[0],Ee=this._p[2],Se=this._mSampleValues,Le=0,Ae=1,De=le-1;Ae!==De&&Se[Ae]<=$e;++Ae)Le+=ce;--Ae;var Oe=($e-Se[Ae])/(Se[Ae+1]-Se[Ae]),Ie=Le+Oe*ce,ze=me(Ie,ye,Ee);return ze>=re?ke($e,Ie,ye,Ee):ze===0?Ie:pe($e,Le,Le+ce,ye,Ee)}},ee}(),pooling=function(){function ee(te){return te.concat(createSizedArray(te.length))}return{double:ee}}(),poolFactory=function(){return function(ee,te,ne){var ae=0,re=ee,oe=createSizedArray(re),ie={newElement:le,release:ce};function le(){var de;return ae?(ae-=1,de=oe[ae]):de=te(),de}function ce(de){ae===re&&(oe=pooling.double(oe),re*=2),ne&&ne(de),oe[ae]=de,ae+=1}return ie}}(),bezierLengthPool=function(){function ee(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,ee)}(),segmentsLengthPool=function(){function ee(){return{lengths:[],totalLength:0}}function te(ne){var ae,re=ne.lengths.length;for(ae=0;ae<re;ae+=1)bezierLengthPool.release(ne.lengths[ae]);ne.lengths.length=0}return poolFactory(8,ee,te)}();function bezFunction(){var ee=Math;function te(fe,ge,me,pe,ke,ve){var _e=fe*pe+ge*ke+me*ve-ke*pe-ve*fe-me*ge;return _e>-.001&&_e<.001}function ne(fe,ge,me,pe,ke,ve,_e,$e,ye){if(me===0&&ve===0&&ye===0)return te(fe,ge,pe,ke,_e,$e);var Ee=ee.sqrt(ee.pow(pe-fe,2)+ee.pow(ke-ge,2)+ee.pow(ve-me,2)),Se=ee.sqrt(ee.pow(_e-fe,2)+ee.pow($e-ge,2)+ee.pow(ye-me,2)),Le=ee.sqrt(ee.pow(_e-pe,2)+ee.pow($e-ke,2)+ee.pow(ye-ve,2)),Ae;return Ee>Se?Ee>Le?Ae=Ee-Se-Le:Ae=Le-Se-Ee:Le>Se?Ae=Le-Se-Ee:Ae=Se-Ee-Le,Ae>-1e-4&&Ae<1e-4}var ae=function(){return function(fe,ge,me,pe){var ke=getDefaultCurveSegments(),ve,_e,$e,ye,Ee,Se=0,Le,Ae=[],De=[],Oe=bezierLengthPool.newElement();for($e=me.length,ve=0;ve<ke;ve+=1){for(Ee=ve/(ke-1),Le=0,_e=0;_e<$e;_e+=1)ye=bmPow(1-Ee,3)*fe[_e]+3*bmPow(1-Ee,2)*Ee*me[_e]+3*(1-Ee)*bmPow(Ee,2)*pe[_e]+bmPow(Ee,3)*ge[_e],Ae[_e]=ye,De[_e]!==null&&(Le+=bmPow(Ae[_e]-De[_e],2)),De[_e]=Ae[_e];Le&&(Le=bmSqrt(Le),Se+=Le),Oe.percents[ve]=Ee,Oe.lengths[ve]=Se}return Oe.addedLength=Se,Oe}}();function re(fe){var ge=segmentsLengthPool.newElement(),me=fe.c,pe=fe.v,ke=fe.o,ve=fe.i,_e,$e=fe._length,ye=ge.lengths,Ee=0;for(_e=0;_e<$e-1;_e+=1)ye[_e]=ae(pe[_e],pe[_e+1],ke[_e],ve[_e+1]),Ee+=ye[_e].addedLength;return me&&$e&&(ye[_e]=ae(pe[_e],pe[0],ke[_e],ve[0]),Ee+=ye[_e].addedLength),ge.totalLength=Ee,ge}function oe(fe){this.segmentLength=0,this.points=new Array(fe)}function ie(fe,ge){this.partialLength=fe,this.point=ge}var le=function(){var fe={};return function(ge,me,pe,ke){var ve=(ge[0]+"_"+ge[1]+"_"+me[0]+"_"+me[1]+"_"+pe[0]+"_"+pe[1]+"_"+ke[0]+"_"+ke[1]).replace(/\./g,"p");if(!fe[ve]){var _e=getDefaultCurveSegments(),$e,ye,Ee,Se,Le,Ae=0,De,Oe,Ie=null;ge.length===2&&(ge[0]!==me[0]||ge[1]!==me[1])&&te(ge[0],ge[1],me[0],me[1],ge[0]+pe[0],ge[1]+pe[1])&&te(ge[0],ge[1],me[0],me[1],me[0]+ke[0],me[1]+ke[1])&&(_e=2);var ze=new oe(_e);for(Ee=pe.length,$e=0;$e<_e;$e+=1){for(Oe=createSizedArray(Ee),Le=$e/(_e-1),De=0,ye=0;ye<Ee;ye+=1)Se=bmPow(1-Le,3)*ge[ye]+3*bmPow(1-Le,2)*Le*(ge[ye]+pe[ye])+3*(1-Le)*bmPow(Le,2)*(me[ye]+ke[ye])+bmPow(Le,3)*me[ye],Oe[ye]=Se,Ie!==null&&(De+=bmPow(Oe[ye]-Ie[ye],2));De=bmSqrt(De),Ae+=De,ze.points[$e]=new ie(De,Oe),Ie=Oe}ze.segmentLength=Ae,fe[ve]=ze}return fe[ve]}}();function ce(fe,ge){var me=ge.percents,pe=ge.lengths,ke=me.length,ve=bmFloor((ke-1)*fe),_e=fe*ge.addedLength,$e=0;if(ve===ke-1||ve===0||_e===pe[ve])return me[ve];for(var ye=pe[ve]>_e?-1:1,Ee=!0;Ee;)if(pe[ve]<=_e&&pe[ve+1]>_e?($e=(_e-pe[ve])/(pe[ve+1]-pe[ve]),Ee=!1):ve+=ye,ve<0||ve>=ke-1){if(ve===ke-1)return me[ve];Ee=!1}return me[ve]+(me[ve+1]-me[ve])*$e}function de(fe,ge,me,pe,ke,ve){var _e=ce(ke,ve),$e=1-_e,ye=ee.round(($e*$e*$e*fe[0]+(_e*$e*$e+$e*_e*$e+$e*$e*_e)*me[0]+(_e*_e*$e+$e*_e*_e+_e*$e*_e)*pe[0]+_e*_e*_e*ge[0])*1e3)/1e3,Ee=ee.round(($e*$e*$e*fe[1]+(_e*$e*$e+$e*_e*$e+$e*$e*_e)*me[1]+(_e*_e*$e+$e*_e*_e+_e*$e*_e)*pe[1]+_e*_e*_e*ge[1])*1e3)/1e3;return[ye,Ee]}var ue=createTypedArray("float32",8);function be(fe,ge,me,pe,ke,ve,_e){ke<0?ke=0:ke>1&&(ke=1);var $e=ce(ke,_e);ve=ve>1?1:ve;var ye=ce(ve,_e),Ee,Se=fe.length,Le=1-$e,Ae=1-ye,De=Le*Le*Le,Oe=$e*Le*Le*3,Ie=$e*$e*Le*3,ze=$e*$e*$e,Ve=Le*Le*Ae,Ne=$e*Le*Ae+Le*$e*Ae+Le*Le*ye,Pe=$e*$e*Ae+Le*$e*ye+$e*Le*ye,Be=$e*$e*ye,Me=Le*Ae*Ae,xe=$e*Ae*Ae+Le*ye*Ae+Le*Ae*ye,Ce=$e*ye*Ae+Le*ye*ye+$e*Ae*ye,Fe=$e*ye*ye,Re=Ae*Ae*Ae,qe=ye*Ae*Ae+Ae*ye*Ae+Ae*Ae*ye,Ge=ye*ye*Ae+Ae*ye*ye+ye*Ae*ye,Ze=ye*ye*ye;for(Ee=0;Ee<Se;Ee+=1)ue[Ee*4]=ee.round((De*fe[Ee]+Oe*me[Ee]+Ie*pe[Ee]+ze*ge[Ee])*1e3)/1e3,ue[Ee*4+1]=ee.round((Ve*fe[Ee]+Ne*me[Ee]+Pe*pe[Ee]+Be*ge[Ee])*1e3)/1e3,ue[Ee*4+2]=ee.round((Me*fe[Ee]+xe*me[Ee]+Ce*pe[Ee]+Fe*ge[Ee])*1e3)/1e3,ue[Ee*4+3]=ee.round((Re*fe[Ee]+qe*me[Ee]+Ge*pe[Ee]+Ze*ge[Ee])*1e3)/1e3;return ue}return{getSegmentsLength:re,getNewSegment:be,getPointInSegment:de,buildBezierData:le,pointOnLine2D:te,pointOnLine3D:ne}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(ee,te){var ne=this.offsetTime,ae;this.propType==="multidimensional"&&(ae=createTypedArray("float32",this.pv.length));for(var re=te.lastIndex,oe=re,ie=this.keyframes.length-1,le=!0,ce,de,ue;le;){if(ce=this.keyframes[oe],de=this.keyframes[oe+1],oe===ie-1&&ee>=de.t-ne){ce.h&&(ce=de),re=0;break}if(de.t-ne>ee){re=oe;break}oe<ie-1?oe+=1:(re=0,le=!1)}ue=this.keyframesMetadata[oe]||{};var be,fe,ge,me,pe,ke,ve=de.t-ne,_e=ce.t-ne,$e;if(ce.to){ue.bezierData||(ue.bezierData=bez.buildBezierData(ce.s,de.s||ce.e,ce.to,ce.ti));var ye=ue.bezierData;if(ee>=ve||ee<_e){var Ee=ee>=ve?ye.points.length-1:0;for(fe=ye.points[Ee].point.length,be=0;be<fe;be+=1)ae[be]=ye.points[Ee].point[be]}else{ue.__fnct?ke=ue.__fnct:(ke=BezierFactory.getBezierEasing(ce.o.x,ce.o.y,ce.i.x,ce.i.y,ce.n).get,ue.__fnct=ke),ge=ke((ee-_e)/(ve-_e));var Se=ye.segmentLength*ge,Le,Ae=te.lastFrame<ee&&te._lastKeyframeIndex===oe?te._lastAddedLength:0;for(pe=te.lastFrame<ee&&te._lastKeyframeIndex===oe?te._lastPoint:0,le=!0,me=ye.points.length;le;){if(Ae+=ye.points[pe].partialLength,Se===0||ge===0||pe===ye.points.length-1){for(fe=ye.points[pe].point.length,be=0;be<fe;be+=1)ae[be]=ye.points[pe].point[be];break}else if(Se>=Ae&&Se<Ae+ye.points[pe+1].partialLength){for(Le=(Se-Ae)/ye.points[pe+1].partialLength,fe=ye.points[pe].point.length,be=0;be<fe;be+=1)ae[be]=ye.points[pe].point[be]+(ye.points[pe+1].point[be]-ye.points[pe].point[be])*Le;break}pe<me-1?pe+=1:le=!1}te._lastPoint=pe,te._lastAddedLength=Ae-ye.points[pe].partialLength,te._lastKeyframeIndex=oe}}else{var De,Oe,Ie,ze,Ve;if(ie=ce.s.length,$e=de.s||ce.e,this.sh&&ce.h!==1)if(ee>=ve)ae[0]=$e[0],ae[1]=$e[1],ae[2]=$e[2];else if(ee<=_e)ae[0]=ce.s[0],ae[1]=ce.s[1],ae[2]=ce.s[2];else{var Ne=createQuaternion(ce.s),Pe=createQuaternion($e),Be=(ee-_e)/(ve-_e);quaternionToEuler(ae,slerp(Ne,Pe,Be))}else for(oe=0;oe<ie;oe+=1)ce.h!==1&&(ee>=ve?ge=1:ee<_e?ge=0:(ce.o.x.constructor===Array?(ue.__fnct||(ue.__fnct=[]),ue.__fnct[oe]?ke=ue.__fnct[oe]:(De=ce.o.x[oe]===void 0?ce.o.x[0]:ce.o.x[oe],Oe=ce.o.y[oe]===void 0?ce.o.y[0]:ce.o.y[oe],Ie=ce.i.x[oe]===void 0?ce.i.x[0]:ce.i.x[oe],ze=ce.i.y[oe]===void 0?ce.i.y[0]:ce.i.y[oe],ke=BezierFactory.getBezierEasing(De,Oe,Ie,ze).get,ue.__fnct[oe]=ke)):ue.__fnct?ke=ue.__fnct:(De=ce.o.x,Oe=ce.o.y,Ie=ce.i.x,ze=ce.i.y,ke=BezierFactory.getBezierEasing(De,Oe,Ie,ze).get,ce.keyframeMetadata=ke),ge=ke((ee-_e)/(ve-_e)))),$e=de.s||ce.e,Ve=ce.h===1?ce.s[oe]:ce.s[oe]+($e[oe]-ce.s[oe])*ge,this.propType==="multidimensional"?ae[oe]=Ve:ae=Ve}return te.lastIndex=re,ae}function slerp(ee,te,ne){var ae=[],re=ee[0],oe=ee[1],ie=ee[2],le=ee[3],ce=te[0],de=te[1],ue=te[2],be=te[3],fe,ge,me,pe,ke;return ge=re*ce+oe*de+ie*ue+le*be,ge<0&&(ge=-ge,ce=-ce,de=-de,ue=-ue,be=-be),1-ge>1e-6?(fe=Math.acos(ge),me=Math.sin(fe),pe=Math.sin((1-ne)*fe)/me,ke=Math.sin(ne*fe)/me):(pe=1-ne,ke=ne),ae[0]=pe*re+ke*ce,ae[1]=pe*oe+ke*de,ae[2]=pe*ie+ke*ue,ae[3]=pe*le+ke*be,ae}function quaternionToEuler(ee,te){var ne=te[0],ae=te[1],re=te[2],oe=te[3],ie=Math.atan2(2*ae*oe-2*ne*re,1-2*ae*ae-2*re*re),le=Math.asin(2*ne*ae+2*re*oe),ce=Math.atan2(2*ne*oe-2*ae*re,1-2*ne*ne-2*re*re);ee[0]=ie/degToRads,ee[1]=le/degToRads,ee[2]=ce/degToRads}function createQuaternion(ee){var te=ee[0]*degToRads,ne=ee[1]*degToRads,ae=ee[2]*degToRads,re=Math.cos(te/2),oe=Math.cos(ne/2),ie=Math.cos(ae/2),le=Math.sin(te/2),ce=Math.sin(ne/2),de=Math.sin(ae/2),ue=re*oe*ie-le*ce*de,be=le*ce*ie+re*oe*de,fe=le*oe*ie+re*ce*de,ge=re*ce*ie-le*oe*de;return[be,fe,ge,ue]}function getValueAtCurrentTime(){var ee=this.comp.renderedFrame-this.offsetTime,te=this.keyframes[0].t-this.offsetTime,ne=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(ee===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=ne&&ee>=ne||this._caching.lastFrame<te&&ee<te))){this._caching.lastFrame>=ee&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var ae=this.interpolateValue(ee,this._caching);this.pv=ae}return this._caching.lastFrame=ee,this.pv}function setVValue(ee){var te;if(this.propType==="unidimensional")te=ee*this.mult,mathAbs(this.v-te)>1e-5&&(this.v=te,this._mdf=!0);else for(var ne=0,ae=this.v.length;ne<ae;)te=ee[ne]*this.mult,mathAbs(this.v[ne]-te)>1e-5&&(this.v[ne]=te,this._mdf=!0),ne+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var ee,te=this.effectsSequence.length,ne=this.kf?this.pv:this.data.k;for(ee=0;ee<te;ee+=1)ne=this.effectsSequence[ee](ne);this.setVValue(ne),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(ee){this.effectsSequence.push(ee),this.container.addDynamicProperty(this)}function ValueProperty(ee,te,ne,ae){this.propType="unidimensional",this.mult=ne||1,this.data=te,this.v=ne?te.k*ne:te.k,this.pv=te.k,this._mdf=!1,this.elem=ee,this.container=ae,this.comp=ee.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(ee,te,ne,ae){this.propType="multidimensional",this.mult=ne||1,this.data=te,this._mdf=!1,this.elem=ee,this.container=ae,this.comp=ee.comp,this.k=!1,this.kf=!1,this.frameId=-1;var re,oe=te.k.length;for(this.v=createTypedArray("float32",oe),this.pv=createTypedArray("float32",oe),this.vel=createTypedArray("float32",oe),re=0;re<oe;re+=1)this.v[re]=te.k[re]*this.mult,this.pv[re]=te.k[re];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(ee,te,ne,ae){this.propType="unidimensional",this.keyframes=te.k,this.keyframesMetadata=[],this.offsetTime=ee.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=te,this.mult=ne||1,this.elem=ee,this.container=ae,this.comp=ee.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(ee,te,ne,ae){this.propType="multidimensional";var re,oe=te.k.length,ie,le,ce,de;for(re=0;re<oe-1;re+=1)te.k[re].to&&te.k[re].s&&te.k[re+1]&&te.k[re+1].s&&(ie=te.k[re].s,le=te.k[re+1].s,ce=te.k[re].to,de=te.k[re].ti,(ie.length===2&&!(ie[0]===le[0]&&ie[1]===le[1])&&bez.pointOnLine2D(ie[0],ie[1],le[0],le[1],ie[0]+ce[0],ie[1]+ce[1])&&bez.pointOnLine2D(ie[0],ie[1],le[0],le[1],le[0]+de[0],le[1]+de[1])||ie.length===3&&!(ie[0]===le[0]&&ie[1]===le[1]&&ie[2]===le[2])&&bez.pointOnLine3D(ie[0],ie[1],ie[2],le[0],le[1],le[2],ie[0]+ce[0],ie[1]+ce[1],ie[2]+ce[2])&&bez.pointOnLine3D(ie[0],ie[1],ie[2],le[0],le[1],le[2],le[0]+de[0],le[1]+de[1],le[2]+de[2]))&&(te.k[re].to=null,te.k[re].ti=null),ie[0]===le[0]&&ie[1]===le[1]&&ce[0]===0&&ce[1]===0&&de[0]===0&&de[1]===0&&(ie.length===2||ie[2]===le[2]&&ce[2]===0&&de[2]===0)&&(te.k[re].to=null,te.k[re].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=te,this.keyframes=te.k,this.keyframesMetadata=[],this.offsetTime=ee.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=ne||1,this.elem=ee,this.container=ae,this.comp=ee.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var ue=te.k[0].s.length;for(this.v=createTypedArray("float32",ue),this.pv=createTypedArray("float32",ue),re=0;re<ue;re+=1)this.v[re]=initFrame,this.pv[re]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",ue)},this.addEffect=addEffect}var PropertyFactory=function(){function ee(ne,ae,re,oe,ie){ae.sid&&(ae=ne.globalData.slotManager.getProp(ae));var le;if(!ae.k.length)le=new ValueProperty(ne,ae,oe,ie);else if(typeof ae.k[0]=="number")le=new MultiDimensionalProperty(ne,ae,oe,ie);else switch(re){case 0:le=new KeyframedValueProperty(ne,ae,oe,ie);break;case 1:le=new KeyframedMultidimensionalProperty(ne,ae,oe,ie);break}return le.effectsSequence.length&&ie.addDynamicProperty(le),le}var te={getProp:ee};return te}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(te){this.dynamicProperties.indexOf(te)===-1&&(this.dynamicProperties.push(te),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var te,ne=this.dynamicProperties.length;for(te=0;te<ne;te+=1)this.dynamicProperties[te].getValue(),this.dynamicProperties[te]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(te){this.container=te,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=function(){function ee(){return createTypedArray("float32",2)}return poolFactory(8,ee)}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(ee,te){this.c=ee,this.setLength(te);for(var ne=0;ne<te;)this.v[ne]=pointPool.newElement(),this.o[ne]=pointPool.newElement(),this.i[ne]=pointPool.newElement(),ne+=1},ShapePath.prototype.setLength=function(ee){for(;this._maxLength<ee;)this.doubleArrayLength();this._length=ee},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(ee,te,ne,ae,re){var oe;switch(this._length=Math.max(this._length,ae+1),this._length>=this._maxLength&&this.doubleArrayLength(),ne){case"v":oe=this.v;break;case"i":oe=this.i;break;case"o":oe=this.o;break;default:oe=[];break}(!oe[ae]||oe[ae]&&!re)&&(oe[ae]=pointPool.newElement()),oe[ae][0]=ee,oe[ae][1]=te},ShapePath.prototype.setTripleAt=function(ee,te,ne,ae,re,oe,ie,le){this.setXYAt(ee,te,"v",ie,le),this.setXYAt(ne,ae,"o",ie,le),this.setXYAt(re,oe,"i",ie,le)},ShapePath.prototype.reverse=function(){var ee=new ShapePath;ee.setPathData(this.c,this._length);var te=this.v,ne=this.o,ae=this.i,re=0;this.c&&(ee.setTripleAt(te[0][0],te[0][1],ae[0][0],ae[0][1],ne[0][0],ne[0][1],0,!1),re=1);var oe=this._length-1,ie=this._length,le;for(le=re;le<ie;le+=1)ee.setTripleAt(te[oe][0],te[oe][1],ae[oe][0],ae[oe][1],ne[oe][0],ne[oe][1],le,!1),oe-=1;return ee},ShapePath.prototype.length=function(){return this._length};var shapePool=function(){function ee(){return new ShapePath}function te(re){var oe=re._length,ie;for(ie=0;ie<oe;ie+=1)pointPool.release(re.v[ie]),pointPool.release(re.i[ie]),pointPool.release(re.o[ie]),re.v[ie]=null,re.i[ie]=null,re.o[ie]=null;re._length=0,re.c=!1}function ne(re){var oe=ae.newElement(),ie,le=re._length===void 0?re.v.length:re._length;for(oe.setLength(le),oe.c=re.c,ie=0;ie<le;ie+=1)oe.setTripleAt(re.v[ie][0],re.v[ie][1],re.o[ie][0],re.o[ie][1],re.i[ie][0],re.i[ie][1],ie);return oe}var ae=poolFactory(4,ee,te);return ae.clone=ne,ae}();function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(ee){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=ee,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var ee;for(ee=0;ee<this._length;ee+=1)shapePool.release(this.shapes[ee]);this._length=0};var shapeCollectionPool=function(){var ee={newShapeCollection:re,release:oe},te=0,ne=4,ae=createSizedArray(ne);function re(){var ie;return te?(te-=1,ie=ae[te]):ie=new ShapeCollection,ie}function oe(ie){var le,ce=ie._length;for(le=0;le<ce;le+=1)shapePool.release(ie.shapes[le]);ie._length=0,te===ne&&(ae=pooling.double(ae),ne*=2),ae[te]=ie,te+=1}return ee}(),ShapePropertyFactory=function(){var ee=-999999;function te(ve,_e,$e){var ye=$e.lastIndex,Ee,Se,Le,Ae,De,Oe,Ie,ze,Ve,Ne=this.keyframes;if(ve<Ne[0].t-this.offsetTime)Ee=Ne[0].s[0],Le=!0,ye=0;else if(ve>=Ne[Ne.length-1].t-this.offsetTime)Ee=Ne[Ne.length-1].s?Ne[Ne.length-1].s[0]:Ne[Ne.length-2].e[0],Le=!0;else{for(var Pe=ye,Be=Ne.length-1,Me=!0,xe,Ce,Fe;Me&&(xe=Ne[Pe],Ce=Ne[Pe+1],!(Ce.t-this.offsetTime>ve));)Pe<Be-1?Pe+=1:Me=!1;if(Fe=this.keyframesMetadata[Pe]||{},Le=xe.h===1,ye=Pe,!Le){if(ve>=Ce.t-this.offsetTime)ze=1;else if(ve<xe.t-this.offsetTime)ze=0;else{var Re;Fe.__fnct?Re=Fe.__fnct:(Re=BezierFactory.getBezierEasing(xe.o.x,xe.o.y,xe.i.x,xe.i.y).get,Fe.__fnct=Re),ze=Re((ve-(xe.t-this.offsetTime))/(Ce.t-this.offsetTime-(xe.t-this.offsetTime)))}Se=Ce.s?Ce.s[0]:xe.e[0]}Ee=xe.s[0]}for(Oe=_e._length,Ie=Ee.i[0].length,$e.lastIndex=ye,Ae=0;Ae<Oe;Ae+=1)for(De=0;De<Ie;De+=1)Ve=Le?Ee.i[Ae][De]:Ee.i[Ae][De]+(Se.i[Ae][De]-Ee.i[Ae][De])*ze,_e.i[Ae][De]=Ve,Ve=Le?Ee.o[Ae][De]:Ee.o[Ae][De]+(Se.o[Ae][De]-Ee.o[Ae][De])*ze,_e.o[Ae][De]=Ve,Ve=Le?Ee.v[Ae][De]:Ee.v[Ae][De]+(Se.v[Ae][De]-Ee.v[Ae][De])*ze,_e.v[Ae][De]=Ve}function ne(){var ve=this.comp.renderedFrame-this.offsetTime,_e=this.keyframes[0].t-this.offsetTime,$e=this.keyframes[this.keyframes.length-1].t-this.offsetTime,ye=this._caching.lastFrame;return ye!==ee&&(ye<_e&&ve<_e||ye>$e&&ve>$e)||(this._caching.lastIndex=ye<ve?this._caching.lastIndex:0,this.interpolateShape(ve,this.pv,this._caching)),this._caching.lastFrame=ve,this.pv}function ae(){this.paths=this.localShapeCollection}function re(ve,_e){if(ve._length!==_e._length||ve.c!==_e.c)return!1;var $e,ye=ve._length;for($e=0;$e<ye;$e+=1)if(ve.v[$e][0]!==_e.v[$e][0]||ve.v[$e][1]!==_e.v[$e][1]||ve.o[$e][0]!==_e.o[$e][0]||ve.o[$e][1]!==_e.o[$e][1]||ve.i[$e][0]!==_e.i[$e][0]||ve.i[$e][1]!==_e.i[$e][1])return!1;return!0}function oe(ve){re(this.v,ve)||(this.v=shapePool.clone(ve),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function ie(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var ve;this.kf?ve=this.pv:this.data.ks?ve=this.data.ks.k:ve=this.data.pt.k;var _e,$e=this.effectsSequence.length;for(_e=0;_e<$e;_e+=1)ve=this.effectsSequence[_e](ve);this.setVValue(ve),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function le(ve,_e,$e){this.propType="shape",this.comp=ve.comp,this.container=ve,this.elem=ve,this.data=_e,this.k=!1,this.kf=!1,this._mdf=!1;var ye=$e===3?_e.pt.k:_e.ks.k;this.v=shapePool.clone(ye),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=ae,this.effectsSequence=[]}function ce(ve){this.effectsSequence.push(ve),this.container.addDynamicProperty(this)}le.prototype.interpolateShape=te,le.prototype.getValue=ie,le.prototype.setVValue=oe,le.prototype.addEffect=ce;function de(ve,_e,$e){this.propType="shape",this.comp=ve.comp,this.elem=ve,this.container=ve,this.offsetTime=ve.data.st,this.keyframes=$e===3?_e.pt.k:_e.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var ye=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,ye),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=ee,this.reset=ae,this._caching={lastFrame:ee,lastIndex:0},this.effectsSequence=[ne.bind(this)]}de.prototype.getValue=ie,de.prototype.interpolateShape=te,de.prototype.setVValue=oe,de.prototype.addEffect=ce;var ue=function(){var ve=roundCorner;function _e($e,ye){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=ye.d,this.elem=$e,this.comp=$e.comp,this.frameId=-1,this.initDynamicPropertyContainer($e),this.p=PropertyFactory.getProp($e,ye.p,1,0,this),this.s=PropertyFactory.getProp($e,ye.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return _e.prototype={reset:ae,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var ye=this.p.v[0],Ee=this.p.v[1],Se=this.s.v[0]/2,Le=this.s.v[1]/2,Ae=this.d!==3,De=this.v;De.v[0][0]=ye,De.v[0][1]=Ee-Le,De.v[1][0]=Ae?ye+Se:ye-Se,De.v[1][1]=Ee,De.v[2][0]=ye,De.v[2][1]=Ee+Le,De.v[3][0]=Ae?ye-Se:ye+Se,De.v[3][1]=Ee,De.i[0][0]=Ae?ye-Se*ve:ye+Se*ve,De.i[0][1]=Ee-Le,De.i[1][0]=Ae?ye+Se:ye-Se,De.i[1][1]=Ee-Le*ve,De.i[2][0]=Ae?ye+Se*ve:ye-Se*ve,De.i[2][1]=Ee+Le,De.i[3][0]=Ae?ye-Se:ye+Se,De.i[3][1]=Ee+Le*ve,De.o[0][0]=Ae?ye+Se*ve:ye-Se*ve,De.o[0][1]=Ee-Le,De.o[1][0]=Ae?ye+Se:ye-Se,De.o[1][1]=Ee+Le*ve,De.o[2][0]=Ae?ye-Se*ve:ye+Se*ve,De.o[2][1]=Ee+Le,De.o[3][0]=Ae?ye-Se:ye+Se,De.o[3][1]=Ee-Le*ve}},extendPrototype([DynamicPropertyContainer],_e),_e}(),be=function(){function ve(_e,$e){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=_e,this.comp=_e.comp,this.data=$e,this.frameId=-1,this.d=$e.d,this.initDynamicPropertyContainer(_e),$e.sy===1?(this.ir=PropertyFactory.getProp(_e,$e.ir,0,0,this),this.is=PropertyFactory.getProp(_e,$e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(_e,$e.pt,0,0,this),this.p=PropertyFactory.getProp(_e,$e.p,1,0,this),this.r=PropertyFactory.getProp(_e,$e.r,0,degToRads,this),this.or=PropertyFactory.getProp(_e,$e.or,0,0,this),this.os=PropertyFactory.getProp(_e,$e.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return ve.prototype={reset:ae,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var $e=Math.floor(this.pt.v)*2,ye=Math.PI*2/$e,Ee=!0,Se=this.or.v,Le=this.ir.v,Ae=this.os.v,De=this.is.v,Oe=2*Math.PI*Se/($e*2),Ie=2*Math.PI*Le/($e*2),ze,Ve,Ne,Pe,Be=-Math.PI/2;Be+=this.r.v;var Me=this.data.d===3?-1:1;for(this.v._length=0,ze=0;ze<$e;ze+=1){Ve=Ee?Se:Le,Ne=Ee?Ae:De,Pe=Ee?Oe:Ie;var xe=Ve*Math.cos(Be),Ce=Ve*Math.sin(Be),Fe=xe===0&&Ce===0?0:Ce/Math.sqrt(xe*xe+Ce*Ce),Re=xe===0&&Ce===0?0:-xe/Math.sqrt(xe*xe+Ce*Ce);xe+=+this.p.v[0],Ce+=+this.p.v[1],this.v.setTripleAt(xe,Ce,xe-Fe*Pe*Ne*Me,Ce-Re*Pe*Ne*Me,xe+Fe*Pe*Ne*Me,Ce+Re*Pe*Ne*Me,ze,!0),Ee=!Ee,Be+=ye*Me}},convertPolygonToPath:function(){var $e=Math.floor(this.pt.v),ye=Math.PI*2/$e,Ee=this.or.v,Se=this.os.v,Le=2*Math.PI*Ee/($e*4),Ae,De=-Math.PI*.5,Oe=this.data.d===3?-1:1;for(De+=this.r.v,this.v._length=0,Ae=0;Ae<$e;Ae+=1){var Ie=Ee*Math.cos(De),ze=Ee*Math.sin(De),Ve=Ie===0&&ze===0?0:ze/Math.sqrt(Ie*Ie+ze*ze),Ne=Ie===0&&ze===0?0:-Ie/Math.sqrt(Ie*Ie+ze*ze);Ie+=+this.p.v[0],ze+=+this.p.v[1],this.v.setTripleAt(Ie,ze,Ie-Ve*Le*Se*Oe,ze-Ne*Le*Se*Oe,Ie+Ve*Le*Se*Oe,ze+Ne*Le*Se*Oe,Ae,!0),De+=ye*Oe}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],ve),ve}(),fe=function(){function ve(_e,$e){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=_e,this.comp=_e.comp,this.frameId=-1,this.d=$e.d,this.initDynamicPropertyContainer(_e),this.p=PropertyFactory.getProp(_e,$e.p,1,0,this),this.s=PropertyFactory.getProp(_e,$e.s,1,0,this),this.r=PropertyFactory.getProp(_e,$e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return ve.prototype={convertRectToPath:function(){var $e=this.p.v[0],ye=this.p.v[1],Ee=this.s.v[0]/2,Se=this.s.v[1]/2,Le=bmMin(Ee,Se,this.r.v),Ae=Le*(1-roundCorner);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt($e+Ee,ye-Se+Le,$e+Ee,ye-Se+Le,$e+Ee,ye-Se+Ae,0,!0),this.v.setTripleAt($e+Ee,ye+Se-Le,$e+Ee,ye+Se-Ae,$e+Ee,ye+Se-Le,1,!0),Le!==0?(this.v.setTripleAt($e+Ee-Le,ye+Se,$e+Ee-Le,ye+Se,$e+Ee-Ae,ye+Se,2,!0),this.v.setTripleAt($e-Ee+Le,ye+Se,$e-Ee+Ae,ye+Se,$e-Ee+Le,ye+Se,3,!0),this.v.setTripleAt($e-Ee,ye+Se-Le,$e-Ee,ye+Se-Le,$e-Ee,ye+Se-Ae,4,!0),this.v.setTripleAt($e-Ee,ye-Se+Le,$e-Ee,ye-Se+Ae,$e-Ee,ye-Se+Le,5,!0),this.v.setTripleAt($e-Ee+Le,ye-Se,$e-Ee+Le,ye-Se,$e-Ee+Ae,ye-Se,6,!0),this.v.setTripleAt($e+Ee-Le,ye-Se,$e+Ee-Ae,ye-Se,$e+Ee-Le,ye-Se,7,!0)):(this.v.setTripleAt($e-Ee,ye+Se,$e-Ee+Ae,ye+Se,$e-Ee,ye+Se,2),this.v.setTripleAt($e-Ee,ye-Se,$e-Ee,ye-Se+Ae,$e-Ee,ye-Se,3))):(this.v.setTripleAt($e+Ee,ye-Se+Le,$e+Ee,ye-Se+Ae,$e+Ee,ye-Se+Le,0,!0),Le!==0?(this.v.setTripleAt($e+Ee-Le,ye-Se,$e+Ee-Le,ye-Se,$e+Ee-Ae,ye-Se,1,!0),this.v.setTripleAt($e-Ee+Le,ye-Se,$e-Ee+Ae,ye-Se,$e-Ee+Le,ye-Se,2,!0),this.v.setTripleAt($e-Ee,ye-Se+Le,$e-Ee,ye-Se+Le,$e-Ee,ye-Se+Ae,3,!0),this.v.setTripleAt($e-Ee,ye+Se-Le,$e-Ee,ye+Se-Ae,$e-Ee,ye+Se-Le,4,!0),this.v.setTripleAt($e-Ee+Le,ye+Se,$e-Ee+Le,ye+Se,$e-Ee+Ae,ye+Se,5,!0),this.v.setTripleAt($e+Ee-Le,ye+Se,$e+Ee-Ae,ye+Se,$e+Ee-Le,ye+Se,6,!0),this.v.setTripleAt($e+Ee,ye+Se-Le,$e+Ee,ye+Se-Le,$e+Ee,ye+Se-Ae,7,!0)):(this.v.setTripleAt($e-Ee,ye-Se,$e-Ee+Ae,ye-Se,$e-Ee,ye-Se,1,!0),this.v.setTripleAt($e-Ee,ye+Se,$e-Ee,ye+Se-Ae,$e-Ee,ye+Se,2,!0),this.v.setTripleAt($e+Ee,ye+Se,$e+Ee-Ae,ye+Se,$e+Ee,ye+Se,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:ae},extendPrototype([DynamicPropertyContainer],ve),ve}();function ge(ve,_e,$e){var ye;if($e===3||$e===4){var Ee=$e===3?_e.pt:_e.ks,Se=Ee.k;Se.length?ye=new de(ve,_e,$e):ye=new le(ve,_e,$e)}else $e===5?ye=new fe(ve,_e):$e===6?ye=new ue(ve,_e):$e===7&&(ye=new be(ve,_e));return ye.k&&ve.addDynamicProperty(ye),ye}function me(){return le}function pe(){return de}var ke={};return ke.getShapeProp=ge,ke.getConstructorFunction=me,ke.getKeyframedConstructorFunction=pe,ke}();/*!
|